mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-16 19:41:03 +03:00
Switch use_certbot to the MUCH more explicit use_letsencrypt
This commit is contained in:
parent
8e258ee611
commit
a65a750464
|
@ -18,6 +18,6 @@
|
||||||
"use_docker": "y",
|
"use_docker": "y",
|
||||||
"use_heroku": "n",
|
"use_heroku": "n",
|
||||||
"js_task_runner": ["Gulp", "Grunt", "None"],
|
"js_task_runner": ["Gulp", "Grunt", "None"],
|
||||||
"use_certbot": "n",
|
"use_lets_encrypt": "n",
|
||||||
"open_source_license": ["MIT", "BSD", "Apache Software License 2.0", "Not open source"]
|
"open_source_license": ["MIT", "BSD", "Apache Software License 2.0", "Not open source"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ else:
|
||||||
remove_packageJSON_file()
|
remove_packageJSON_file()
|
||||||
|
|
||||||
# 7. Removes all certbot/letsencrypt files if it isn't going to be used
|
# 7. Removes all certbot/letsencrypt files if it isn't going to be used
|
||||||
if '{{ cookiecutter.use_certbot }}'.lower() != 'y':
|
if '{{ cookiecutter.use_lets_encrypt }}'.lower() != 'y':
|
||||||
remove_certbot_files()
|
remove_certbot_files()
|
||||||
|
|
||||||
# 8. Display a warning if use_docker and use_grunt are selected. Grunt isn't
|
# 8. Display a warning if use_docker and use_grunt are selected. Grunt isn't
|
||||||
|
@ -227,8 +227,8 @@ if '{{ cookiecutter.js_task_runner }}'.lower() in ['grunt', 'gulp'] and '{{ cook
|
||||||
"js task runner service to your docker configuration manually."
|
"js task runner service to your docker configuration manually."
|
||||||
)
|
)
|
||||||
|
|
||||||
# 9. Removes the certbot/letsencrypt files and display a warning if use_certbot is selected and use_docker isn't.
|
# 9. Removes the certbot/letsencrypt files and display a warning if use_lets_encrypt is selected and use_docker isn't.
|
||||||
if '{{ cookiecutter.use_certbot }}'.lower() == 'y' and '{{ cookiecutter.use_docker }}'.lower() != 'y':
|
if '{{ cookiecutter.use_lets_encrypt }}'.lower() == 'y' and '{{ cookiecutter.use_docker }}'.lower() != 'y':
|
||||||
remove_certbot_files()
|
remove_certbot_files()
|
||||||
print(
|
print(
|
||||||
"You selected to use certbot(letsencrypt) and didn't select to use docker. This is NOT supported out of the box for now. You "
|
"You selected to use certbot(letsencrypt) and didn't select to use docker. This is NOT supported out of the box for now. You "
|
||||||
|
@ -236,7 +236,7 @@ if '{{ cookiecutter.use_certbot }}'.lower() == 'y' and '{{ cookiecutter.use_dock
|
||||||
)
|
)
|
||||||
|
|
||||||
# 10. Directs the user to the documentation if certbot and docker are selected.
|
# 10. Directs the user to the documentation if certbot and docker are selected.
|
||||||
if '{{ cookiecutter.use_certbot }}'.lower() == 'y' and '{{ cookiecutter.use_docker }}'.lower() == 'y':
|
if '{{ cookiecutter.use_lets_encrypt }}'.lower() == 'y' and '{{ cookiecutter.use_docker }}'.lower() == 'y':
|
||||||
print(
|
print(
|
||||||
"You selected to use certbot(letsencrypt), please see the documentation for instructions on how to use this in production. "
|
"You selected to use certbot(letsencrypt), please see the documentation for instructions on how to use this in production. "
|
||||||
"You must generate a dhparams.pem file before running docker-compose in a production environment."
|
"You must generate a dhparams.pem file before running docker-compose in a production environment."
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
FROM nginx:latest
|
FROM nginx:latest
|
||||||
ADD nginx.conf /etc/nginx/nginx.conf
|
ADD nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
{% if cookiecutter.use_certbot == 'y' and cookiecutter.use_docker == 'y' %}
|
{% if cookiecutter.use_lets_encrypt == 'y' and cookiecutter.use_docker == 'y' %}
|
||||||
ADD start.sh /start.sh
|
ADD start.sh /start.sh
|
||||||
ADD nginx-secure.conf /etc/nginx/nginx-secure.conf
|
ADD nginx-secure.conf /etc/nginx/nginx-secure.conf
|
||||||
ADD dhparams.pem /etc/ssl/private/dhparams.pem
|
ADD dhparams.pem /etc/ssl/private/dhparams.pem
|
||||||
|
|
|
@ -35,7 +35,7 @@ http {
|
||||||
listen 80;
|
listen 80;
|
||||||
charset utf-8;
|
charset utf-8;
|
||||||
|
|
||||||
{% if cookiecutter.use_certbot == 'y' and cookiecutter.use_docker == 'y' %}
|
{% if cookiecutter.use_lets_encrypt == 'y' and cookiecutter.use_docker == 'y' %}
|
||||||
server_name ___my.example.com___ ;
|
server_name ___my.example.com___ ;
|
||||||
|
|
||||||
location /.well-known/acme-challenge {
|
location /.well-known/acme-challenge {
|
||||||
|
|
|
@ -27,12 +27,12 @@ services:
|
||||||
build: ./compose/nginx
|
build: ./compose/nginx
|
||||||
depends_on:
|
depends_on:
|
||||||
- django
|
- django
|
||||||
{% if cookiecutter.use_certbot == 'y' %}
|
{% if cookiecutter.use_lets_encrypt == 'y' %}
|
||||||
- certbot
|
- certbot
|
||||||
{% endif %}
|
{% endif %}
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:80:80"
|
- "0.0.0.0:80:80"
|
||||||
{% if cookiecutter.use_certbot == 'y' %}
|
{% if cookiecutter.use_lets_encrypt == 'y' %}
|
||||||
environment:
|
environment:
|
||||||
- MY_DOMAIN_NAME={{ cookiecutter.domain_name }}
|
- MY_DOMAIN_NAME={{ cookiecutter.domain_name }}
|
||||||
ports:
|
ports:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user