Move configuration into the unit file

This commit is contained in:
2025-09-27 21:32:15 +02:00
parent 6a66cc0b96
commit fb842558f0
3 changed files with 80 additions and 27 deletions

View File

@@ -11,7 +11,7 @@ another system.
## git-monitor
The git-monitor is a system service, that monitors a target directory on the
The git-monitor is a system service that monitors a target directory on the
PiDP-10. It contains a file with a list of git repositories to monitor, one at a
time. The service will check if any of the repositories changed, and pull them.
After a successful pull a script will be called, if it exists, that allows the
@@ -36,3 +36,49 @@ service to be enabled on system boot, enable the service:
```bash
sudo systemctl enable git-monitor.service
```
### Configuration
The service is usable immediately after installation. The service is configured
through a series of environment variables, that can be set to change the default
behaviour. There are five different environment variables to configure the
service with:
<table>
<tr>
<th>Environment Variable</th>
<th>Description</th>
<th>Default Value</th>
</tr>
<tr>
<td>GITMONITOR_URLS</td>
<td>A file that contains the list of observed repositories in a directory by name and URL.</td>
<td>/opt/src/repository.list</td>
</tr>
<tr>
<td>GITMONITOR_LOCAL_PATH</td>
<td>The path in which the clone repositories will be stored.</td>
<td>/opt/src</td>
</tr>
<tr>
<td>GITMONITOR_BRANCH_NAME</td>
<td>The name of the branch to observe.</td>
<td>develop</td>
</tr>
<tr>
<td>GITMONITOR_POLL_INTERVALL</td>
<td>The number of seconds to wait until the next poll.</td>
<td>30</td>
</tr>
<tr>
<td>GITMONITOR_LOCK_FILE</td>
<td>The lock file that is used to monitor the service. </td>
<td>/run/lock/git-monitor.lock</td>
</tr>
</table>
You can override these settings by creating an override file for the service
unit. Create a new file
`/etc/serviced/service/git-monitor.service.d/override.conf` by typing
`sudo systemctl edit git-monitor.service`. You can then uncomment the
`Environment` statements, and change the value of the variables accordingly.