crocandr преди 7 години
ревизия
2bdcf31fa3
променени са 4 файла, в които са добавени 81 реда и са изтрити 0 реда
  1. 13 0
      Dockerfile
  2. 21 0
      README.md
  3. 12 0
      docker-compose.yml
  4. 35 0
      files/start.sh

+ 13 - 0
Dockerfile

@@ -0,0 +1,13 @@
+FROM debian
+
+ENV DOWNLOAD_URL https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.28-9669-beta/softether-vpnserver-v4.28-9669-beta-2018.09.11-linux-x64-64bit.tar.gz
+
+RUN apt-get update && apt-get install -y curl tar gzip grep make gcc cpp
+RUN curl -L -o /opt/softether.tar.gz $DOWNLOAD_URL && tar xzfp /opt/softether.tar.gz -C /opt 
+RUN cd /opt/vpnserver && make i_read_and_agree_the_license_agreement 
+
+COPY files/start.sh /opt/start.sh
+RUN chmod 755 /opt/*.sh
+
+#ENTRYPOINT /bin/bash
+ENTRYPOINT /opt/start.sh

+ 21 - 0
README.md

@@ -0,0 +1,21 @@
+# SoftEther
+
+My basic SoftEther VPN Server container.
+
+  - https://www.softether.org
+  
+# Usage
+
+The recommended way is docker-compose.
+
+```
+docker-compose up -d
+```
+
+# Remote Management
+
+  - start the VPN server
+  - connect to the server with SoftEther Server Manager Tool from Windows or macOS
+  
+Notice:
+sometimes the default 443 port is used by another service, so use another available port like 5555, 8888...

+ 12 - 0
docker-compose.yml

@@ -0,0 +1,12 @@
+version: '3'
+
+services:
+  softether:
+    image: croc/softether
+    volumes:
+      - './config:/config'
+      - './log:/log'
+      - '/etc/localtime:/etc/localtime:ro'
+    privileged: true
+    network_mode: host
+#    restart: always

+ 35 - 0
files/start.sh

@@ -0,0 +1,35 @@
+#!/bin/bash
+
+BASE_DIR="/opt/vpnserver"
+CONFIG_DIR="/config"
+LOG_DIR="/log"
+
+[ -z $VERBOSE ] && { VERBOSE="yes"; }
+
+# prestart vpn server
+$BASE_DIR/vpnserver start
+sleep 1
+$BASE_DIR/vpnserver stop
+
+# config
+[ -d $CONFIG_DIR ] || { mkdir -p $CONFIG_DIR; }
+echo "Preconfiguring config files..."
+[ -d $BASE_DIR/backup.vpn_server.config ] && { mv $BASE_DIR/backup.vpn_server.config $CONFIG_DIR && ln -sf $CONFIG_DIR/backup.vpn_server.config $BASE_DIR; }
+[ -d $BASE_DIR/chain_certs ] && { mv $BASE_DIR/chain_certs $CONFIG_DIR && ln -sf $CONFIG_DIR/chain_certs $BASE_DIR; }
+[ -f $BASE_DIR/vpn_server.config ] && { mv $BASE_DIR/vpn_server.config $CONFIG_DIR && ln -sf $CONFIG_DIR/vpn_server.config $BASE_DIR; }
+
+# log
+[ -d $LOG_DIR ] || { mkdir -p $LOG_DIR; }
+for logf in $BASE_DIR/*_log
+do
+  [ -d $logf ] && { mv $logf $LOG_DIR && ln -sf $LOG_DIR/$( basename $logf ) $BASE_DIR; }
+done
+
+# basic config
+$BASE_DIR/vpncmd RemoteEnable
+
+# start vpn service
+$BASE_DIR/vpnserver start
+
+# something daemon like stuff
+[ $VERBOSE == "no" ] && { /bin/bash; } || { tail -f $LOG_DIR/server_log/*.log; }