update deploy.
Some checks failed
Deploy / Build (push) Failing after 5m50s

This commit is contained in:
amass 2024-12-01 18:58:58 +08:00
parent 9a9a797986
commit 34253a4bf6
5 changed files with 49 additions and 14 deletions

View File

@ -10,7 +10,7 @@ jobs:
Build: Build:
runs-on: [ubuntu-latest, ubuntu-24.04] runs-on: [ubuntu-latest, ubuntu-24.04]
container: 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: credentials:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}

View File

@ -89,8 +89,7 @@ int main(int argc, char const *argv[]) {
signals.add(SIGUSR1); signals.add(SIGUSR1);
signals.async_wait([&application](boost::system::error_code const &, int signal) { signals.async_wait([&application](boost::system::error_code const &, int signal) {
// Stop the io_context. This will cause run() // Stop the io_context. This will cause run()
// to return immediately, eventually destroying the // to return immediately, eventually destroying the io_context and any remaining handlers in it.
// io_context and any remaining handlers in it.
LOG(info) << "capture " << (signal == SIGINT ? "SIGINT" : "SIGTERM") << ",stop!"; LOG(info) << "capture " << (signal == SIGINT ? "SIGINT" : "SIGTERM") << ",stop!";
application->ioContext().stop(); application->ioContext().stop();
}); });

View File

@ -20,10 +20,12 @@ EOF
function init() { function init() {
echo "start deploy server" echo "start deploy server"
scp -P $SERVER_PORT resources/openresty.service $USER@$SERVER_ADDRESS:/lib/systemd/system/openresty.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/frps.service 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 <<EOF ssh $USER@$SERVER_ADDRESS -p $SERVER_PORT <<EOF
apt install unzip
if [ ! -d /root/Server ]; then if [ ! -d /root/Server ]; then
mkdir -p /root/Server /root/Server/logs mkdir -p /root/Server /root/Server/logs
fi fi
@ -39,13 +41,24 @@ function init() {
opm get bungle/lua-resty-session opm get bungle/lua-resty-session
fi fi
if [ -f /root/Server/frp_0.60.0_linux_amd64/frps ]; then if [ -f /root/Server/frp_0.61.0_linux_amd64/frps ]; then
echo "frps has installed." echo "frps has installed."
else else
pushd /root/Server pushd /root/Server
# wget https://github.com/fatedier/frp/releases/download/v0.60.0/frp_0.60.0_linux_amd64.tar.gz wget https://github.com/fatedier/frp/releases/download/v0.61.0/frp_0.61.0_linux_amd64.tar.gz
wget https://frp-by1.wwvvww.cn:44048/s/frps/download -O frp_0.60.0_linux_amd64.tar.gz tar xvf ./frp_0.61.0_linux_amd64.tar.gz
tar xvf ./frp_0.60.0_linux_amd64.tar.gz rm frp_0.61.0_linux_amd64.tar.gz
popd
fi
if [ -f freedom_5.22.0_linux_amd64/freedom ]; then
echo "v2ray has installed."
else
pushd /root/Server
wget https://github.com/v2fly/v2ray-core/releases/download/v5.22.0/v2ray-linux-64.zip -O freedom_v5.22.0_linux_amd64.zip
unzip freedom_v5.22.0_linux_amd64.zip -d freedom_v5.22.0_linux_amd64
mv freedom_v5.22.0_linux_amd64/v2ray freedom_v5.22.0_linux_amd64/freedom
rm freedom_v5.22.0_linux_amd64.zip
popd popd
fi fi
@ -58,16 +71,24 @@ function init() {
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update apt update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 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 fi
if [ "$(docker ps -q -f name=librespeed)" ]; then if [ "$(docker ps -q -f name=librespeed)" ]; then
echo "librespeed has running." echo "librespeed has running."
else else
pushd /root/Server pushd /root/Server
docker run -d --name=librespeed -e PASSWORD=88888888 -p 8087:80 \ docker run -d --restart=unless-stopped --name=librespeed -e PASSWORD=88888888 -p 8087:80 \
-v ${PWD}/librespeed:/config --restart unless-stopped lscr.io/linuxserver/librespeed:latest -v /root/Server/librespeed:/config --restart unless-stopped lscr.io/linuxserver/librespeed:latest
popd popd
fi fi
EOF EOF

15
resources/freedom.service Normal file
View File

@ -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

View File

@ -5,7 +5,7 @@ Wants = network.target
[Service] [Service]
Type=simple 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 Restart=always
RestartSec=2s RestartSec=2s
LimitNOFILE=infinity LimitNOFILE=infinity