Skip to content

Commit 1fcf105

Browse files
authored
Merge pull request #193 from alseambusher/cleanup
Cleanup
2 parents 02398fe + 9a4e5d6 commit 1fcf105

File tree

6 files changed

+869
-19
lines changed

6 files changed

+869
-19
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# docker run -d -p 8000:8000 alseambusher/crontab-ui
2-
FROM alpine:3.13.5
2+
FROM alpine:3.15.3
33

44
ENV CRON_PATH /etc/crontabs
55

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VER=0.3.15
1+
VER=0.3.16
22

33
release:
44
sed -i '' "s/version\": \".*/version\": \"$(VER)\",/" package.json

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ If you need to autosave your changes to crontab directly:
5252

5353
crontab-ui --autosave
5454

55+
### List of ennvironment variables supported
56+
- HOST
57+
- PORT
58+
- BASE_URL
59+
- CRON_DB_PATH
60+
- CRON_PATH
61+
- BASIC_AUTH_USER, BASIC_AUTH_PWD
62+
- SSL_CERT, SSL_KEY
63+
- ENABLE_AUTOSAVE
64+
65+
5566
## Docker
5667
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)
5768
```bash

app.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var express = require('express');
33
var app = express();
44
var crontab = require("./crontab");
55
var restore = require("./restore");
6+
var package_json = require('./package.json');
67
var moment = require('moment');
78
var basicAuth = require('express-basic-auth');
89
var http = require('http');
@@ -269,7 +270,7 @@ server.listen(app.get('port'), app.get('host'), function() {
269270
});
270271
// If --autosave is used then we will also save whatever is in the db automatically without having to mention it explictly
271272
// we do this by watching log file and setting a on change hook to it
272-
if (process.argv.includes("--autosave")){
273+
if (process.argv.includes("--autosave") || process.env.ENABLE_AUTOSAVE) {
273274
crontab.autosave_crontab(()=>{});
274275
fs.watchFile(crontab.crontab_db_file, () => {
275276
crontab.autosave_crontab(()=>{
@@ -300,5 +301,5 @@ server.listen(app.get('port'), app.get('host'), function() {
300301
}
301302

302303
var protocol = startHttpsServer ? "https" : "http";
303-
console.log("Crontab UI is running at " + protocol + "://" + app.get('host') + ":" + app.get('port') + base_url);
304+
console.log("Crontab UI (" + package_json.version + ") is running at " + protocol + "://" + app.get('host') + ":" + app.get('port') + base_url);
304305
});

0 commit comments

Comments
 (0)