1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-10-01 08:44:09 +02:00

setup cron for background jobs

This commit is contained in:
Robin Appelman 2026-09-20 12:52:24 +02:00
commit fd3c5f4708
7 changed files with 21 additions and 5 deletions

View file

@ -2,7 +2,6 @@
touch /var/log/nginx/access.log touch /var/log/nginx/access.log
touch /var/log/nginx/error.log touch /var/log/nginx/error.log
touch /var/log/cron/owncloud.log
mkdir /config mkdir /config
if not ("/config/php.ini" | path exists) { if not ("/config/php.ini" | path exists) {
@ -35,6 +34,7 @@ let dirs = [
let files = [ let files = [
["condition", "path"]; ["condition", "path"];
["/", "/var/www/html/build/integration/composer.lock"], ["/", "/var/www/html/build/integration/composer.lock"],
["/", "/var/log/cron/haze.log"]
] ]
$dirs | each { |dir| $dirs | each { |dir|
@ -88,6 +88,7 @@ if ("REDIS_TLS" in $env) {
cp /etc/supervisor/redis-tls.conf /etc/supervisor/enabled/ cp /etc/supervisor/redis-tls.conf /etc/supervisor/enabled/
} else { } else {
cp /etc/supervisor/redis-plain.conf /etc/supervisor/enabled/ cp /etc/supervisor/redis-plain.conf /etc/supervisor/enabled/
cp /etc/supervisor/redis-plain.conf /etc/supervisor/enabled/
} }
if ("BLACKFIRE_SERVER_ID" in $env) { if ("BLACKFIRE_SERVER_ID" in $env) {

View file

@ -3,5 +3,4 @@ runCommand "configs" {} ''
mkdir -p $out mkdir -p $out
cp -r ${./configs} $out/etc cp -r ${./configs} $out/etc
chmod -R +w $out/etc chmod -R +w $out/etc
mkdir $out/etc/supervisor/enabled/
'' ''

View file

@ -0,0 +1,2 @@
# m h dom mon dow user command
* * * * * haze php -f /var/www/html/cron.php -- -v >> /var/log/cron/haze.log 2>&1

View file

@ -1,2 +0,0 @@
# m h dom mon dow command
*/5 * * * * sudo -u haze php -f /var/www/html/cron.php >> /var/log/cron/haze.log 2>&1

View file

@ -0,0 +1,2 @@
[program:cron]
command = crond -x sch -f

View file

@ -2,7 +2,7 @@
touch /var/log/nginx/access.log touch /var/log/nginx/access.log
touch /var/log/nginx/error.log touch /var/log/nginx/error.log
touch /var/log/cron/owncloud.log touch /var/log/cron/haze.log
if ("/var/www/html/config/config.php" | path exists) { if ("/var/www/html/config/config.php" | path exists) {
exit 0 exit 0

View file

@ -616,6 +616,20 @@ async fn setup(
) )
.await?; .await?;
} }
cloud
.occ(
docker,
vec![
"config:app:set",
"core",
"backgroundjobs_mode",
"--value",
"cron",
],
None,
Vec::<String>::default(),
)
.await?;
let domains = [ip_str.as_str(), "cloud", &cloud.id, host]; let domains = [ip_str.as_str(), "cloud", &cloud.id, host];
for (i, domain) in domains.iter().enumerate() { for (i, domain) in domains.iter().enumerate() {