Closed psychok7 closed 7 years ago
@pslobo please detail here all the steps that should go into the script and the exact calls made to certbot
My initial idea for a startup script is based on the following assumptions:
Given those assumptions the steps could be something like:
startproject --[staging|production] project_name
DOMAIN
, and EMAIL
DOMAIN
and EMAIL
in production.env
or staging.env
docker run -it --rm -v {{ project_name }}_https_certs:/etc/letsencrypt -p 80:80 -p 443:443 palobo/certbot:1.0 certonly -t -n --standalone -d {DOMAIN} -m {EMAIL} --agree-tos
I agree that we can remove the .env
files. In that case, the startup script will have to populate ${DOMAIN}
in ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem;
and ssl_certificate_key /etc/letsencrypt/${DOMAIN}/privkey.pem;
in letsencrypt.conf
@pslobo
--template=/your_path/django-project-template-yadpt/minimal/
with the github urlproduction.env
or staging.env
. We are already asking for the external variables we need in the script.The rest seems fine to me.
Instead of a simple Python script, i think we should write a django management command
since this project needs the user to have django installed
We either need some way to specify if we're going to run production or staging, mainly because of the https_certs
volume. We either have the option to create both i.e. production_https_certs
and staging_https_certs
or the script needs to know which environment the user is planing on running and just create the right volume.
@pslobo --[staging|production]
will tell the script the right environment and we create {{ project_name }}_https_certs
@pslobo @kapz
We should create a Python startup script that will simplify something like
django-admin startproject project_name --template=/your_path/django-project-template-yadpt/minimal/ --extension='py, yml, conf, sh'
intostartproject project_name --context='/path/file
(maybe use a static --template pointing to github).The extra-context could be the
.env
file with a mapping likeDOMAIN="github.com"
. The script would then read the file and pass the dictionary to a tool like https://github.com/alfredo/django-startproject-plus in order to override the need variables in the files.The script will also create the let's encrypt certificates the first time before running anything else and call the following command:
docker run -it --rm -v https_certs:/etc/letsencrypt -p 80:80 -p 443:443 palobo/certbot:1.0 certonly -t -n --standalone -d github.com -m test@example.com --agree-tos