Browse Source

skip empty variable values which can cause server startup fail

pull/7587/head
starbirdtech383 10 months ago
parent
commit
70f69869f5
  1. 6
      docker-compose/aio/.gitignore
  2. 36
      docker-compose/aio/README.md
  3. 10
      docker-compose/aio/advanced.md
  4. 7
      docker-compose/aio/bin/restart.sh
  5. 7
      docker-compose/aio/bin/start.sh
  6. 11
      docker-compose/aio/conf/nc_properties.env
  7. 17
      docker-compose/aio/prepare_env.sh
  8. 2
      docker-compose/aio/sbin/install_vars.sh
  9. 1
      docker-compose/aio/security.md

6
docker-compose/aio/.gitignore vendored

@ -1,3 +1,3 @@
conf conf/
data data/
logs logs/

36
docker-compose/aio/README.md

@ -1,6 +1,10 @@
# Install full stack nocodb with Docker (compose) # Install full stack nocodb with Docker (compose)
This page provides instructions to install nocodb full stack using Docker. The installation will run multiple contianers in single node. This page provides instructions to install nocodb all-in-one (aio) using Docker-Compse. The installation will run multiple contianers in single node which includes
- nocodb
- postgres
- nginx
- redis
## Prerequisites ## Prerequisites
Before you begin, ensure you have the following prerequisites: Before you begin, ensure you have the following prerequisites:
@ -9,24 +13,37 @@ Before you begin, ensure you have the following prerequisites:
- Docker-Compose (version 2.17.3 or later) - Docker-Compose (version 2.17.3 or later)
- Ports 80 and 443 are available - Ports 80 and 443 are available
TIP: you could simply run ./pre-req-check.sh from this directory which will check. TIP: you could simply run [./pre-req-check.sh](./pre-req-check.sh) which performs pre-requisite check.
## Install ## Install
Run install.sh, This script performs pre-requisite check, prompts you through required application properties and finally performs `docker-compose up -d`. Run [install.sh](./install.sh), This script performs pre-requisite check, prompts you through required application properties and finally performs `docker-compose up -d`.
Note: For most cases where any external integration is not required. The defaults properties are just fine. Note: For most cases where any external integration is not required. The defaults properties are just fine.
``` ```
./install.sh ./install.sh
``` ```
* At this point, your installation is completed and you should be able to access your nocodb instance * * At this point, your installation is completed and you should be able to access your nocodb instance *
### An example output will be like below. ### An example output will be like below.
``` ```
./install.sh
** Performing nocodb system check and setup. This step may require sudo permissions
| Checking if required tools (docker, docker-compose, jq, lsof) are installed...
| Checking port accessibility...
| Port 80 is free.
| WARNING: Port 443 is in use. Please make sure it is free.
** System check completed successfully. **
** Few pre-requisites are failing. Recommend to resolve and proceed. However you could still proceed to install **
| Press Y to continue or N to skip (Y/N)?
Preparing environment file before install..
| Press Y to continue with defaults or N to customise app properties (Y/N)
backing up previous docker-compose/aio/conf/nc_properties.env file to nocodb/docker-compose/aio/conf/nc_properties.env-1707455571.bak
Environment variables written to docker-compose/aio/conf/nc_properties.env file.
Installing docker containers
``` ```
## Data and Conf directories ## Data and Conf directories
This directory acts as the NC_INSTALL_ROOT by default and it will have data, conf directories which are `.gitingore` to avoid accidentlly exposing to git. This directory acts as the NC_INSTALL_ROOT by default and it will have data, conf directories which are `.gitingore` to avoid accidentlly exposing to git repository.
During installation the default properties are configured at [nc_properties.env](./conf/nc_properties.env) which can be updated if required and restarted
``` ```
. .
@ -47,10 +64,3 @@ install script performs the following steps
1. pre-req-check.sh and warns if there is anything missing which could potentially cause issues at later stage. However it will let you proceed if you wish to. 1. pre-req-check.sh and warns if there is anything missing which could potentially cause issues at later stage. However it will let you proceed if you wish to.
2. create application properties file under conf dir which will then be used for future upgrades etc. 2. create application properties file under conf dir which will then be used for future upgrades etc.
3. runs docker-compose up -d 3. runs docker-compose up -d
##

10
docker-compose/aio/advanced.md

@ -3,7 +3,7 @@
## Restarting containers ## Restarting containers
There are atleast 4 main containers which are running as part of this installation through same docker-compose. The same docker-compose can be leveraged to restart any or all of these containers. There are atleast 4 main containers which are running as part of this installation through same docker-compose. The same docker-compose can be leveraged to restart any or all of these containers.
Use below command to restart all containers\ Use [restart.sh](./bin/restart.sh) or Use below command to restart all containers
``` docker compose restart ``` ``` docker compose restart ```
To restart individual containers with name ( names: nocodb, nginx, postgres, redis)\ To restart individual containers with name ( names: nocodb, nginx, postgres, redis)\
@ -38,9 +38,5 @@ There are two main directories where nginx configurations are maintained
- nocodb team managed configurations at [nginx/conf.d](./conf/nginx/conf.d). - nocodb team managed configurations at [nginx/conf.d](./conf/nginx/conf.d).
- self managed (you) [conf/nginx/conf.d](./conf/nginx/conf.d) - self managed (you) [conf/nginx/conf.d](./conf/nginx/conf.d)
## postgres configurations
## Add Node [postgres.conf](./data/postgres/postgresql.conf) and [pg_hba.conf](./data/postgres/pg_hba.conf) are created under ./data/postgres directory upon first postgres container creation. The configurations can be updated and restarted continer to take affect.
## Minio integration for resources
## Enable scheduled backups to run nightly on all your instances.

7
docker-compose/aio/bin/restart.sh

@ -0,0 +1,7 @@
#!/bin/bash
# docker-compse restart all containers utilty script
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
COMPONENT_DIR=${SCRIPT_DIR}/../
cd ${COMPONENT_DIR}
docker-compose restart

7
docker-compose/aio/bin/start.sh

@ -0,0 +1,7 @@
#!/bin/bash
# docker-compse restart all containers utilty script
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
COMPONENT_DIR=${SCRIPT_DIR}/../
cd ${COMPONENT_DIR}
docker-compose up -d

11
docker-compose/aio/conf/nc_properties.env

@ -4,13 +4,10 @@ POSTGRES_PASSWORD=test123
POSTGRES_DB=nocodb POSTGRES_DB=nocodb
NC_REDIS_URL=redis://redis:6379/4 NC_REDIS_URL=redis://redis:6379/4
NC_DB=pg://postgres:5432?u=postgres&password=${POSTGRES_PASSWORD:-nocodb}&d=postgres NC_DB=pg://postgres:5432?u=postgres&password=${POSTGRES_PASSWORD:-nocodb}&d=postgres
NC_PUBLIC_URL=rajanishs-MacBook-Pro.local NC_PUBLIC_URL=http://rajanishs-MacBook-Pro.local
NC_CONNECT_TO_EXTERNAL_DB_DISABLED=false NC_CONNECT_TO_EXTERNAL_DB_DISABLED=false
NC_INVITE_ONLY_SIGNUP=false NC_INVITE_ONLY_SIGNUP=false
NC_ADMIN_EMAIL=false NC_ADMIN_EMAIL=admin@nocodb.com
NC_ADMIN_PASSWORD=false NC_ADMIN_PASSWORD=nocodb123
NC_S3_BUCKET_NAME=asdf NC_S3_BUCKET_NAME=nocodb-attachements
NC_S3_REGION=asd
NC_S3_ACCESS_KEY=sda
NC_S3_ACCESS_SECRET=adsfa

17
docker-compose/aio/prepare_env.sh

@ -16,6 +16,11 @@ if [ -f ${ENV_FILE} ]; then
cp ${ENV_FILE} ${bkp_file} cp ${ENV_FILE} ${bkp_file}
fi fi
function trim(){
local var="${@}"
echo "$(sed -e 's/[[:space:]]*$//' <<<${var})"
}
function acceptProperty(){ function acceptProperty(){
local varDetail="$1" local varDetail="$1"
local promptUser="${2:-true}" local promptUser="${2:-true}"
@ -25,7 +30,7 @@ function acceptProperty(){
default_value="${prop#*=}" default_value="${prop#*=}"
prev_value_or_default=${!key:-${default_value}} prev_value_or_default=${!key:-${default_value}}
echo promptUser: ${promptUser} # echo promptUser: ${promptUser}
# echo prop: ${prop} # echo prop: ${prop}
# echo key: ${key} # echo key: ${key}
# echo default_value: ${default_value} # echo default_value: ${default_value}
@ -34,10 +39,12 @@ function acceptProperty(){
fi fi
# Use user input or default value if empty # Use user input or default value if empty
value=${user_input:-$prev_value_or_default} value=$(trim ${user_input:-$prev_value_or_default})
# Store key-value pair in a variable # Store key-value pair in a variable
userValues="${userValues}${key}=${value}\n" if [[ ${value} != "" ]]; then
userValues="${userValues}${key}=${value}\n"
fi
} }
# Iterate over the properties array and prompt user for input # Iterate over the properties array and prompt user for input
for multi_property_array in basic_properties invite_only_signup_priorities google_login_properties email_properties s3_attachment_properties ; do for multi_property_array in basic_properties invite_only_signup_priorities google_login_properties email_properties s3_attachment_properties ; do
@ -56,7 +63,9 @@ for multi_property_array in basic_properties invite_only_signup_priorities googl
fi fi
continue continue
fi fi
acceptProperty "${varDetail}" "${promptUser}" if [[ ${prop} != "main" ]]; then
acceptProperty "${varDetail}" "${promptUser}"
fi
done done
done done

2
docker-compose/aio/sbin/install_vars.sh

@ -10,7 +10,7 @@ basic_properties=(
"POSTGRES_DB=nocodb | " "POSTGRES_DB=nocodb | "
"NC_REDIS_URL=redis://redis:6379/4 | default to redis container" "NC_REDIS_URL=redis://redis:6379/4 | default to redis container"
'NC_DB=pg://postgres:5432?u=postgres&password=${POSTGRES_PASSWORD:-nocodb}&d=postgres | hide' 'NC_DB=pg://postgres:5432?u=postgres&password=${POSTGRES_PASSWORD:-nocodb}&d=postgres | hide'
"NC_PUBLIC_URL=$(hostname) | Are you using custom DNS, configure NC_PUBLIC_URL to reflect in the invite emails?" "NC_PUBLIC_URL=http://$(hostname) | Are you using custom DNS, configure NC_PUBLIC_URL to reflect in the invite emails?"
"NC_CONNECT_TO_EXTERNAL_DB_DISABLED=false | Disable connecting to external db?" "NC_CONNECT_TO_EXTERNAL_DB_DISABLED=false | Disable connecting to external db?"
) )

1
docker-compose/aio/security.md

@ -1 +0,0 @@
Security
Loading…
Cancel
Save