|
1 | 1 |
|
2 | 2 | # Configuration file
|
3 | 3 |
|
4 |
| -You can use interactive config file generator: |
5 |
| -* for [server](https://semaphoreui.com/install/binary/2_12/config) |
6 |
| -* for [runner](https://semaphoreui.com/install/binary/2_12/runner). |
| 4 | +## Creating configuration file |
| 5 | + |
| 6 | +Semaphore uses a `config.json` file for its core configuration. You can generate this file interactively using built-in tools or through a web-based configurator. |
| 7 | + |
| 8 | +### Generate via CLI |
| 9 | + |
| 10 | +Use the following commands to generate the configuration file interactively: |
| 11 | + |
| 12 | +* For the Semaphore server: |
| 13 | + ``` |
| 14 | + semaphore setup |
| 15 | + ``` |
| 16 | +* For the Semaphore runner: |
| 17 | + ``` |
| 18 | + semaphore runner setup |
| 19 | + ``` |
| 20 | + |
| 21 | + <div class="warning"> |
| 22 | + For more details about runner configuration, see the <a href="./../runners.md">Runners</a> section. |
| 23 | + </div> |
| 24 | + |
| 25 | + |
| 26 | +### Generate via Web |
| 27 | + |
| 28 | +Alternatively, you can use the web-based interactive configurator: |
| 29 | +* [Server Configurator](https://semaphoreui.com/install/binary/2_13/config) |
| 30 | +* [Runner Configurator](https://semaphoreui.com/install/binary/2_13/runner) |
| 31 | + |
| 32 | +## Configuration file example |
7 | 33 |
|
8 | 34 | Semaphore uses a `config.json` configuration file with following content:
|
9 | 35 |
|
10 | 36 | ```javascript
|
11 | 37 | {
|
12 |
| - "bolt": { |
13 |
| - "host": "/home/ubuntu/semaphore.bolt" |
14 |
| - }, |
15 |
| - "mysql": { |
16 |
| - "host": "localhost", |
17 |
| - "user": "root", |
18 |
| - "pass": "*****", |
19 |
| - "name": "semaphore", |
20 |
| - "options": {} |
21 |
| - }, |
22 |
| - "postgres": { |
23 |
| - "host": "localhost", |
24 |
| - "user": "postgres", |
25 |
| - "pass": "*****", |
26 |
| - "name": "semaphore", |
27 |
| - "options": {} |
28 |
| - }, |
29 |
| - "dialect": "postgres", |
30 |
| - "port": "", |
31 |
| - "interface": "", |
32 |
| - "tmp_path": "/tmp/semaphore", |
33 |
| - "cookie_hash": "*****", |
34 |
| - "cookie_encryption": "*****", |
35 |
| - "access_key_encryption": "*****", |
36 |
| - "email_sender": "", |
37 |
| - "email_host": "", |
38 |
| - "email_port": "", |
39 |
| - "web_host": "", |
40 |
| - "ldap_binddn": "", |
41 |
| - "ldap_bindpassword": "", |
42 |
| - "ldap_server": "", |
43 |
| - "ldap_searchdn": "", |
44 |
| - "ldap_searchfilter": "", |
45 |
| - "ldap_mappings": { |
46 |
| - "dn": "", |
47 |
| - "mail": "", |
48 |
| - "uid": "", |
49 |
| - "cn": "" |
50 |
| - }, |
51 |
| - "telegram_chat": "", |
52 |
| - "telegram_token": "", |
53 |
| - "concurrency_mode": "", |
54 |
| - "max_parallel_tasks": 0, |
55 |
| - "email_alert": false, |
56 |
| - "telegram_alert": false, |
57 |
| - "slack_alert": false, |
58 |
| - "slack_url": "", |
59 |
| - "microsoft_teams_alert": false, |
60 |
| - "microsoft_teams_url": "", |
61 |
| - "rocketchat_alert": false, |
62 |
| - "rocketchat_url": "", |
63 |
| - "ldap_enable": false, |
64 |
| - "ldap_needtls": false |
65 |
| -} |
| 38 | + "mysql_test": { |
| 39 | + "host": "127.0.0.1:3306", |
| 40 | + "user": "root", |
| 41 | + "pass": "***", |
| 42 | + "name": "semaphore" |
| 43 | + }, |
| 44 | + |
| 45 | + "dialect": "mysql", |
| 46 | + |
| 47 | + "git_client": "go_git", |
| 48 | + |
| 49 | + "auth": { |
| 50 | + "totp": { |
| 51 | + "enabled": false, |
| 52 | + "allow_recovery": true |
| 53 | + } |
| 54 | + }, |
| 55 | + |
| 56 | + "use_remote_runner": true, |
| 57 | + "runner_registration_token": "73fs***", |
| 58 | + |
| 59 | + "tmp_path": "/tmp/semaphore", |
| 60 | + "cookie_hash": "96Nt***", |
| 61 | + "cookie_encryption": "x0bs***", |
| 62 | + "access_key_encryption": "j1ia***", |
| 63 | + |
| 64 | + "max_tasks_per_template": 3, |
| 65 | + |
| 66 | + "log": { |
| 67 | + "events": { |
| 68 | + "enabled": true, |
| 69 | + "path": "./events.log" |
| 70 | + } |
| 71 | + }, |
| 72 | + |
| 73 | + "process": { |
| 74 | + "chroot": "/opt/semaphore/sandbox" |
| 75 | + } |
| 76 | + } |
66 | 77 | ```
|
67 | 78 |
|
68 |
| -Usage: |
| 79 | +## Configuration file usage |
| 80 | + |
| 81 | +* For Semaphore server: |
69 | 82 |
|
70 | 83 | ```bash
|
71 | 84 | semaphore server --config ./config.json
|
72 |
| -``` |
| 85 | +``` |
| 86 | + |
| 87 | +* For Semaphore runner: |
| 88 | + |
| 89 | +```bash |
| 90 | +semaphore runner start --config ./config.json |
| 91 | +``` |
0 commit comments