Browse Source

Add the "SHORT_URL" environment for docker image subweb

musk-1024 1 year ago
parent
commit
3c7cfe41b3
1 changed files with 5 additions and 0 deletions
  1. 5 0
      subweb/start.sh

+ 5 - 0
subweb/start.sh

@@ -11,6 +11,11 @@ else
   echo "如需修改请在容器启动时使用 -e API_URL='https://sub.ops.ci' 传递环境变量"
 fi
 
+if [ $SHORT_URL ]; then
+  echo "当前短链接地址为: $SHORT_URL"
+  sed -i "s#https://s.ops.ci#$SHORT_URL#g" /usr/share/nginx/html/conf/config.js
+fi
+
 if [ $SITE_NAME ]; then
   sed -i "s#Subconverter Web#$SITE_NAME#g" /usr/share/nginx/html/conf/config.js
 fi