Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling configuration file errors in cm-beetle (issue #30) #31

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,41 @@ beetle:
cblog:
root: # To be set in runtime (based on beetle.root)

## Set API access config
api:
# Set API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8080 or * for all)
allow:
origins: "*"

# Set API_AUTH_ENABLED=true currently for basic auth for all routes (i.e., url or path)
auth:
enabled: true

username: default
password: default

## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8056)
self:
endpoint: localhost:8056

tumblebug:
rest:
url: http://localhost:1323/tumblebug
endpoint: http://localhost:1323
api:
username: default
password: default

## Set internal DB config (SQLlite)
db:
url: localhost:3306
database: cm_beetle
user: cm_beetle
password: cm_beetle

## Logger configuration
logfile:
# Set log file path (default logfile path: ./beetle.log)
path: ./beetle.log
maxsize: 10
# Set log file path (default logfile path: ./log/beetle.log)
path: ./log/beetle.log
maxsize: 1000
maxbackups: 3
maxage: 30
compress: false
Expand All @@ -31,30 +57,6 @@ beetle:
node:
env: development

## Set internal DB config (SQLlite)
db:
url: localhost:3306
database: cm_beetle
user: cm_beetle
password: cm_beetle

## Set API access config
api:
# Set API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8080 or * for all)
allow:
origins: "*"

# Set API_AUTH_ENABLED=true currently for basic auth for all routes (i.e., url or path)
auth:
enabled: true

username: default
password: default

## Set period for auto control goroutine invocation
autocontrol:
duration_ms: 10000

## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8056)
self:
endpoint: localhost:8056
duration_ms: 10000
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export BEETLE_API_PASSWORD=default
export BEETLE_SELF_ENDPOINT=localhost:8056

## Set API access config
export BEETLE_TUMBLEBUG_REST_URL=http://localhost:1323/tumblebug

export BEETLE_TUMBLEBUG_ENDPOINT=http://localhost:1323
export BEETLE_TUMBLEBUG_API_USERNAME=default
export BEETLE_TUMBLEBUG_API_PASSWORD=default

## Set internal DB config (SQLlite)
export BEETLE_SQLITE_URL=localhost:3306
Expand All @@ -27,9 +28,9 @@ export BEETLE_SQLITE_USER=cm_beetle
export BEETLE_SQLITE_PASSWORD=cm_beetle

## Logger configuration
# Set log file path (default logfile path: ./beetle.log)
export BEETLE_LOGFILE_PATH=beetle.log
export BEETLE_LOGFILE_MAXSIZE=10
# Set log file path (default logfile path: ./log/beetle.log)
export BEETLE_LOGFILE_PATH=log/beetle.log
export BEETLE_LOGFILE_MAXSIZE=1000
export BEETLE_LOGFILE_MAXBACKUPS=3
export BEETLE_LOGFILE_MAXAGE=30
export BEETLE_LOGFILE_COMPRESS=false
Expand All @@ -40,6 +41,5 @@ export BEETLE_LOGWRITER=both
# Set execution environment, such as development or production
export BEETLE_NODE_ENV=development


## Set period for auto control goroutine invocation
export BEETLE_AUTOCONTROL_DURATION_MS=10000
export BEETLE_AUTOCONTROL_DURATION_MS=10000
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,41 @@ beetle:
cblog:
root: # To be set in runtime (based on beetle.root)

## Set Tumblebug API endpoint
## Set API access config
api:
# Set API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8080 or * for all)
allow:
origins: "*"

# Set API_AUTH_ENABLED=true currently for basic auth for all routes (i.e., url or path)
auth:
enabled: true

username: default
password: default

## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8056)
self:
endpoint: localhost:8056

tumblebug:
rest:
url: http://localhost:1323/tumblebug
endpoint: http://localhost:1323
api:
username: default
password: default

## Set internal DB config (SQLlite)
db:
url: localhost:3306
database: cm_beetle
user: cm_beetle
password: cm_beetle

## Logger configuration
logfile:
# Set log file path (default logfile path: ./beetle.log)
path: ./beetle.log
maxsize: 10
# Set log file path (default logfile path: ./log/beetle.log)
path: ./log/beetle.log
maxsize: 100
maxbackups: 3
maxage: 30
compress: false
Expand All @@ -32,30 +57,6 @@ beetle:
node:
env: development

## Set internal DB config (SQLlite)
db:
url: localhost:3306
database: cm_beetle
user: cm_beetle
password: cm_beetle

## Set API access config
api:
# Set API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8080 or * for all)
allow:
origins: "*"

# Set API_AUTH_ENABLED=true currently for basic auth for all routes (i.e., url or path)
auth:
enabled: true

username: default
password: default

## Set period for auto control goroutine invocation
autocontrol:
duration_ms: 10000

## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8056)
self:
endpoint: localhost:8056
duration_ms: 10000
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,31 @@ export BEETLE_CBSTORE_ROOT=$BEETLE_ROOT
export BEETLE_CBLOG_ROOT=$BEETLE_ROOT

## Set API access config
export BEETLE_TUMBLEBUG_REST_URL=http://localhost:1323/tumblebug
# BEETLE_API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8080 or * for all)
export BEETLE_API_ALLOW_ORIGINS=*
# Set BEETLE_API_AUTH_ENABLED=true currently for basic auth for all routes (i.e., url or path)
export BEETLE_API_AUTH_ENABLED=true
export BEETLE_API_USERNAME=default
export BEETLE_API_PASSWORD=default

## Set BEETLE_SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8056)
export BEETLE_SELF_ENDPOINT=localhost:8056

## Set API access config
export BEETLE_TUMBLEBUG_ENDPOINT=http://localhost:1323
export BEETLE_TUMBLEBUG_API_USERNAME=default
export BEETLE_TUMBLEBUG_API_PASSWORD=default

## Set internal DB config (SQLlite)
export BEETLE_SQLITE_URL=localhost:3306
export BEETLE_SQLITE_DATABASE=cm_beetle
export BEETLE_SQLITE_USER=cm_beetle
export BEETLE_SQLITE_PASSWORD=cm_beetle

## Logger configuration
# Set log file path (default logfile path: ./beetle.log)
export BEETLE_LOGFILE_PATH=beetle.log
export BEETLE_LOGFILE_MAXSIZE=10
export BEETLE_LOGFILE_MAXSIZE=100
export BEETLE_LOGFILE_MAXBACKUPS=3
export BEETLE_LOGFILE_MAXAGE=30
export BEETLE_LOGFILE_COMPRESS=false
Expand All @@ -22,22 +41,5 @@ export BEETLE_LOGWRITER=both
# Set execution environment, such as development or production
export BEETLE_NODE_ENV=development

## Set internal DB config (SQLlite)
export BEETLE_SQLITE_URL=localhost:3306
export BEETLE_SQLITE_DATABASE=cm_beetle
export BEETLE_SQLITE_USER=cm_beetle
export BEETLE_SQLITE_PASSWORD=cm_beetle

## Set API access config
# BEETLE_API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8080 or * for all)
export BEETLE_API_ALLOW_ORIGINS=*
# Set BEETLE_API_AUTH_ENABLED=true currently for basic auth for all routes (i.e., url or path)
export BEETLE_API_AUTH_ENABLED=true
export BEETLE_API_USERNAME=default
export BEETLE_API_PASSWORD=default

## Set period for auto control goroutine invocation
export BEETLE_AUTOCONTROL_DURATION_MS=10000

## Set BEETLE_SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8056)
export BEETLE_SELF_ENDPOINT=localhost:8056
export BEETLE_AUTOCONTROL_DURATION_MS=10000
17 changes: 11 additions & 6 deletions conf/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,14 @@ services:
# https://github.com/cloud-barista/cm-beetle/discussions/73
# https://hub.docker.com/r/cloudbaristaorg/cm-beetle
# See https://github.com/cloud-barista/cm-beetle/blob/main/deployments/docker-compose/docker-compose.yaml#L156
# If you need to modify the config.yaml file, including modifying tumblebug's credentials, you'll need to copy the latest file and modify it before using it.
# see conf folder : https://github.com/cloud-barista/cm-beetle/tree/main/conf
# And remove the conf-related comments in the volumes settings below.
cm-beetle:
#image: cloudbaristaorg/cm-beetle:0.2.0
image: cloudbaristaorg/cm-beetle:edge
#image: cm-beetle-mzc:edge

container_name: cm-beetle
platform: linux/amd64
ports:
Expand All @@ -219,29 +224,29 @@ services:
- cb-tumblebug
volumes:
- ./tool/mayfly:/app/tool/mayfly
- ./conf/cm-beetle/conf/:/app/conf/
#- ./conf/cm-beetle/conf:/app/conf/
- ./data/cm-beetle/log/:/app/log/
environment:
# - BEETLE_ROOT=/app
# - BEETLE_CBSTORE_ROOT=/app
# - BEETLE_CBLOG_ROOT=/app
- BEETLE_TUMBLEBUG_ENDPOINT=http://cb-tumblebug:1323
# - BEETLE_LOGFILE_PATH=/app/log/beetle.log
# - BEETLE_LOGFILE_MAXSIZE=10
# - BEETLE_LOGFILE_MAXSIZE=1000
# - BEETLE_LOGFILE_MAXBACKUPS=3
# - BEETLE_LOGFILE_MAXAGE=30
# - BEETLE_LOGFILE_COMPRESS=false
# - BEETLE_LOGLEVEL=debug
- BEETLE_LOGLEVEL=debug
# - BEETLE_LOGWRITER=both
# - BEETLE_NODE_ENV=development
- BEETLE_NODE_ENV=development
# - BEETLE_SQLITE_URL=localhost:3306
# - BEETLE_SQLITE_DATABASE=cm_beetle
# - BEETLE_SQLITE_USER=cm_beetle
# - BEETLE_SQLITE_PASSWORD=cm_beetle
# - BEETLE_API_ALLOW_ORIGINS=*
# - BEETLE_API_AUTH_ENABLED=true
# - BEETLE_API_USERNAME=default
# - BEETLE_API_PASSWORD=default
- BEETLE_API_USERNAME=default
- BEETLE_API_PASSWORD=default
# - BEETLE_AUTOCONTROL_DURATION_MS=10000
- BEETLE_SELF_ENDPOINT=localhost:8056
healthcheck: # for CM-Beetle
Expand Down