├── .travis.yml ├── Dockerfile ├── Dockerfile.letsencrypt ├── Dockerfile.s3 ├── LICENSE ├── README.md └── entrypoint.sh /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | language: bash 4 | 5 | services: 6 | - docker 7 | 8 | install: 9 | - docker build -t intelliops/cronicle:latest -f Dockerfile . 10 | - docker build -t intelliops/cronicle-letsencrypt:latest -f Dockerfile.letsencrypt . 11 | - docker build -t intelliops/cronicle-s3:latest -f Dockerfile.s3 . 12 | - docker run --name cronicle -d -p 127.0.0.1:3012:3012 intelliops/cronicle:latest 13 | - docker run --name cronicle-letsencrypt -d -p 127.0.0.1:4012:3012 intelliops/cronicle-letsencrypt:latest 14 | - docker run --name cronicle-s3 -d -p 127.0.0.1:5012:3012 intelliops/cronicle-s3:latest 15 | 16 | script: 17 | - docker ps -a 18 | - sleep 20 19 | - docker exec cronicle /bin/ash -c "cat /opt/cronicle/conf/config.json" 20 | - docker exec cronicle-letsencrypt /bin/ash -c "cat /opt/cronicle/conf/config.json" 21 | - docker exec cronicle-s3 /bin/ash -c "cat /opt/cronicle/conf/config.json" 22 | - curl http://localhost:3012 | grep LICENSE 23 | - curl http://localhost:4012 | grep LICENSE 24 | - curl http://localhost:5012 | grep LICENSE 25 | - docker stop cronicle cronicle-letsencrypt cronicle-s3 26 | - docker rm -f cronicle cronicle-letsencrypt cronicle-s3 27 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:10.11-alpine 2 | LABEL maintainer="Sander Bel " 3 | 4 | ARG CRONICLE_VERSION='0.8.28' 5 | 6 | # Docker defaults 7 | ENV CRONICLE_base_app_url 'http://localhost:3012' 8 | ENV CRONICLE_WebServer__http_port 3012 9 | ENV CRONICLE_WebServer__https_port 443 10 | ENV CRONICLE_web_socket_use_hostnames 1 11 | ENV CRONICLE_server_comm_use_hostnames 1 12 | ENV CRONICLE_web_direct_connect 0 13 | ENV CRONICLE_socket_io_transports '["polling", "websocket"]' 14 | 15 | RUN apk add --no-cache git curl wget perl bash perl-pathtools tar \ 16 | procps tini 17 | 18 | RUN adduser cronicle -D -h /opt/cronicle 19 | 20 | USER cronicle 21 | 22 | WORKDIR /opt/cronicle/ 23 | 24 | RUN mkdir -p data logs plugins 25 | 26 | RUN curl -L "https://github.com/jhuckaby/Cronicle/archive/v${CRONICLE_VERSION}.tar.gz" | tar zxvf - --strip-components 1 && \ 27 | npm install && \ 28 | node bin/build.js dist 29 | 30 | ADD entrypoint.sh /entrypoint.sh 31 | 32 | EXPOSE 3012 33 | 34 | # data volume is also configured in entrypoint.sh 35 | VOLUME ["/opt/cronicle/data", "/opt/cronicle/logs", "/opt/cronicle/plugins"] 36 | 37 | ENTRYPOINT ["/sbin/tini", "--"] 38 | 39 | CMD ["sh", "/entrypoint.sh"] 40 | -------------------------------------------------------------------------------- /Dockerfile.letsencrypt: -------------------------------------------------------------------------------- 1 | FROM intelliops/cronicle:0.8.28 2 | LABEL maintainer="Sander Bel " 3 | 4 | USER root 5 | 6 | RUN curl https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem -o /usr/local/share/ca-certificates/LetsEncryptX3IdenTrust.crt && \ 7 | chmod 644 /usr/local/share/ca-certificates/LetsEncryptX3IdenTrust.crt && \ 8 | update-ca-certificates 9 | 10 | USER cronicle 11 | -------------------------------------------------------------------------------- /Dockerfile.s3: -------------------------------------------------------------------------------- 1 | FROM intelliops/cronicle:0.8.28 2 | LABEL maintainer="Sander Bel " 3 | 4 | USER root 5 | 6 | # Amazon S3 7 | RUN npm install aws-sdk 8 | 9 | USER cronicle 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 belsander 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-cronicle 2 | [![Build status](https://img.shields.io/docker/build/intelliops/cronicle.svg)](https://hub.docker.com/r/intelliops/cronicle) [![Build status](https://img.shields.io/travis/belsander/docker-cronicle/master.svg)](https://travis-ci.org/belsander/docker-cronicle) 3 | 4 | Docker container for a Cronicle single-server master node 5 | 6 | # Supported tags 7 | 8 | * `0.8.28`, `latest` [Dockerfile](https://raw.githubusercontent.com/belsander/docker-cronicle/master/Dockerfile) 9 | * `0.8.28-letsencrypt`, `letsencrypt` [Dockerfile.letsencrypt](https://raw.githubusercontent.com/belsander/docker-cronicle/master/Dockerfile.letsencrypt) 10 | * `0.8.28-s3`, `s3` [Dockerfile.s3](https://raw.githubusercontent.com/belsander/docker-cronicle/master/Dockerfile.s3) 11 | 12 | ## latest 13 | Latest version of Cronicle server based upon nodejs Docker image. 14 | 15 | ## letsencrypt 16 | Same as the `latest` Docker image, but with support for Let's Encrypt 17 | certificates. Which means that the Cronicle server can be used with SSL and a 18 | Let's Encrypt certificate. If this is not needed, just use the tag `latest`. 19 | 20 | ## s3 21 | Same as the `latest` Docker image, but with support for Amazon S3 storage. If 22 | there is no need for S3, again, just go for `latest`. 23 | 24 | # Usage 25 | 26 | ## Install 27 | ```sh 28 | docker pull intelliops/cronicle:latest 29 | ``` 30 | 31 | ## Running 32 | ```sh 33 | docker run --name cronicle --hostname localhost -p 3012:3012 intelliops/cronicle:latest 34 | ``` 35 | 36 | Alternatively with persistent data and logs: 37 | ```sh 38 | docker run --name cronicle \ 39 | -v /path-to-cronicle-storage/data:/opt/cronicle/data:rw \ 40 | -v /path-to-cronicle-storage/logs:/opt/cronicle/logs:rw \ 41 | --hostname localhost -p 3012:3012 intelliops/cronicle:latest 42 | ``` 43 | 44 | The web UI will be available at: http://localhost:3012 45 | 46 | > NOTE: please replace the hostname `localhost`, this is only for testing 47 | > purposes! If you rename the hostname also consider setting the environmental 48 | > variable `CRONICLE_base_app_url`. 49 | > e.g `docker run --name cronicle --hostname cronicle-host -p 3012:3012 -e CRONICLE_base_app_url='http://cronicle-host:3012' intelliops/cronicle:latest` 50 | 51 | ## Volumes 52 | Cronicle process runs under the `cronicle` user with `ID 1001` and `GUID `1001`. If you are using Docker bind mounts set permissions accordingly. 53 | 54 | | Path | Description | 55 | |--------|--------| 56 | | /opt/cronicle/data | Volume for data | 57 | | /opt/cronicle/logs | Volume for logs | 58 | | /opt/cronicle/plugins | Volume for plugins | 59 | 60 | ## Configuration 61 | 62 | ### Environmental variables 63 | Cronicle supports a special environment variable syntax, which can specify command-line options as well as override any configuration settings. The variable name syntax is `CRONICLE_key` where `key` is one of several command-line options (see table below) or a JSON configuration property path. 64 | 65 | For overriding configuration properties by environment variable, you can specify any top-level JSON key from `config.json`, or a *path* to a nested property using double-underscore (`__`) as a path separator. For boolean properties, you can specify `1` for true and `0` for false. Here is an example of some of the possibilities available: 66 | 67 | | Environmental variable | Description | Default value | 68 | |--------|--------|--------| 69 | | CRONICLE_base_app_url | A fully-qualified URL to Cronicle on your server, including the port if non-standard. This is used for self-referencing URLs. | http://localhost:3012 | 70 | | CRONICLE_WebServer__http_port | The HTTP port for the web UI of your Cronicle server. (Keep default value, unless you know what you are doing) | 3012 | 71 | | CRONICLE_WebServer__https_port | The SSL port for the web UI of your Cronicle server. (Keep default value, unless you know what you are doing) | 443 | 72 | | CRONICLE_web_socket_use_hostnames | Setting this parameter to `1` will force Cronicle's Web UI to connect to the back-end servers using their hostnames rather than IP addresses. This includes both AJAX API calls and Websocket streams. | 1 | 73 | | CRONICLE_server_comm_use_hostnames | Setting this parameter to `1` will force the Cronicle servers to connect to each other using hostnames rather than LAN IP addresses. | 1 | 74 | | CRONICLE_web_direct_connect | When this property is set to `0`, the Cronicle Web UI will connect to whatever hostname/port is on the URL. It is expected that this hostname/port will always resolve to your master server. This is useful for single server setups, situations when your users do not have direct access to your Cronicle servers via their IPs or hostnames, or if you are running behind some kind of reverse proxy. If you set this parameter to `1`, then the Cronicle web application will connect directly to your individual Cronicle servers. This is more for multi-server configurations, especially when running behind a load balancer with multiple backup servers. The Web UI must always connect to the master server, so if you have multiple backup servers, it needs a direct connection. | 0 | 75 | | CRONICLE_socket_io_transports | This allows you to customize the socket.io transports used to connect to the server for real-time updates. If you are trying to run Cronicle in an environment where WebSockets are not allowed (perhaps an ancient firewall or proxy), you can change this array to contain the `polling` transport first. Otherwise set it to `["websocket"]` | ["polling", "websocket"] 76 | 77 | ### Custom configuration file 78 | A custom configuration file can be provide in the following location: 79 | ```sh 80 | /path-to-cronicle-storage/data/config.json.import 81 | ``` 82 | The file will get loaded the very first time Cronicle is started. If afterwards 83 | a forced reload of the custom configuration is needed remove the following file 84 | and restart the Docker container: 85 | ```sh 86 | /path-to-cronicle-storage/data/.setup_done 87 | ``` 88 | 89 | ## Web UI credentials 90 | The default credentials for the web interface are: `admin` / `admin` 91 | 92 | # Reference 93 | https://github.com/jhuckaby/Cronicle 94 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ROOT_DIR=/opt/cronicle 4 | CONF_DIR=$ROOT_DIR/conf 5 | BIN_DIR=$ROOT_DIR/bin 6 | LIB_DIR=$ROOT_DIR/lib 7 | # DATA_DIR needs to be the same as the exposed Docker volume in Dockerfile 8 | DATA_DIR=$ROOT_DIR/data 9 | # PLUGINS_DIR needs to be the same as the exposed Docker volume in Dockerfile 10 | PLUGINS_DIR=$ROOT_DIR/plugins 11 | 12 | # The env variables below are needed for Docker and cannot be overwritten 13 | export CRONICLE_Storage__Filesystem__base_dir=${DATA_DIR} 14 | export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt 15 | export CRONICLE_echo=1 16 | export CRONICLE_foreground=1 17 | 18 | # Only run setup when setup needs to be done 19 | if [ ! -f $DATA_DIR/.setup_done ] 20 | then 21 | $BIN_DIR/control.sh setup 22 | 23 | cp $CONF_DIR/config.json $CONF_DIR/config.json.origin 24 | 25 | if [ -f $DATA_DIR/config.json.import ] 26 | then 27 | # Move in custom configuration 28 | cp $DATA_DIR/config.json.import $CONF_DIR/config.json 29 | fi 30 | 31 | # Create plugins directory 32 | mkdir -p $PLUGINS_DIR 33 | 34 | # Marking setup done 35 | touch $DATA_DIR/.setup_done 36 | fi 37 | 38 | # Run cronicle 39 | /usr/local/bin/node "$LIB_DIR/main.js" 40 | --------------------------------------------------------------------------------