Skip to content

Commit

Permalink
staging
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Feb 14, 2024
1 parent 4f3bee2 commit 424ff78
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 53 deletions.
5 changes: 1 addition & 4 deletions deploy-static
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ fi

./process-static $fd

servers=({0..3}.grapheneos.org)

rsync -ptcv --chmod=F755 --fsync --preallocate certbot-replicate root@${servers[0]}:/usr/local/bin/
rsync -ptcv --chmod=F644 --fsync --preallocate replicate.conf root@${servers[0]}:/etc/systemd/system/certbot-renew.service.d/
servers=(staging.grapheneos.org)

for server in ${servers[@]}; do
echo $server
Expand Down
56 changes: 7 additions & 49 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ http {
ssl_prefer_server_ciphers on;
ssl_conf_command Options PrioritizeChaCha;

ssl_certificate /etc/letsencrypt/live/grapheneos.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/grapheneos.org/privkey.pem;
ssl_certificate /etc/letsencrypt/live/staging.grapheneos.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/staging.grapheneos.org/privkey.pem;

# maintained by nginx-rotate-session-ticket-keys in ramfs
ssl_session_ticket_key session-ticket-keys/4.key;
Expand All @@ -66,11 +66,11 @@ http {
ssl_session_timeout 1d;
ssl_buffer_size 4k;

ssl_trusted_certificate /etc/letsencrypt/live/grapheneos.org/chain.pem;
ssl_trusted_certificate /etc/letsencrypt/live/staging.grapheneos.org/chain.pem;
ssl_stapling on;
ssl_stapling_verify on;
# maintained by certbot-ocsp-fetcher
ssl_stapling_file /var/cache/certbot-ocsp-fetcher/grapheneos.org.der;
ssl_stapling_file /var/cache/certbot-ocsp-fetcher/staging.grapheneos.org.der;

log_format main '$connection-$connection_requests $remote_addr $remote_user $ssl_protocol $server_protocol '
'$host $request_method "$request_uri" $status $request_length $body_bytes_sent/$bytes_sent '
Expand Down Expand Up @@ -114,23 +114,7 @@ http {
server {
listen 80;
listen [::]:80;
server_name grapheneos.org www.grapheneos.org grapheneos.app www.grapheneos.app grapheneos.ca www.grapheneos.ca grapheneos.com www.grapheneos.com grapheneos.dev www.grapheneos.dev grapheneos.info www.grapheneos.info grapheneos.net www.grapheneos.net grapheneos.ovh www.grapheneos.ovh grapheneos.page www.grapheneos.page vanadium.app www.vanadium.app;

keepalive_timeout 0;

location /.well-known/acme-challenge/ {
return 301 http://0.grapheneos.org$request_uri;
}

location / {
return 301 https://$host$request_uri;
}
}

server {
listen 80;
listen [::]:80;
server_name 0.grapheneos.org;
server_name staging.grapheneos.org;

keepalive_timeout 0;

Expand All @@ -139,7 +123,7 @@ http {
}

location / {
return 301 https://grapheneos.org$request_uri;
return 301 https://$host$request_uri;
}
}

Expand All @@ -159,33 +143,7 @@ http {
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.grapheneos.org grapheneos.app www.grapheneos.app grapheneos.ca www.grapheneos.ca grapheneos.com www.grapheneos.com grapheneos.dev www.grapheneos.dev grapheneos.info www.grapheneos.info grapheneos.net www.grapheneos.net grapheneos.ovh www.grapheneos.ovh grapheneos.page www.grapheneos.page;

include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always;

location / {
return 301 https://grapheneos.org$request_uri;
}
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name vanadium.app www.vanadium.app;

include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always;

location / {
return 302 https://github.com/GrapheneOS/Vanadium;
}
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name grapheneos.org;
server_name staging.grapheneos.org;

include root_grapheneos.org.conf;
error_page 403 =404 /404;
Expand Down
3 changes: 3 additions & 0 deletions nginx/snippets/security-headers-base.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# staging site (not a security header)
add_header X-Robots-Tag "noindex" always;

add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
Expand Down

0 comments on commit 424ff78

Please sign in to comment.