Docker yaml authentication settings (gremlinserver.authentication) question
Does anyone have any experience setting up authentication on Docker by using the supplied .yaml file? I'm having trouble passingin a map to properly set one of the options: gremlinserver.authentication.config.
Additional info, but not related to the my main problem:
I have a file with the contents of username/password pairs which follow the schema:
username:password (sha256)
This file is located within the docker instance at: /etc/opt/janusgraph/janusgraph-credentials-server.properties
However, gremlin server expects credentialsDb as a map and docker wants a string. Therefore I seem unable to configure this property.
Here are the relevant parts of my docker .yaml file:
Solution:Jump to solution
Due to gremlin server expecting a map, but docker being unable to pass it to the server in the format that is expected.I think you simply have a slight misunderstanding of the YAML format here. YAML is basically a nested map of maps. Now, if your YAML looks like this: ...
5 Replies
However, gremlin server expects credentialsDb as a map and docker wants a string.What do you mean by this exactly? Can you please share any errors you are getting caused by this? Also, did you write this YAML file by hand and then mount / COPY it into the Docker container or was it generated via env vars from the JanusGraph Docker startup logic?
Hi @Florian Hockmann - it was the original docker file from the Janusgraph Github with slight customizations to the configuration per the guide on https://github.com/JanusGraph/janusgraph-docker.
"The environment variables supported by the JanusGraph image are summarized below."
janusgraph.* Any JanusGraph configuration option to override in the template properties file, specified with an outer janusgraph namespace (e.g., janusgraph.storage.hostname). See JanusGraph Configuration for available options.
gremlinserver.* Any Gremlin Server configuration option to override in the default configuration (YAML) file, specified with an outer gremlinserver namespace (e.g., gremlinserver.threadPoolWorker). You can set or update nested options using additional dots (e.g., gremlinserver.graphs.graph). See Gremlin Server Configuration for available options. See Gremlin Server Environment Variable Syntax section below for help editing gremlin server configuration using environment variables.
Has anyone here added authentication configs via gremlinserver.authentication.config by passing in a map? Or is everyone just using the standard authentication mechanism, no user or password?
When removing authentication, the docker file spins up fine, but making an attempt to turn on authentication breaks it. Due to gremlin server expecting a map, but docker being unable to pass it to the server in the format that is expected. Am I formatting the map incorrectly? How have others found success?
Testing: It's incredibly easy to test and reproduce. Take your already deployed docker file and try to spin up another instance by passing in a custom config via gremlinserver.authentication.config.
Solution
Due to gremlin server expecting a map, but docker being unable to pass it to the server in the format that is expected.I think you simply have a slight misunderstanding of the YAML format here. YAML is basically a nested map of maps. Now, if your YAML looks like this: then you can change the value of c via the JanusGraph Docker container by passing the environment variable
gremlinserver.a.b.c=newvalue
It also doesn't matter if you're using indentation or curly braces here. So the document could also look like this:
So the two options you want to configure, can be configured via env vars with JanusGraph like this:
gremlinserver.authentication.authenticator="org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator"
and
gremlinserver.authentication.config.credentialsDb="/etc/opt/janusgraph/janusgraph-credentials-server.properties"
credentialsDb
is just another entry under gremlinserver.authentication.config
@Florian Hockmann - Thank you for your help. This worked and got me to my next step of troubleshooting, but for anyone trying make sure you replace = (equal) with a : (colon).