-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
salt-master
committed
Nov 22, 2023
1 parent
481318e
commit bc30db2
Showing
16 changed files
with
249 additions
and
44 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
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,24 @@ | ||
#!/bin/bash | ||
|
||
which nebula-cert 1>/dev/null || echo "nebula-cert not installed" || exit 2 | ||
which jq 1>/dev/null || echo "jq not installed" || exit 2 | ||
|
||
echo "This script will delete the current nebula CA and related host certificates to create new ones. Press [ENTER] to continue" | ||
read | ||
|
||
# Regenerate CA with validity of 10 years | ||
rm ca.crt ca.key | ||
nebula-cert ca -duration 87600h -name "Freifunk Muenchen Nebula CA G2" | ||
|
||
for i in *.ffmuc.net.crt; do | ||
|
||
_data=$(nebula-cert print -json -path $i) | ||
name=$(echo $_data | jq '.details.name' | tr -d '"') | ||
groups=$(echo $_data | jq '.details.groups' | tr -cd 'a-z,') | ||
ip=$(echo $_data | jq '.details.ips[0]' | tr -d '"') | ||
|
||
rm -v $name.crt $name.key | ||
|
||
echo $ip - $name - $groups | ||
nebula-cert sign -name "$name" -ip "$ip" -groups "$groups" | ||
done |
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,58 @@ | ||
upstream uisp_backend { | ||
server docker07.ov.ffmuc.net:9443; | ||
keepalive 32; | ||
} | ||
upstream uisp_inform_backend { | ||
server docker07.ov.ffmuc.net:8080; | ||
keepalive 32; | ||
} | ||
|
||
server { | ||
listen 443 ssl http2; | ||
listen [::]:443 ssl http2; | ||
listen 80; | ||
listen [::]:80; | ||
listen 8080; | ||
listen [::]:8080; | ||
|
||
server_name uisp.ext.ffmuc.net uisp.ffmuc.net uisp; | ||
|
||
client_max_body_size 0; | ||
|
||
location /inform { | ||
resolver 5.1.66.255 valid=30s; | ||
proxy_pass http://uisp_inform_backend; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "Upgrade"; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
|
||
proxy_http_version 1.1; | ||
} | ||
location / { | ||
# Force HTTPS connection - but only for not /inform | ||
if ($scheme != "https") { | ||
rewrite ^ https://$host$uri permanent; | ||
} | ||
resolver 5.1.66.255 valid=30s; | ||
proxy_pass https://uisp_backend; | ||
proxy_redirect https://uisp_backend/ /; | ||
proxy_ssl_verify off; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "Upgrade"; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
|
||
proxy_http_version 1.1; | ||
} | ||
|
||
# Force HTTPS connection. This rules is domain agnostic | ||
|
||
ssl_certificate /etc/letsencrypt/live/ffmuc.net/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/ffmuc.net/privkey.pem; | ||
|
||
access_log /var/log/nginx/{{ domain }}_access.log json_normal; | ||
error_log /var/log/nginx/{{ domain }}_error.log; | ||
} |
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 @@ | ||
# Unifi STUN UDP Traffic | ||
upstream uisp_stun { | ||
server docker07.ov.ffmuc.net:2055; | ||
} | ||
|
||
server { | ||
listen 2055 udp; | ||
proxy_pass uisp_stun; | ||
proxy_responses 1; | ||
error_log /var/log/nginx/uisp_stun.log; | ||
} |
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
Oops, something went wrong.