config.py.product 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # @File : config.py
  4. # @Author: becivells
  5. #@Contact : becivells@gmail.com
  6. # @Date : 2017/10/19
  7. #@Software : PyCharm
  8. # @Desc :
  9. HOST = '0.0.0.0'
  10. PORT = 5000
  11. DEBUG = False #True or False
  12. #允许git server地址访问
  13. GIT_SERVER = [
  14. #localhost
  15. '127.0.0.1',
  16. '123.206.177.125'
  17. ]
  18. #访问的路径
  19. SYNC_PATH = 'hookssync'
  20. ##如果token不存在路径访问正确那么访问时频繁更新配置间隔的时间
  21. CONF_UPDATE_TIME = 30
  22. #允许执行命令时的路径
  23. PATH_WHITE_LIST = [
  24. # /app/web/test
  25. '^/app/web/.*',
  26. # /app/web/tests
  27. '^/var/www/html/.*'
  28. ]
  29. #允许在webhooks执行时执行的命令 使用正则表达式进行匹配
  30. EXEC_WHITE_LIST = [
  31. # git pull origin master
  32. '^git pull \w+ \w+$',
  33. # git fetch origin master && git reset --hard origin/master
  34. '^git fetch \w+ \w+ && git reset --hard \w+/\w+$',
  35. # git pull origin master && supervisorctl restart webhooks
  36. '^git pull \w+ \w+ && supervisorctl restart \w+$',
  37. # git fetch origin master && git reset --hard origin/master && supervisorctl restart webhooks
  38. '^git fetch \w+ \w+ && git reset --hard \w+/\w+ && supervisorctl restart \w+$'
  39. ]
  40. repo = {
  41. "9901b6deb47111e7b832704d7b885ead":{
  42. "name":"shop",
  43. "path":"/app/web/game",
  44. "ip":['127.0.0.1','123.206.177.125'],
  45. "cmd":'git pull origin master',
  46. "user":'apache',
  47. 'interval':3
  48. }
  49. }
  50. # repo = {
  51. # "9901b6deb47111e7b832704d7b885ead":{
  52. # "name":"fanghuishop",
  53. # "path":"/app/web/fanghuishop",
  54. # "ip":['127.0.0.1','123.206.177.125'],
  55. # "cmd":'git fetch origin master && git reset --hard origin/master',
  56. # "user":'apache',
  57. # 'interval':3
  58. # }
  59. # }