Skip to content

Commit

Permalink
feat: configurable cron schedule (joshuaavalon#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaavalon authored Mar 6, 2021
1 parent d29642a commit ba9f0b2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 24 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ENV CLOUDFLARE_CONFIG=/app/config.yaml
ENV PUID=1001
ENV PGID=1001
ENV NODE_ENV=production
ENV CRON='*/5 * * * *'

COPY --from=builder /packages /app/packages/
COPY package.json package-lock.json /app/
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,18 @@ ipv6:

> If configuration file is found, environment variables are ignored.

| Parameters | Default | Description |
| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| \*ZONE | | Domain, e.g. `example.com`. |
| \*HOST | | DNS record to be updated, e.g. `example.com`, `subdomain.example.com`. |
| \*EMAIL | | Cloudflare Email |
| \*API | | Cloudflare API key |
| PROXY | true | Whether the record is receiving the performance and security benefits of Cloudflare. `true` to enable; `false` to disable. |
| FORCE_CREATE | | When set, a record will be created if one does not exist already. |
| IPV6 | | When set, update IPv6 instead of IPv4. |
| PUID | | User ID used by the script. |
| PGID | | Group ID used by the script. |
| Parameters | Default | Description |
| ------------ | ----------------- | -------------------------------------------------------------------------------------------------------------------------- |
| \*ZONE | | Domain, e.g. `example.com`. |
| \*HOST | | DNS record to be updated, e.g. `example.com`, `subdomain.example.com`. |
| \*EMAIL | | Cloudflare Email |
| \*API | | Cloudflare API key |
| PROXY | true | Whether the record is receiving the performance and security benefits of Cloudflare. `true` to enable; `false` to disable. |
| FORCE_CREATE | | When set, a record will be created if one does not exist already. |
| IPV6 | | When set, update IPv6 instead of IPv4. |
| PUID | | User ID used by the script. |
| PGID | | Group ID used by the script. |
| CRON | \*\/5 \* \* \* \* | DDNS update schedule. |

\* These parameters are required.

Expand Down
5 changes: 5 additions & 0 deletions docker/root/etc/cont-init.d/11-cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv sh

echo "Setting crontab to ${CRON}"
echo "${CRON} /app/cloudflare.sh" >> /etc/crontabs/root
chmod 600 /etc/crontabs/root
1 change: 0 additions & 1 deletion docker/root/etc/crontabs/root

This file was deleted.

24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ba9f0b2

Please sign in to comment.