Init
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -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
4
danted-init.sh
Normal 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
23
danted.conf
Normal 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
17
docker-compose.yaml
Normal 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
20
docker-entrypoint.sh
Normal 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
|
||||||
|
|
||||||
Reference in New Issue
Block a user