Skip to content

Commit

Permalink
Merge pull request #193 from alseambusher/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
alseambusher committed Apr 4, 2022
2 parents 02398fe + 9a4e5d6 commit 1fcf105
Show file tree
Hide file tree
Showing 6 changed files with 869 additions and 19 deletions.
2 changes: 1 addition & 1 deletion 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

Expand Down
2 changes: 1 addition & 1 deletion Makefile
@@ -1,4 +1,4 @@
VER=0.3.15
VER=0.3.16

release:
sed -i '' "s/version\": \".*/version\": \"$(VER)\",/" package.json
Expand Down
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions app.js
Expand Up @@ -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');
Expand Down Expand Up @@ -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(()=>{
Expand Down Expand Up @@ -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);
});

0 comments on commit 1fcf105

Please sign in to comment.