cert command
This commit is contained in:
parent
882cfb2a98
commit
9ecab37cc0
1
bootstrap/.gitignore
vendored
1
bootstrap/.gitignore
vendored
@ -3,3 +3,4 @@ venv
|
||||
*.pyc
|
||||
data/
|
||||
__pycache__
|
||||
sensitive.py
|
27
oshipka.sh
27
oshipka.sh
@ -8,13 +8,16 @@ echo "oshipka is at: $OSHIPKA_PATH"
|
||||
|
||||
#!/usr/bin/env bash
|
||||
HELP="
|
||||
Usage $0 [ bootstrap | worker | web | venv | install ]
|
||||
Usage $0 [ bootstrap | worker | web | venv | install | link | cert ]
|
||||
|
||||
bootstrap [PROJECT_PATH] Create a new project in PROJECT_PATH
|
||||
worker Start worker
|
||||
web Start webapp
|
||||
venv Init venv
|
||||
install Install requirements
|
||||
link Link dev oshipka
|
||||
|
||||
cert [DOMAIN] Install certificate
|
||||
"
|
||||
|
||||
worker () {
|
||||
@ -36,6 +39,21 @@ install_reqs() {
|
||||
pip install -r requirements.txt
|
||||
}
|
||||
|
||||
link_dev_oshipka() {
|
||||
source venv/bin/activate
|
||||
pip install -e ${OSHIPKA_PATH}
|
||||
}
|
||||
|
||||
install_cert() {
|
||||
#[ ! -f /tmp/certbot-auto ] && wget -O /tmp/certbot-auto https://dl.eff.org/certbot-auto
|
||||
#chmod +x /tmp/certbot-auto
|
||||
#certbot=/tmp/certbot-auto
|
||||
shift
|
||||
PROJECT_DOMAIN=$1
|
||||
sudo apt install certbot
|
||||
certbot certonly --authenticator standalone --installer nginx --pre-hook "service nginx stop" --post-hook "service nginx start" --redirect --agree-tos --no-eff-email --email admin@app.com -d ${PROJECT_DOMAIN} --no-bootstrap
|
||||
}
|
||||
|
||||
bootstrap() {
|
||||
shift
|
||||
PROJECT_PATH=$1
|
||||
@ -68,8 +86,7 @@ bootstrap() {
|
||||
cp ${OSHIPKA_PATH}/bootstrap/.gitignore ${PROJECT_PATH}/.gitignore
|
||||
cd ${PROJECT_PATH}
|
||||
init_venv
|
||||
source venv/bin/activate
|
||||
pip install -e ${OSHIPKA_PATH}
|
||||
link_dev_oshipka
|
||||
}
|
||||
|
||||
command_main() {
|
||||
@ -85,7 +102,9 @@ command_main() {
|
||||
;;
|
||||
install) install_reqs "$@"
|
||||
;;
|
||||
link) install_reqs "$@"
|
||||
link) link_dev_oshipka "$@"
|
||||
;;
|
||||
cert) install_cert "$@"
|
||||
;;
|
||||
*) >&2 echo -e "${HELP}"
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user