207 字
1 分钟
AutoPCR部署
先进行apt的基础安装
apt updateapt install python3 pip python3.11-venv pkg-config libssl-dev git make build-essential curl proxychains创建并切换到autopcr账户,进行一些基础信息配置
adduser autopcrsu autopcrcdgit clone https://github.com/cc004/autopcr.gitcd autopcrpython3 -m venv .venv
echo 'export RUSTUP_DIST_SERVER="https://rsproxy.cn"' >> ~/.bashrcecho 'export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"' >> ~/.bashrcsource ~/.bashrc安装cargo和rustc
curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | shsource "$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 = trueEOF
rustc --versioncargo --version进行autopcr的基础配置
proxychains .venv/bin/pip3 install -r requirements.txt
.venv/bin/python3 _download_web.py切换回root创建一个服务
cat > /usr/lib/systemd/system/autopcr.service << EOF[Unit]Description=autopcrAfter=network.target
[Service]User=autopcrExecStart=bash /home/autopcr/autopcrstart.shTimeoutSec=2
[Install]WantedBy=default.targetEOF
cat > /home/autopcr/autopcrstart.sh << EOF#!/bin/bashcd /home/autopcr/autopcrgit pull.venv/bin/python3 _download_web.py.venv/bin/python _httpserver_test.pyEOF最后的访问地址为
:13200/daily/login
更新
切换到autopcr用户运行如下命令
sudo systemctl stop autopcrcd ~/autopcrproxychains git pullproxychains .venv/bin/python3 _download_web.pysudo systemctl start autopcr