Compare commits
9 Commits
3d82d7728b
...
a87dcd5f3d
Author | SHA1 | Date | |
---|---|---|---|
a87dcd5f3d | |||
e9dc8c6b42 | |||
a859c5837c | |||
3037db52d6 | |||
12781c12e9 | |||
71467e35ff | |||
abb4187794 | |||
65d3c81478 | |||
72e6866ea6 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ letsencrypt/
|
||||
letsencrypt_certs/
|
||||
nginx.conf.default
|
||||
rojo.charlesreid1.com
|
||||
conf.d/http.subdomains.conf
|
||||
|
@@ -1,2 +0,0 @@
|
||||
allow 10.5.0.1;
|
||||
allow 45.56.87.232;
|
@@ -1,55 +0,0 @@
|
||||
####################
|
||||
#
|
||||
# charlesreid1 subdomains
|
||||
# (http only, https happens with krash)
|
||||
#
|
||||
# runs on #blackbeard
|
||||
#
|
||||
# nginx only listens on the private vpn ip,
|
||||
# because it is reverse-proxied by another
|
||||
# nginx instance (krash).
|
||||
# binding to the private vpn ip happens
|
||||
# at the docker level, not the nginx level.
|
||||
#
|
||||
# 7777 pages.charlesreid1.com
|
||||
# 7778 hooks.charlesreid1.com
|
||||
# 7779 bots.charlesreid1.com
|
||||
#
|
||||
####################
|
||||
|
||||
server {
|
||||
listen 7777;
|
||||
server_name pages.charlesreid1.com;
|
||||
include /etc/nginx/conf.d/client-allow.conf;
|
||||
deny all;
|
||||
port_in_redirect off;
|
||||
location / {
|
||||
index index.html;
|
||||
try_files $uri $uri/ $uri/index.html =404;
|
||||
root /www/pages.charlesreid1.com/htdocs;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 7778;
|
||||
server_name hooks.charlesreid1.com;
|
||||
include /etc/nginx/conf.d/client-allow.conf;
|
||||
deny all;
|
||||
location / {
|
||||
index index.html;
|
||||
try_files $uri $uri/ =404;
|
||||
root /www/hooks.charlesreid1.com/htdocs;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 7779;
|
||||
server_name bots.charlesreid1.com;
|
||||
include /etc/nginx/conf.d/client-allow.conf;
|
||||
deny all;
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
root /www/bots.charlesreid1.com/htdocs;
|
||||
index index.html;
|
||||
}
|
||||
}
|
1
conf.d_templates/client-allow.conf
Normal file
1
conf.d_templates/client-allow.conf
Normal file
@@ -0,0 +1 @@
|
||||
allow {{ nginx_charlesreid1_ip }};
|
69
conf.d_templates/http.subdomains.conf.j2
Normal file
69
conf.d_templates/http.subdomains.conf.j2
Normal file
@@ -0,0 +1,69 @@
|
||||
####################
|
||||
#
|
||||
# charlesreid1 subdomains
|
||||
# (this is http only)
|
||||
# (the https happens in pod-charlesreid1)
|
||||
# (this happens in pod-webhooks)
|
||||
#
|
||||
# We use a client-allow.conf to block all IPs
|
||||
# except for the IP of the machine running
|
||||
# pod-charlesreid1. This is because this pod
|
||||
# is reverse-proxied by the machine running
|
||||
# pod-charlesreid1.
|
||||
#
|
||||
# Binding to a private ip happens
|
||||
# at the docker level, not the nginx level.
|
||||
#
|
||||
# 7777 pages.{{ server_name_default }}
|
||||
# 7778 hooks.{{ server_name_default }}
|
||||
# 7779 bots.{{ server_name_default }}
|
||||
#
|
||||
####################
|
||||
|
||||
server {
|
||||
listen 7777;
|
||||
listen [::]:7777;
|
||||
server_name pages.{{ server_name_default }};
|
||||
## Only allow IPs in client-allow.conf
|
||||
#include /etc/nginx/conf.d/client-allow.conf;
|
||||
#deny all;
|
||||
port_in_redirect off;
|
||||
location / {
|
||||
index index.html;
|
||||
try_files $uri $uri/ $uri/index.html =404;
|
||||
root /www/pages.{{ server_name_default }}/htdocs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
server {
|
||||
listen 7778;
|
||||
listen [::]:7778;
|
||||
server_name hooks.{{ server_name_default }};
|
||||
## Only allow IPs in client-allow.conf
|
||||
#include /etc/nginx/conf.d/client-allow.conf;
|
||||
#deny all;
|
||||
location / {
|
||||
index index.html;
|
||||
try_files $uri $uri/ $uri/index.html =404;
|
||||
root /www/hooks.{{ server_name_default }}/htdocs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
server {
|
||||
listen 7779;
|
||||
listen [::]:7779;
|
||||
server_name bots.{{ server_name_default }};
|
||||
## Only allow IPs in client-allow.conf
|
||||
#include /etc/nginx/conf.d/client-allow.conf;
|
||||
#deny all;
|
||||
location / {
|
||||
index index.html;
|
||||
try_files $uri $uri/ $uri/index.html =404;
|
||||
root /www/bots.{{ server_name_default }}/htdocs;
|
||||
}
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@ inside the container:
|
||||
```
|
||||
server {
|
||||
listen *:7777;
|
||||
}
|
||||
```
|
||||
|
||||
Meanwhile, in the `docker-compose.yml` file,
|
||||
|
Submodule mkdocs-material updated: ff95dcb846...b0c6890853
@@ -21,7 +21,7 @@ theme:
|
||||
font:
|
||||
text: 'Roboto'
|
||||
code: 'Roboto Mono'
|
||||
pages:
|
||||
nav:
|
||||
- 'Home': 'index.md'
|
||||
|
||||
# Extensions
|
||||
@@ -31,3 +31,6 @@ markdown_extensions:
|
||||
guess_lang: false
|
||||
- toc:
|
||||
permalink: true
|
||||
|
||||
|
||||
strict: true
|
||||
|
30
scripts/clean_config.py
Normal file
30
scripts/clean_config.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import glob
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
"""
|
||||
Clean d-nginx-subdomains conf.d directory
|
||||
|
||||
|
||||
This script cleans out the conf.d directory
|
||||
in the d-nginx-subdomains repo.
|
||||
|
||||
This script should be run before you generate a new set
|
||||
of config files from the nginx config file templates in
|
||||
d-nginx-subdomains/conf.d_templates/
|
||||
|
||||
This script cleans out all the config files in the folder
|
||||
d-nginx-subdomains/conf.d/
|
||||
|
||||
That way there are no old config files to clash with the
|
||||
new ones.
|
||||
"""
|
||||
|
||||
HERE = os.path.abspath(os.path.dirname(__file__))
|
||||
CONF = os.path.abspath(os.path.join(HERE,'..','conf.d'))
|
||||
|
||||
for f in glob.glob(os.path.join(CONF,"*.conf")):
|
||||
if os.path.basename(f)!="_.conf":
|
||||
cmd = ['rm','-fr',f]
|
||||
subprocess.call(cmd)
|
||||
|
Reference in New Issue
Block a user