-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into issue-1202
- Loading branch information
Showing
14 changed files
with
336 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# This file is configured for deployment of the CantusDB project in local development. | ||
# When building the project locally, replace the contents of cantusdb.conf with the | ||
# contents of this file. | ||
|
||
# server { | ||
# listen 80; | ||
# | ||
# server_tokens off; | ||
# | ||
# location ^~ /.well-known/acme-challenge/ { | ||
# root /var/www/lego; | ||
# } | ||
# | ||
# location / { | ||
# return 301 https://$host$request_uri; | ||
# } | ||
# } | ||
|
||
# server { | ||
# # Redirect all https traffic for mass.cantusdatabase.org to cantusdatabase.org | ||
# listen 443 ssl; | ||
# | ||
# server_name mass.cantusdatabase.org; | ||
# | ||
# ssl_certificate /etc/nginx/ssl/live/certificates/cantusdatabase.org.crt; | ||
# ssl_certificate_key /etc/nginx/ssl/live/certificates/cantusdatabase.org.key; | ||
# | ||
# location / { | ||
# return 301 https://cantusdatabase.org$request_uri; | ||
# } | ||
# } | ||
|
||
server { | ||
# listen 443 default_server http2 ssl; | ||
listen 80; | ||
|
||
# ssl_certificate /etc/nginx/ssl/live/certificates/cantusdatabase.org.crt; | ||
# ssl_certificate_key /etc/nginx/ssl/live/certificates/cantusdatabase.org.key; | ||
|
||
location / { | ||
proxy_pass http://django:8000; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $host; | ||
proxy_redirect off; | ||
} | ||
|
||
location /static { | ||
alias /resources/static/; | ||
} | ||
location /media { | ||
alias /resources/media/; | ||
} | ||
|
||
location /concordances { | ||
alias /resources/api_cache/concordances.json; | ||
expires modified +24h; | ||
} | ||
|
||
location = /style.css { | ||
root /; | ||
} | ||
location = /background.jpg { | ||
root /; | ||
} | ||
location = /CantusLogoSmall.gif { | ||
root /; | ||
} | ||
location = /favicon.ico { | ||
root /; | ||
} | ||
|
||
error_page 502 /502.html; | ||
location = /502.html { | ||
root /; | ||
} | ||
error_page 504 /504.html; | ||
location = /504.html { | ||
root /; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
server { | ||
listen 80; | ||
|
||
server_tokens off; | ||
|
||
location ^~ /.well-known/acme-challenge/ { | ||
root /var/www/lego; | ||
} | ||
|
||
location / { | ||
return 301 https://$host$request_uri; | ||
} | ||
} | ||
|
||
server { | ||
# Redirect all https traffic for staging-alias.cantusdatabase.org to staging.cantusdatabase.org | ||
# (on Production, this redirects from mass.cantusdatabase.org to cantusdatabase.org. | ||
# The Staging server's subdomain "staging-alias" is analogous to Production's "mass" subdomain.) | ||
listen 443 ssl; | ||
|
||
# server_name mass.cantusdatabase.org; | ||
server_name staging-alias.cantusdatabase.org; | ||
|
||
# ssl_certificate /etc/nginx/ssl/live/certificates/cantusdatabase.org.crt; | ||
# ssl_certificate_key /etc/nginx/ssl/live/certificates/cantusdatabase.org.key; | ||
ssl_certificate /etc/nginx/ssl/live/certificates/staging.cantusdatabase.org.crt; | ||
ssl_certificate_key /etc/nginx/ssl/live/certificates/staging.cantusdatabase.org.key; | ||
|
||
location / { | ||
return 301 https://staging.cantusdatabase.org$request_uri; | ||
} | ||
} | ||
|
||
server { | ||
|
||
listen 443 default_server http2 ssl; | ||
|
||
# ssl_certificate /etc/nginx/ssl/live/certificates/cantusdatabase.org.crt; | ||
# ssl_certificate_key /etc/nginx/ssl/live/certificates/cantusdatabase.org.key; | ||
ssl_certificate /etc/nginx/ssl/live/certificates/staging.cantusdatabase.org.crt; | ||
ssl_certificate_key /etc/nginx/ssl/live/certificates/staging.cantusdatabase.org.key; | ||
|
||
location / { | ||
proxy_pass http://django:8000; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $host; | ||
proxy_redirect off; | ||
} | ||
|
||
location /static { | ||
alias /resources/static/; | ||
} | ||
location /media { | ||
alias /resources/media/; | ||
} | ||
|
||
location /concordances { | ||
alias /resources/api_cache/concordances.json; | ||
expires modified +24h; | ||
} | ||
|
||
location = /style.css { | ||
root /; | ||
} | ||
location = /background.jpg { | ||
root /; | ||
} | ||
location = /CantusLogoSmall.gif { | ||
root /; | ||
} | ||
location = /favicon.ico { | ||
root /; | ||
} | ||
|
||
error_page 502 /502.html; | ||
location = /502.html { | ||
root /; | ||
} | ||
error_page 504 /504.html; | ||
location = /504.html { | ||
root /; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
###################### | ||
# CantusDB Cron Jobs # | ||
###################### | ||
|
||
# Note: This is set up to run on the production and staging servers. If you want to run it on your local machine, you will need to change the paths. | ||
|
||
# min hour day month weekday command | ||
0 4 * * * bash /home/ubuntu/code/CantusDB/cron/postgres/db_backup.sh | ||
10 4 * * * bash /home/ubuntu/code/CantusDB/cron/management/manage.sh update_cached_concordances | ||
40 4 1 * * bash /home/ubuntu/code/CantusDB/cron/management/manage.sh populate_next_chant_fields; bash /home/ubuntu/code/CantusDB/cron/management/manage.sh populate_is_last_chant_in_feast | ||
50 4 * * 7 /usr/local/bin/docker-compose -f /home/ubuntu/code/CantusDB/docker-compose.yml exec -T nginx lego --path /etc/nginx/ssl/live -d cantusdatabase.org -d www.cantusdatabase.org -d mass.cantusdatabase.org -m [email protected] --http --http.webroot /var/www/lego/ renew --days 45 --renew-hook "nginx -s reload" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This file is configured for deployment of the CantusDB project in local development. | ||
# When building the project locally, replace the contents of docker-compose.yml with the | ||
# contents of this file. | ||
|
||
version: '3' | ||
|
||
services: | ||
django: | ||
build: | ||
context: ./django | ||
volumes: | ||
- ./:/code/ | ||
- static_volume:/resources/static | ||
- media_volume:/resources/media | ||
- api_cache_volume:/resources/api_cache | ||
env_file: ./config/envs/dev_env | ||
ports: | ||
- 3000:3000 # this mapping allows the VSCode Dev Containers extension to work | ||
restart: always | ||
depends_on: | ||
- postgres | ||
|
||
nginx: | ||
build: | ||
context: ./nginx | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
volumes: | ||
- ./config/nginx/conf.d:/etc/nginx/conf.d | ||
- static_volume:/resources/static | ||
- media_volume:/resources/media | ||
- api_cache_volume:/resources/api_cache | ||
- ./certificates:/etc/nginx/ssl/live | ||
restart: always | ||
depends_on: | ||
- django | ||
|
||
postgres: | ||
build: | ||
context: ./postgres | ||
env_file: ./config/envs/dev_env | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data/ | ||
restart: always | ||
command: postgres -c 'config_file=/etc/postgresql/postgresql.conf' | ||
|
||
volumes: | ||
postgres_data: | ||
static_volume: | ||
media_volume: | ||
api_cache_volume: |
Oops, something went wrong.