Compare commits
5 Commits
4a1d95e818
...
8a07c8afe4
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a07c8afe4 | |||
| c3638870b1 | |||
| 1dd04b8320 | |||
| 9ea1e04472 | |||
| 3704e4d6fc |
@@ -119,6 +119,7 @@ const main = async () => {
|
|||||||
if (!process.env.WEBHOOK_URL) {
|
if (!process.env.WEBHOOK_URL) {
|
||||||
// await sendEmail(emailData);
|
// await sendEmail(emailData);
|
||||||
} else {
|
} else {
|
||||||
|
log.fatal({ stack: err.stack }, err.message);
|
||||||
await sendNotify({
|
await sendNotify({
|
||||||
module: "system",
|
module: "system",
|
||||||
subModule: "fatalCrash",
|
subModule: "fatalCrash",
|
||||||
|
|||||||
12
drizzle-dev.config.ts
Normal file
12
drizzle-dev.config.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { defineConfig } from "drizzle-kit";
|
||||||
|
|
||||||
|
const dbURL = `postgres://${process.env.DATABASE_USER}:${process.env.DATABASE_PASSWORD}@${process.env.DATABASE_HOST}:${process.env.DATABASE_PORT}/${process.env.DATABASE_DB}`;
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
dialect: "postgresql",
|
||||||
|
schema: "./app/src/pkg/db/schema",
|
||||||
|
out: "./migrations",
|
||||||
|
dbCredentials: { url: dbURL },
|
||||||
|
// verbose: true, // optional, logs more details
|
||||||
|
//strict: true, // optional, prevents unsafe operations
|
||||||
|
});
|
||||||
@@ -4,7 +4,7 @@ const dbURL = `postgres://${process.env.DATABASE_USER}:${process.env.DATABASE_PA
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
dialect: "postgresql",
|
dialect: "postgresql",
|
||||||
schema: "./app/src/pkg/db/schema",
|
schema: "./dist/pkg/db/schema",
|
||||||
out: "./migrations",
|
out: "./migrations",
|
||||||
dbCredentials: { url: dbURL },
|
dbCredentials: { url: dbURL },
|
||||||
// verbose: true, // optional, logs more details
|
// verbose: true, // optional, logs more details
|
||||||
|
|||||||
@@ -9,3 +9,71 @@ This is the Approved way of running via windows and utlizing HTTPS
|
|||||||
This process is optional and not needed to run the app.
|
This process is optional and not needed to run the app.
|
||||||
|
|
||||||
Please note that if you plan to utlize the scanner app you must use IIS to run as PWA apps requires ssl
|
Please note that if you plan to utlize the scanner app you must use IIS to run as PWA apps requires ssl
|
||||||
|
|
||||||
|
## Creating the application
|
||||||
|
|
||||||
|
1. Open IIS
|
||||||
|
2. Expand the plant and select application pools
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. Right click and create application
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. Name is Logistics Support Tool
|
||||||
|
|
||||||
|
- Change .NET CLR verion to not managed
|
||||||
|
- leave the rest as default
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Create the website
|
||||||
|
|
||||||
|
1. Expand the Sites
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. Right click on default site and click "Add Application..."
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. Fill out the form like below
|
||||||
|
|
||||||
|
- For the Alias Enter LST
|
||||||
|
- Change the Application pool to Logistics Support Tool
|
||||||
|
- Change the phycical path to the path that you have the lst wrapper in, below is the example we used to install the app from the install instructions.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
E:\LST\lstWrapper
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Making sure websocket is enabled
|
||||||
|
|
||||||
|
By default websocket is disbabled and we need this in order to run the app.
|
||||||
|
|
||||||
|
Open:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
C:\Windows\System32\inetsrv\config\applicationHost.config
|
||||||
|
```
|
||||||
|
|
||||||
|
Search inside for the section definition:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<section name="webSocket" overrideModeDefault="Deny" />
|
||||||
|
```
|
||||||
|
|
||||||
|
Change it to:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<section name="webSocket" overrideModeDefault="Allow" />
|
||||||
|
```
|
||||||
|
|
||||||
|
Save and restart IIS:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
iisreset
|
||||||
|
```
|
||||||
|
|||||||
BIN
lstDocs/docs/install-extras/img/addApplication.png
Normal file
BIN
lstDocs/docs/install-extras/img/addApplication.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
lstDocs/docs/install-extras/img/application.png
Normal file
BIN
lstDocs/docs/install-extras/img/application.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.1 KiB |
BIN
lstDocs/docs/install-extras/img/applicationPools.png
Normal file
BIN
lstDocs/docs/install-extras/img/applicationPools.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 112 KiB |
BIN
lstDocs/docs/install-extras/img/createApplicationPool.png
Normal file
BIN
lstDocs/docs/install-extras/img/createApplicationPool.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
lstDocs/docs/install-extras/img/defaultsite.png
Normal file
BIN
lstDocs/docs/install-extras/img/defaultsite.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
BIN
lstDocs/docs/install-extras/img/pool.png
Normal file
BIN
lstDocs/docs/install-extras/img/pool.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
@@ -30,6 +30,19 @@ Get the latest build **From Azure**.
|
|||||||
- [Postgres](https://www.postgresql.org/download/);
|
- [Postgres](https://www.postgresql.org/download/);
|
||||||
- This is the DB of choice.
|
- This is the DB of choice.
|
||||||
|
|
||||||
|
## Other Items
|
||||||
|
|
||||||
|
### Firewall rules
|
||||||
|
|
||||||
|
If you will be using lst app on a tablet or scanner you will need to have 443 open
|
||||||
|
please request this from IT
|
||||||
|
|
||||||
|
- Logistics network as the source
|
||||||
|
- Alpla prod server ip as the destination
|
||||||
|
- ports to open
|
||||||
|
- 443 # to access via https://
|
||||||
|
- 3000 # This is in case you need to go direct to the app utlizing an ip:port
|
||||||
|
|
||||||
## Creating the app
|
## Creating the app
|
||||||
|
|
||||||
Create a new directory where all you will host the app recommeneded
|
Create a new directory where all you will host the app recommeneded
|
||||||
@@ -52,6 +65,7 @@ LST/
|
|||||||
│ ├── main.js
|
│ ├── main.js
|
||||||
├── frontend/
|
├── frontend/
|
||||||
│ ├── dist # Frontend app
|
│ ├── dist # Frontend app
|
||||||
|
│ ├── public
|
||||||
├── lstDocs/
|
├── lstDocs/
|
||||||
│ ├── build # Docs on the entire app
|
│ ├── build # Docs on the entire app
|
||||||
├── lstWrapper/
|
├── lstWrapper/
|
||||||
@@ -67,6 +81,11 @@ LST/
|
|||||||
├── package-lock.json
|
├── package-lock.json
|
||||||
├── README.md
|
├── README.md
|
||||||
├── CHANGELOG.md
|
├── CHANGELOG.md
|
||||||
|
├── Dockerfile
|
||||||
|
├── docker-compose.yml
|
||||||
|
├── drizzle.config.ts
|
||||||
|
├── migrations # for all the db migrations
|
||||||
|
├── LICENSE
|
||||||
```
|
```
|
||||||
|
|
||||||
## Doing the intial setup
|
## Doing the intial setup
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
<!-- Enable WebSockets -->
|
<!-- Enable WebSockets (may require unlocking at host level) -->
|
||||||
<webSocket enabled="true" receiveBufferLimit="4194304" pingInterval="00:01:00" />
|
<webSocket enabled="true" receiveBufferLimit="4194304" pingInterval="00:01:00" />
|
||||||
|
|
||||||
<rewrite>
|
<rewrite>
|
||||||
<rules>
|
<rules>
|
||||||
<!-- Proxy all requests starting with /lst/ to the .NET wrapper (port 4000) -->
|
|
||||||
<rule name="Proxy to Wrapper" stopProcessing="true">
|
<rule name="Proxy to Wrapper" stopProcessing="true">
|
||||||
<match url="^lst/(.*)" />
|
<match url="^lst/(.*)" />
|
||||||
<conditions>
|
<conditions>
|
||||||
<!-- Skip this rule if it's a WebSocket request -->
|
|
||||||
<add input="{HTTP_UPGRADE}" pattern="^WebSocket$" negate="true" />
|
<add input="{HTTP_UPGRADE}" pattern="^WebSocket$" negate="true" />
|
||||||
</conditions>
|
</conditions>
|
||||||
<action type="Rewrite" url="http://localhost:4000/{R:1}" />
|
<action type="Rewrite" url="http://localhost:4000/{R:1}" />
|
||||||
@@ -23,18 +21,25 @@
|
|||||||
</rewrite>
|
</rewrite>
|
||||||
|
|
||||||
<staticContent>
|
<staticContent>
|
||||||
|
<remove fileExtension=".js" />
|
||||||
<mimeMap fileExtension=".js" mimeType="application/javascript" />
|
<mimeMap fileExtension=".js" mimeType="application/javascript" />
|
||||||
|
<remove fileExtension=".mjs" />
|
||||||
<mimeMap fileExtension=".mjs" mimeType="application/javascript" />
|
<mimeMap fileExtension=".mjs" mimeType="application/javascript" />
|
||||||
|
<remove fileExtension=".css" />
|
||||||
<mimeMap fileExtension=".css" mimeType="text/css" />
|
<mimeMap fileExtension=".css" mimeType="text/css" />
|
||||||
|
<remove fileExtension=".svg" />
|
||||||
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
|
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
|
||||||
</staticContent>
|
</staticContent>
|
||||||
|
|
||||||
<handlers>
|
<handlers>
|
||||||
<!-- Let AspNetCoreModule handle all requests -->
|
|
||||||
<remove name="WebSocketHandler" />
|
<remove name="WebSocketHandler" />
|
||||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
||||||
</handlers>
|
</handlers>
|
||||||
|
|
||||||
<aspNetCore processPath="dotnet" arguments=".\lstWrapper.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
|
<aspNetCore processPath="dotnet"
|
||||||
|
arguments=".\lstWrapper.dll"
|
||||||
|
stdoutLogEnabled="false"
|
||||||
|
stdoutLogFile=".\logs\stdout"
|
||||||
|
hostingModel="inprocess" />
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
"docker": "docker compose up --build --force-recreate -d",
|
"docker": "docker compose up --build --force-recreate -d",
|
||||||
"commit": "cz",
|
"commit": "cz",
|
||||||
"deploy": "standard-version --conventional-commits && npm run build",
|
"deploy": "standard-version --conventional-commits && npm run build",
|
||||||
"db:migrate": "npx drizzle-kit push",
|
"db:migrate": "npx drizzle-kit push --config=drizzle-dev.config.ts",
|
||||||
"db:generate": "npx drizzle-kit generate"
|
"db:generate": "npx drizzle-kit generate --config=drizzle-dev.config.ts"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ param (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Example string to run with the parameters in it.
|
# Example string to run with the parameters in it.
|
||||||
# .\scripts\services.ps1 -serviceName "LST_app" -option "install" -appPath "E:\LST" -description "Logistics Support Tool in go" -command "E:\LST\app\lst_app.exe"
|
# .\scripts\services.ps1 -serviceName "LST_ctl" -option "install" -appPath "E:\LST" -description "Logistics Support Tool controller" -command "E:\LST\controller\lst_app.exe"
|
||||||
|
# .\scripts\services.ps1 -serviceName "LST_app" -option "install" -appPath "E:\LST" -description "Logistics Support Tool" -command "run start"
|
||||||
|
|
||||||
$nssmPath = $AppPath + "\nssm.exe"
|
$nssmPath = $AppPath + "\nssm.exe"
|
||||||
$npmPath = "C:\Program Files\nodejs\npm.cmd" # Path to npm.cmd
|
$npmPath = "C:\Program Files\nodejs\npm.cmd" # Path to npm.cmd
|
||||||
|
|||||||
Reference in New Issue
Block a user