From 9a4e5d6bb52a430f0fc3a900236a3aaf9841c84e Mon Sep 17 00:00:00 2001 From: alse Date: Sun, 3 Apr 2022 17:44:15 -0700 Subject: [PATCH] Update documentation --- Dockerfile | 2 +- Makefile | 2 +- README.md | 11 +++++++++++ app.js | 5 +++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 438cede..fe60804 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # docker run -d -p 8000:8000 alseambusher/crontab-ui -FROM alpine:3.13.5 +FROM alpine:3.15.3 ENV CRON_PATH /etc/crontabs diff --git a/Makefile b/Makefile index 413851c..13966ca 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VER=0.3.15 +VER=0.3.16 release: sed -i '' "s/version\": \".*/version\": \"$(VER)\",/" package.json diff --git a/README.md b/README.md index 14d6a49..b186db6 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,17 @@ If you need to autosave your changes to crontab directly: crontab-ui --autosave +### List of ennvironment variables supported +- HOST +- PORT +- BASE_URL +- CRON_DB_PATH +- CRON_PATH +- BASIC_AUTH_USER, BASIC_AUTH_PWD +- SSL_CERT, SSL_KEY +- ENABLE_AUTOSAVE + + ## Docker You can use crontab-ui with docker. You can use the prebuilt images in the [dockerhub](https://hub.docker.com/r/alseambusher/crontab-ui/tags) ```bash diff --git a/app.js b/app.js index 7c71cfd..1bc4f4e 100755 --- a/app.js +++ b/app.js @@ -3,6 +3,7 @@ var express = require('express'); var app = express(); var crontab = require("./crontab"); var restore = require("./restore"); +var package_json = require('./package.json'); var moment = require('moment'); var basicAuth = require('express-basic-auth'); var http = require('http'); @@ -269,7 +270,7 @@ server.listen(app.get('port'), app.get('host'), function() { }); // If --autosave is used then we will also save whatever is in the db automatically without having to mention it explictly // we do this by watching log file and setting a on change hook to it - if (process.argv.includes("--autosave")){ + if (process.argv.includes("--autosave") || process.env.ENABLE_AUTOSAVE) { crontab.autosave_crontab(()=>{}); fs.watchFile(crontab.crontab_db_file, () => { crontab.autosave_crontab(()=>{ @@ -300,5 +301,5 @@ server.listen(app.get('port'), app.get('host'), function() { } var protocol = startHttpsServer ? "https" : "http"; - console.log("Crontab UI is running at " + protocol + "://" + app.get('host') + ":" + app.get('port') + base_url); + console.log("Crontab UI (" + package_json.version + ") is running at " + protocol + "://" + app.get('host') + ":" + app.get('port') + base_url); });