Go program to update and push files periodically to a Git repository
2.1K
Go program to update and push files periodically to a Git repository
For bind mounting, create a files directory with the right permissions:
mkdir files
chown 1000 files
chmod 700 files
Use the following command:
docker run -d -v $(pwd)/files:/files qmcgaw/updated
You can also use docker-compose.yml with:
docker-compose up -d
To use with Git, you will also need to bind mount some files:
/key by default/passphrase, if your SSH key is encrypted/known_hosts by default, the default contains only Github key
And set their ownership to user ID 1000 also.Check logs with docker logs updated and update the image with docker pull qmcgaw/updated
This Go program only reads parameters from environment variables for ease of use with Docker.
Commonly used
| Environment variable | Default | Possible values | Description |
|---|---|---|---|
OUTPUT_DIR | ./files | Any absolute or relative directory path | Directory where files are written to |
PERIOD | 24h | Integer from 1 | Period in minutes between each run |
RESOLVE_HOSTNAMES | no | yes or no | Resolve hostnames found to obtain IP addresses |
HTTP_TIMEOUT | 3s | integer from 1 | Default HTTP client timeout in milliseconds |
LOG_LEVEL | info | debug, info, warning, error | Logging level |
TZ | America/Montreal | string | Timezone |
Git operation
| Environment variable | Default | Possible values | Description |
|---|---|---|---|
GIT | no | yes or no | Do Git operations or not |
GIT_URL | SSH Git URL address | SSH URL to the remote repository, used only if GIT=yes | |
SSH_KEY | ./key | File path | File path containing your SSH key, only used if GIT=yes |
SSH_KEY_PASSPHRASE | File path | Optional file path containing your SSH key passphrase, only used if GIT=yes. Does not work with OpenSSH keys |
Checksums
| Environment variable | Default | Possible values | Description |
|---|---|---|---|
NAMED_ROOT_MD5 | 076cfeb40394314adf28b7be79e6ecb1 | MD5 hexadecimal sum or "" | Named root MD5 sum. Disables checking if empty |
ROOT_ANCHORS_SHA256 | 45336725f9126db810a59896ae93819de743c416262f79c4444042c92e520770 | SHA256 hexadecimal sum or "" | Root anchors SHA256 sum. Disables checking if empty |
Extras
| Environment variable | Default | Possible values | Description |
|---|---|---|---|
SHOUTRRR_SERVICES | One or more comma separated Shoutrrr URLs | Comma separated list of Shoutrrr URLs |
Build the program
go build cmd/updated/main.go -o updated
Depending on your system, change its permissions chmod +x updated
Run the program ./updated
This container is used to periodically update files at github.com/qdm12/files which are used by several other projects.
This repository is under an MIT license
Content type
Image
Digest
sha256:87f6a16b0…
Size
5.6 MB
Last updated
3 months ago
docker pull qmcgaw/updated