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

Avoid the sed facade in start-server.sh by mounting the sormas.properties file directly into the sormas container #255

Open
JonasCir opened this issue Jul 14, 2021 · 1 comment

Comments

@JonasCir
Copy link
Contributor

JonasCir commented Jul 14, 2021

Situation

For each new property, we have to adjust the .env file, and need to add sed calls to the start-server.sh script. This introduces a lot of dependencies and margin for errors. I just noticed that for S2S the are variables in the environment which are not even used.

How to improve

Provide an example sormas.properties which gets mounted into the sormas containers. If new properties are introduced, we then just need to touch one central file and avoid inconsistencies between the files in this repo and upstream SORMAS. Further, this will save us directly >200 LOC of setup code as well as in the compose files which do not need to forward every single env variable on their own.

Another advantage for production is, that you only need to template the properties file directly without the need to take a complicated detour over .env and the setup script.

@JonasCir
Copy link
Contributor Author

JonasCir commented Jul 15, 2021

Further, some characters like - confuse sed, so you can't really use them:
sed -i -E "s/#?sormas2sormas.id=.*/sormas2sormas.id=${SORMAS2SORMAS_ID}/" "${PROPERTIES_FILE}" wont work for SORMAS2SORMAS_ID=HZI-TEST. >ou have to take care of escaping manually or via scripts while populating the env which is just a pain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant