File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ You can configure what the application does by changing ``config.json``:
3333 "github_ips_only": true,
3434 "enforce_secret": "",
3535 "return_scripts_info": true
36+ "hooks_path": "/.../hooks/"
3637 }
3738
3839:github_ips_only: Restrict application to be called only by GitHub IPs. IPs
@@ -48,6 +49,8 @@ You can configure what the application does by changing ``config.json``:
4849 you will be able to see the result of your hooks from within your GitHub
4950 hooks configuration page (see "Recent Deliveries").
5051 Default: ``true ``.
52+ :hooks_path: Configures a path to import the hooks. If not set, it'll import
53+ the hooks from the default location (/.../python-github-webhooks/hooks)
5154
5255
5356Adding Hooks
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ def index():
4242 """
4343
4444 path = normpath (abspath (dirname (__file__ )))
45- hooks = join (path , 'hooks' )
4645
4746 # Only POST is implemented
4847 if request .method != 'POST' :
@@ -52,6 +51,8 @@ def index():
5251 with open (join (path , 'config.json' ), 'r' ) as cfg :
5352 config = loads (cfg .read ())
5453
54+ hooks = config .get ('hooks_path' , join (path , 'hooks' ))
55+
5556 # Allow Github IPs only
5657 if config .get ('github_ips_only' , True ):
5758 src_ip = ip_address (
You can’t perform that action at this time.
0 commit comments