From 847a5f1480e9e964f5e27efa5fcbf00c5fcebe86 Mon Sep 17 00:00:00 2001 From: amass Date: Thu, 2 Jan 2025 21:50:35 +0800 Subject: [PATCH] change gitea url. --- .gitea/workflows/deploy.yaml | 15 ++++++--------- .gitea/workflows/docker.yaml | 15 ++++++--------- CMakeLists.txt | 2 +- Server/conf/nginx.conf | 17 +++++++++++++++++ Server/conf/server.conf | 18 ------------------ 5 files changed, 30 insertions(+), 37 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 93c3bc3..026cf50 100755 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -21,17 +21,14 @@ jobs: echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 ssh-keyscan -t ed25519 -p 22022 frp-by1.wwvvww.cn >> ~/.ssh/known_hosts - - name: Clone repository - run: | - echo "git clone --depth 10 --branch=${GITHUB_REF##*/} ssh://git@frp-by1.wwvvww.cn:22022/${{ gitea.repository }}.git" - git clone --depth 1 --branch=${GITHUB_REF##*/} ssh://git@frp-by1.wwvvww.cn:22022/${{ gitea.repository }}.git . - git checkout ${GITHUB_SHA} + - name: checkout repository + uses: actions/checkout@v4 - name: Notify-Start if: ${{ always() }} run: | echo "${{ github.repository }} 开始构建..." > notify.tpl - echo "构建地址: https://amass.fun/gitea/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl - echo "仓库地址: https://amass.fun/gitea/${{ github.repository }}">> notify.tpl + echo "构建地址: https://gitea.amass.fun/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl + echo "仓库地址: https://gitea.amass.fun/${{ github.repository }}">> notify.tpl echo "提交ID: $(git rev-parse --short HEAD)">> notify.tpl 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 @@ -113,8 +110,8 @@ jobs: run: | echo "${{ github.repository }} 构建结束" > notify.tpl echo "构建状态: ${{ job.status }}">> notify.tpl - echo "构建地址: https://amass.fun/gitea/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl - echo "仓库地址: https://amass.fun/gitea/${{ github.repository }}">> notify.tpl + echo "构建地址: https://gitea.amass.fun/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl + echo "仓库地址: https://gitea.amass.fun/${{ github.repository }}">> notify.tpl echo "提交ID: $(git rev-parse --short HEAD)">> notify.tpl 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 diff --git a/.gitea/workflows/docker.yaml b/.gitea/workflows/docker.yaml index 1c25b10..a3a5702 100644 --- a/.gitea/workflows/docker.yaml +++ b/.gitea/workflows/docker.yaml @@ -14,17 +14,14 @@ jobs: echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 ssh-keyscan -t ed25519 -p 22022 frp-by1.wwvvww.cn >> ~/.ssh/known_hosts - - name: Clone repository - run: | - echo "git clone --depth 1 --branch=${GITHUB_REF##*/} ssh://git@frp-by1.wwvvww.cn:22022/${{ gitea.repository }}.git" - git clone --depth 1 --branch=${GITHUB_REF##*/} ssh://git@frp-by1.wwvvww.cn:22022/${{ gitea.repository }}.git . - git checkout ${GITHUB_SHA} + - name: checkout repository + uses: actions/checkout@v4 - name: Notify-Start if: ${{ always() }} run: | echo "${{ github.repository }} 开始构建..." > notify.tpl - echo "构建地址: https://amass.fun/gitea/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl - echo "仓库地址: https://amass.fun/gitea/${{ github.repository }}">> notify.tpl + echo "构建地址: https://gitea.amass.fun/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl + echo "仓库地址: https://gitea.amass.fun/${{ github.repository }}">> notify.tpl echo "提交ID: $(git rev-parse --short HEAD)">> notify.tpl 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 @@ -58,8 +55,8 @@ jobs: run: | echo "${{ github.repository }} 构建结束" > notify.tpl echo "构建状态: ${{ job.status }}">> notify.tpl - echo "构建地址: https://amass.fun/gitea/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl - echo "仓库地址: https://amass.fun/gitea/${{ github.repository }}">> notify.tpl + echo "构建地址: https://gitea.amass.fun/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl + echo "仓库地址: https://gitea.amass.fun/${{ github.repository }}">> notify.tpl echo "提交ID: $(git rev-parse --short HEAD)">> notify.tpl 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 diff --git a/CMakeLists.txt b/CMakeLists.txt index f8f9f1f..77c2b41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set(OPENSSL_LIBRARIES ssl crypto) include(FetchContent) FetchContent_Declare(Kylin -GIT_REPOSITORY https://amass.fun/gitea/amass/Kylin.git +GIT_REPOSITORY https://gitea.amass.fun/amass/Kylin.git ) set(KYLIN_WITH_NNG ON) # add_subdirectory(/mnt/e/Projects/Kylin Kylin) diff --git a/Server/conf/nginx.conf b/Server/conf/nginx.conf index 2757416..4beffc9 100644 --- a/Server/conf/nginx.conf +++ b/Server/conf/nginx.conf @@ -64,6 +64,23 @@ http { server 127.0.0.1:7700; } + server { + listen 443 ssl; + server_name gitea.amass.fun; + ssl_certificate cert/gitea.amass.fun.pem; + ssl_certificate_key cert/gitea.amass.fun.key; + location / { + client_max_body_size 512M; + proxy_pass http://frp_http_proxy; + proxy_set_header Connection $http_connection; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + server { listen 443 ssl; server_name unraid.amass.fun; diff --git a/Server/conf/server.conf b/Server/conf/server.conf index 6dfec25..729cc1c 100644 --- a/Server/conf/server.conf +++ b/Server/conf/server.conf @@ -80,24 +80,6 @@ location /freedom { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -location ~ ^/(gitea|v2)($|/) { - client_max_body_size 512M; - - # make nginx use unescaped URI, keep "%2F" as-is, remove the "/gitea" sub-path prefix, pass "/v2" as-is. - rewrite ^ $request_uri; - rewrite ^/(gitea($|/))?(.*) /$3 break; - proxy_pass http://frp_http_proxy$uri; - - proxy_set_header Connection $http_connection; - proxy_set_header Upgrade $http_upgrade; - # 这里强制修改 Host 为 gitea.amass.fun 只是为了frpc能够做url路由 - proxy_set_header Host gitea.amass.fun; - # proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; -} - location = /search/website_collections { content_by_lua_file lua/request_website_collections.lua; }