diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 5d00548..69854a7 100755 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -10,7 +10,7 @@ jobs: Build: runs-on: [ubuntu-latest, ubuntu-24.04] container: - image: registry.cn-shenzhen.aliyuncs.com/amass_toolset/ubuntu_dev:22.04 + image: registry.cn-shenzhen.aliyuncs.com/amass_toolset/ubuntu_dev:24.04 credentials: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/Server/main.cpp b/Server/main.cpp index 6f34c86..d183350 100644 --- a/Server/main.cpp +++ b/Server/main.cpp @@ -89,8 +89,7 @@ int main(int argc, char const *argv[]) { signals.add(SIGUSR1); signals.async_wait([&application](boost::system::error_code const &, int signal) { // Stop the io_context. This will cause run() - // to return immediately, eventually destroying the - // io_context and any remaining handlers in it. + // to return immediately, eventually destroying the io_context and any remaining handlers in it. LOG(info) << "capture " << (signal == SIGINT ? "SIGINT" : "SIGTERM") << ",stop!"; application->ioContext().stop(); }); diff --git a/resources/deploy.sh b/resources/deploy.sh index 5d69d81..13a4f67 100755 --- a/resources/deploy.sh +++ b/resources/deploy.sh @@ -20,10 +20,12 @@ EOF function init() { echo "start deploy server" - scp -P $SERVER_PORT resources/openresty.service $USER@$SERVER_ADDRESS:/lib/systemd/system/openresty.service - scp -P $SERVER_PORT resources/frps.service $USER@$SERVER_ADDRESS:/etc/systemd/system/frps.service + scp -P $SERVER_PORT resources/openresty.service $USER@$SERVER_ADDRESS:/lib/systemd/system/ + scp -P $SERVER_PORT resources/frps.service $USER@$SERVER_ADDRESS:/etc/systemd/system/ + scp -P $SERVER_PORT resources/freedom.service $USER@$SERVER_ADDRESS:/etc/systemd/system/ ssh $USER@$SERVER_ADDRESS -p $SERVER_PORT < /dev/null - apt-get update - apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + apt update + apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + fi + + if [ "$(docker ps -q -f name=twikoo)" ]; then + echo "twikoo has running." + else + pushd /root/Server + docker run --name twikoo --restart=always -e TWIKOO_THROTTLE=1000 -p 8083:8080 -v /root/Server/twikoo:/app/data -d imaegoo/twikoo + popd fi if [ "$(docker ps -q -f name=librespeed)" ]; then echo "librespeed has running." else pushd /root/Server - docker run -d --name=librespeed -e PASSWORD=88888888 -p 8087:80 \ - -v ${PWD}/librespeed:/config --restart unless-stopped lscr.io/linuxserver/librespeed:latest + docker run -d --restart=unless-stopped --name=librespeed -e PASSWORD=88888888 -p 8087:80 \ + -v /root/Server/librespeed:/config --restart unless-stopped lscr.io/linuxserver/librespeed:latest popd fi EOF diff --git a/resources/freedom.service b/resources/freedom.service new file mode 100644 index 0000000..0315aa7 --- /dev/null +++ b/resources/freedom.service @@ -0,0 +1,15 @@ +[Unit] +Description=Freedom Service +Documentation=https://amass.fun/我的笔记/工作笔记/内网穿透 +After = network.target syslog.target +Wants = network.target + +[Service] +Type=simple +ExecStart=/root/Server/freedom_v5.22.0_linux_amd64/freedom run -config /root/Server/freedom_v5.22.0_linux_amd64/config.json +Restart=always +RestartSec=2s +LimitNOFILE=infinity + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/resources/frps.service b/resources/frps.service index c3d0049..c8881d4 100644 --- a/resources/frps.service +++ b/resources/frps.service @@ -5,7 +5,7 @@ Wants = network.target [Service] Type=simple -ExecStart=/root/Server/frp_0.60.0_linux_amd64/frps -c /root/Server/frp_0.60.0_linux_amd64/frps.toml +ExecStart=/root/Server/frp_0.61.0_linux_amd64/frps -c /root/Server/frp_0.61.0_linux_amd64/frps.toml Restart=always RestartSec=2s LimitNOFILE=infinity