From 81cc7c3b43db3bafc034628f9e563a3fd784e622 Mon Sep 17 00:00:00 2001 From: whaffman Date: Thu, 3 Jul 2025 15:35:11 +0200 Subject: [PATCH] Add initial Docker setup with Nginx, SSH, and Tor services --- Dockerfile | 17 +++++++++++++++++ entrypoint.sh | 13 +++++++++++++ index.html | 24 ++++++++++++++++++++++++ nginx.conf | 10 ++++++++++ sshd_config | 10 ++++++++++ torrc | 6 ++++++ 6 files changed, 80 insertions(+) create mode 100644 entrypoint.sh create mode 100644 index.html create mode 100644 nginx.conf create mode 100644 sshd_config create mode 100644 torrc 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 @@ + + + Welcome to ft_onion + + + +

Welcome to ft_onion

+

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