Skip to content

Commit f135f17

Browse files
authored
Merge pull request #4777 from tesilaaliset/fix-docker
Fix docker
2 parents 2f21922 + 9622530 commit f135f17

File tree

8 files changed

+48
-18
lines changed

8 files changed

+48
-18
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ COPY . .
1414
RUN apt-get update && apt-get install -y apt-utils curl sudo systemd xxd lsof gawk iproute2 &&\
1515
mkdir -p /hiddify-data/ssl/ && \
1616
rm -rf /opt/hiddify-manager/ssl && \
17-
ln -sf /hiddify-data/ssl /opt/hiddify-manager/ssl &&\
18-
bash install.sh install-docker --no-gui &&\
19-
rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
17+
ln -sf /hiddify-data/ssl /opt/hiddify-manager/ssl
18+
19+
RUN bash install.sh install-docker --no-gui
20+
RUN rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
2021

2122
COPY other/docker/ /usr/bin/
2223

common/install.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ python -m pip config set global.index-url https://pypi.org/simple > /dev/null
99
# rm /etc/resolv.conf
1010
# ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
1111

12-
if [[ $COUNTRY == 'cn' ]]; then
13-
sudo timedatectl set-timezone Asia/Shanghai
14-
elif [[ $COUNTRY == 'ru' ]]; then
15-
sudo timedatectl set-timezone Europe/Moscow
16-
else
17-
sudo timedatectl set-timezone Asia/Tehran
12+
if [ "${MODE}" != "install-docker" ];then
13+
if [[ $COUNTRY == 'cn' ]]; then
14+
sudo timedatectl set-timezone Asia/Shanghai
15+
elif [[ $COUNTRY == 'ru' ]]; then
16+
sudo timedatectl set-timezone Asia/Moscow
17+
else
18+
sudo timedatectl set-timezone Asia/Tehran
19+
fi
1820
fi
1921

2022
groupadd -f hiddify-common
@@ -39,7 +41,9 @@ fi
3941

4042
ln -sf $(pwd)/sysctl.conf /etc/sysctl.d/hiddify.conf
4143

42-
sysctl --system > /dev/null
44+
if [ "${MODE}" != "install-docker" ];then
45+
sysctl --system > /dev/null
46+
fi
4347

4448
if [[ "$ONLY_IPV4" != true ]]; then
4549
sysctl -w net.ipv6.conf.all.disable_ipv6=0
@@ -83,7 +87,10 @@ echo "@reboot root /opt/hiddify-manager/install.sh --no-gui --no-log >> /opt/hid
8387
echo "@daily root /opt/hiddify-manager/common/daily_actions.sh >> /opt/hiddify-manager/log/system/daily_actions.log 2>&1" >/etc/cron.d/hiddify_daily_memory_release
8488
service cron reload
8589

86-
localectl set-locale LANG=C.UTF-8
90+
if [ "${MODE}" != "install-docker" ];then
91+
localectl set-locale LANG=C.UTF-8
92+
fi
93+
8794
update-locale LANG=C.UTF-8
8895

8996
echo "hiddify-panel ALL=(root) NOPASSWD: /opt/hiddify-manager/common/commander.py" >/etc/sudoers.d/hiddify

common/run.sh.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
source /opt/hiddify-manager/common/utils.sh
22

3+
if [ "${MODE}" != "install-docker" ];then
4+
35
# open essential ports
46
allow_port "tcp" 22
57
allow_port "tcp" 80
@@ -99,7 +101,7 @@ ip6tables -P INPUT ACCEPT
99101
save_firewall
100102

101103
#add2iptables "INPUT -p tcp --dport 9000 -j DROP"
102-
104+
fi
103105
{% if hconfigs['auto_update'] %}
104106
echo "0 3 * * * root $(pwd)/../update.sh --no-gui --no-log" >/etc/cron.d/hiddify_auto_update
105107
service cron reload

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ services:
1414

1515
#specific version
1616
#image: ghcr.io/hiddify/hiddify-manager:v10.80.0
17+
ports:
18+
- "443:443"
19+
- "80:80"
20+
- "22:22"
21+
- "80:80"
22+
- "443:443"
23+
- "53:53/udp"
24+
- "53:53/tcp"
25+
- "42238:42238/udp"
26+
- "19572:19572/udp"
27+
- "17573:17573/udp"
1728
privileged: true
1829
cap_add:
1930
- NET_ADMIN

hiddify-panel/app.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SECRET_KEY=Pl3453Ch4ng3
44
DEBUG=False
55
RUN_HOST=0.0.0.0
66
RUN_PORT=9000
7-
SQLALCHEMY_DATABASE_URI=sqlite:////opt/hiddify-manager/hiddify-panel/hiddifypanelnew.db
87

9-
REDIS_URI_MAIN=redis://:YOUR_SECURE_PASSWORD@127.0.0.1:6379/0
10-
REDIS_URI_SSH=redis://:YOUR_SECURE_PASSWORD@127.0.0.1:6379/1
8+
DB_VERSION=0SQLALCHEMY_DATABASE_URI ='mysql+mysqldb://hiddifypanel:MYSQL_STRONG_PASS@mariadb/hiddifypanel?charset=utf8mb4'
9+
REDIS_URI_MAIN = 'redis://:REDIS_STRONG_PASS@redis:6379/0'
10+
REDIS_URI_SSH = 'redis://:REDIS_STRONG_PASS@redis:6379/1'

hiddify-panel/install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ fi
2121

2222
pip uninstall -y flask-babelex >/dev/null 2>&1
2323

24+
if [ "${MODE}" == "install-docker" ];then
25+
rm -rf /opt/hiddify-manager/hiddify-panel/src
26+
mkdir -p /opt/hiddify-manager/hiddify-panel/src
27+
git clone --depth 1 --branch main https://github.com/hiddify/hiddifypanel.git /opt/hiddify-manager/hiddify-panel/src
28+
HIDDIFY_PANLE_SOURCE_DIR=/opt/hiddify-manager/hiddify-panel/src
29+
fi
30+
2431
# install/build hiddifypanel package
2532
if [ -n "$HIDDIFY_PANLE_SOURCE_DIR" ]; then
2633
echo "NOTICE: building hiddifypanel package from source..."

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function main() {
4242
clean_files
4343
update_progress "${PROGRESS_ACTION}" "Common Tools and Requirements" 2
4444
runsh install.sh common &
45-
if [ "${DOCKER_MODE}" != "true" ];then
45+
if [ "$MODE" != "install-docker" ];then
4646
install_run other/redis &
4747
install_run other/mysql &
4848
fi
@@ -166,7 +166,7 @@ function set_config_from_hpanel() {
166166

167167
function install_run() {
168168
echo "==========================================================="
169-
if [ "$MODE" == "install-docker" ];then
169+
if [ "$MODE" == "install-docker" ];then
170170
runsh install.sh $1
171171
return
172172
elif [ "$DO_NOT_INSTALL" != "true" ];then

other/wireguard/install.sh.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ PostDown = ip6tables -t nat -D POSTROUTING -o ${SERVER_PUB_NIC} -j MASQUERADE" >
5959
echo "net.ipv4.ip_forward = 1
6060
net.ipv6.conf.all.forwarding = 1" >/etc/sysctl.d/wg.conf
6161

62-
sysctl --system > /dev/null
62+
if [ "$MODE" != "install-docker" ];then
63+
sysctl --system > /dev/null
64+
fi
6365

6466
systemctl start "wg-quick@${SERVER_WG_NIC}"
6567
systemctl enable "wg-quick@${SERVER_WG_NIC}"

0 commit comments

Comments
 (0)