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

proxy config revamp #3831

Merged
merged 2 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog/unreleased/fix-remove-legacy-accounts-routes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: remove legacy accounts proxy routes

We've removed the legacy accounts routes from the proxy default config.
There were no longer used since the switch to IDM as the default user
backend. Also accounts is no longer part of the oCIS binary and therefore
should not be part of the proxy default route config.

https://github.com/owncloud/ocis/pull/3831
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ policies:
- endpoint: /archiver
backend: http://localhost:9140
- type: regex
endpoint: /ocs/v[12].php/cloud/(users?|groups)
endpoint: /ocs/v[12].php/cloud/user/signing-key
backend: http://localhost:9110
- endpoint: /ocs/
backend: http://localhost:9140
Expand Down Expand Up @@ -53,10 +53,6 @@ policies:
backend: http://localhost:9120
- endpoint: /graph-explorer
backend: http://localhost:9135
- endpoint: /api/v0/accounts
backend: http://localhost:9181
- endpoint: /accounts.js
backend: http://localhost:9181
- endpoint: /api/v0/settings
backend: http://localhost:9190
- endpoint: /settings.js
Expand Down
205 changes: 59 additions & 146 deletions deployments/examples/ocis_hello/config/ocis/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,149 +3,62 @@ policy_selector:
policy: ocis

policies:
- name: ocis
routes:
# defaults, taken from https://owncloud.dev/extensions/proxy/configuration/
- type: ""
method: ""
endpoint: /
backend: http://localhost:9100
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /.well-known/
backend: http://localhost:9130
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /konnect/
backend: http://localhost:9130
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /signin/
backend: http://localhost:9130
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /archiver
backend: http://localhost:9140
service: ""
apache_vhost: false
- type: regex
method: ""
endpoint: /ocs/v[12].php/cloud/(users?|groups)
backend: http://localhost:9110
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /ocs/
backend: http://localhost:9140
service: ""
apache_vhost: false
- type: query
method: ""
endpoint: /remote.php/?preview=1
backend: http://localhost:9115
service: ""
apache_vhost: false
- type: ""
method: REPORT
endpoint: /remote.php/dav/
backend: http://localhost:9115
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /remote.php/
backend: ""
service: ocdav
apache_vhost: false
- type: ""
method: ""
endpoint: /dav/
backend: ""
service: ocdav
apache_vhost: false
- type: ""
method: ""
endpoint: /webdav/
backend: ""
service: ocdav
apache_vhost: false
- type: ""
method: ""
endpoint: /status.php
backend: ""
service: ocdav
apache_vhost: false
- type: ""
method: ""
endpoint: /index.php/
backend: ""
service: ocdav
apache_vhost: false
- type: ""
method: ""
endpoint: /apps/
backend: ""
service: ocdav
apache_vhost: false
- type: ""
method: ""
endpoint: /data
backend: http://localhost:9140
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /app/
backend: http://localhost:9140
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /graph/
backend: http://localhost:9120
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /graph-explorer
backend: http://localhost:9135
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /api/v0/accounts
backend: http://localhost:9181
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /accounts.js
backend: http://localhost:9181
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /api/v0/settings
backend: http://localhost:9190
service: ""
apache_vhost: false
- type: ""
method: ""
endpoint: /settings.js
backend: http://localhost:9190
service: ""
apache_vhost: false
# oCIS Hello specific routes
- endpoint: "/api/v0/greet"
backend: http://ocis-hello:9105
- endpoint: "/hello.js"
backend: http://ocis-hello:9105
- name: ocis
routes:
# defaults, taken from https://owncloud.dev/extensions/proxy/configuration/
- endpoint: /
backend: http://localhost:9100
- endpoint: /.well-known/
backend: http://localhost:9130
- endpoint: /konnect/
backend: http://localhost:9130
- endpoint: /signin/
backend: http://localhost:9130
- endpoint: /archiver
backend: http://localhost:9140
- type: regex
endpoint: /ocs/v[12].php/cloud/user/signing-key
backend: http://localhost:9110
- endpoint: /ocs/
backend: http://localhost:9140
- type: query
endpoint: /remote.php/?preview=1
backend: http://localhost:9115
- method: REPORT
endpoint: /remote.php/dav/
backend: http://localhost:9115
- type: query
endpoint: /dav/?preview=1
backend: http://localhost:9115
- type: query
endpoint: /webdav/?preview=1
backend: http://localhost:9115
- endpoint: /remote.php/
service: com.owncloud.web.ocdav
- endpoint: /dav/
service: com.owncloud.web.ocdav
- endpoint: /webdav/
service: com.owncloud.web.ocdav
- endpoint: /status.php
service: com.owncloud.web.ocdav
- endpoint: /index.php/
service: com.owncloud.web.ocdav
- endpoint: /apps/
service: com.owncloud.web.ocdav
- endpoint: /data
backend: http://localhost:9140
- endpoint: /app/
backend: http://localhost:9140
- endpoint: /graph/
backend: http://localhost:9120
- endpoint: /graph-explorer
backend: http://localhost:9135
- endpoint: /api/v0/settings
backend: http://localhost:9190
- endpoint: /settings.js
backend: http://localhost:9190
# oCIS Hello specific routes
- endpoint: "/api/v0/greet"
backend: http://ocis-hello:9105
- endpoint: "/hello.js"
backend: http://ocis-hello:9105
10 changes: 0 additions & 10 deletions extensions/proxy/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,6 @@ func DefaultPolicies() []config.Policy {
Endpoint: "/graph-explorer",
Backend: "http://localhost:9135",
},
// if we were using the go micro api gateway we could look up the endpoint in the registry dynamically
{
Endpoint: "/api/v0/accounts",
Backend: "http://localhost:9181",
},
// TODO the lookup needs a better mechanism
{
Endpoint: "/accounts.js",
Backend: "http://localhost:9181",
},
{
Endpoint: "/api/v0/settings",
Backend: "http://localhost:9190",
Expand Down
6 changes: 1 addition & 5 deletions tests/parallelDeployAcceptance/drone/ocis/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ policies:
- endpoint: /archiver
backend: http://localhost:9140
- type: regex
endpoint: /ocs/v[12].php/cloud/(users?|groups)
endpoint: /ocs/v[12].php/cloud/user/signing-key
backend: http://localhost:9110
- endpoint: /ocs/
backend: http://localhost:9140
Expand Down Expand Up @@ -53,10 +53,6 @@ policies:
backend: http://localhost:9120
- endpoint: /graph-explorer
backend: http://localhost:9135
- endpoint: /api/v0/accounts
backend: http://localhost:9181
- endpoint: /accounts.js
backend: http://localhost:9181
- endpoint: /api/v0/settings
backend: http://localhost:9190
- endpoint: /settings.js
Expand Down