Skip to content

Instantly share code, notes, and snippets.

@neontorrent
Last active January 20, 2025 03:56
Show Gist options
  • Save neontorrent/7c697a8844c47e59d72675edebab68c2 to your computer and use it in GitHub Desktop.
Save neontorrent/7c697a8844c47e59d72675edebab68c2 to your computer and use it in GitHub Desktop.
Centos 8 - tinyproxy, shadowsocks-rust
# install dependencies
yum install epel-release -y
yum install gcc gettext autoconf libtool automake make pcre-devel asciidoc xmlto udns-devel libev-devel -y
yum config-manager --set-enabled PowerTools
yum update
yum install tinyproxy -y
#vi /etc/tinyproxy/tinyproxy.conf
echo 'BasicAuth myuser mypassword
Allow 0.0.0.0' >> /etc/tinyproxy/tinyproxy.conf
systemctl enable tinyproxy
systemctl restart tinyproxy
systemctl status tinyproxy
# install shadowsocks
dnf copr enable atim/shadowsocks-rust
dnf install shadowsocks-rust -y
mkdir -p /etc/shadowsocks-rust/server/default
cat > /etc/shadowsocks-rust/server/default/ss.json5 <<EOF
{
"server": "0.0.0.0",
"server_port": 8443,
"local_port": 1080,
"local_address": "127.0.0.1",
"password": "password",
"timeout": 300,
"method": "chacha20-ietf-poly1305"
}
EOF
systemctl enable shadowsocks-rust-server@default
systemctl restart shadowsocks-rust-server@default
systemctl status shadowsocks-rust-server@default
# configure firewall (if needed)
firewall-cmd --zone=public --add-port=8443/tcp --permanent
firewall-cmd --zone=public --add-port=8443/udp --permanent
firewall-cmd --reload
yum install cron
systemctl start cron
systemctl enable cron
# install v2ray
yum install socat -y
release=$(curl -s 'https://api.github.com/repos/shadowsocks/v2ray-plugin/releases/latest' | grep tag_name | sed -E 's/.*"([^"]+)".*/\1/')
curl -sL "https://github.com/shadowsocks/v2ray-plugin/releases/download/${release}/v2ray-plugin-linux-amd64-${release}.tar.gz" | tar xvz -C /tmp
mv -f /tmp/v2ray-plugin_linux_amd64 /usr/bin/v2ray-plugin
chmod +x /usr/bin/v2ray-plugin
curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --register-account -m [email protected]
~/.acme.sh/acme.sh --issue --dns dns_cf -d mydomain.me --standalone
~/.acme.sh/acme.sh -i -d mydomain.me --fullchainpath /etc/shadowsocks-rust/server/default/v2ray.cer --keypath /etc/shadowsocks-rust/server/default/v2ray.key
# key file is owned by root but ss daemon starts under pseudo user
chmod 644 /etc/shadowsocks-rust/server/default/v2ray.key
cat > /etc/shadowsocks-rust/server/default/ss.json5 <<EOF
{
"server": "0.0.0.0",
"server_port": 8443,
"local_port": 1080,
"local_address": "127.0.0.1",
"password": "password",
"timeout": 300,
"method": "chacha20-ietf-poly1305",
"mode": "tcp_and_udp",
"plugin": "/usr/bin/v2ray-plugin",
"plugin_opts": "server;host=domain.me;cert=/etc/shadowsocks-rust/server/default/v2ray.cer;key=/etc/shadowsocks-rust/server/default/v2ray.key",
"plugin_args": [
"loglevel", "debug"
],
"plugin_mode": "tcp_and_udp"
}
EOF
systemctl restart shadowsocks-rust-server@default
systemctl status shadowsocks-rust-server@default
#journalctl -u shadowsocks-rust-server@default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment