README.md 1.9 KB
Newer Older
Adam Harrison-Fuller's avatar
Adam Harrison-Fuller committed
1
# Gitlab RSS Sync
2
3
Create Gitlab issues from RSS Feeds with optional labelling.  Created to monitor RSS feeds and bring posts to
our attention (Security Releases, Product Updates etc)
Adam Harrison-Fuller's avatar
Adam Harrison-Fuller committed
4
5

## Config file
6
7
8
9
10

The config file **MUST** be named config.yaml, an example one is provided [here](config.yaml.example).  Below is a brief
 description of its contents.

```yaml
Adam Harrison-Fuller's avatar
Adam Harrison-Fuller committed
11
12
13
14
15
16
interval: 300 // Interval in seconds to check the RSS feeds.
feeds:
  - id: test //Specify a feed ID that is used internally for duplicate detection.
    feed_url: http://example.com/rss.xml // The Feed URL.
    name: Test Feed // A User friendly display name.
    gitlab_project_id: 12345 // The Gitlab project ID to create issues under.
Adam Harrison-Fuller's avatar
Adam Harrison-Fuller committed
17
    added_since: "2019-03-27T15:00:00Z" // (Optional) For longer RSS feeds specify a ISO 8601 DateTime to exclude items published/updated earlier than this
18
    labels: // (Optional) A list of labels to add to created Issues.
Adam Harrison-Fuller's avatar
Adam Harrison-Fuller committed
19
      - TestLabel
Adam Harrison-Fuller's avatar
Adam Harrison-Fuller committed
20
21
   - id: feed2
     ...
Adam Harrison-Fuller's avatar
Adam Harrison-Fuller committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
```

## Docker
A Docker image is made available on [DockerHub](https://hub.docker.com/r/adamhf/gitlabrsssync)

### Required Environment Variables
* GITLAB_API_TOKEN - Gitlab personal access token that will be used to create Issues NOTE: You must have access to create
issues in the projects you specify in the config file.
* CONFIG_DIR - The directory the application should look for config.yaml in.
* DATA_DIR - The directory the application should look for (or create) the state.db in.

### Volume mounts
Make sure the location of your DATA_DIR environment variable is set to a persistant volume / mount as the database
that is contained within it stores the state of which RSS items have already been synced.

### Run it
38
39
```sh
docker run -e GITLAB_API_TOKEN=<INSERT_TOKEN> -e DATA_DIR=/data -e CONFIG_DIR=/app -v <PATH_TO_DATA_DIR>:/data -v <PATH_TO_CONFIG_DIR>/config adamhf/rss-sync:latest
Adam Harrison-Fuller's avatar
Adam Harrison-Fuller committed
40
41
42
43
```

### TODO
* Make the retroactive setting of the Gitlab creation time optional.