From 128ab5eecea563da7debe21f99e7b5534039b1a1 Mon Sep 17 00:00:00 2001 From: hey Date: Mon, 23 Mar 2026 16:27:52 -0400 Subject: [PATCH] Added enterprise functionality --- .env.sample | 12 ++++++++++++ README.md | 8 ++++++++ abra.sh | 1 + compose-license.yml | 25 +++++++++++++++++++++++++ entrypoint.sh.tmpl | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 80 insertions(+) create mode 100644 compose-license.yml create mode 100644 entrypoint.sh.tmpl diff --git a/.env.sample b/.env.sample index 491379c..67decda 100644 --- a/.env.sample +++ b/.env.sample @@ -10,3 +10,15 @@ LETS_ENCRYPT_ENV=production SECRET_DB_PASSWORD_VERSION=v1 SECRET_NC_DB_URL_VERSION=v1 ENABLE_BACKUPS=true + +COMPOSE_FILE="compose.yml" + +# ---- UNCOMMENT THESE LINES FOR ENTERPRISE VERSION USE ---- +#COMPOSE_FILE="$COMPOSE_FILE:compose.license.yml" + +# License to enable enterprise features. +#NC_LICENSE_KEY= + +#JWT used for authentication in enterprise version +#SECRET_AUTH_JWT_VERSION=v1 +#NC_AUTH_JWT_SECRET_FILE=/run/secrets/auth_jwt \ No newline at end of file diff --git a/README.md b/README.md index c5cb75e..c7cc052 100644 --- a/README.md +++ b/README.md @@ -25,4 +25,12 @@ * `abra app secret insert nc_db_url v1 pg://db:5432?u=nocodb&p=${DATABASE_PW}&d=nocodb` * `abra app deploy ` +## NocoDB Enterprise Version + +* `abra app config `. Uncomment the variables used for setting enterprise values. Make sure you have a valid license. +* `abra app undeploy ` +* `export JWT_SECRET=$(pwgen 50)` +* `abra app secret insert auth_jwt v1 ${JWT_SECRET}` +* `abra app deploy ` + For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech). diff --git a/abra.sh b/abra.sh index 0975f1e..629333f 100644 --- a/abra.sh +++ b/abra.sh @@ -1 +1,2 @@ export PG_BACKUP_VERSION=v1 +export NOCODB_ENTRYPOINT_VERSION=v1 \ No newline at end of file diff --git a/compose-license.yml b/compose-license.yml new file mode 100644 index 0000000..8884ffe --- /dev/null +++ b/compose-license.yml @@ -0,0 +1,25 @@ +version: "3.8" +services: + app: + image: nocodb/nocodb-ee:2026.03.0-pre.01 + secrets: + - auth_jwt + configs: + - source: nocodb_entrypoint + target: /entrypoint.sh + mode: 0555 + entrypoint: /entrypoint.sh + environment: + NC_LICENSE_KEY: ${NC_LICENSE_KEY} + + +configs: + nocodb_entrypoint: + name: ${STACK_NAME}_nocodb_entrypoint_${NOCODB_ENTRYPOINT_VERSION} + file: entrypoint.sh.tmpl + template_driver: golang + +secrets: + auth_jwt: + external: true + name: ${STACK_NAME}_auth_jwt_${SECRET_AUTH_JWT_VERSION} \ No newline at end of file diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl new file mode 100644 index 0000000..eacb129 --- /dev/null +++ b/entrypoint.sh.tmpl @@ -0,0 +1,34 @@ +#!/bin/sh +set -e + +echo "Entrypoint running" + +file_env() { + var="$1" + fileVar="${var}_FILE" + def="${2:-}" + + eval "var_val=\${$var}" + eval "file_val=\${$fileVar}" + + if [ -n "$var_val" ] && [ -n "$file_val" ]; then + echo >&2 "error: both $var and $fileVar are set (but are exclusive)" + exit 1 + fi + + val="$def" + + if [ -n "$var_val" ]; then + val="$var_val" + elif [ -n "$file_val" ]; then + val="$(cat "$file_val")" + fi + + export "$var=$val" + unset "$fileVar" +} + +file_env "NC_AUTH_JWT_SECRET" +echo "Added JWT secret" + +/usr/bin/dumb-init -- /usr/src/appEntry/start.sh "$@" \ No newline at end of file -- 2.49.0