Improve server config documentation and cleanup

This commit is contained in:
Eduard Heimbuch
2023-12-01 14:34:50 +01:00
committed by René Pfeuffer
parent abe0a62cb4
commit d0c43dd9f4
32 changed files with 431 additions and 303 deletions

View File

@@ -5,15 +5,18 @@ displayToc: true
---
SCM-Manager can be configured in several ways. We recommend using `config.yml` to have most of the settings in
one place.
However, if required, each option in this configuration can also be set via environment variables.
one place. However, if required, each option in this configuration can also be set via environment variables.
See the relevant topics below for more information.
## Change log level
The log level can be configured in the `config.yml`.
You may either change the root log level to change the log level globally for all loggers.
You can change the root log level to change the log level globally for all loggers.
Also, new specific logger can be added to control logging in a fine-grained style.
We provide two types of log appender.
`fileAppender` which writes the logging output to a defined log file and the `consoleAppender` which simply prints
everything to your (bash/shell) console.
Depending on which platform your scm-server is running, we already configured the recommended logging settings.
#### Example
@@ -21,6 +24,8 @@ Also, new specific logger can be added to control logging in a fine-grained styl
log:
# General logging level
rootLevel: WARN
enableFileAppender: true
enableConsoleAppender: true
# Custom specific loggers
# The "name" has to be the path of the classes to be logged with this logger
@@ -34,6 +39,8 @@ log:
To override this config with environment variables you could set it like:
`SCM_LOG_ROOT_LEVEL` to one of the log levels, like `DEBUG`
`SCM_LOG_FILE_APPENDER_ENABLED` to one of the log levels, like `true`
`SCM_LOG_CONSOLE_APPENDER_ENABLED` to one of the log levels, like `false`
`SCM_LOG_LOGGER` with a comma-separated list of your loggers, like `sonia.scm:DEBUG,com.cloudogu.scm:TRACE`
Supported log levels are: TRACE, DEBUG, INFO, WARN, ERROR
@@ -98,9 +105,10 @@ If the logback configuration is enabled, the log configuration of the `config.ym
</configuration>
```
## Change host and port
## Change host, port and context path
The listener host and port of your SCM-Server can directly be edited in the top level of your `config.yml`.
If you want your server without a context path (use `root path`), you can change this option to be `/`.
#### Example
@@ -109,26 +117,13 @@ The listener host and port of your SCM-Server can directly be edited in the top
addressBinding: 0.0.0.0
# This is the exposed port for your application
port: 8080
```
To override this config with environment variables you could set it like:
`SCM_SERVER_PORT` to your port
`SCM_SERVER_ADDRESS_BINDING` to the destination ip / hostname
## Change context path
SCM-Server context path can be set directly in the top level of your `config.yml`.
If you want your server without a context path (use `root`), you can change this option to be `/`.
#### Example
```yaml
contextPath: /
```
To override this config with environment variables you could set it like:
`SCM_SERVER_PORT` to your port, like `8081`
`SCM_SERVER_ADDRESS_BINDING` to the destination ip / hostname, like `0.0.0.0`
`SCM_SERVER_CONTEXT_PATH` to `/myContextPath`
## SSL
@@ -212,12 +207,80 @@ https:
## Change directories
The default directories are platform-specific and therefore could be different if you try scm-server on different
operation systems. Paths starting with `/` are absolute to your file system. If you use relative paths without a
starting `/`, your configured path will be located under the base directory of your scm-server.
operational systems. Paths starting with `/` are absolute to your file system. If you use relative paths without a
starting `/`, your configured path will be located relative to your base directory of your scm-server (
like `/opt/scm-server`
on unix-based packages).
For technical reasons the tempDir is located at the top level of your config.yml. All other path-based config options
are located under `webapp`.
#### Example
```yaml
tempDir: /tmp
homeDir: scm-home
webapp:
homeDir: ./scm-home
workDir:
```
To override this config with environment variables you could set it like:
`SCM_TEMP_DIR` to your port, like `/tmp`
`SCM_WEBAPP_HOMEDIR` to home dir (aka `scm-home`), like `./myHomeDir`
`SCM_WEBAPP_WORKDIR` to `/scm-work`
## Reverse proxy
If your SCM-Manager instance is behind a reverse proxy like NGINX, you most likely will have to enable
X-Forward-Headers.
These HTTP headers are being appended to the requests which are redirected by your reverse proxy server. Without
this option set, your SCM-Server may run into connection issues. This option is disabled by default, because without a
reverse proxy it could cause security issues.
#### Example
```yaml
forwardHeadersEnabled: true
```
## Webapp
The webapp configuration consists of anything that is not webserver or logging related.
Most of the available options should be set to the recommended values of your default `config.yml` file.
```yaml
webapp:
## Sets explicit working directory for internal processes, empty means default java temp dir
workDir:
## Home directory "scm-home" which is also set for classpath
homeDir: /var/lib/scm
cache:
dataFile:
enabled: true
store:
enabled: true
## Warning: Enabling this option can lead to security issue.
endlessJwt: false
## Number of async threads
asyncThreads: 4
## Max seconds to abort async execution
maxAsyncAbortSeconds: 60
## Amount of central work queue workers
centralWorkQueue:
workers: 4
## Strategy for the working copy pool implementation [sonia.scm.repository.work.NoneCachingWorkingCopyPool, sonia.scm.repository.work.SimpleCachingWorkingCopyPool]
workingCopyPoolStrategy: sonia.scm.repository.work.SimpleCachingWorkingCopyPool
## Amount of "cached" working copies
workingCopyPoolSize: 5
```
To override this config with environment variables can set the options following the schema `SCM_WEBAPP_PROPERTYNAME`.
All hierarchy levels have to be separated by underscores `_`.
Like:
- `SCM_WEBAPP_CACHE_DATAFILE_ENABLED` = `true`
- `SCM_WEBAPP_MAXASYNCABORTSECONDS` = `45`
- `SCM_WEBAPP_CENTRALWORKQUEUE_WORKERS` = `42`