Upgraded all libraries, switched to npm, upgraded angular and jdk21
Locusworks Team/portal-webapp/pipeline/head There was a failure building this commit

This commit is contained in:
iparenteau committed 2026-09-04 15:22:35 -05:00
1 parent c2f8e20fad
commit a6df549919
335 files changed
+10923 -12700

No files matched your search

+48 -46
View File
@@ -2,23 +2,41 @@
---
1. Clone the repository from BigMac:
- Add your public key to BigMac account.
- Clone the repository: `git clone "ssh://git@bigmac.northgrum.com:8010/saipt/portal-webapp.git"`
- Clone the repository: `git clone "ssh://git@bigmac.locusworks.net:8010/saipt/portal-webapp.git"`
2. Create/Edit `settings.xml` in your `.m2` folder (see next section for example)
3. This project requires ngas-commons to be built prior to building this application
- Checkout `ngas-commons` (`"ssh://git@bigmac.northgrum.com:8010/saipt/ngas-commons.git"`)
- Change directories into `ngas-commons` and run `mvn clean install`
4. Change directories into the project and run `mvn clean install` (This might take awhile)
5. Once the server launches, you should be able to access the webapp by browsing to `http://localhost:8080/portal/`
## Yarn
---
Yarn is the the new package manager used with node.js in replacement of `npm` it uses the same package.json file.
To download a new client side library use the command `yarn add <package_name> --save`. This will add the files to the `node_modules` library.
Next include the appropriate file into the `assets.js` file inside `portal_client` to make sure it will be injected into the `index.html` file during run time.
The `assets.js` file specifies all the vendor libraries that have to be included into the client code during build.
3. Change directories into the project and run `mvn clean install` (this may take a while).
4. Start the executable Spring Boot application with `java -jar portal_webapp/target/portal_webapp-1.0.0-RELEASE.jar`.
5. Browse to `http://localhost:8080/portal/`.
Application configuration is stored under `${user.home}/.portal` by default. Override this persistent location with the `PORTAL_HOME` environment variable or the `-Dportal.home=/path/to/portal` JVM property. The directory contains `portal.properties`, the AES seed, logger settings, logs, and temporary key files.
Local runs use a persistent H2 database by default. Set `dbType=mysql` in `portal.properties` only when an external MySQL server is intended; H2 and MySQL have separate connection and credential properties.
External MySQL deployments require MySQL Server 8.4 or newer with Connector/J 26.7.0.
## npm
---
npm is used to install the Angular client dependencies declared in `portal_client/package.json`.
The Maven build provisions the supported Node.js LTS and npm versions declared in the root `pom.xml`; a global installation is not required for Maven builds.
From `portal_client`, run `npm ci` for a reproducible install, `npm test` for unit tests, and `npm run build` for the production bundle. Angular CLI discovers application imports and static assets directly; no legacy asset-injection manifest is required.
The `allowScripts` entries in `package.json` approve specific versions of the native Angular build helpers. Review and renew those entries when upgrading the corresponding packages. SockJS remains an explicitly allowed CommonJS dependency for the server's SockJS transport. STOMP uses its ESM entry through the TypeScript path mapping because version 7.3.0's browser export selects UMD.
## Dependency checks
`mvn clean install` runs OWASP Dependency-Check. NVD, RetireJS, and the npm lockfile audit remain enabled; the npm audit includes development dependencies. The Node Package Analyzer skips development dependencies to avoid treating uninstalled native binaries for other platforms as missing application packages.
Sonatype OSS Index requires credentials and is opt-in. Configure a Maven `settings.xml` server with ID `oss-index`, your account username, and API token, then run `mvn clean install -Dportal.ossIndexEnabled=true` to include it.
## H2 tests
---
Tests use an isolated in-memory H2 database through the `portal.database.*` system-property overrides. Production continues to default to MySQL.
Run the common-module datasource test with:
`mvn -pl portal_common -am test`
## Settings.xml
@@ -31,19 +49,19 @@ Sample:
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<proxies>
<proxy>
<id>ngas-proxy</id>
<id>locusworks-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>eastproxy.northgrum.com</host>
<host>eastproxy.locusworks.net</host>
<port>80</port>
<username>(your MyID)</username>
<password>(your login password)</password>
</proxy>
<proxy>
<id>ngas-proxy2</id>
<id>locusworks-proxy2</id>
<active>true</active>
<protocol>https</protocol>
<host>eastproxy.northgrum.com</host>
<host>eastproxy.locusworks.net</host>
<port>80</port>
<username>(your MyID)</username>
<password>(your login password)</password>
@@ -55,29 +73,13 @@ Sample:
<username>root</username>
<password>(mysql root password)</password>
</server>
<server>
<!-- in tomcat conf/tomcat-users.xml specify a user that has role manager-script -->
<id>tomcat-localhost</id>
<username>(manager-script username)</username>
<password>(manager-script password)</password>
</server>
</servers>
<profiles>
<profile>
<id> local-deploy </id>
<properties>
<tomcat-home>C:\development\apache-tomcat-8.5.24-portal</tomcat-home>
<tomcat-version>8.5.24</tomcat-version>
<tomcat-base-url>http://localhost:8080</tomcat-base-url>
</properties>
</profile>
</profiles>
</settings>
```
## Configuring Tomcat
---
Tomcat cannot run on port 80 or 443 unless it is is running as root (big security concern with that). It is suggested to use proxy services like `NGINX` or `Apache` to proxy 80 or 443 traffic to redirect to tomcat
</servers>
</settings>
```
## Running Spring Boot
---
The application is packaged as an executable JAR and does not require a separately installed application server. Spring Boot supplies the embedded web server. For production, NGINX or Apache can proxy ports 80 and 443 to the application on port 8080.
#### NGINX
1. In the default /etc/nginx/conf.d add a file called portal.conf
@@ -91,11 +93,11 @@ Tomcat cannot run on port 80 or 443 unless it is is running as root (big securit
'' close;
}
upstream tomcat {
upstream portal_app {
# Use IP Hash for session persistence
ip_hash;
# List of Tomcat application servers
# List of Portal application instances
server 127.0.0.1:8080;
}
@@ -123,7 +125,7 @@ Tomcat cannot run on port 80 or 443 unless it is is running as root (big securit
# WebSocket configuration
location / {
proxy_pass http://tomcat;
proxy_pass http://portal_app;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;