config/app.yaml
The configuration file is located at config/app.yaml
. It is used to store the application settings.
General Configuration (Server)
# config/app.yaml
server:
mode: prod
address: 127.0.0.1
port: 8000 # No need to change if using docker compose
gracefulShutdownPeriod: 30
rateLimits:
- limitType: server
burst: 500
qps: 100
cacheSize: 1
- limitType: ip
burst: 50
qps: 10
cacheSize: 2048
# Frontend URL for sending email
baseUrl: https://localhost:5173
Mode
dev
: Development mode, which is used for development.prod
: Production mode, which is used for production.test
: Test mode, which is used for testing.debug
: Debug mode, which is used for debugging.
JWT
The JWT secret and realm are used for JWT authentication.
# config/app.yaml
jwt:
secret: somesecret # Change this to a random string
realm: sccce
secret
: The secret key for JWT.realm
: The realm for JWT.
Log Level
# config/app.yaml
log:
level: info
Sending Emails
Sending mails are required for the following purposes:
- User registration Verification Code
- User password reset Verification Code
There are two methods to send emails.
- SendGrid API (Default)
- SMTP through Gomail
- SendGrid API
- SMTP through Gomail
- Create an account at SendGrid
- Create an API key
- Update the configuration File
# config/app.yaml
mail:
enable: true
sendgridAPIKey: your-api-key
account: sender-email
- Update the configuration File
# config/app.yaml
mail:
enable: true
host: smtp-server
port: 587 # or your smtp port
account: your-email
password: your-password
MongoDB Configuration
# config/app.yaml
db:
host: 127.0.0.1 # Change to `mongodb` if using docker compose
port: 27017
dbName: ${MONGO_DATABASE} # Takes from .env
username: ${MONGO_USERNAME} # Takes from .env
password: ${MONGO_PASSWORD} # Takes from .env
migrate: true # Not used currently
Redis Configuration
# config/app.yaml
redis:
enable: true # Currently does not have any use
port: 6379
host: localhost # or "redis" if using docker compose
password: ${REDIS_PASSWORD} # Takes from .env
GCE Configuration
# config/app.yaml
gce:
username: admin
password: admin
ssh:
host: gvmd
port: 22
username: devSSHuser
password: greenbone
gcePath: ./Greenbone/ # No need to change
scriptsDir: ./scripts/greenbone # No need to change
pyEnvPath: ./Greenbone/venv/ # No need to change
ELK
# config/app.yaml
elk:
enable: true
ip: 127.0.0.1
port: 9200
username: ${ELK_USERNAME} # Takes from .env
password: ${ELASTIC_PASSWORD} # Takes from .env
Example Configuration
# config/app.yaml
server:
mode: prod
address: 127.0.0.1
port: 8000
gracefulShutdownPeriod: 30
rateLimits:
- limitType: server
burst: 500
qps: 100
cacheSize: 1
- limitType: ip
burst: 50
qps: 10
cacheSize: 2048
# Frontend URL for sending email
baseUrl: https://localhost:5173
jwt:
secret: somesecret
realm: test
log:
level: info
db:
host: 127.0.0.1
port: 27017
dbName: sccce
username: fyp
password: somepassword
migrate: true
redis:
enable: true
port: 6379
host: localhost # host: "redis"
password: somepassword
mail:
enable: true # Set to true to enable mail service
# Required for all mail services
account: sender-email
# Uncomment Below to use SMTP
# # Use SMTP
# server: "smtp.office365.com"
# port: 587
# password: "your-password"
# Use SendGrid
sendgridAPIKey: your-api-key
gce:
username: admin
password: admin
ssh:
host: gvmd
port: 22
username: devSSHuser
password: greenbone
gcePath: ./Greenbone/
pyEnvPath: ./Greenbone/venv/