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

dbms.backup.address config value cannot be overridden by an env variable #52

Closed
samattridge opened this issue Sep 7, 2016 · 3 comments

Comments

@samattridge
Copy link

I would like to initialize Neo4J backups remotely but obviously can't without enabling the 'dbms.backup.address' config value. I have had to take a copy of the neo4j.conf and inject it to the docker container because the value cannot be overridden using an environment variable like other settings can.

Could this be fixed? Ideally, so that all settings within the config file could be overridden.

@benbc
Copy link
Contributor

benbc commented Sep 15, 2016

You are quite right, this is a bit of a pain currently. In fact I don't think that the setting even needs to be configurable because the backup server should be listening on 0.0.0.0 inside a container. There is a PR on this at #35.

We also have an ambition to make all settings overridable by environment variables, but that requires a product change and we haven't been able to prioritize it yet.

@jangaraj
Copy link
Contributor

jangaraj commented Apr 1, 2017

@benbc Will you accept PR, which will allow to overwrite any current/further neo4j setting from the env variable, which will start with prefix NEO4J_?

Concept:

# read env variables, which start with NEO4J_ prefix
# and update conf settings based on their values
for i in $( printenv | grep ^NEO4J_ | awk -F'=' '{print $1}' | sort -rn ); do
    setting=$(echo ${i} | sed 's|^NEO4J_||' | sed 's|_|.|g')
    value=$(echo ${!i})
    sed --in-place "s|.*${setting}=.*|${setting}=${value}|" conf/neo4j.conf
done

@spacecowboy
Copy link
Contributor

@jangaraj this is a feature we've been considering so if you are willing to do the work I'd be happy to review and help.

Some things to keep in mind:

  • Some settings are commented by default and some are not
  • Not all settings are actually present (commented or not) in the config file. So a sed by itself is not guaranteed to replace something
  • A user might define a custom config volume AND some environment variables.

The reference of all configuration options might be of interest: https://neo4j.com/docs/operations-manual/current/reference/configuration-settings/

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

4 participants