-
Notifications
You must be signed in to change notification settings - Fork 7
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
update weaver 6.1.0 #489
Open
fmigneault
wants to merge
8
commits into
master
Choose a base branch
from
weaver-6.x
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
update weaver 6.1.0 #489
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
686d51e
update weaver 6.1.0
fmigneault be78fa5
fix typo
fmigneault aba090e
fix missing query params forwarding for weaver + partial patch twitch…
fmigneault f16df97
replace 302 by 301 for weaver redirects
fmigneault e551143
add info about WEAVER_ALT_PREFIX to docs
fmigneault 5c5c374
Merge remote-tracking branch 'origin/master' into weaver-6.x
fmigneault af450b5
revert slashes breaking for weaver script-name
fmigneault 5a98313
bump weaver to 6.1.1 - bugfix for PROV endpoints
fmigneault 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
60 changes: 43 additions & 17 deletions
60
birdhouse/components/weaver/config/proxy/conf.extra-service.d/weaver.conf.template
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 | ||||
---|---|---|---|---|---|---|
@@ -1,25 +1,51 @@ | ||||||
|
||||||
location = /weaver-auth { | ||||||
internal; | ||||||
# note: using 'TWITCHER_VERIFY_PATH' path to avoid performing the request via proxy 'TWITCHER_PROTECTED_PATH' | ||||||
# This ensures that access is validated for the user, but does not trigger its access/download twice. | ||||||
# It is also more efficient, since less contents are transferred/buffered. | ||||||
proxy_pass ${BIRDHOUSE_PROXY_SCHEME}://${BIRDHOUSE_FQDN_PUBLIC}${TWITCHER_VERIFY_PATH}/$request_uri; | ||||||
proxy_pass_request_body off; | ||||||
proxy_set_header Host $host; | ||||||
proxy_set_header Content-Length ""; | ||||||
proxy_set_header X-Original-URI $request_uri; | ||||||
proxy_set_header X-Forwarded-Proto $real_scheme; | ||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||||||
proxy_set_header X-Forwarded-Host $host:$server_port; | ||||||
} | ||||||
|
||||||
location = /${WEAVER_MANAGER_NAME} { | ||||||
return 301 /${WEAVER_MANAGER_NAME}/$is_args$args; | ||||||
} | ||||||
location ~ ^/${WEAVER_MANAGER_NAME}/(.*)$ { | ||||||
auth_request /weaver-auth; | ||||||
auth_request_set $auth_status $upstream_status; | ||||||
|
||||||
# NOTE: | ||||||
# Inject the 'WEAVER_MANAGER_NAME' prefix here to align with 'SCRIPT_NAME' in the docker-compose config. | ||||||
# This is needed to help UI elements resolve the full URI path with proxy service prefixes since the | ||||||
# generated locations returned that must be interpreted/retrieved by the client/browser would otherwise | ||||||
# not be aware of the proxy redirection path prefix, leading to unresolved resources. | ||||||
proxy_pass http://weaver:4001/${WEAVER_MANAGER_NAME}/$1$is_args$args; | ||||||
proxy_set_header Host $http_host; | ||||||
proxy_set_header X-Original-URI $request_uri; | ||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||||||
proxy_set_header X-Forwarded-Proto $real_scheme; | ||||||
proxy_set_header X-Forwarded-Host $http_host:$server_port; | ||||||
proxy_buffering off; | ||||||
} | ||||||
|
||||||
# NOTE: | ||||||
# Redirect to internal network of twitcher with Weaver root endpoint and alias allows to set | ||||||
# the same 'magpie' permissions on the 'weaver' service defined by "WEAVER_MANAGER_NAME". | ||||||
# This allows verification of the same service user/group permissions references regardless | ||||||
# whether the *shortcut* Weaver endpoint, the alias or the explicit 'twitcher' proxy route is used. | ||||||
# redirect EMS/ADES to actual secured Weaver path | ||||||
#location /${WEAVER_CONFIG} { | ||||||
# return 302 ${BIRDHOUSE_PROXY_SCHEME}://${BIRDHOUSE_FQDN_PUBLIC}${TWITCHER_PROTECTED_PATH}/${WEAVER_MANAGER_NAME}; | ||||||
#} | ||||||
|
||||||
location /${WEAVER_MANAGER_NAME} { | ||||||
proxy_pass ${BIRDHOUSE_PROXY_SCHEME}://${BIRDHOUSE_FQDN_PUBLIC}${TWITCHER_PROTECTED_PATH}/${WEAVER_MANAGER_NAME}; | ||||||
proxy_set_header Host $host; | ||||||
proxy_buffering off; | ||||||
include /etc/nginx/conf.d/cors.include; | ||||||
location = ${TWITCHER_PROTECTED_PATH}/${WEAVER_MANAGER_NAME} { | ||||||
return 301 /${WEAVER_MANAGER_NAME}/$is_args$args; | ||||||
} | ||||||
location ${TWITCHER_PROTECTED_PATH}/${WEAVER_MANAGER_NAME}/ { | ||||||
return 301 /${WEAVER_MANAGER_NAME}/$is_args$args; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Actually include the matched subpath in the redirect. Also, this should be 308 so that clients don't change a POST request to GET when performing the redirect. (This was discovered when running the |
||||||
} | ||||||
|
||||||
# NOTE: | ||||||
# this is needed only if not using the location already provided by the core configuration | ||||||
# see 'birdhouse/components/proxy/conf.d/all-services.include.template' | ||||||
# location where process job outputs will be accessible | ||||||
#location ^~ ${WEAVER_WPS_OUTPUTS_PATH}/ { | ||||||
# alias ${WEAVER_WPS_OUTPUTS_DIR}/; | ||||||
#} | ||||||
# optional alternate endpoint to access weaver (see 'components/weaver/default.env') | ||||||
${WEAVER_ALT_PREFIX_PROXY_LOCATION} |
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.
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.
We need to match something in order to include the subpath in the redirect (see next comment)