Skip to content

Commit 3278451

Browse files
committed
staging
1 parent df6487d commit 3278451

File tree

9 files changed

+75
-33
lines changed

9 files changed

+75
-33
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
define public_ipv4 = 198.98.56.238;
2+
define public_ipv6 = 2605:6400:0010:0c41:de92:c534:326a:711a;
3+
define neighbor_as = 53667;
4+
define neighbor_ipv4 = 169.254.169.179;
5+
define neighbor_ipv6 = 2605:6400:ffff::2;
6+
define bgp_password = "{{bgp_password}}";
7+
8+
filter grapheneos_ipv4_filter {
9+
accept;
10+
};
11+
12+
filter grapheneos_ipv6_filter {
13+
accept;
14+
};

bird.staging.conf

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
include "bird.local.conf";
2+
3+
log syslog all;
4+
5+
router id public_ipv4;
6+
7+
protocol device {
8+
scan time 10;
9+
};
10+
11+
template bgp grapheneos {
12+
local as 40806;
13+
multihop 2;
14+
authentication md5;
15+
password bgp_password;
16+
graceful restart on;
17+
connect delay time 0;
18+
connect retry time 5;
19+
}
20+
21+
protocol bgp grapheneos_ipv4 from grapheneos {
22+
source address public_ipv4;
23+
neighbor neighbor_ipv4 as neighbor_as;
24+
ipv4 {
25+
import none;
26+
export filter grapheneos_ipv4_filter;
27+
};
28+
};
29+
30+
protocol bgp grapheneos_ipv6 from grapheneos {
31+
source address public_ipv6;
32+
neighbor neighbor_ipv6 as neighbor_as;
33+
ipv6 {
34+
import none;
35+
export filter grapheneos_ipv6_filter;
36+
};
37+
};
38+
39+
protocol static grapheneos_ipv4_route {
40+
ipv4;
41+
};
42+
43+
protocol static grapheneos_ipv6_route {
44+
ipv6;
45+
route 2602:f4d9:4::/48 via public_ipv6;
46+
};

deploy

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ elif [[ $# -ne 0 ]]; then
2323
fi
2424

2525
# use YYYYMMDDSS SOA serial format
26-
old_serial=$(cat serial.txt 2>/dev/null || echo -n $(date -u +"%Y%m%d00"))
26+
old_serial=$(cat serial-staging.txt 2>/dev/null || echo -n $(date -u +"%Y%m%d00"))
2727
serial=$(date -u +"%Y%m%d")
2828
if [[ ${old_serial:0:8} = ${serial} ]]; then
2929
old_sequence=${old_serial:8:2}
@@ -35,7 +35,7 @@ else
3535
fi
3636
echo serial: $serial
3737
echo
38-
echo -n $serial > serial.txt
38+
echo -n $serial > serial-staging.txt
3939

4040
. servers.sh
4141

@@ -44,11 +44,7 @@ for server in ${servers[@]}; do
4444

4545
remote=root@$server
4646

47-
if [[ $server == *.ns1.grapheneos.org ]]; then
48-
subdomain=ns1
49-
else
50-
subdomain=ns2
51-
fi
47+
subdomain=ns1.staging
5248

5349
if (( reconfigure )); then
5450
cp pdns.conf pdns.conf.tmp
@@ -70,8 +66,7 @@ for server in ${servers[@]}; do
7066
rm -rf zones.tmp
7167

7268
if (( reconfigure )); then
73-
ssh $remote 'sleep 5 &&
74-
systemctl daemon-reload &&
69+
ssh $remote 'systemctl daemon-reload &&
7570
systemctl enable --now geoipupdate.timer pdns.service pdns-trigger-health-checks.timer &&
7671
systemctl restart pdns.service'
7772
else

deploy-bgp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ deploy_bird() {
2424
for server in ${servers[@]}; do
2525
echo $server
2626

27-
if [[ $server == *.ns1.grapheneos.org ]]; then
28-
subdomain=ns1
29-
else
30-
subdomain=ns2
31-
fi
27+
subdomain=staging
3228

3329
deploy_bird $server $subdomain
3430

deploy-dnsdist

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ for server in ${servers[@]}; do
1616

1717
remote=root@$server
1818

19-
if [[ $server == *.ns1.grapheneos.org ]]; then
20-
subdomain=ns1
21-
else
22-
subdomain=ns2
23-
fi
19+
subdomain=ns1.staging
2420

2521
cp dnsdist.conf dnsdist.conf.tmp
2622
sed -i "s/{{subdomain}}/$subdomain/g;s/{{threads}}/${threads[$server]:-1}/g" dnsdist.conf.tmp

deploy-static

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ if ! flock -n $fd; then
1111
exit 1
1212
fi
1313

14-
rsync -pcv --chmod=F644 --fsync --preallocate mirrors.ns1 root@ewr.ns1.grapheneos.org:/etc/mirrors
15-
rsync -pcv --chmod=F644 --fsync --preallocate mirrors.ns2 root@iad.ns2.grapheneos.org:/etc/mirrors
16-
1714
. servers.sh
1815

1916
for server in ${servers[@]}; do
@@ -23,11 +20,7 @@ for server in ${servers[@]}; do
2320

2421
rm -rf nginx-tmp
2522
cp -a nginx nginx-tmp
26-
if [[ $server == *.ns1.grapheneos.org ]]; then
27-
sed -i 's/{{subdomain}}/ns1/g; s/{{primary}}/ewr/g' nginx-tmp/nginx.conf
28-
else
29-
sed -i 's/{{subdomain}}/ns2/g; s/{{primary}}/iad/g' nginx-tmp/nginx.conf
30-
fi
23+
sed -i s/{{subdomain}}/ns1.staging/g nginx-tmp/nginx.conf
3124
gixy nginx-tmp/nginx.conf
3225
rsync -rpcv --chmod=D755,F644 --delete --fsync --preallocate nginx-tmp/{nginx.conf,mime.types} $remote:/etc/nginx/
3326
ssh $remote systemctl reload nginx

nginx/nginx.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ http {
8787
server {
8888
listen 80;
8989
listen [::]:80;
90-
server_name {{subdomain}}.grapheneos.org {{subdomain}}.attestation.app {{subdomain}}.grapheneos.app {{subdomain}}.grapheneos.ca {{subdomain}}.grapheneos.com {{subdomain}}.grapheneos.dev {{subdomain}}.grapheneos.foundation {{subdomain}}.grapheneos.info {{subdomain}}.grapheneos.net {{subdomain}}.grapheneos.network {{subdomain}}.grapheneos.online {{subdomain}}.grapheneos.ovh {{subdomain}}.grapheneos.page {{subdomain}}.grapheneos.social {{subdomain}}.seamlessupdate.app {{subdomain}}.vanadium.app;
90+
server_name {{subdomain}}.grapheneos.org ns2.staging.grapheneos.org {{subdomain}}.attestation.app ns2.staging.attestation.app;
9191

9292
location /.well-known/acme-challenge/ {
93-
return 301 http://{{primary}}.{{subdomain}}.grapheneos.org$request_uri;
93+
root /srv/certbot;
9494
}
9595

9696
location / {
@@ -128,12 +128,12 @@ http {
128128
listen 443 ssl;
129129
listen [::]:443 ssl;
130130
http2 on;
131-
server_name {{subdomain}}.grapheneos.org {{subdomain}}.attestation.app {{subdomain}}.grapheneos.app {{subdomain}}.grapheneos.ca {{subdomain}}.grapheneos.com {{subdomain}}.grapheneos.dev {{subdomain}}.grapheneos.foundation {{subdomain}}.grapheneos.info {{subdomain}}.grapheneos.net {{subdomain}}.grapheneos.network {{subdomain}}.grapheneos.online {{subdomain}}.grapheneos.ovh {{subdomain}}.grapheneos.page {{subdomain}}.grapheneos.social {{subdomain}}.seamlessupdate.app {{subdomain}}.vanadium.app;
131+
server_name {{subdomain}}.grapheneos.org ns2.staging.grapheneos.org {{subdomain}}.attestation.app ns2.staging.attestation.app;
132132

133133
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
134134

135135
location = / {
136-
return 301 https://grapheneos.org/articles/grapheneos-servers#ns1.grapheneos.org;
136+
return 301 https://grapheneos.org/articles/grapheneos-servers#ns1.staging.grapheneos.org;
137137
}
138138

139139
location / {

pdns.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ security-poll-suffix=
4747

4848
webserver=yes
4949
webserver-address=/run/pdns/http.sock
50+
51+
loglevel=7
52+
log-dns-queries=yes

servers.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
. bgp-password.sh
22

33
readonly servers_ns1=(
4-
{bom,ewr,fra,lax,lon,mia,sao,sea,sin,syd,tyo}.ns1.grapheneos.org
54
)
65

76
readonly servers_ns2=(
8-
{ber,iad,lon,mia,sea,sjc,sin,tyo}.ns2.grapheneos.org
97
)
108

119
readonly servers=(
10+
ns1.staging.grapheneos.org
1211
"${servers_ns1[@]}"
1312
"${servers_ns2[@]}"
1413
)

0 commit comments

Comments
 (0)