Updated envar flow
This commit is contained in:
parent
c524c985c1
commit
86c71e0e90
4 changed files with 7 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,4 +4,4 @@ node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
# Env files
|
# Env files
|
||||||
.env
|
.env
|
||||||
.env.development
|
.env.dev
|
||||||
|
|
|
@ -7,6 +7,9 @@ services:
|
||||||
- "80:52026"
|
- "80:52026"
|
||||||
networks:
|
networks:
|
||||||
- dunestorm_dev
|
- dunestorm_dev
|
||||||
|
environment:
|
||||||
|
- CAIRO_PUBLIC_URL=${CAIRO_PUBLIC_URL}
|
||||||
|
- NUBIAN_INTERNAL_URL=${NUBIAN_INTERNAL_URL}
|
||||||
networks:
|
networks:
|
||||||
dunestorm_dev:
|
dunestorm_dev:
|
||||||
external: true
|
external: true
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const { createProxyMiddleware } = require("http-proxy-middleware");
|
const { createProxyMiddleware } = require("http-proxy-middleware");
|
||||||
const port = process.env.PORT ?? 52026;
|
const port = process.env.PORT ?? 52026;
|
||||||
const cairoUrl = process.env.CAIRO_URL ?? "http://cairo.dunestorm.net:52000";
|
const cairoUrl = process.env.CAIRO_PUBLIC_URL;
|
||||||
const nubianUrl = process.env.NUBIAN_URL ?? "http://nubian.dunestorm.net:52001";
|
const nubianUrl = process.env.NUBIAN_INTERNAL_URL;
|
||||||
const app = express();
|
const app = express();
|
||||||
app.use("/", express.static("build"));
|
app.use("/", express.static("build"));
|
||||||
app.use("/cairo", createProxyMiddleware({ target: cairoUrl }));
|
app.use("/cairo", createProxyMiddleware({ target: cairoUrl }));
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Stash extends React.Component {
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.response && error.response.status === 401)
|
if (error.response && error.response.status === 401)
|
||||||
return window.location.replace(
|
return window.location.replace(
|
||||||
`${process.env.REACT_APP_CAIRO_URL}${api.cairo.urls.login}?redirectUri=${window.location.href}`
|
`${process.env.REACT_APP_CAIRO_PUBLIC_URL}${api.cairo.urls.login}?redirectUri=${window.location.href}`
|
||||||
);
|
);
|
||||||
console.error("Auth server not up/configured properly!");
|
console.error("Auth server not up/configured properly!");
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue