Skip to content

Commit

Permalink
Merge pull request #7516 from wso2/changeset-release/master
Browse files Browse the repository at this point in the history
[Release] [GitHub Action] Update package versions
  • Loading branch information
brionmario authored Feb 6, 2025
2 parents 5ee3218 + f96389a commit c88f752
Show file tree
Hide file tree
Showing 5 changed files with 220 additions and 110 deletions.
108 changes: 0 additions & 108 deletions .changeset/khaki-eyes-film.md

This file was deleted.

109 changes: 109 additions & 0 deletions apps/console/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,114 @@
# @wso2is/console

## 2.41.0

### Minor Changes

- [#7484](https://github.com/wso2/identity-apps/pull/7484) [`935b7aba2e1cc618588ec76325945dc00c12cba5`](https://github.com/wso2/identity-apps/commit/935b7aba2e1cc618588ec76325945dc00c12cba5) Thanks [@brionmario](https://github.com/brionmario)! - This pull request introduces support for a configurable proxy context path across multiple files in the project. The changes ensure that the application can dynamically handle different proxy context paths based on the server configuration.

Ex: The My Account can be hosted under `https://is.dev.wso2.com/auth/t/brionmario.com/myaccount`.
⚠️ Note that `auth` is the context path.

#### Pre-requisites

We currently need the following NGINX configuration.

- `auth` is the proxy context path.
- `https://is.dev.wso2.com` is the server host.

```nginx
upstream ssl.is.dev.wso2.com {
server 127.0.0.1:9443;
ip_hash;
}

server {
listen 443 ssl;
server_name is.dev.wso2.com;
ssl_certificate /opt/homebrew/etc/nginx/ssl/certificate.crt;
ssl_certificate_key /opt/homebrew/etc/nginx/ssl/privateKey.key;

location /auth/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
proxy_pass https://ssl.is.dev.wso2.com/;

# Dynamically rewrite cookie paths based on the tenant
proxy_cookie_path ~^/(/)? /auth/$1;
proxy_cookie_path / /auth;

# Match and rewrite tenant-specific cookie paths
proxy_cookie_path ~^/auth/(t/[^/]+)/ /auth/$1;

proxy_redirect https://is.dev.wso2.com/auth/ https://is.dev.wso2.com/auth/;
proxy_redirect https://is.dev.wso2.com/ https://is.dev.wso2.com/auth/;
proxy_redirect https://is.dev.wso2.com:443/ https://is.dev.wso2.com/auth/;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

location /console {
rewrite ^/console(.*)$ /auth/console$1 last;

proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

proxy_read_timeout 5m;
proxy_send_timeout 5m;

# Forward the rewritten path to the backend
proxy_pass https://ssl.is.dev.wso2.com/;

# Dynamically handle tenant-specific redirects
proxy_redirect ~^https://is\.dev\.wso2\.com/auth/(t/[^/]+)/console https://is.dev.wso2.com/console;
}

location /myaccount {
rewrite ^/myaccount(.*)$ /auth/myaccount$1 last;

proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

proxy_read_timeout 5m;
proxy_send_timeout 5m;

# Forward the rewritten path to the backend
proxy_pass https://ssl.is.dev.wso2.com/;

# Dynamically handle tenant-specific redirects
proxy_redirect ~^https://is\.dev\.wso2\.com/auth/(t/[^/]+)/myaccount https://is.dev.wso2.com/myaccount;
}
}
```

#### Consuming the context path

Context path configuration is consumed in different ways.

1. Get the `proxy context` path defined in `server.proxy_context_path` using the Java Util in the JSP files.

```js
var proxyContextPathGlobal =
"<%=ServerConfiguration.getInstance().getFirstProperty(PROXY_CONTEXT_PATH)%>";
```

2. Additionally, can override the context path per app with a TOML config.

```toml
[console]
proxy_context_path = "auth"
```

## 2.40.30

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/console/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@wso2is/console",
"version": "2.40.30",
"version": "2.41.0",
"description": "WSO2 Identity Server Console",
"author": "WSO2",
"license": "Apache-2.0",
Expand Down
109 changes: 109 additions & 0 deletions apps/myaccount/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,114 @@
# @wso2is/myaccount

## 2.17.0

### Minor Changes

- [#7484](https://github.com/wso2/identity-apps/pull/7484) [`935b7aba2e1cc618588ec76325945dc00c12cba5`](https://github.com/wso2/identity-apps/commit/935b7aba2e1cc618588ec76325945dc00c12cba5) Thanks [@brionmario](https://github.com/brionmario)! - This pull request introduces support for a configurable proxy context path across multiple files in the project. The changes ensure that the application can dynamically handle different proxy context paths based on the server configuration.

Ex: The My Account can be hosted under `https://is.dev.wso2.com/auth/t/brionmario.com/myaccount`.
⚠️ Note that `auth` is the context path.

#### Pre-requisites

We currently need the following NGINX configuration.

- `auth` is the proxy context path.
- `https://is.dev.wso2.com` is the server host.

```nginx
upstream ssl.is.dev.wso2.com {
server 127.0.0.1:9443;
ip_hash;
}

server {
listen 443 ssl;
server_name is.dev.wso2.com;
ssl_certificate /opt/homebrew/etc/nginx/ssl/certificate.crt;
ssl_certificate_key /opt/homebrew/etc/nginx/ssl/privateKey.key;

location /auth/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
proxy_pass https://ssl.is.dev.wso2.com/;

# Dynamically rewrite cookie paths based on the tenant
proxy_cookie_path ~^/(/)? /auth/$1;
proxy_cookie_path / /auth;

# Match and rewrite tenant-specific cookie paths
proxy_cookie_path ~^/auth/(t/[^/]+)/ /auth/$1;

proxy_redirect https://is.dev.wso2.com/auth/ https://is.dev.wso2.com/auth/;
proxy_redirect https://is.dev.wso2.com/ https://is.dev.wso2.com/auth/;
proxy_redirect https://is.dev.wso2.com:443/ https://is.dev.wso2.com/auth/;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

location /console {
rewrite ^/console(.*)$ /auth/console$1 last;

proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

proxy_read_timeout 5m;
proxy_send_timeout 5m;

# Forward the rewritten path to the backend
proxy_pass https://ssl.is.dev.wso2.com/;

# Dynamically handle tenant-specific redirects
proxy_redirect ~^https://is\.dev\.wso2\.com/auth/(t/[^/]+)/console https://is.dev.wso2.com/console;
}

location /myaccount {
rewrite ^/myaccount(.*)$ /auth/myaccount$1 last;

proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

proxy_read_timeout 5m;
proxy_send_timeout 5m;

# Forward the rewritten path to the backend
proxy_pass https://ssl.is.dev.wso2.com/;

# Dynamically handle tenant-specific redirects
proxy_redirect ~^https://is\.dev\.wso2\.com/auth/(t/[^/]+)/myaccount https://is.dev.wso2.com/myaccount;
}
}
```

#### Consuming the context path

Context path configuration is consumed in different ways.

1. Get the `proxy context` path defined in `server.proxy_context_path` using the Java Util in the JSP files.

```js
var proxyContextPathGlobal =
"<%=ServerConfiguration.getInstance().getFirstProperty(PROXY_CONTEXT_PATH)%>";
```

2. Additionally, can override the context path per app with a TOML config.

```toml
[console]
proxy_context_path = "auth"
```

## 2.16.28

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/myaccount/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@wso2is/myaccount",
"version": "2.16.28",
"version": "2.17.0",
"description": "WSO2 Identity Server My Account",
"author": "WSO2",
"license": "Apache-2.0",
Expand Down

0 comments on commit c88f752

Please sign in to comment.