Skip to content

Commit

Permalink
Changed webapp ports
Browse files Browse the repository at this point in the history
  • Loading branch information
UO282476 authored and UO282476 committed May 2, 2023
1 parent a807d7b commit 3201d06
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 29 deletions.
4 changes: 2 additions & 2 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
- /etc/letsencrypt/live/lomapen1a.cloudns.ph/privkey.pem:/app/certificates/privkey.pem
- /etc/letsencrypt/live/lomapen1a.cloudns.ph/fullchain.pem:/app/certificates/fullchain.pem
ports:
- "80:80"
- "443:443"
- "3080:3080"
- "3443:3443"
depends_on:
- restapi
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ services:
webapp:
build: ./webapp
ports:
- "80:80"
- "443:443"
- "3080:3080"
- "3443:3443"
depends_on:
- restapi
prometheus:
Expand Down
2 changes: 1 addition & 1 deletion restapi/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let host = process.env.host || "localhost";
api.use(
cors({
credentials: true,
origin: ["https://" + host + ":443"],
origin: ["https://" + host + ":3443"],
allowedHeaders: ["Content-Type", "Authorization"],
preflightContinue: true,
})
Expand Down
8 changes: 4 additions & 4 deletions restapi/src/repositories/pods/PodSessionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class PodSessionManager {
Assertion.exists(provider, "A provider must be given.");
provider = decodeURIComponent(provider);

let redirect = "https://" + host + ":443/api/login/success";
let redirect = "https://" + host + ":3443/api/login/success";

const session = new Session();
req.session.solidSessionId = session.info.sessionId;
Expand All @@ -40,7 +40,7 @@ export class PodSessionManager {
},
});
} catch (err) {
res.redirect("https://" + host + ":443/login/fail");
res.redirect("https://" + host + ":3443/login/fail");
}
}

Expand All @@ -52,12 +52,12 @@ export class PodSessionManager {
let solidSession = await getSessionFromStorage(sessionId);

await solidSession?.handleIncomingRedirect(
`https://${host}:443${this.handle}${req.url}`
`https://${host}:3443${this.handle}${req.url}`
);

await PodManager.permissionManager.setupPod(sessionId);

return res.redirect("https://" + host + ":443/map");
return res.redirect("https://" + host + ":3443/map");
}

public async logout(req: any, res: Response): Promise<any> {
Expand Down
2 changes: 1 addition & 1 deletion webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app
#Install the dependencies
RUN npm install

ARG API_URI="https://20.13.141.12:443/api"
ARG API_URI="https://20.13.141.12:5443/api"
ENV REACT_APP_API_URI=$API_URI

ARG HOST_URI="20.13.141.12"
Expand Down
4 changes: 2 additions & 2 deletions webapp/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const express = require('express');
let expressStaticGzip = require('express-static-gzip');
const path = require('path');

const portHttp = 80;
const portHttps = 443;
const portHttp = 3080;
const portHttps = 3443;

//Load certificates
let privateKey = fs.readFileSync("certificates/privkey.pem");
Expand Down
14 changes: 0 additions & 14 deletions webapp/server.ts

This file was deleted.

2 changes: 1 addition & 1 deletion webapp/src/components/mainPage/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function LoginForm(props: LoginFormProps): JSX.Element {
const [cookies, setCookie] = useCookies();

const [idp, setIdp] = useState("");
const [currentUrl, setCurrentUrl] = useState("http://localhost:443/map");
const [currentUrl, setCurrentUrl] = useState("https://localhost:3443/map");

const [notificationStatus, setNotificationStatus] = useState(false);
const [notification, setNotification] = useState<NotificationType>({ severity: 'warning', message: '' });
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/mainPage/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ function LoggedNavbar(props: LogoutProps) {
let host = process.env.host || "localhost";
let url = window.location.href;
if (url.includes("https")) {
return "https://" + host + ":443/map"
return "https://" + host + ":3443/map"
} else {
return "http://" + host + ":80/map"
return "http://" + host + ":3080/map"
}

}
Expand Down

0 comments on commit 3201d06

Please sign in to comment.