Skip to content

Commit 146a978

Browse files
authored
Merge 4af9e7f into d0476f5
2 parents d0476f5 + 4af9e7f commit 146a978

File tree

18 files changed

+88
-81
lines changed

18 files changed

+88
-81
lines changed

.env-dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ COMMON_ROOM_CONTROLWORD=
2424

2525
# Endpoint for all gates
2626
#GATE_ENDPOINT_HOST=onechan
27-
#GATE_ENDPOINT_PORT=80
2827

2928
# Uncomment to enable torgate
3029
#TORGATE_HOSTNAME=yourhost.onion

docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ services:
4444
SEARCHD_PID_FILE: "searchd.pid"
4545
ports:
4646
- "80:80"
47+
- "81:81"
4748
volumes:
4849
- www-smilies:/src/www/img/smilies
4950
- www-homeboards:/src/www/ico/homeboards

docker/config/1chan/nginx.conf

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,73 @@ http {
119119
}
120120

121121
}
122+
123+
server {
124+
125+
listen 81 proxy_protocol;
126+
server_name ~^[a-z0-9]+\.onion$;
127+
128+
root /src/www;
129+
index index.php;
130+
131+
real_ip_header proxy_protocol;
132+
real_ip_recursive on;
133+
134+
# local
135+
set_real_ip_from 192.168.0.0/16;
136+
set_real_ip_from 172.16.0.0/12;
137+
set_real_ip_from 10.0.0.0/8;
138+
set_real_ip_from fc00::/7;
139+
140+
client_max_body_size 5m;
141+
client_body_timeout 60;
142+
143+
# Add CORS headers globally
144+
add_header 'Access-Control-Allow-Origin' '*';
145+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
146+
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
147+
148+
location ~ ^/(socket\.io|broadcast)/ {
149+
150+
proxy_pass http://127.0.0.1:9393;
151+
proxy_http_version 1.1;
152+
proxy_set_header Host $host;
153+
proxy_set_header X-Real-IP $remote_addr;
154+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
155+
proxy_set_header Upgrade $http_upgrade;
156+
proxy_set_header Connection "Upgrade";
157+
proxy_connect_timeout 7d;
158+
proxy_send_timeout 7d;
159+
proxy_read_timeout 7d;
160+
161+
}
162+
163+
location / {
164+
165+
if (!-e $request_filename) {
166+
rewrite ^(/.*)$ /index.php?q=$1 last;
167+
break;
168+
}
169+
170+
}
171+
172+
location ~ \.php$ {
173+
174+
include /etc/nginx/fastcgi_params;
175+
fastcgi_intercept_errors on;
176+
fastcgi_index index.php;
177+
fastcgi_pass localhost:9000;
178+
fastcgi_param SCRIPT_FILENAME $request_filename;
179+
180+
}
181+
182+
location ~* ^(?!.*socket\.io\.js).*\.(js|css|png|jpg|jpeg|gif|ico)$ {
183+
184+
try_files $uri /index.php;
185+
expires max;
186+
log_not_found off;
187+
188+
}
189+
190+
}
122191
}

docker/config/i2pgate/init.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ else
1414
sed -i 's/\__GATE_ENDPOINT_HOST__/'"${GATE_ENDPOINT_HOST}"'/g' /etc/i2pd/tunnels.conf
1515
fi
1616

17-
if [ -z "${GATE_ENDPOINT_PORT}" ]; then
18-
echo "GATE_ENDPOINT_PORT environment var is undefined, i2pgate will be disabled";
19-
exit 0;
20-
else
21-
sed -i 's/\__GATE_ENDPOINT_PORT__/'"${GATE_ENDPOINT_PORT}"'/' /etc/i2pd/tunnels.conf
22-
fi
23-
24-
printf "i2pgate started: ${GATE_ENDPOINT_HOST}:${GATE_ENDPOINT_PORT}\n\n"
17+
printf "i2pgate started: ${GATE_ENDPOINT_HOST}:80\n\n"
2518

2619
i2pd --service --conf /etc/i2pd/i2pd.conf

docker/config/i2pgate/tunnels.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[__GATE_ENDPOINT_HOST__]
22
type = http
33
host = __GATE_ENDPOINT_HOST__
4-
port = __GATE_ENDPOINT_PORT__
4+
port = 80
55
keys = secret_key.dat

docker/config/torgate/cron.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

docker/config/torgate/init.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,7 @@ else
3030
sed -i 's/\__GATE_ENDPOINT_HOST__/'"${GATE_ENDPOINT_HOST}"'/' /etc/tor/torrc
3131
fi
3232

33-
if [ -z "${GATE_ENDPOINT_PORT}" ]; then
34-
echo "GATE_ENDPOINT_PORT environment var is undefined, torgate will be disabled";
35-
exit 0;
36-
else
37-
sed -i 's/\__GATE_ENDPOINT_PORT__/'"${GATE_ENDPOINT_PORT}"'/' /etc/tor/torrc
38-
fi
39-
4033
chmod -R 600 /var/lib/tor/hidden_service
41-
echo "Torgate started: ${TORGATE_HOSTNAME} -> ${GATE_ENDPOINT_HOST}:${GATE_ENDPOINT_PORT}"
34+
echo "Torgate started: ${TORGATE_HOSTNAME} -> ${GATE_ENDPOINT_HOST}:81"
4235

4336
tor

docker/config/torgate/supervisord.conf

Lines changed: 0 additions & 21 deletions
This file was deleted.

docker/config/torgate/torrc.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ RunAsDaemon 0
7070
## address y:z.
7171

7272
HiddenServiceDir /var/lib/tor/hidden_service/
73-
HiddenServicePort 80 __GATE_ENDPOINT_HOST__:__GATE_ENDPOINT_PORT__
73+
HiddenServiceExportCircuitID haproxy
74+
HiddenServicePort 80 __GATE_ENDPOINT_HOST__:81
7475

7576
#HiddenServiceDir /var/lib/tor/other_hidden_service/
7677
#HiddenServicePort 80 127.0.0.1:80

docker/config/yggdrasil/docker-entrypoint.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,10 @@ if [[ -z $@ ]]; then
2323
sed -i 's/\__GATE_ENDPOINT_HOST__/'"${GATE_ENDPOINT_HOST}"'/g' ./supervisord.conf
2424
fi
2525

26-
if [ -z "${GATE_ENDPOINT_PORT}" ]; then
27-
echo "GATE_ENDPOINT_PORT environment var is undefined, yggdrasil will be disabled";
28-
exit 0;
29-
else
30-
sed -i 's/\__GATE_ENDPOINT_PORT__/'"${GATE_ENDPOINT_PORT}"'/g' ./supervisord.conf
31-
fi
32-
3326
printf "Updating peers...\n\n"
3427
./peers_updater -c ./yggdrasil.conf -n 5 -u
3528

36-
printf "yggdrasil started: ${GATE_ENDPOINT_HOST}:${GATE_ENDPOINT_PORT}\n\n"
29+
printf "yggdrasil started: ${GATE_ENDPOINT_HOST}:80\n\n"
3730
supervisord -c ./supervisord.conf
3831

3932
fi

0 commit comments

Comments
 (0)