本帖最后由 bulesky 于 2024-9-21 13:54 编辑
lx0113 发表于 2024-9-20 23:15
大佬,使用的官方rustdesk/rustdesk-server-s6:latest,docker-compose搭建,该如何自定义key
rustdesk-server-s6是由S6管理服务,你可以将run脚本挂载进去,我看容器中的run
#!/command/with-contenv sh
cd /data
PARAMS=
[ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k _"
/usr/bin/hbbr $PARAMS
/data # exit
#!/command/with-contenv sh
sleep 2
cd /data
PARAMS=
[ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k _"
/usr/bin/hbbs -r $RELAY $PARAMS
可以改写下
mkdir ./hbbr
touch ./hbbr/run
然后写入./hbbr/run
#!/command/with-contenv sh
cd /data
PARAMS=
[ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k ${KEY}"
/usr/bin/hbbr $PARAMS
同样hbbs
mkdir ./hbbs
touch ./hbbs/run
然后写入./hbbs/run
#!/command/with-contenv sh
sleep 2
cd /data
PARAMS=
[ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k ${KEY}"
/usr/bin/hbbs -r $RELAY $PARAMS
然后compose配置中挂载
environment:
- "RELAY=192.168.1.66:21117"
- "ENCRYPTED_ONLY=1"
- KEY=abc123456789
volumes:
- ./data:/data
- ./hbbr/run:/etc/s6-overlay/s6-rc.d/hbbr/run
- ./hbbs/run:/etc/s6-overlay/s6-rc.d/hbbs/run
然后启动就可以了
结果
|