This commit is contained in:
Damir Ibragimov
2023-07-25 13:23:46 +03:00
parent e55bb58542
commit 428250524f
5 changed files with 76 additions and 1 deletions

View File

@@ -2,4 +2,15 @@ FROM ubuntu
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y apt-utils && apt install -y gcc make dkms && apt upgrade -y && apt install nano openresolv iproute2 iptables dante-server RUN apt update && apt install -y apt-utils dnsutils && apt upgrade -y && apt install -y dante-server iproute2 iptables nano curl wget tini
ENTRYPOINT ["tini", "--"]
ADD danted-init.sh /danted-init.sh
ADD docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod 755 /*.sh
ENTRYPOINT ["tini", "--"]
STOPSIGNAL SIGINT
CMD ["/docker-entrypoint.sh"]

4
danted-init.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
useradd -r -M -s /sbin/nologin -c "Socks user" -u 1000 $SUSER
(echo $PASSWD; echo $PASSWD) | passwd $SUSER

23
danted.conf Normal file
View File

@@ -0,0 +1,23 @@
logoutput: syslog
user.privileged: root
user.unprivileged: nobody
# The listening network interface or address.
internal: 0.0.0.0 port=1080
# The proxying network interface or address.
external: eth0
# socks-rules determine what is proxied through the external interface.
socksmethod: username
# client-rules determine who can connect to the internal interface.
clientmethod: none
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
}

17
docker-compose.yaml Normal file
View File

@@ -0,0 +1,17 @@
---
version: "3.9"
services:
tubuntu:
build:
context: .
dockerfile: Dockerfile
image: ghostklart/danted:arm
container_name: danted
hostname: danted
volumes:
- ./danted.conf:/etc/danted.conf
env_file:
- danted.env
ports:
- 1080:1080
restart: unless-stopped

20
docker-entrypoint.sh Normal file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
starting() {
echo "Creating user"
bash /danted-init.sh
echo "Starting danted"
danted -p /danted.pid
}
ending() {
echo "Stopping danted"
kill -9 $(cat /danted.pid)
echo "Stopping container"
}
trap ending SIGINT SIGTERM
echo "Starting container"
starting