Git Product home page Git Product logo

vps-auto-change-ip's Introduction

vps auto change ip

这是一个简单的 python 脚本, 目的是在 vps ip 被墙的时候自动切换 ip 并同步更新面板里对应的 ip.

目前只支持 oracle 和 v2board. 其他提供商和面板的支持等待开发.

脚本会隔一段时间 ping 一下所有的 server, 如果发现 ping 不通, 那么把 ip 换掉. 因此 ping 的流量必须过墙.

如果脚本本身就在国内的话, 脚本自身就可以负责 ping, 那么直接运行脚本即可.

python3 app/main.py

如果脚本本身部署在墙外, 那么必须要部署一个 ping_server 部署在国内负责 ping.

# 部署在国内
# uvicorn app/ping_server.py
cd ping_server & go build
./ping_server

# 部署在国外
python3 app/main.py

docker

git clone https://github.com/justin-himself/vps-auto-change-ip
cd vps-auto-change-ip
mv config.example config
docker build -t justinhimself/vps-auto-change-ip .

部署程序本体:

docker run -d \
  --name vps_auto_change_ip \
  --restart unless-stopped \
  -v $PWD/config:/config \
  justinhimself/vps-auto-change-ip

部署 ping_server (optional)

docker run -d \
  --name vps_auto_change_ip_ping_server \
  --restart unless-stopped \
  -p 8000:8000 \
  -v $PWD/config:/config \
  justinhimself/vps-auto-change-ip \
  uvicorn app.ping_server:app --host 0.0.0.0

ping_server 的 config 只需要保留 ping 的内容就好.

vps-auto-change-ip's People

Contributors

by-justin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.