Skip to content

Commit d17b338

Browse files
committed
new: add missing environment variables and externalize them to .env files
1 parent 6e2c0f8 commit d17b338

File tree

6 files changed

+232
-136
lines changed

6 files changed

+232
-136
lines changed

deploy/docker/README.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Included Dockerfile can be used to build an **all-in-one** image with all requir
44

55
For examples on running the all-in-one image or the multi image deployment see **deploy/docker/docker-compose.yaml** and **deploy/docker/docker-compose-multi.yaml**
66

7+
Environment variables used to configure various aspects of the services are stored in **default.env**, **default-multi.env** and **override.env**. Look into the **default** files to see which variables can be set and what are the default values. To change the defaults, use **override.env**. You don't have to use **--env-file** parameter with **doker compose** because the files are loaded from within `docker-compose.yaml` and `docker-compose-multi.yaml`.
78

89
## all-in-one image
910

@@ -50,14 +51,18 @@ Image can be configured by setting environment variables.
5051
| `LOWCODER_MAX_DEVELOPERS` | Default maximum developers | `100` |
5152
| `LOWCODER_WORKSPACE_MODE` | SAAS to activate, ENTERPRISE to switch off - Workspaces | `SAAS` |
5253
| `LOWCODER_EMAIL_SIGNUP_ENABLED` | Control if users create their own Workspace automatic when Sign Up | `true` |
54+
| `LOWCODER_EMAIL_AUTH_ENABLED` | Controls whether authentication via email is enabled | `true` |
5355
| `LOWCODER_CREATE_WORKSPACE_ON_SIGNUP` | IF LOWCODER_WORKSPACE_MODE = SAAS, controls if a own workspace is created for the user after sign up | `true` |
5456
| `LOWCODER_MARKETPLACE_PRIVATE_MODE` | Control if not to show Apps on the local Marketplace to anonymous users | `true` |
5557
| `LOWCODER_SUPERUSER_USERNAME` | Username of the Super-User of an Lowcoder Installation | `admin@localhost` |
5658
| `LOWCODER_SUPERUSER_PASSWORD` | Password of the Super-User, if not present or empty, it will be generated | `generated and printed into log file |
57-
59+
| `LOWCODER_PLUGINS_DIR` | Directory holding lowcoder plugins | `/lowcoder-stacks/plugins` |
60+
| `LOWCODER_COOKIE_NAME` | Name of the lowcoder application cookie | `LOWCODER_CE_SELFHOST_TOKEN` |
61+
| `LOWCODER_COOKIE_MAX_AGE` | Lowcoder application cookie max age in hours | `24` |
62+
| `LOWCODER_APP_SNAPSHOT_RETENTIONTIME` | Application snapshots retention time in days | `30` |
5863

5964
Also you should set the API-KEY secret, whcih should be a string of at least 32 random characters. (from Lowcoder v2.3.x on)
60-
On linux/mac, generate one eg. with: head /dev/urandom | head -c 30 | shasum -a 256
65+
On linux/mac, generate one eg. with: `head /dev/urandom | head -c 30 | shasum -a 256`
6166

6267
| Environment variable | Description | Default-Value |
6368
|-------------------------------------| ----------------------------------------------------------------------- | ----------------------------------------------------- |
@@ -76,7 +81,7 @@ To enable secure Password Reset flow for the users, you need to configure your o
7681
| `LOWCODER_ADMIN_SMTP_SSL_ENABLED` | Enable SSL encryption | `false` |
7782
| `LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED` | Enable STARTTLS encryption | `true` |
7883
| `LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED` | Require STARTTLS encryption | `true` |
79-
| `LOWCODER_LOST_PASSWORD_EMAIL_SENDER` | "from" Email address of the password Reset Email Sender | `service@lowcoder.cloud` |
84+
| `LOWCODER_EMAIL_NOTIFICATIONS_SENDER` | "from" Email address of the password Reset Email Sender | `info@localhost` |
8085

8186

8287
## Building api-service image
@@ -119,6 +124,10 @@ Image can be configured by setting environment variables.
119124
| `LOWCODER_MARKETPLACE_PRIVATE_MODE` | Control if not to show Apps on the local Marketplace to anonymous users | `true` |
120125
| `LOWCODER_SUPERUSER_USERNAME` | Username of the Super-User of an Lowcoder Installation | `admin@localhost` |
121126
| `LOWCODER_SUPERUSER_PASSWORD` | Password of the Super-User, if not present or empty, it will be generated | `generated and printed into log file |
127+
| `LOWCODER_PLUGINS_DIR` | Directory holding lowcoder plugins | `/lowcoder-stacks/plugins` |
128+
| `LOWCODER_COOKIE_NAME` | Name of the lowcoder application cookie | `LOWCODER_CE_SELFHOST_TOKEN` |
129+
| `LOWCODER_COOKIE_MAX_AGE` | Lowcoder application cookie max age in hours | `24` |
130+
| `LOWCODER_APP_SNAPSHOT_RETENTIONTIME` | Application snapshots retention time in days | `30` |
122131

123132
Also you should set the API-KEY secret, whcih should be a string of at least 32 random characters. (from Lowcoder v2.3.x on)
124133
On linux/mac, generate one eg. with: head /dev/urandom | head -c 30 | shasum -a 256
@@ -140,7 +149,7 @@ To enable secure Password Reset flow for the users, you need to configure your o
140149
| `LOWCODER_ADMIN_SMTP_SSL_ENABLED` | Enable SSL encryption | `false` |
141150
| `LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED` | Enable STARTTLS encryption | `true` |
142151
| `LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED` | Require STARTTLS encryption | `true` |
143-
| `LOWCODER_LOST_PASSWORD_EMAIL_SENDER` | "from" Email address of the password Reset Email Sender | `service@lowcoder.cloud` |
152+
| `LOWCODER_EMAIL_NOTIFICATIONS_SENDER` | "from" Email address of the password Reset Email Sender | `info@localhost` |
144153

145154
## Building node-service image
146155

deploy/docker/default-multi.env

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#####################################################################
2+
## ##
3+
## Lowcoder environment variables override for multi image ##
4+
## installation. ##
5+
## ##
6+
## !!! PLEASE DO NOT CHANGE THIS FILE !!! ##
7+
## ##
8+
## To change the variables use file: override.env ##
9+
## ##
10+
## It will be loaded automatically and will override the defaults ##
11+
## You don't have to copy the whole default.env, only the changed ##
12+
## environment variables. ##
13+
## ##
14+
#####################################################################
15+
16+
# Update individual service URLs to match the multi setup
17+
LOWCODER_MONGODB_URL="mongodb://lowcoder:secret123@mongodb/lowcoder?authSource=admin"
18+
LOWCODER_REDIS_URL="redis://redis:6379"
19+
LOWCODER_NODE_SERVICE_URL="http://lowcoder-node-service:6060"
20+
LOWCODER_API_SERVICE_URL="http://lowcoder-api-service:8080"
21+

deploy/docker/default.env

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
#####################################################################
2+
## ##
3+
## Default lowcoder environment variables. ##
4+
## ##
5+
## !!! PLEASE DO NOT CHANGE THIS FILE !!! ##
6+
## ##
7+
## To change the variables use file: override.env ##
8+
## ##
9+
## It will be loaded automatically and will override the defaults ##
10+
## You don't have to copy the whole default.env, only the changed ##
11+
## environment variables. ##
12+
## ##
13+
#####################################################################
14+
15+
16+
##
17+
## Enable services (applies to all-in-one deployment) ##
18+
## - you can disable them in favor of external services
19+
#
20+
# If true redis server is started in the container
21+
LOWCODER_REDIS_ENABLED="true"
22+
# If true mongo database is started in the container
23+
LOWCODER_MONGODB_ENABLED="true"
24+
# If true lowcoder api-service is started in the container
25+
LOWCODER_API_SERVICE_ENABLED="true"
26+
# If true lowcoder node-service is started in the container
27+
LOWCODER_NODE_SERVICE_ENABLED="true"
28+
# If true lowcoder web frontend is started in the container
29+
LOWCODER_FRONTEND_ENABLED="true"
30+
#
31+
# Set LOWCODER_MONGODB_EXPOSED to "true" and uncomment mongodb port
32+
# to make internal mongo database accessible from host
33+
# (applies to all-in-one deployment)
34+
#
35+
LOWCODER_MONGODB_EXPOSED="false"
36+
37+
##
38+
## Generic parameters
39+
##
40+
#
41+
# URL of the public User Interface
42+
LOWCODER_PUBLIC_URL="http://localhost:3000/"
43+
44+
# ID of user running services. It will own all created logs and data.
45+
LOWCODER_PUID="1000"
46+
# ID of group of the user running services
47+
LOWCODER_PGID="1000"
48+
49+
##
50+
## api-service parameters
51+
##
52+
# Name of the lowcoder application cookie
53+
LOWCODER_COOKIE_NAME=LOWCODER_CE_SELFHOST_TOKEN
54+
# Lowcoder application cookie max age in hours
55+
LOWCODER_COOKIE_MAX_AGE=24
56+
# Default maximum organizations per user
57+
LOWCODER_MAX_ORGS_PER_USER=100
58+
# Default maximum members per organization
59+
LOWCODER_MAX_MEMBERS_PER_ORG=1000
60+
# Default maximum groups per organization
61+
LOWCODER_MAX_GROUPS_PER_ORG=100
62+
# Default maximum applications per organization
63+
LOWCODER_MAX_APPS_PER_ORG=1000
64+
# Default maximum developers
65+
LOWCODER_MAX_DEVELOPERS=50
66+
# Mongo database connection string (use the later one in case of multi-image compose)
67+
LOWCODER_MONGODB_URL="mongodb://localhost:27017/lowcoder?authSource=admin"
68+
#LOWCODER_MONGODB_URL="mongodb://lowcoder:secret123@mongodb/lowcoder?authSource=admin"
69+
# Redis server URL
70+
LOWCODER_REDIS_URL="redis://localhost:6379"
71+
# Control if users create their own Workspace automatic when Sign Up
72+
LOWCODER_EMAIL_SIGNUP_ENABLED="true"
73+
# Controls whether authentication via email is enabled
74+
LOWCODER_EMAIL_AUTH_ENABLED="true"
75+
# IF LOWCODER_WORKSPACE_MODE = SAAS, controls if own workspace is created for the user after sign up
76+
LOWCODER_CREATE_WORKSPACE_ON_SIGNUP="true"
77+
# Application snapshots retention time in days
78+
LOWCODER_APP_SNAPSHOT_RETENTIONTIME=30
79+
#
80+
# ! PLEASE CHANGE THESE TO SOMETHING UNIQUE !
81+
#
82+
# LOWCODER_DB_ENCRYPTION_PASSWORD and LOWCODER_DB_ENCRYPTION_SALT is used
83+
# to encrypt sensitive data in mongo database so it is important to change the defaults
84+
#
85+
LOWCODER_DB_ENCRYPTION_PASSWORD="lowcoder.org"
86+
LOWCODER_DB_ENCRYPTION_SALT="lowcoder.org"
87+
88+
# CORS allowed domains
89+
LOWCODER_CORS_DOMAINS="*"
90+
#
91+
# API-KEY secret - should be a string of at least 32 random characters
92+
# - on linux/mac, generate one eg. with: head /dev/urandom | head -c 30 | shasum -a 256
93+
#
94+
LOWCODER_API_KEY_SECRET="5a41b090758b39b226603177ef48d73ae9839dd458ccb7e66f7e7cc028d5a50b"
95+
96+
##
97+
## api and node service parameters
98+
##
99+
# Directory holding lowcoder plugins
100+
LOWCODER_PLUGINS_DIR="../plugins"
101+
# Number of max Request per Second - set to 0 to disable rate limiting
102+
LOWCODER_API_RATE_LIMIT=100
103+
# Lowcoder API service URL
104+
LOWCODER_API_SERVICE_URL="http://localhost:8080"
105+
# Lowcoder Node service URL
106+
LOWCODER_NODE_SERVICE_URL="http://localhost:6060"
107+
108+
##
109+
## Frontend parameters
110+
##
111+
# Lowcoder max request size
112+
LOWCODER_MAX_REQUEST_SIZE=20m
113+
# Lowcoder max query timeout (in seconds)
114+
LOWCODER_MAX_QUERY_TIMEOUT=120
115+
# Default lowcoder query timeout
116+
LOWCODER_DEFAULT_QUERY_TIMEOUT=10
117+
# SAAS to activate, ENTERPRISE to switch off - Workspaces
118+
LOWCODER_WORKSPACE_MODE=SAAS
119+
# Controls whether to show Apps on the local Marketplace to anonymous users
120+
# - if true, apps are not shown to anonymous users
121+
LOWCODER_MARKETPLACE_PRIVATE_MODE="true"
122+
123+
##
124+
## Lowcoder notification emails setup
125+
##
126+
# Mail server host
127+
LOWCODER_ADMIN_SMTP_HOST=localhost
128+
# Mail server port
129+
LOWCODER_ADMIN_SMTP_PORT=587
130+
# Use authentication when sending email
131+
LOWCODER_ADMIN_SMTP_AUTH="true"
132+
# Username (email) used for authentication
133+
LOWCODER_ADMIN_SMTP_USERNAME=
134+
# Password used for authentication
135+
LOWCODER_ADMIN_SMTP_PASSWORD=
136+
# Enable SSL for connetion to the mail server
137+
LOWCODER_ADMIN_SMTP_SSL_ENABLED="false"
138+
# Enable STARTTLS
139+
LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED="true"
140+
# Require STARTTLS
141+
LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED="true"
142+
143+
# Email used in notifications from lowcoder
144+
LOWCODER_EMAIL_NOTIFICATIONS_SENDER=info@localhost
145+
146+
# Lowcoder superuser username
147+
LOWCODER_SUPERUSER_USERNAME=admin@localhost
148+
# Lowcoder superuser password
149+
# If left blank, a password will be generated and written into log (lowcoder-stacks/logs/api-service/api-service.log)
150+
LOWCODER_SUPERUSER_PASSWORD=
151+
152+

deploy/docker/docker-compose-multi.yaml

+22-61
Original file line numberDiff line numberDiff line change
@@ -48,56 +48,13 @@ services:
4848
# Enabled ports to be able to access backend from host
4949
# ports:
5050
# - "8080:8080"
51-
environment:
52-
LOWCODER_PUBLIC_URL: "http://localhost:3000/"
53-
LOWCODER_PUID: "9001"
54-
LOWCODER_PGID: "9001"
55-
LOWCODER_MONGODB_URL: "mongodb://lowcoder:secret123@mongodb/lowcoder?authSource=admin"
56-
LOWCODER_REDIS_URL: "redis://redis:6379"
57-
LOWCODER_NODE_SERVICE_URL: "http://lowcoder-node-service:6060"
58-
LOWCODER_MAX_QUERY_TIMEOUT: 120
59-
LOWCODER_MAX_REQUEST_SIZE: 20m
60-
LOWCODER_EMAIL_AUTH_ENABLED: "true"
61-
LOWCODER_EMAIL_SIGNUP_ENABLED: "true"
62-
LOWCODER_CREATE_WORKSPACE_ON_SIGNUP: "true"
63-
#
64-
# ! PLEASE CHANGE THESE TO SOMETHING UNIQUE !
65-
#
66-
# LOWCODER_DB_ENCRYPTION_PASSWORD and LOWCODER_DB_ENCRYPTION_SALT is used
67-
# to encrypt sensitive data in database so it is important to change the defaults
68-
#
69-
LOWCODER_DB_ENCRYPTION_PASSWORD: "lowcoder.org"
70-
LOWCODER_DB_ENCRYPTION_SALT: "lowcoder.org"
71-
LOWCODER_CORS_DOMAINS: "*"
72-
LOWCODER_MAX_ORGS_PER_USER: 100
73-
LOWCODER_MAX_MEMBERS_PER_ORG: 1000
74-
LOWCODER_MAX_GROUPS_PER_ORG: 100
75-
LOWCODER_MAX_APPS_PER_ORG: 1000
76-
LOWCODER_MAX_DEVELOPERS: 50
77-
#
78-
# API-KEY secret - should be a string of at least 32 random characters
79-
# - on linux/mac, generate one eg. with: head /dev/urandom | head -c 30 | shasum -a 256
80-
#
81-
LOWCODER_API_KEY_SECRET: "5a41b090758b39b226603177ef48d73ae9839dd458ccb7e66f7e7cc028d5a50b"
82-
LOWCODER_PLUGINS_DIR: "../plugins"
83-
LOWCODER_API_RATE_LIMIT: 50
84-
LOWCODER_WORKSPACE_MODE: SAAS
85-
LOWCODER_MARKETPLACE_PRIVATE_MODE: "true"
86-
# Lowcoder notification emails setup
87-
LOWCODER_ADMIN_SMTP_HOST: smtp.gmail.com
88-
LOWCODER_ADMIN_SMTP_PORT: 587
89-
LOWCODER_ADMIN_SMTP_USERNAME:
90-
LOWCODER_ADMIN_SMTP_PASSWORD:
91-
LOWCODER_ADMIN_SMTP_AUTH: "true"
92-
LOWCODER_ADMIN_SMTP_SSL_ENABLED: "false"
93-
LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED: "true"
94-
LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED: "true"
95-
# Email used as sender in lost password email
96-
LOWCODER_EMAIL_NOTIFICATIONS_SENDER: info@localhost
97-
# Lowcoder superuser details
98-
LOWCODER_SUPERUSER_USERNAME: admin@localhost
99-
# If left blank, a password will be generated and written into api-service log
100-
LOWCODER_SUPERUSER_PASSWORD:
51+
env_file:
52+
- path: ./default.env
53+
required: true
54+
- path: ./default-multi.env
55+
required: true
56+
- path: ./override.env
57+
required: false
10158
restart: unless-stopped
10259
depends_on:
10360
mongodb:
@@ -122,10 +79,13 @@ services:
12279
# Enabled ports to be able to access backend from host
12380
# ports:
12481
# - "6060:6060"
125-
environment:
126-
LOWCODER_PUID: "9001"
127-
LOWCODER_PGID: "9001"
128-
LOWCODER_API_SERVICE_URL: "http://lowcoder-api-service:8080"
82+
env_file:
83+
- path: ./default.env
84+
required: true
85+
- path: ./default-multi.env
86+
required: true
87+
- path: ./override.env
88+
required: false
12989
restart: unless-stopped
13090
depends_on:
13191
lowcoder-api-service:
@@ -145,13 +105,13 @@ services:
145105
container_name: lowcoder-frontend
146106
ports:
147107
- "3000:3000"
148-
environment:
149-
LOWCODER_PUID: "9001"
150-
LOWCODER_PGID: "9001"
151-
LOWCODER_MAX_REQUEST_SIZE: 20m
152-
LOWCODER_MAX_QUERY_TIMEOUT: 120
153-
LOWCODER_API_SERVICE_URL: "http://lowcoder-api-service:8080"
154-
LOWCODER_NODE_SERVICE_URL: "http://lowcoder-node-service:6060"
108+
env_file:
109+
- path: ./default.env
110+
required: true
111+
- path: ./default-multi.env
112+
required: true
113+
- path: ./override.env
114+
required: false
155115
restart: unless-stopped
156116
depends_on:
157117
lowcoder-node-service:
@@ -162,6 +122,7 @@ services:
162122
restart: true
163123
volumes:
164124
- ./lowcoder-stacks/assets:/lowcoder/assets
125+
- ./lowcoder-stacks/ssl:/lowcoder-stacks/ssl
165126
healthcheck:
166127
test: curl --fail http://lowcoder-frontend:3000 || exit 1
167128
interval: 5s

0 commit comments

Comments
 (0)