From 384998befef4181bce15effc234323708ac91218 Mon Sep 17 00:00:00 2001 From: mikeTWC1984 Date: Sat, 6 Apr 2024 14:29:32 -0400 Subject: [PATCH] linux build andmanager update --- bin/manager | 6 ++++++ bundle | 39 +++++++++++++++++++++------------------ package-lock.json | 4 ++-- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/bin/manager b/bin/manager index 012ccb2..57c8cd4 100755 --- a/bin/manager +++ b/bin/manager @@ -14,6 +14,7 @@ while (( "$#" )); do --port ) shift; port=$1 ;; --key ) shift; key=$1 ;; --storage ) shift; storage=$1 ;; + --sqlite ) shift; sqlite=$1 ;; --help ) usage ;; -*) echo "invalid parameter: $1"; usage ;; esac @@ -25,6 +26,11 @@ if [[ $port ]]; then echo "Custom port set: $port" fi +if [[ $sqlite ]]; then + export CRONICLE_sqlite="$(realpath $sqlite)" + echo "Using custom sqlite db as storage: $sqlite" +fi + if [[ $storage ]]; then if [[ -f $storage ]]; then export CRONICLE_storage_config="$(realpath $storage)" diff --git a/bundle b/bundle index 8292bda..fdbc74c 100755 --- a/bundle +++ b/bundle @@ -74,9 +74,9 @@ fi # --------------------------------------------------------------------- -echo "------------------------------------------------------" -echo " Installing cronicle bundle into $(readlink -f $dist)" -echo "------------------------------------------------------" +echo "" +echo -e "\033[1;4mInstalling cronicle bundle into $(readlink -f $dist)\033[0m" +echo "" # debug settings minify="--minify=true" @@ -441,9 +441,8 @@ if [ "$restart" = 1 ]; then fi echo "" -echo "---------------------------------------------------------------------------------------------------------------------------------------" +echo -e "\033[1;4mBundle is ready: $(readlink -f $dist)\033[0m" echo "" -echo "Bundle is ready: $(readlink -f $dist)" if [ "$lmdb" = 1 ]; then echo " - Lmdb package was installed in $dist" @@ -455,6 +454,7 @@ if [ "$restart" = 1 ]; then exit 0 fi +if [ ! "$dev" = 1 ]; then cat << EOF Before you begin: @@ -462,29 +462,32 @@ Before you begin: - Set you Secret key in conf/config.json || conf/secret_key file || CRONICLE_secret_key_file || CRONICLE_secret_key env variables To setup cronicle storage (on the first run): - node $dist/bin/storage-cli.js setup + node $dist/bin/storage-cli.js setup Start as manager in foreground: - node $dist/bin/cronicle.js --echo --foreground --manager --color + node $dist/bin/cronicle.js --echo --foreground --manager --color -Or use $dist/bin/manager script to setup storage + start cronicle in single manager mode +Use $dist/bin/manager entrypoint to complete both steps (use for dev or docker): + $dist/bin/manager [--port 3012] [--storage /path/to/storage.json] [--key secretKey] [--sqlite /path/to/sqlite.db] [--color] -To reinstall/upgrade run: ./bundle.sh $dist -f -Please back up $(readlink -f $dist) first for prod deployments +Or use control.sh tool: + $dist/bin/control.sh [setup|status|start|stop] + +Use force flag (-f) to reinstall/upgrade (after git pull or npm package update): + ./bundle.sh $dist -f To setup as systemd service (! make sure node version for sudo user is 16 or higher): - cd $(readlink -f $dist) - npm i pixl-boot - sudo node node_modules/pixl-boot/cli.js install - ### systemctl status croniclex + cd $(readlink -f $dist) + npm i pixl-boot + sudo node node_modules/pixl-boot/cli.js install + ### systemctl status croniclex To remove service: - sudo node node_modules/pixl-boot/cli.js uninstall - ---------------------------------------------------------------------------------------------------------------------------------------- - + sudo node node_modules/pixl-boot/cli.js uninstall EOF +fi + # OPTIONAL UNIT TEST if [ "$test" = 1 ]; then writehead " Bundling unit test files" diff --git a/package-lock.json b/package-lock.json index 4ffb162..8af66a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cronicle-edge", - "version": "1.8.1", + "version": "1.8.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cronicle-edge", - "version": "1.8.1", + "version": "1.8.2", "license": "MIT", "dependencies": { "@iarna/toml": "^2.2.5",