@@ -10,8 +10,8 @@ The WebHook works in two parts, a web listener and a worker. The web listener
10
10
adds requests to Redis and the worker processes the requests.
11
11
12
12
The worker will interact with the system's git as the user running the worker.
13
- This means that the user running the worker should have its key added to
14
- the appropriate GitHub accounts.
13
+ ** This means that the user running the worker should have its key added to
14
+ the appropriate GitHub accounts.**
15
15
16
16
During testing it would make sense to run the worker manually. For production
17
17
deployments it would probably make more sense to runt he worker using something
@@ -27,19 +27,21 @@ Ensure that [git-subsplit][2] is installed correctly. If is not available
27
27
in your version of git (likely true for versions older than 1.7.11)
28
28
please install it manually from [ here] [ 5 ] .
29
29
30
+ You should initialize subsplit with a git repository:
30
31
31
- ### Installation
32
-
33
- #### If You Already Have Composer
32
+ cd /home/myuser
33
+ git subsplit init [email protected] :orga/repo.git
34
34
35
- composer create-project dflydev/git-subsplit-github-webhook:1.0.x-dev -n webhook
36
- cd webhook
35
+ It will create a ` .subsplit ` working directory that you will use later.
37
36
38
- #### If You Need Composer
37
+ ### Installation
39
38
40
- curl -s https://getcomposer.org/installer | php
41
- php composer.phar create-project dflydev/ git-subsplit-github-webhook:1.0.x-dev -n webhook
39
+ git clone [email protected] :dflydev/dflydev-git-subsplit-github-webhook.git
40
+ mv dflydev- git-subsplit-github-webhook/ webhook/
42
41
cd webhook
42
+ composer install
43
+
44
+ N.B. If you need composer : [ https://getcomposer.org/download/ ] [ 8 ]
43
45
44
46
### Redis
45
47
@@ -49,6 +51,7 @@ Ensure that the Redis server is running.
49
51
50
52
Copy ` config.json.dist ` to ` config.json ` and edit it accordingly. Please make sure
51
53
to pay special attention to setting ` working-directory ` correctly.
54
+ Don't forget to change the ` webhook-secret ` to secure your webhook.
52
55
53
56
### Web Server
54
57
@@ -63,7 +66,7 @@ Start the worker by running `php bin/subsplit-worker.php`.
63
66
### GitHub
64
67
65
68
From your repository go to ** Settings** / ** Service Hooks** / ** WebHook URLs** .
66
- Enter the URL to your WebHook and click ** Update Settings** .
69
+ Enter the URL to your WebHook and your secret. Then click ** Update Settings** .
67
70
68
71
Click ** WebHook URLs** again and click ** Test Hook** .
69
72
@@ -77,26 +80,13 @@ Configuration
77
80
78
81
```
79
82
{
80
- "working-directory": "/home/myuser/.git- subsplit-working ",
81
- "allowed-ips ": ["127.0.0.1"] ,
83
+ "working-directory": "/home/myuser/.subsplit",
84
+ "webhook-secret ": "ThisTokenIsNotSoSecretChangeIt" ,
82
85
"projects": {
83
- "sculpin": {
84
- "url": "https://github.com/sculpin/sculpin",
85
- "repository-url": "[email protected] :sculpin/sculpin.git",
86
- "splits": [
87
- "src/Sculpin/Core:[email protected] :sculpin/core.git"
88
- ]
89
- },
90
- "react": {
91
- "url": "https://github.com/reactphp/react",
86
+ "project-1": {
87
+ "url": "[email protected] :orga/private-repo.git",
92
88
"splits": [
93
- "src/React/EventLoop:[email protected] :reactphp/event-loop.git",
94
- "src/React/Stream:[email protected] :reactphp/stream.git",
95
- "src/React/Cache:[email protected] :reactphp/cache.git",
96
- "src/React/Socket:[email protected] :reactphp/socket.git",
97
- "src/React/Http:[email protected] :reactphp/http.git",
98
- "src/React/HttpClient:[email protected] :reactphp/http-client.git",
99
- "src/React/Dns:[email protected] :reactphp/dns.git"
89
+ "src/public:[email protected] :orga/public-repo.git"
100
90
]
101
91
}
102
92
}
@@ -112,12 +102,12 @@ Configuration
112
102
The directory in which the subsplits will be processed. This is more or less
113
103
a temporary directory in which all projects will have their subsplit initialized.
114
104
115
- #### allowed-ips
105
+ #### webhook-secret
116
106
117
- * Array . Default: [ '207.97.227.253', '50.57.128.197', '108.171.174.178' ] *
107
+ * String . Default: "ThisTokenIsNotSoSecretChangeIt". ** Required. ** *
118
108
119
- The IP addresses that are allowed to call the WebHook. The default values are
120
- GitHub's IP addresses published here .
109
+ This is a secret string that should be unique to your webhook. It's used to secure communication between the webhook and github.
110
+ You can use a * secret generator * if you want a strong string .
121
111
122
112
#### projects
123
113
@@ -135,9 +125,8 @@ Each project description object can have the following properties:
135
125
` url ` property against each project's listed ` url ` property to determine
136
126
which project the request is for.
137
127
138
- This URL will look like: ** https:// github.com/sculpin/sculpin **
128
+ This URL should be like: ** git@ github.com: orga /repo.git **
139
129
140
- Note: The URL is secure (http** s** ) and does not contain ` .git ` extension.
141
130
* ** repository-url** :
142
131
The URL that ` git ` will use to check out the project. This setting is
143
132
optional. If it is not defined the repository URL will be read from the
@@ -174,3 +163,4 @@ Thanks Igor. :)
174
163
[ 5 ] : https://github.com/apenwarr/git-subtree
175
164
[ 6 ] : http://upstart.ubuntu.com
176
165
[ 7 ] : http://supervisord.org
166
+ [ 8 ] : https://getcomposer.org/download/
0 commit comments