Skip to content

Commit 02dd31c

Browse files
fix: 修复selenium弱密码的问题
默认禁用vnc,默认vnc为只读模式,缺省弱密码改为强密码。 用户可以手动开启vnc,开启后可以指定是否只读,并修改vnc密码。 参考: https://github.com/SeleniumHQ/docker-selenium#debugging https://github.com/SeleniumHQ/docker-selenium#disabling-vnc
1 parent c443eef commit 02dd31c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: metersphere/docker-compose-seleniarm.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
container_name: selenium-chrome
66
shm_size: 2gb
77
ports:
8-
- "5900:5900" # password: secret
8+
- "5900:5900"
99
depends_on:
1010
- selenium-hub
1111
entrypoint: bash -c '[ ! -f /home/seluser/language ] && sudo sed -i -e "s/# $$LANG.*/$$LANG UTF-8/" /etc/locale.gen && sudo dpkg-reconfigure --frontend=noninteractive locales && sudo update-locale LANG=$$LANG && touch /home/seluser/language; /opt/bin/entry_point.sh'
@@ -21,6 +21,9 @@ services:
2121
- SCREEN_HEIGHT=1080
2222
- LANGUAGE=zh_CN.UTF-8
2323
- LANG=zh_CN.UTF-8
24+
- SE_START_VNC=false
25+
- SE_VNC_VIEW_ONLY=1
26+
- SE_VNC_PASSWORD=Password123@selenium
2427
restart: always
2528
healthcheck:
2629
test: ["CMD", "bash", "-c", "< /dev/tcp/localhost/5900"]
@@ -34,7 +37,7 @@ services:
3437
container_name: selenium-firefox
3538
shm_size: 2gb
3639
ports:
37-
- "5901:5900" # password: secret
40+
- "5901:5900"
3841
depends_on:
3942
- selenium-hub
4043
entrypoint: bash -c '[ ! -f /home/seluser/language ] && sudo sed -i -e "s/# $$LANG.*/$$LANG UTF-8/" /etc/locale.gen && sudo dpkg-reconfigure --frontend=noninteractive locales && sudo update-locale LANG=$$LANG && touch /home/seluser/language; /opt/bin/entry_point.sh'
@@ -50,6 +53,9 @@ services:
5053
- SCREEN_HEIGHT=1080
5154
- LANGUAGE=zh_CN.UTF-8
5255
- LANG=zh_CN.UTF-8
56+
- SE_START_VNC=false
57+
- SE_VNC_VIEW_ONLY=1
58+
- SE_VNC_PASSWORD=Password123@selenium
5359
restart: always
5460
healthcheck:
5561
test: [ "CMD", "bash", "-c", "< /dev/tcp/localhost/5900" ]

0 commit comments

Comments
 (0)