refactor(samples/httpaste.it): finalize initial sample
- add tor daemon - clean directory structure
This commit is contained in:
parent
d558a65609
commit
60a01ea511
7 changed files with 49 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ services:
|
||||||
build:
|
build:
|
||||||
context: ../..
|
context: ../..
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
target: uwsgi
|
||||||
environment:
|
environment:
|
||||||
HTTPASTE_CONFIGPATH: /usr/local/httpaste/config.ini
|
HTTPASTE_CONFIGPATH: /usr/local/httpaste/config.ini
|
||||||
volumes:
|
volumes:
|
||||||
|
|
@ -13,7 +14,7 @@ services:
|
||||||
target: /shared
|
target: /shared
|
||||||
volume:
|
volume:
|
||||||
nocopy: true
|
nocopy: true
|
||||||
- ./httpaste/config.ini:/usr/local/httpaste/config.ini
|
- ./httpaste/usr/local/httpaste/config.ini:/usr/local/httpaste/config.ini
|
||||||
command: -s /shared/uwsgi.sock --chmod-socket=666
|
command: -s /shared/uwsgi.sock --chmod-socket=666
|
||||||
httpd:
|
httpd:
|
||||||
build:
|
build:
|
||||||
|
|
@ -28,6 +29,12 @@ services:
|
||||||
target: /shared
|
target: /shared
|
||||||
volume:
|
volume:
|
||||||
nocopy: true
|
nocopy: true
|
||||||
- ./httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf
|
- ./httpd/usr/local/apache2/conf/httpd.conf:/usr/local/apache2/conf/httpd.conf
|
||||||
|
tor:
|
||||||
|
build:
|
||||||
|
context: ./tor
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
volumes:
|
||||||
|
- ./tor/etc/tor/torrc:/etc/tor/torrc
|
||||||
volumes:
|
volumes:
|
||||||
system-shared:
|
system-shared:
|
||||||
17
samples/httpaste.it/httpaste.service
Normal file
17
samples/httpaste.it/httpaste.service
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=httpaste (via Docker Compose)
|
||||||
|
Requires=docker.service
|
||||||
|
After=docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
WorkingDirectory=/usr/local/src/httpaste/samples/httpaste.it
|
||||||
|
ExecStart=docker-compose up
|
||||||
|
ExecStop=docker-compose down
|
||||||
|
TimeoutStartSec=0
|
||||||
|
Restart=on-failure
|
||||||
|
StartLimitIntervalSec=60
|
||||||
|
StartLimitBurst=3
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
@ -61,3 +61,10 @@ ServerName 127.0.0.1
|
||||||
SetEnv proxy-sendchunks
|
SetEnv proxy-sendchunks
|
||||||
ProxyPass "/" "unix:/shared/uwsgi.sock|uwsgi://localhost/"
|
ProxyPass "/" "unix:/shared/uwsgi.sock|uwsgi://localhost/"
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|
||||||
|
<VirtualHost 0.0.0.0:80>
|
||||||
|
#ProxyPreserveHost On
|
||||||
|
ServerAlias *.onion
|
||||||
|
SetEnv proxy-sendchunks
|
||||||
|
ProxyPass "/" "unix:/shared/uwsgi.sock|uwsgi://localhost/"
|
||||||
|
</VirtualHost>
|
||||||
10
samples/httpaste.it/tor/Dockerfile
Normal file
10
samples/httpaste.it/tor/Dockerfile
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
FROM debian:bullseye-slim
|
||||||
|
|
||||||
|
RUN apt-get update -y && apt-get install -y tor
|
||||||
|
|
||||||
|
COPY ./usr/local/sbin/hostname.sh /usr/local/sbin/hostname
|
||||||
|
RUN chmod +x /usr/local/sbin/hostname
|
||||||
|
|
||||||
|
USER debian-tor
|
||||||
|
|
||||||
|
ENTRYPOINT ["tor"]
|
||||||
3
samples/httpaste.it/tor/etc/tor/torrc
Normal file
3
samples/httpaste.it/tor/etc/tor/torrc
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
DataDirectory /var/lib/tor
|
||||||
|
HiddenServiceDir /var/lib/tor/hidden_service/
|
||||||
|
HiddenServicePort 80 httpd:80
|
||||||
3
samples/httpaste.it/tor/usr/local/sbin/hostname.sh
Executable file
3
samples/httpaste.it/tor/usr/local/sbin/hostname.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
prop=HiddenServiceDir
|
||||||
|
cat $(grep $prop /etc/tor/torrc | sed "s/$prop //g")/hostname
|
||||||
Loading…
Add table
Add a link
Reference in a new issue