2
0
Эх сурвалжийг харах

Notify Due Days: Add settings to Snap/Docker/Source.
Rename env variables to NOTIFY_DUE_DAYS_BEFORE_AND_AFTER and NOTIFY_DUE_AT_HOUR_OF_DAY.

Thanks to xet7 !

Lauri Ojansivu 5 жил өмнө
parent
commit
5084cddf37

+ 2 - 0
Dockerfile

@@ -21,6 +21,8 @@ ENV BUILD_DEPS="apt-utils bsdtar gnupg gosu wget curl bzip2 build-essential pyth
     ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURES_BERORE=3 \
     ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURES_BERORE=3 \
     ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60 \
     ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60 \
     ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15 \
     ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15 \
+    NOTIFY_DUE_DAYS_BEFORE_AND_AFTER="" \
+    NOTIFY_DUE_AT_HOUR_OF_DAY="" \
     EMAIL_NOTIFICATION_TIMEOUT=30000 \
     EMAIL_NOTIFICATION_TIMEOUT=30000 \
     MATOMO_ADDRESS="" \
     MATOMO_ADDRESS="" \
     MATOMO_SITE_ID="" \
     MATOMO_SITE_ID="" \

+ 13 - 0
docker-compose.yml

@@ -232,6 +232,19 @@ services:
       #- ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60
       #- ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60
       #- ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15
       #- ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15
       #---------------------------------------------------------------
       #---------------------------------------------------------------
+      # ==== EMAIL DUE DATE NOTIFICATION =====
+      # https://github.com/wekan/wekan/pull/2536
+      # System timelines will be showing any user modification for
+      # dueat startat endat receivedat, also notification to
+      # the watchers and if any card is due, about due or past due.
+      #
+      # Notify due days, default 2 days before and after. 0 = due notifications disabled. Default: 2
+      #- NOTIFY_DUE_DAYS_BEFORE_AND_AFTER=2
+      #
+      # Notify due at hour of day. Default every morning at 8am. Can be 0-23.
+      # If env variable has parsing error, use default. Notification sent to watchers.
+      #- NOTIFY_DUE_AT_HOUR_OF_DAY=8
+      #-----------------------------------------------------------------
       # ==== EMAIL NOTIFICATION TIMEOUT, ms =====
       # ==== EMAIL NOTIFICATION TIMEOUT, ms =====
       # Defaut: 30000 ms = 30s
       # Defaut: 30000 ms = 30s
       #- EMAIL_NOTIFICATION_TIMEOUT=30000
       #- EMAIL_NOTIFICATION_TIMEOUT=30000

+ 5 - 4
models/cards.js

@@ -1582,12 +1582,13 @@ const findDueCards = days => {
 };
 };
 const addCronJob = _.debounce(
 const addCronJob = _.debounce(
   Meteor.bindEnvironment(function findDueCardsDebounced() {
   Meteor.bindEnvironment(function findDueCardsDebounced() {
-    const notifydays = parseInt(process.env.NOTIFY_DUE_DAYS, 10) || 2; // default as 2 days b4 and after
+    const notifydays =
+      parseInt(process.env.NOTIFY_DUE_DAYS_BEFORE_AND_AFTER, 10) || 2; // default as 2 days before and after
     if (!(notifydays > 0 && notifydays < 15)) {
     if (!(notifydays > 0 && notifydays < 15)) {
       // notifying due is disabled
       // notifying due is disabled
       return;
       return;
     }
     }
-    const notifyitvl = process.env.NOTIFY_DUE_ITVL; //passed in the itvl has to be a number standing for the hour of current time
+    const notifyitvl = process.env.NOTIFY_DUE_AT_HOUR_OF_DAY; //passed in the itvl has to be a number standing for the hour of current time
     const defaultitvl = 8; // default every morning at 8am, if the passed env variable has parsing error use default
     const defaultitvl = 8; // default every morning at 8am, if the passed env variable has parsing error use default
     const itvl = parseInt(notifyitvl, 10) || defaultitvl;
     const itvl = parseInt(notifyitvl, 10) || defaultitvl;
     const scheduler = (job => () => {
     const scheduler = (job => () => {
@@ -1619,8 +1620,8 @@ if (Meteor.isServer) {
     // With a huge database, this result in a very slow app and high CPU on the mongodb side.
     // With a huge database, this result in a very slow app and high CPU on the mongodb side.
     // To correct it, add Index to parentId:
     // To correct it, add Index to parentId:
     Cards._collection._ensureIndex({ parentId: 1 });
     Cards._collection._ensureIndex({ parentId: 1 });
-    /*let notifydays = parseInt(process.env.NOTIFY_DUE_DAYS) || 2; // default as 2 days b4 and after
-    let notifyitvl = parseInt(process.env.NOTIFY_DUE_ITVL) || 3600 * 24 * 1e3; // default interval as one day
+    /*let notifydays = parseInt(process.env.NOTIFY_DUE_DAYS_BEFORE_AND_AFTER) || 2; // default as 2 days b4 and after
+    let notifyitvl = parseInt(process.env.NOTIFY_DUE_AT_HOUR_OF_DAY) || 3600 * 24 * 1e3; // default interval as one day
     Meteor.call("findDueCards",notifydays,notifyitvl);*/
     Meteor.call("findDueCards",notifydays,notifyitvl);*/
     Meteor.defer(() => {
     Meteor.defer(() => {
       addCronJob();
       addCronJob();

+ 18 - 1
releases/virtualbox/start-wekan.sh

@@ -35,7 +35,24 @@
         #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURES_BERORE=3
         #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURES_BERORE=3
         #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60
         #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60
         #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15
         #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15
-        #---------------------------------------------
+        #---------------------------------------------------------------
+        # ==== EMAIL DUE DATE NOTIFICATION =====
+        # https://github.com/wekan/wekan/pull/2536
+        # System timelines will be showing any user modification for
+        # dueat startat endat receivedat, also notification to
+        # the watchers and if any card is due, about due or past due.
+        #
+        # Notify due days, default 2 days before and after. 0 = due notifications disabled. Default: 2
+        #export NOTIFY_DUE_DAYS_BEFORE_AND_AFTER=2
+        #
+        # Notify due at hour of day. Default every morning at 8am. Can be 0-23.
+        # If env variable has parsing error, use default. Notification sent to watchers.
+        #export NOTIFY_DUE_AT_HOUR_OF_DAY=8
+        #-----------------------------------------------------------------
+        # ==== EMAIL NOTIFICATION TIMEOUT, ms =====
+        # Defaut: 30000 ms = 30s
+        #export EMAIL_NOTIFICATION_TIMEOUT=30000
+        #-----------------------------------------------------------------
         # CORS: Set Access-Control-Allow-Origin header. Example: *
         # CORS: Set Access-Control-Allow-Origin header. Example: *
         #export CORS=*
         #export CORS=*
         # To enable the Set Access-Control-Allow-Headers header. "Authorization,Content-Type" is required for cross-origin use of the API.
         # To enable the Set Access-Control-Allow-Headers header. "Authorization,Content-Type" is required for cross-origin use of the API.

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
snap-src/bin/config


+ 18 - 0
snap-src/bin/wekan-help

@@ -58,6 +58,24 @@ echo -e "\n"
 echo -e "Accounts lockout unknown users failure window, in seconds. Default: 15"
 echo -e "Accounts lockout unknown users failure window, in seconds. Default: 15"
 echo -e "\t$ snap set $SNAP_NAME accounts-lockout-unknown-users-failure-window='15'"
 echo -e "\t$ snap set $SNAP_NAME accounts-lockout-unknown-users-failure-window='15'"
 echo -e "\n"
 echo -e "\n"
+echo -e "EMAIL DUE DATE NOTIFICATION https://github.com/wekan/wekan/pull/2536"
+echo -e "System timelines will be showing any user modification for dueat startat endat receivedat, also notification to the watchers and if any card is due, about due or past due."
+echo -e "Notify due days, default 2 days before and after. 0 = due notifications disabled. Default: 2"
+echo -e "To enable different Notify Due Days Before And After than default 2:"
+echo -e "\t$ snap set $SNAP_NAME notify-due-days-before-and-after='4'"
+echo -e "\t-Disable Notifying for Due Days:"
+echo -e "\t$ snap set $SNAP_NAME notify-due-days-before-and-after='0'"
+echo -e "\n"
+echo -e "\t-To set back to default 2:"
+echo -e "\t$ snap set $SNAP_NAME notify-due-days-before-and-after=''"
+echo -e "\n"
+echo -e "Notify due at hour of day. Default every morning at 8am. Can be 0-23."
+echo -e "If env variable has parsing error, use default. Notification sent to watchers."
+echo -e "To enable different Notify Due At Hour Of Day than default 8:"
+echo -e "\t$ snap set $SNAP_NAME notify-due-at-hour-of-day='10'"
+echo -e "\t-To set back default 8 of Notify Due at Hour of Day:"
+echo -e "\t$ snap set $SNAP_NAME notify-due-at-hour-of-day=''"
+echo -e "\n"
 echo -e "To enable the Email Notification Timeout of wekan in ms, default 30000 (=30s):"
 echo -e "To enable the Email Notification Timeout of wekan in ms, default 30000 (=30s):"
 echo -e "\t$ snap set $SNAP_NAME email-notification-timeout='10000'"
 echo -e "\t$ snap set $SNAP_NAME email-notification-timeout='10000'"
 echo -e "\t-Disable the Email Notification Timeout of Wekan:"
 echo -e "\t-Disable the Email Notification Timeout of Wekan:"

+ 15 - 0
start-wekan.bat

@@ -31,6 +31,21 @@ REM SET ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURES_BERORE=3
 REM SET ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60
 REM SET ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60
 REM SET ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15
 REM SET ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15
 
 
+REM # ==== EMAIL DUE DATE NOTIFICATION =====
+REM # https://github.com/wekan/wekan/pull/2536
+REM # System timelines will be showing any user modification for
+REM # dueat startat endat receivedat, also notification to
+REM # the watchers and if any card is due, about due or past due.
+REM # Notify due days, default 2 days before and after. 0 = due notifications disabled. Default: 2
+REM SET NOTIFY_DUE_DAYS_BEFORE_AND_AFTER=2
+REM # Notify due at hour of day. Default every morning at 8am. Can be 0-23.
+REM # If env variable has parsing error, use default. Notification sent to watchers.
+REM SET NOTIFY_DUE_AT_HOUR_OF_DAY=8
+
+REM # ==== EMAIL NOTIFICATION TIMEOUT, ms =====
+REM # Defaut: 30000 ms = 30s
+REM SET EMAIL_NOTIFICATION_TIMEOUT=30000
+
 REM # CORS: Set Access-Control-Allow-Origin header. Example: *
 REM # CORS: Set Access-Control-Allow-Origin header. Example: *
 REM SET CORS=*
 REM SET CORS=*
 REM # To enable the Set Access-Control-Allow-Headers header. "Authorization,Content-Type" is required for cross-origin use of the API.
 REM # To enable the Set Access-Control-Allow-Headers header. "Authorization,Content-Type" is required for cross-origin use of the API.

+ 18 - 1
start-wekan.sh

@@ -36,7 +36,24 @@
       #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURES_BERORE=3
       #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURES_BERORE=3
       #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60
       #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60
       #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15
       #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15
-      #---------------------------------------------
+      #---------------------------------------------------------------
+      # ==== EMAIL DUE DATE NOTIFICATION =====
+      # https://github.com/wekan/wekan/pull/2536
+      # System timelines will be showing any user modification for
+      # dueat startat endat receivedat, also notification to
+      # the watchers and if any card is due, about due or past due.
+      #
+      # Notify due days, default 2 days before and after. 0 = due notifications disabled. Default: 2
+      #export NOTIFY_DUE_DAYS_BEFORE_AND_AFTER=2
+      #
+      # Notify due at hour of day. Default every morning at 8am. Can be 0-23.
+      # If env variable has parsing error, use default. Notification sent to watchers.
+      #export NOTIFY_DUE_AT_HOUR_OF_DAY=8
+      #-----------------------------------------------------------------
+      # ==== EMAIL NOTIFICATION TIMEOUT, ms =====
+      # Defaut: 30000 ms = 30s
+      #export EMAIL_NOTIFICATION_TIMEOUT=30000
+      #-----------------------------------------------------------------
       # CORS: Set Access-Control-Allow-Origin header. Example: *
       # CORS: Set Access-Control-Allow-Origin header. Example: *
       #export CORS=*
       #export CORS=*
       # To enable the Set Access-Control-Allow-Headers header. "Authorization,Content-Type" is required for cross-origin use of the API.
       # To enable the Set Access-Control-Allow-Headers header. "Authorization,Content-Type" is required for cross-origin use of the API.

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно