先进行apt的基础安装
1
2
|
apt update
apt install python3 pip python3.11-venv pkg-config libssl-dev git make build-essential curl proxychains
|
创建并切换到autopcr账户,进行一些基础信息配置
1
2
3
4
5
6
7
8
9
10
|
adduser autopcr
su autopcr
cd
git clone https://github.com/cc004/autopcr.git
cd autopcr
python3 -m venv .venv
echo 'export RUSTUP_DIST_SERVER="https://rsproxy.cn"' >> ~/.bashrc
echo 'export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"' >> ~/.bashrc
source ~/.bashrc
|
安装cargo和rustc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh
source "$HOME/.cargo/env"
cat > ~/.cargo/config << EOF
[source.crates-io]
replace-with = 'rsproxy-sparse'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"
[net]
git-fetch-with-cli = true
EOF
rustc --version
cargo --version
|
进行autopcr的基础配置
1
2
3
|
proxychains .venv/bin/pip3 install -r requirements.txt
.venv/bin/python3 _download_web.py
|
切换回root创建一个服务
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
cat > /usr/lib/systemd/system/autopcr.service << EOF
[Unit]
Description=autopcr
After=network.target
[Service]
User=autopcr
ExecStart=bash /home/autopcr/autopcrstart.sh
TimeoutSec=2
[Install]
WantedBy=default.target
EOF
cat > /home/autopcr/autopcrstart.sh << EOF
#!/bin/bash
cd /home/autopcr/autopcr
.venv/bin/python _httpserver_test.py
EOF
|
最后的访问地址为
:13200/daily/login
更新
切换到autopcr用户运行如下命令
1
2
3
4
5
|
sudo systemctl stop autopcr
cd ~/autopcr
proxychains git pull
proxychains .venv/bin/python3 _download_web.py
sudo systemctl start autopcr
|