Skip to content

Commit 3bb4cc1

Browse files
committed
Configuration with alternative host proxyman.local instead of localhost name as requests to localhost are bypassing configured proxies.
1 parent 1c7e5b2 commit 3bb4cc1

File tree

4 files changed

+21
-561
lines changed

4 files changed

+21
-561
lines changed

backend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To use proxyman for debgging, add the following lines to `/etc/hosts`:
1919
::1 proxyman.local
2020
```
2121
Some browsers do not forward any requests to `localhost`, see [Proxyman Documentation](https://docs.proxyman.io/troubleshooting/couldnt-see-any-request-from-localhost-server) for more information.
22-
22+
Caveat: `Proxyman` seems to modify some requests and invalidate JWT signatures. To be confirmed.
2323

2424

2525
### Accessing Keycloak (Port 8180)

backend/src/main/resources/application.properties

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,28 @@ hub.public-root-path=${quarkus.http.root-path}
1111

1212
# Connection Params for Keycloak Public Client (quarkus.oidc.auth-server-url may use network-private hostname)
1313
# `public-url` is used in the frontend (js), `local-url` in the backend. Maybe the same URL, but does not have to be.
14+
15+
# If using proxyman.local for use with proxyman, start keycloak separately, see docker-compose.yml
16+
# uncomment to use proxyman.local setup
1417
hub.keycloak.public-url=http://localhost:8180
1518
hub.keycloak.local-url=http://localhost:8180
19+
20+
#hub.keycloak.public-url=http://proxyman.local:8180
21+
#hub.keycloak.local-url=http://proxyman.local:8180
22+
#quarkus.oidc.auth-server-url=http://proxyman.local:8180/realms/cryptomator
1623
hub.keycloak.realm=cryptomator
1724

1825
hub.managed-instance=false
1926

2027
quarkus.resteasy-reactive.path=/api
2128
%test.quarkus.resteasy-reactive.path=/
2229

30+
# uncomment to use proxyman.local setup
31+
quarkus.http.host=proxyman.local
2332
quarkus.http.port=8080
33+
quarkus.http.access-log.enabled=true
34+
%dev.quarkus.log.level=INFO
35+
#%dev.quarkus.log.level=TRACE
2436

2537
quarkus.oidc.application-type=service
2638
quarkus.oidc.client-id=cryptomatorhub
@@ -70,15 +82,15 @@ quarkus.flyway.locations=classpath:org/cryptomator/hub/flyway
7082

7183
# Allow cross-origin requests in DEV profile
7284
%dev.quarkus.http.cors=true
73-
%dev.quarkus.http.cors.origins=http://localhost:3000,http//localhost:8080
85+
%dev.quarkus.http.cors.origins=http://localhost:3000,http//localhost:8080,http://proxyman.local:3000,http//proxyman.local:8080
7486

7587
%test.quarkus.application.version=TEST_VERSION_3000
7688

7789
# HTTP Security Headers see e.g. https://owasp.org/www-project-secure-headers/#div-bestpractices
7890
quarkus.http.header."Content-Security-Policy".value=default-src 'self'; connect-src 'self' api.cryptomator.org; object-src 'none'; child-src 'self'; img-src * data:; frame-ancestors 'none'
79-
%dev.quarkus.http.header."Content-Security-Policy".value=default-src 'self'; connect-src 'self' api.cryptomator.org localhost:8180; object-src 'none'; child-src 'self'; img-src * data:; frame-ancestors 'none'
91+
%dev.quarkus.http.header."Content-Security-Policy".value=default-src 'self'; connect-src 'self' api.cryptomator.org localhost:8180 proxyman.local:8180; object-src 'none'; child-src 'self'; img-src * data:; frame-ancestors 'none'
8092
# dev-ui needs very permissive CSP:
81-
# %dev.quarkus.http.header."Content-Security-Policy".value=default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data:; connect-src 'self' api.cryptomator.org localhost:8180;
93+
# %dev.quarkus.http.header."Content-Security-Policy".value=default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data:; connect-src 'self' api.cryptomator.org localhost:8180 proxyman.local:8180;
8294
quarkus.http.header."Referrer-Policy".value=no-referrer
8395
quarkus.http.header."Strict-Transport-Security".value=max-age=31536000; includeSubDomains
8496
quarkus.http.header."X-Content-Type-Options".value=nosniff

0 commit comments

Comments
 (0)