Commit graph

146 commits

Author SHA1 Message Date
4f086b008d ci: set tag for gitleaks 2024-01-26 22:51:12 +01:00
d655c811c1 ci: fix woodpecker warnings 2024-01-24 20:01:21 +01:00
65d3097548 ci: shellcheck disable=SC2086 2023-11-09 09:18:19 +01:00
9dec488c64 git Revert "ci: fix linter errors: nextcloud-exec.sh"
This reverts commit d3755a20fd.
2023-11-09 09:15:52 +01:00
156aad8d30 ci: # shellcheck disable=SC1091 2023-11-09 09:07:39 +01:00
c01a58c9b3 ci: shellcheck -x 2023-11-09 09:06:21 +01:00
d3755a20fd ci: fix linter errors: nextcloud-exec.sh 2023-11-09 09:05:30 +01:00
d65d3ae4e0 ci: fix linter errors: healthcheck.sh 2023-11-09 09:04:49 +01:00
3eab1e668f ci: fix linter errors: find-container.sh 2023-11-09 09:03:35 +01:00
993d41945c ci: fix linter errors: entrypoint.sh 2023-11-09 09:03:00 +01:00
b0fc5f7cb7 ci: fix linter errors: run-cron-php.sh 2023-11-09 09:02:29 +01:00
4a8746e853 ci: fix linter errors: cron-tasks.sh 2023-11-09 09:02:19 +01:00
21278feb22 ci: enable shellcheck 2023-11-09 08:57:51 +01:00
fda096686d ci: disable shellcheck 2023-11-08 16:26:14 +01:00
02dd3b1daf FROM alpine:3 2023-11-08 16:25:44 +01:00
ca8d31d9ed add badge 2023-11-08 13:25:03 +01:00
08f853cd2d ci: add shellcheck 2023-11-03 19:31:52 +01:00
c3d9d911df drone -> woodpecker 2023-11-03 19:23:41 +01:00
72b620cc26 ci: fix linter errors 2023-10-31 18:39:10 +01:00
d175bdd6fc ci: fix linter warnings 2023-10-31 18:38:32 +01:00
b3ae127df4 ci: enable hadolint 2023-10-31 18:37:43 +01:00
df9e744c18 ci: disable hadolint 2023-10-31 18:35:29 +01:00
184bd8ca80 ci: add ci 2023-10-31 18:32:42 +01:00
John Molakvoæ
b639405e9b
fix: only return one container when searching (#22) 2023-08-07 15:26:14 -05:00
Robert Dailey
76bf57baf3 Use correct match ending for project naming mode 2022-03-19 14:18:52 -05:00
Robert Dailey
52579827be Support naming conventions for compose v2 and swarm
- Naming convention in Docker Swarm: Fixes #14
- Compose v2 uses `-` separator instead of `_`: Fixes #10
2022-03-19 14:00:38 -05:00
Robert Dailey
f2ce54653b Fix various custom script processing issues
The following issues were addressed. Note that these are edge cases.

* If an empty `/cron-scripts` directory was mounted in the container, an
  error would occur.
* If files in the `/cron-scripts` directory had spaces in the name, this
  would cause issues.
* stdin was held open when running `docker exec` which would cause hangs
  and other issues. The `exec` command is now run non-interactively.
* Custom scripts that failed would interrupt processing of scripts after
  it, if any.
2020-10-27 16:48:34 -05:00
Robert Dailey
ff71477632 Do not replace built-in scripts
When the user mounts /cron-scripts in the container, this replaced the built-in
scripts. The built-in scripts are now shipped in /cron-scripts-builtin now.
2020-10-26 13:55:10 -05:00
Robert Dailey
d13a18876a Links & build status added to README 2020-09-18 12:36:27 -05:00
Robert Dailey
9e661cb13c Use Github Actions for CI & ARM64 Support
Transition from Docker Hub automated builds to Github Actions for CI
builds. This allows support for other architectures.

ARM64 support has been added as well. This fixes #5.
2020-09-18 12:27:55 -05:00
Robert Dailey
6bd173f22e Add troubleshooting section to README
Initial troubleshooting topics are related to errors seen when there is
no bash available in the Nextcloud container. Relates to issue #6.
2020-08-28 15:39:15 -05:00
Robert Dailey
faa77b77c8 Support for custom shells
It is now possible to override and explicitly specify the shell you
would like used when executing cron tasks. This is accomplished with the
NEXTCLOUD_EXEC_SHELL environment variable, which defaults to bash. You
can also override and customize the arguments provided to that shell
executable via NEXTCLOUD_EXEC_SHELL_ARGS, which defaults to "-c".

See documentation for more detail and examples.

Fixes #6
2020-08-28 15:23:33 -05:00
Robert Dailey
08ec92f509 Add extra logs and debugging features
* New DEBUG environment variable enables `set -x` in shell scripts for
  extra verbose output for debugging custom cron scripts and to assist
  with development of the core scripts.
* Verify if we can find the Nextcloud container on start up. Fail if
  not.
* Print information about how we will search for Nextcloud on start up.
* During cron task execution, the ID of the Nextcloud container is
  printed, if found.
2020-08-28 14:52:00 -05:00
Robert Dailey
5d63bb14e4 Retain LF for shell scripts 2020-08-28 11:19:18 -05:00
clewsy
e90dcc60d2 apk add docker-cli instead of docker. 2020-01-21 12:06:50 -06:00
Robert Dailey
9eedf6f503 README: Multiple custom task script support
Explain in the README that multiple shell scripts are supported for
custom cron tasks.
2020-01-15 09:06:56 -06:00
Robert Dailey
241d96828d Clarify some aspects of the setup instruction example
An example is provided for the path to the YML file so that `NEXTCLOUD_PROJECT_NAME`
in the example makes sense.
2019-10-28 08:05:53 -05:00
Robert Dailey
6416dd8731 Cronjob works now between Nextcloud container recreation
If the Nextcloud container is recreated while the cronjob container is still running, the ID of the
container is obtained each time the cron tasks are executed. Previously it was cached on entrypoint,
so if the ID changed this container would fail.
2019-06-20 19:34:58 -05:00
Robert Dailey
0bfd68a109 Fix markdown lint issues and incorrect image name 2019-05-25 12:23:35 -05:00
Robert Dailey
26bf5c5f82
Use tini as init for entrypoint script
Signed-off-by: Robert Dailey <rcdailey@gmail.com>
2019-02-03 14:14:11 -06:00
Robert Dailey
e9b5772dae
Allow configuration of user used for task execution
New NEXTCLOUD_EXEC_USER environment variable added which allows control over which
user is used to execute cron tasks inside the Nextcloud container. By default, the
user is `www-data`. If the environment variable is specified but empty, no `--user`
option is provided to `docker exec`.
2019-01-11 21:08:39 -06:00
Robert Dailey
990ee018d2 SIGTERM now stops crond
This means `docker stop` will be faster
2018-12-06 17:58:26 -06:00
Robert Dailey
ab6372fa79 Provide the ability to run user-defined cron tasks
Mount individual shell scripts (with the `*.sh` extension) inside `/cron-scripts/` in the
container. The cron daemon will automatically run these scripts inside the Nextcloud
container for you. Write the scripts as if they will run in the Nextcloud container
itself.
2018-12-06 17:58:26 -06:00
Robert Dailey
a48d069b3e Add README 2018-12-01 21:35:08 -06:00
Robert Dailey
04a4297164 Initial implementation of the nextcloud cronjob docker image 2018-12-01 21:34:56 -06:00
Robert Dailey
632211b91e Add gitattributes 2018-12-01 19:08:15 -06:00