Comments (7)
I tested it with the SCM-Manager 3.1.0. Configuration provided as environment variables override the configuration provided by the config.yml. But they do not change the values inside the config.yml.
The values inside the config.yml is not supposed to be changed, by environment variables. But you can override the behavior, configured by the config.yml, by using the environment variables.
from scm-manager.
This sounds like a reasonable request. We will check this. Thanks for the suggestion!
from scm-manager.
Hello @mfide,
this is already possible by using this snippet inside your docker-compose.yaml File
environment:
- SCM_FORWARD_HEADERS_ENABLED=true
from scm-manager.
Hello @mfide,
this is already possible by using this snippet inside your docker-compose.yaml File
environment: - SCM_FORWARD_HEADERS_ENABLED=true
Did you test that?
For me it is always ignored and config.yml produced in /etc/scm looks like following:
..
## Evaluates headers set by a reverse proxy like X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host
forwardHeadersEnabled: false
..
from scm-manager.
I tested it with the SCM-Manager 3.1.0.
Configuration provided as environment variables override the configuration provided by the config.yml.
But they do not change the values inside the config.yml.
Here is the complete docker-compose.yaml.
version: '3'
services:
scm:
image: scmmanager/scm-manager:3.1.0
ports:
- 8080:8080
volumes:
- scm-volume:/var/lib/scm
environment:
- SCM_FORWARD_HEADERS_ENABLED=true
proxy:
image: nginx
#nginx config files and certificates
volumes:
- type: bind
source: ./nginx.conf
target: /etc/nginx/conf.d/default.conf
read_only: true
- type: bind
source: ./nginx.crt
target: /etc/nginx/ssl/nginx.crt
read_only: true
- type: bind
source: ./nginx.key
target: /etc/nginx/ssl/nginx.key
read_only: true
ports:
- 443:443
depends_on:
- scm
volumes:
scm-volume:
name: scm-home
And here is the used nginx.conf:
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
location / {
proxy_pass http://scm:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
}
}
from scm-manager.
Hi @zT-1337,
I have created a new instance using following docker-compose.yml in my test folder:
Docker version:
docker --version
Docker version 26.1.0, build 9714adc
docker-compose.yml:
version: '3'
services:
scm:
image: scmmanager/scm-manager:3.1.0
environment:
- SCM_FORWARD_HEADERS_ENABLED=true
Running the container:
mf@myserver:~/test$ docker compose up -d
WARN[0000] /home/mf/test/docker-compose.yml: `version` is obsolete
[+] Running 1/1
✔ scm Pulled 0.6s
[+] Running 2/2
✔ Network test_default Created 0.1s
✔ Container test-scm-1 Started
Check status:
mf@myserver:~/test$ docker compose ps
WARN[0000] /home/mf/test/docker-compose.yml: `version` is obsolete
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
test-scm-1 scmmanager/scm-manager:3.1.0 "/opt/scm-server/bin…" scm 38 seconds ago Up 37 seconds (healthy) 8080/tcp
Attach to container's bash:
mf@myserver:~/test$ docker exec -it test-scm-1 /bin/sh
/opt/scm-server $
/opt/scm-server $ cd /etc/scm/
/etc/scm $
/etc/scm $
Print config.yml produced:
etc/scm $ cat config.yml
# base server config
## Address to listen 0.0.0.0 means on every interface
addressBinding: 0.0.0.0
port: 8080
contextPath: /scm
## Evaluates headers set by a reverse proxy like X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host
forwardHeadersEnabled: false <----------------------------- here it is still false
## increase http header size for mercurial
httpHeaderSize: 16384
## set http idle timeout (set to 0 for default)
idleTimeout: 0
# ssl config - ssl is only evaluated if key store path is set
## path to your cert file
https:
keyStorePath: ""
keyStorePassword: secret
keyStoreType: PKCS12
sslPort: 8443
redirectHttpToHttps: false
tempDir: /var/cache/scm/work
# logging
log:
rootLevel: WARN
enableFileAppender: false
enableConsoleAppender: true
logger:
sonia.scm: INFO
com.cloudogu.scm: INFO
# webapp config
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
/etc/scm $
from scm-manager.
I tested it with the SCM-Manager 3.1.0. Configuration provided as environment variables override the configuration provided by the config.yml. But they do not change the values inside the config.yml.
The values inside the config.yml is not supposed to be changed, by environment variables. But you can override the behavior, configured by the config.yml, by using the environment variables.
Yes you are right.
I confirmed that config.yml in the container still has "forwardHeadersEnabled: false" item but "SCM_FORWARD_HEADERS_ENABLED=true" in the environment section overrides the behaviour of the container and it behaves as expected.
Thank you for your help.
from scm-manager.
Related Issues (20)
- Provide ability to set repository path & use human-readable names for repository folder name HOT 5
- Subversion seems broken constant errors in logs HOT 3
- Enhance URL Redirection for User-friendly Access to SVN Files HOT 4
- Provide details for enabling dataFileCache HOT 1
- Increasing number of projects shown on Repositories page HOT 2
- IllegalArgumentException: event handler not found HOT 2
- Port the scm-hgnested-plugin to 2.x HOT 1
- When a user is deleted, it is not deleted from the groups it was a member of HOT 2
- SVN dump buggy in docker container of SCM-Manager HOT 1
- Change number display changeset HOT 4
- SCM-Manager hosting using https proxy broken after 3.0.0 upgrade HOT 5
- 'create repository'-permission on namespace level HOT 1
- debian upgrade to 3.0 hangs daemon due to privilege issue HOT 3
- Latest Tag goes from 3.0.3 to 2.46.2 and docker hub scmmanager/scm-manager:latest has followed HOT 2
- I have found a issue in SCM-Manager Plugin error please help me to resolve the issue HOT 7
- Mirror Tags are always gray HOT 5
- Importing scm-manager repository in to GitLab validation of the URL fails in GitLab due to Content-Type in response. HOT 1
- Not possible to change the SCM_HOME directory on Windows HOT 5
- HTTP ERROR 503 Service Unavailable HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scm-manager.