Unverified Commit 8fd97e61 authored by Christopher Guindon's avatar Christopher Guindon Committed by GitHub
Browse files

fix proxy settings (#128)



* fix proxy settings
Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>

* create eclipse.app.base_url
Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>

* follow naming conversion
Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>

* follow naming conversion
Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>
parent 42a33bd9
......@@ -6,36 +6,14 @@ server {
client_max_body_size 16m;
client_body_buffer_size 128k;
# don't cache it
proxy_no_cache 1;
location /api {
# don't cache it
proxy_no_cache 1;
# even if cached, don't try to use it
proxy_cache_bypass 1;
# even if cached, don't try to use it
proxy_cache_bypass 1;
location = /api {
return 302 /api/;
}
location /login/ {
proxy_pass http://localhost:8090/login; # note the trailing slash here, it matters!
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# kill cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
}
location = /api/login {
return 302 /login/;
}
location /api/ {
proxy_pass http://localhost:8090/; # note the trailing slash here, it matters!
proxy_pass http://localhost:8090/api; # note the trailing slash here, it matters!
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
......
......@@ -5,4 +5,6 @@ quarkus.oidc.auth-server-url=http://host.docker.internal:8080/auth/realms/rem_re
quarkus.datasource.jdbc.url = jdbc:mariadb://host.docker.internal/rem_quarkus_api
quarkus.oidc.client-id=sample
quarkus.oidc.credentials.client-secret.value=sample
security.token.salt=somesaltvalue
\ No newline at end of file
security.token.salt=somesaltvalue
eclipse.app.base-url=https://www.rem.docker/
\ No newline at end of file
......@@ -23,6 +23,8 @@ import javax.ws.rs.core.Response;
import io.quarkus.security.Authenticated;
import io.smallrye.jwt.auth.principal.DefaultJWTCallerPrincipal;
import org.eclipse.microprofile.config.inject.ConfigProperty;
/**
* Handles OIDC routing for the request.
*
......@@ -31,11 +33,14 @@ import io.smallrye.jwt.auth.principal.DefaultJWTCallerPrincipal;
@Path("")
public class OIDCResource extends AbstractRESTResource {
@ConfigProperty(name = "eclipse.app.base-url", defaultValue = "/")
String baseUrl;
@GET
@Authenticated
@Path("/login")
public Response routeLogin() throws URISyntaxException {
return redirect("/");
return redirect(baseUrl);
}
/**
......@@ -46,7 +51,7 @@ public class OIDCResource extends AbstractRESTResource {
@GET
@Path("/logout")
public Response routeLogout() throws URISyntaxException {
return redirect("/");
return redirect(baseUrl);
}
@GET
......@@ -83,7 +88,6 @@ public class OIDCResource extends AbstractRESTResource {
return Response.temporaryRedirect(new URI(location)).build();
}
public static class InfoWrapper {
String name;
String givenName;
......
......@@ -16,6 +16,9 @@ quarkus.datasource.jdbc.max-size = 15
eclipse.db.default.limit=25
eclipse.db.default.limit.max=100
## APP Settings
eclipse.app.base-url=https://membership.eclipse.org/
## OIDC Connection/Authentication Info
quarkus.oauth2.enabled=false
quarkus.oidc.application-type=web-app
......@@ -24,6 +27,7 @@ quarkus.oidc.roles.source=accesstoken
quarkus.oidc.authentication.redirect-path=/api/login
quarkus.oidc.logout.post-logout-path=/
quarkus.oidc.logout.path=/api/logout
quarkus.resteasy.path=/api
## Recreate DB profile (easy to trigger in remote envs)
%dbfresh.quarkus.hibernate-orm.database.generation=drop-and-create
......
......@@ -81,6 +81,7 @@ export function getCurrentMode() {
'//membership-staging.eclipse.org',
'//membership.eclipse.org/',
'//www.rem.docker/',
'//nginx.rem.docker/'
].some((value) => {
return window.location.href.indexOf(value) !== -1;
});
......
......@@ -68,7 +68,7 @@ class SignIn extends React.Component {
{getCurrentMode() === MODE_REACT_API && (
<a
href="/login"
href="/api/login"
className="btn btn-secondary"
onClick={() => this.setState({ needLoading: true })}
>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment