diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 6b9c920..8d98317 100755 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -36,6 +36,26 @@ jobs: echo -n "提交消息: ${{ github.event.head_commit.message }}">> notify.tpl cat notify.tpl | envsubst | jq -sR . | xargs -0 -I {} curl -H "Content-Type: application/json" -X POST -d '{"type":"text","msg":{} }' https://amass.fun/notify - run: resources/build.sh build + - name: Copy wt resources to server + uses: appleboy/scp-action@v0.1.7 + with: + host: ${{ vars.YUYUN_SERVER }} + username: ${{ vars.YUYUN_USER }} + password: ${{ secrets.SERVER_ROOT_PASSWORD }} + overwrite: true + strip_components: 6 + source: /opt/Libraries/wt-4.11.1/share/Wt/resources/** + target: /root/Server/resources + - name: Copy app wt resources to server + uses: appleboy/scp-action@v0.1.7 + with: + host: ${{ vars.YUYUN_SERVER }} + username: ${{ vars.YUYUN_USER }} + password: ${{ secrets.SERVER_ROOT_PASSWORD }} + overwrite: true + strip_components: 1 + source: "resources/*.css,resources/*.xml" + target: /root/Server/resources - name: Copy files to server uses: appleboy/scp-action@v0.1.7 with: @@ -77,7 +97,7 @@ jobs: username: ${{ vars.YUYUN_USER }} password: ${{ secrets.SERVER_ROOT_PASSWORD }} script: | - systemctl restart openresty.service + systemctl restart openresty.service; exit 0 - name: Notify-End if: ${{ always() }} run: | diff --git a/WebApplication/WebApplication.cpp b/WebApplication/WebApplication.cpp index 33a487b..cd307f7 100644 --- a/WebApplication/WebApplication.cpp +++ b/WebApplication/WebApplication.cpp @@ -17,7 +17,7 @@ WebApplication::WebApplication(uint16_t port, const std::string &documentRoot) { try { std::vector args; - args.push_back("--approot=./build"); + args.push_back(std::format("--approot={}/resources", documentRoot)); args.push_back(std::format("--docroot={}", documentRoot)); args.push_back("--config=resources/wt_config.xml"); args.push_back(std::format("--http-listen=127.0.0.1:{}", port)); diff --git a/resources/wt_config.xml b/resources/wt_config.xml index 7c96f6c..e4b76be 100644 --- a/resources/wt_config.xml +++ b/resources/wt_config.xml @@ -441,10 +441,8 @@ --> -