From 98e75e111eee978266bba8e9ea42c4053f0e6aa5 Mon Sep 17 00:00:00 2001 From: Dirk-Willem van Gulik Date: Thu, 12 Sep 2024 17:47:12 +0200 Subject: [PATCH] prod changes --- acl/urls.py | 14 ++++++-------- cron-midnight.sh | 1 - cron-weekly.sh | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 9 deletions(-) create mode 100755 cron-weekly.sh diff --git a/acl/urls.py b/acl/urls.py index 84d5e1a..b0015a2 100644 --- a/acl/urls.py +++ b/acl/urls.py @@ -35,14 +35,12 @@ # calls to give an ok/nok for a machine or node given a tag. Requires # a bearer token or superuser credentials along with a valid tag. # - # Disabled for now. - # - # path("acl/api/v1/getok/", views.api_getok, name="acl-v1-getok"), - # path( - # "acl/api/v1/getok4node/", - # views.api_getok_by_node, - # name="acl-v1-getok4-node", - # ), + path("acl/api/v1/getok/", views.api_getok, name="acl-v1-getok"), + path( + "acl/api/v1/getok4node/", + views.api_getok_by_node, + name="acl-v1-getok4-node", + ), # Provide metadata on a tag, requires a valid tag and a bearer token. # # path("acl/api/v1/gettaginfo", views.api_gettaginfo, name="acl-v1-gettaginfo"), diff --git a/cron-midnight.sh b/cron-midnight.sh index 1248219..72f33a4 100755 --- a/cron-midnight.sh +++ b/cron-midnight.sh @@ -20,4 +20,3 @@ fi ${POETRY_RUN}python manage.py pettycash-recache ${POETRY_RUN}python manage.py clean_duplicate_history --auto > /dev/null ${POETRY_RUN}python manage.py clean_old_history --days 1000 --auto > /dev/null -${POETRY_RUN}python manage.py sent-ufo-reminders diff --git a/cron-weekly.sh b/cron-weekly.sh new file mode 100755 index 0000000..3f6af0c --- /dev/null +++ b/cron-weekly.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +test -f .env && source .env + +DIR=${DIR:-/usr/local/makerspaceleiden-crm} +cd $DIR || exit 1 + +POETRY=${POETRY:=false} + +unset POETRY_RUN + +if $POETRY ; then + export POETRY_RUN="poetry run " +else + . ./venv/bin/activate +fi + +${POETRY_RUN}python manage.py sent-ufo-reminders