12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # @File : config.py
- # @Author: becivells
- #@Contact : becivells@gmail.com
- # @Date : 2017/10/19
- #@Software : PyCharm
- # @Desc :
- HOST = '0.0.0.0'
- PORT = 5000
- DEBUG = False #True or False
- #允许git server地址访问
- GIT_SERVER = [
- #localhost
- '127.0.0.1',
- '123.206.177.125'
- ]
- #访问的路径
- SYNC_PATH = 'hookssync'
- ##如果token不存在路径访问正确那么访问时频繁更新配置间隔的时间
- CONF_UPDATE_TIME = 30
- #允许执行命令时的路径
- PATH_WHITE_LIST = [
- # /app/web/test
- '^/app/web/.*',
- # /app/web/tests
- '^/var/www/html/.*'
- ]
- #允许在webhooks执行时执行的命令 使用正则表达式进行匹配
- EXEC_WHITE_LIST = [
- # git pull origin master
- '^git pull \w+ \w+$',
- # git fetch origin master && git reset --hard origin/master
- '^git fetch \w+ \w+ && git reset --hard \w+/\w+$',
- # git pull origin master && supervisorctl restart webhooks
- '^git pull \w+ \w+ && supervisorctl restart \w+$',
- # git fetch origin master && git reset --hard origin/master && supervisorctl restart webhooks
- '^git fetch \w+ \w+ && git reset --hard \w+/\w+ && supervisorctl restart \w+$'
- ]
- repo = {
- "9901b6deb47111e7b832704d7b885ead":{
- "name":"shop",
- "path":"/app/web/game",
- "ip":['127.0.0.1','123.206.177.125'],
- "cmd":'git pull origin master',
- "user":'apache',
- 'interval':3
- }
- }
- # repo = {
- # "9901b6deb47111e7b832704d7b885ead":{
- # "name":"fanghuishop",
- # "path":"/app/web/fanghuishop",
- # "ip":['127.0.0.1','123.206.177.125'],
- # "cmd":'git fetch origin master && git reset --hard origin/master',
- # "user":'apache',
- # 'interval':3
- # }
- # }
|