-
Notifications
You must be signed in to change notification settings - Fork 525
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
feat: support docker use the auth when starting #2403
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9520b41
feat: allow docker image set auth when start
aroundabout f06c0ba
Merge branch 'master' into docker-auth
aroundabout 5ae2b1b
fix: merge error
aroundabout f97f9df
fix: set-auth
aroundabout 704f3a6
opt the test condition
aroundabout f48fc37
enhance cmd
aroundabout 7cec13e
move download keystore to pom
aroundabout 4d5c262
Apply suggestions from code review
aroundabout b3eabb7
apply the review suggestion
aroundabout 7d4733c
update readme
aroundabout fc150e7
Update README.md
imbajin 52f577a
refact wait_storage
aroundabout 9b6491f
update yaml and jamm version
aroundabout a1b5a6c
update license
aroundabout a242d34
tiny changes
aroundabout File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
hugegraph-server/hugegraph-dist/src/assembly/static/bin/enable-auth.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with this | ||
# work for additional information regarding copyright ownership. The ASF | ||
# licenses this file to You under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
function abs_path() { | ||
SOURCE="${BASH_SOURCE[0]}" | ||
while [[ -h "$SOURCE" ]]; do | ||
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)" | ||
SOURCE="$(readlink "$SOURCE")" | ||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" | ||
done | ||
cd -P "$(dirname "$SOURCE")" && pwd | ||
} | ||
|
||
BIN=$(abs_path) | ||
TOP="$(cd "${BIN}"/../ && pwd)" | ||
CONF="$TOP/conf" | ||
|
||
GREMLIN_SERVER_CONF="gremlin-server.yaml" | ||
REST_SERVER_CONF="rest-server.properties" | ||
GRAPH_CONF="hugegraph.properties" | ||
|
||
# make a backup | ||
BAK_CONF="$TOP/conf-bak" | ||
mkdir -p "$BAK_CONF" | ||
cp "${CONF}/${GREMLIN_SERVER_CONF}" "${BAK_CONF}/${GREMLIN_SERVER_CONF}.bak" | ||
cp "${CONF}/${REST_SERVER_CONF}" "${BAK_CONF}/${REST_SERVER_CONF}.bak" | ||
cp "${CONF}/graphs/${GRAPH_CONF}" "${BAK_CONF}/${GRAPH_CONF}.bak" | ||
|
||
|
||
sed -i -e '$a\authentication: {' \ | ||
-e '$a\ authenticator: org.apache.hugegraph.auth.StandardAuthenticator,' \ | ||
-e '$a\ authenticationHandler: org.apache.hugegraph.auth.WsAndHttpBasicAuthHandler,' \ | ||
-e '$a\ config: {tokens: conf/rest-server.properties}' \ | ||
-e '$a\}' ${CONF}/${GREMLIN_SERVER_CONF} | ||
|
||
sed -i -e '$a\auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator' \ | ||
-e '$a\auth.graph_store=hugegraph' ${CONF}/${REST_SERVER_CONF} | ||
|
||
sed -i 's/gremlin.graph=org.apache.hugegraph.HugeFactory/gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy/g' ${CONF}/graphs/${GRAPH_CONF} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove a redundant docker-entrypoint.sh, not move the file to download_keystore.sh