diff --git a/Dockerfile b/Dockerfile index e69de29..0155066 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine:3.20 + +RUN apk update && \ + apk upgrade && \ + apk add --no-cache nginx, openssh, tor \ + && rm -rf /var/cache/apk/* + +COPY nginx.conf /etc/nginx/nginx.conf +COPY torrc /etc/tor/torrc +COPY sshd_config /etc/ssh/sshd_config +COPY index.html /var/www/html/index.html +COPY entrypoint.sh /entrypoint.sh + + +EXPOSE 4242 + +CMD ["sh", "-c", "nginx && tor -f /etc/tor/torrc"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..faace89 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Start the SSH service +/usr/sbin/sshd -D & + +# Start the Nginx service +nginx -g 'daemon off;' & + +# Start the Tor service +tor -f /etc/tor/torrc & + +# Keep the script running to prevent container exit +tail -f /dev/null \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..edbc1c8 --- /dev/null +++ b/index.html @@ -0,0 +1,24 @@ + +
+This is a hidden service running on Tor.
+ + \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..c11f5ed --- /dev/null +++ b/nginx.conf @@ -0,0 +1,10 @@ +server { + listen 80; + server_name + + location / { + root /var/www/html; + index index.html index.htm; + try_files $uri $uri/ =404; + } +} \ No newline at end of file diff --git a/sshd_config b/sshd_config new file mode 100644 index 0000000..be1eed2 --- /dev/null +++ b/sshd_config @@ -0,0 +1,10 @@ +# Basic SSHD Configuration + +Port 4242 +PermitRootLogin yes +PasswordAuthentication yes +ChallengeResponseAuthentication no +UsePAM yes +X11Forwarding no +AllowTcpForwarding no +PermitEmptyPasswords no diff --git a/torrc b/torrc new file mode 100644 index 0000000..1a6f2f4 --- /dev/null +++ b/torrc @@ -0,0 +1,6 @@ +# Basic torrc configuration + +SocksPort 9050 + +HiddenServiceDir /var/lib/tor/hidden_service/ +HiddenServicePort 80 127.0.0.1:80 \ No newline at end of file