Coder Social home page Coder Social logo

qinglong_sync's Introduction

脚本功能

建议青龙版本 v2.12.2

同步青龙系统(A)的配置到青龙系统(B)

  • 环境变量(多次同步,会因为重复失败)
  • 配置文件(可以多次同步,更新为最新配置)
  • 依赖管理(多次同步,会重复安装多次,版本需要>=v2.12.2)

使用说明

在A和B分别创建应用获取 Client ID 和 Client Secret

记录 Client ID 和 Client Secret 后面需要用到

创建应用

在B中配置环境变量

在[配置文件]菜单 的 config.sh 中添加如下配置或在环境变量中添加配置

变量名 变量说明 默认值 是否必填
ql_origin_url A的url None
ql_origin_client_id A的Client ID None
ql_origin_client_secret A的Client Secret None
ql_target_url B的url None
ql_target_client_id B的Client ID None
ql_target_client_secret B的Client Secret None
ql_sync_env 是否同步环境变量(默认同步) "true"
ql_sync_config 是否同步配置文件(默认同步) "true"
ql_sync_dependence 是否同步依赖管理(默认同步) "true"
ql_sync_proxy 配置代理(默认不用代理,如何使用参考python 的 requests proxy) None

例子:

在B中[配置文件]菜单的 config.sh 中添加如下配置 注意同步完成后,下面这些配置会被A覆盖

## sync qinglong
export ql_origin_url="http://A地址"
export ql_origin_client_id="xxx"
export ql_origin_client_secret="xxx"

export ql_target_url="http://A地址"
export ql_target_client_id="xxx"
export ql_target_client_secret="xxx"

添加定时任务

创建定时任务

其中命令为

ql repo https://github.com/sorry510/qinglong_sync

运行一次这个任务,刷新页面,可以获取同步脚本

定时任务列表

运行一次 qinglong_sync.py 这个任务, 就可以完成同步 ps: 注意完成同步后删除或禁用这2个定时任务,否则会发生多次同步

接口文档参考

https://github.com/whyour/qinglong/tree/develop/back/api https://qinglong.ukenn.top/#/

qinglong_sync's People

Contributors

sorry510 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

lllrrr2

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.