-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
42 lines (34 loc) · 857 Bytes
/
entrypoint.sh
File metadata and controls
42 lines (34 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
if [ ! -f /data/proxy-secret ] || [ ! -f /data/proxy-multi.conf ]; then
echo "Downloading initial configuration..."
/usr/local/bin/update-config.sh
fi
echo "0 3 * * * /usr/local/bin/update-config.sh" | crontab -
cron
if [ -z "$SECRET" ]; then
echo "ERROR: SECRET environment variable is not set!"
exit 1
fi
WORKERS=${WORKERS:-1}
PORT=${PORT:-443}
STATS_PORT=${STATS_PORT:-8888}
USER=${USER:-nobody}
TAG_OPTION=""
if [ -n "$PROXY_TAG" ]; then
TAG_OPTION="-P $PROXY_TAG"
fi
echo "Starting MTProxy..."
echo "Port: $PORT"
echo "Stats port: $STATS_PORT"
echo "Workers: $WORKERS"
echo "Secret: ${SECRET:0:8}..."
exec mtproto-proxy \
-u $USER \
-p $STATS_PORT \
-H $PORT \
-S $SECRET \
$TAG_OPTION \
--aes-pwd /data/proxy-secret \
/data/proxy-multi.conf \
-M $WORKERS \
--address 0.0.0.0