File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ services:
111111 nginx :
112112 # build: ./nginx
113113 # image: registry.vathes.com/ibl-navigator/nginx:v0.0-dev5
114- image : registry.vathes.com/ibl-navigator/nginx:v0.0-public3 # for public deploy ?
114+ image : registry.vathes.com/ibl-navigator/nginx:v0.0-public4 # for public deploy ?
115115 environment :
116116 # - URL=datajoint.io # for testdev deploy
117117 # - SUBDOMAINS=testdev # for testdev deploy
Original file line number Diff line number Diff line change @@ -30,10 +30,18 @@ echo "[$(date -u '+%Y-%m-%d %H:%M:%S')][DataJoint]: Enabling SSL feature"
3030mv /ssl.conf /etc/nginx/conf.d/ssl.conf
3131update_cert
3232
33- inotifywait -m /etc/letsencrypt/live/${SUBDOMAINS} .${URL} |
34- while read path action file; do
35- if [ " $( echo $action | grep MODIFY) " ] || [ " $( echo $action | grep CREATE) " ] || [ " $( echo $action | grep MOVE) " ]; then
36- echo " [$( date -u ' +%Y-%m-%d %H:%M:%S' ) ][DataJoint]: Renewal: Reloading NGINX since \` $file \` issue \` $action \` event"
37- update_cert
38- fi
39- done
33+ INIT_TIME=$( date +%s)
34+ LAST_MOD_TIME=$( date -r $( echo /etc/letsencrypt/live/${SUBDOMAINS} .${URL} /$( ls -t /etc/letsencrypt/live/${SUBDOMAINS} .${URL} / | head -n 1) ) +%s)
35+ DELTA=$( expr $LAST_MOD_TIME - $INIT_TIME )
36+ while true ; do
37+ CURR_FILEPATH=$( ls -t /etc/letsencrypt/live/${SUBDOMAINS} .${URL} / | head -n 1)
38+ CURR_LAST_MOD_TIME=$( date -r $( echo /etc/letsencrypt/live/${SUBDOMAINS} .${URL} /${CURR_FILEPATH} ) +%s)
39+ CURR_DELTA=$( expr $CURR_LAST_MOD_TIME - $INIT_TIME )
40+ if [ " $DELTA " -lt " $CURR_DELTA " ]; then
41+ echo " [$( date -u ' +%Y-%m-%d %H:%M:%S' ) ][DataJoint]: Renewal: Reloading NGINX since \` $CURR_FILEPATH \` changed."
42+ update_cert
43+ DELTA=$CURR_DELTA
44+ else
45+ sleep 5
46+ fi
47+ done
You can’t perform that action at this time.
0 commit comments