element-hq / element-hq/synapse

Allow to pass directory for config files and data via environment files

Open
#13,668 0 comments 0 reactions 0 assignees View on GitHub
X-Awaiting-Changes
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#13668](https://github.com/matrix-org/synapse/pull/13668).

---

### Pull Request Checklist

This PR adds the ability to pass the `--config-path` and `--data-dir` parameter via the `CONFIGURATION_DIRECTORY` and `STATE_DIRECTORY` variables.

My intentions is to add a PR to add `ConfigurationDirectory=` and `StateDirectory=` to the systemd service file, so that these directories are generated on first run of the service. systemd also sets the aforementioned environment variables, so that the running service knows where to look for everything.

The first commit (reworking `find_config_files`) is mostly to make sure, that this cannot be "held wrong" when people also pass in the same stuff via the environment and the CLI option.

* [x] Pull request is based on the develop branch
* [ ] Pull request includes a [changelog file](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should:
- Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
- Use markdown where necessary, mostly for `code blocks`.
- End with either a period (.) or an exclamation mark (!).
- Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
* [x] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
* [x] [Code style](https://matrix-org.github.io/synapse/latest/code_style.html) is correct
(run the [linters](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.