Skip to content

Commit

Permalink
Merge branch 'stage'
Browse files Browse the repository at this point in the history
  • Loading branch information
fcv-iteratorIt committed Mar 5, 2024
2 parents 0c668c5 + b949146 commit 5e68b86
Show file tree
Hide file tree
Showing 128 changed files with 11,802 additions and 21,572 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-push-pr.action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: actions/setup-node@v3
name: Set NodeJS version
with:
node-version: 14
node-version: 16
- name: Install packages
run: "npm ci"
- name: Build source
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
trailingComma: "es5",
tabWidth: 4,
printWidth: 90,
printWidth: 120,
semi: true,
singleQuote: false,
useTabs: false,
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# from: https://github.com/Saluki/nestjs-template
FROM node:12-alpine as builder
FROM node:16-alpine as builder

ENV NODE_ENV build

Expand Down
26,387 changes: 8,614 additions & 17,773 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 25 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"typeorm-e2e": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js --config ./ormconfig-e2e.json"
},
"dependencies": {
"@nestjs/axios": "^2.0.0",
"@nestjs/axios": "^3.0.0",
"@chirpstack/chirpstack-api": "4.6.0",
"@grpc/grpc-js": "^1.9.13",
"@nestjs/common": "^9.1.2",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.1.2",
Expand All @@ -41,15 +43,15 @@
"@nestjs/swagger": "^6.1.2",
"@nestjs/typeorm": "^9.0.1",
"@types/bcryptjs": "^2.4.2",
"@types/geojson": "^7946.0.7",
"@types/geojson": "^7946.0.13",
"@types/kafkajs": "^1.9.0",
"@types/passport-saml": "^1.1.3",
"@types/pem": "^1.9.6",
"@types/uuid": "^8.3.0",
"@types/ws": "^8.5.3",
"@types/xml2js": "^0.4.7",
"@types/xml2js": "^0.4.14",
"ajv": "^6.12.6",
"axios": "^1.3.3",
"axios": "^1.6.1",
"axios-cache-adapter": "^2.7.3",
"bcryptjs": "^2.4.3",
"bluebird": "^3.7.2",
Expand All @@ -58,7 +60,8 @@
"class-validator": "^0.14.0",
"compression": "^1.7.4",
"cookie-parser": "^1.4.5",
"crypto-js": "^4.1.1",
"crypto-js": "^4.2.0",
"isolated-vm": "^4.6.0",
"kafkajs": "^2.2.4",
"lodash": "^4.17.20",
"mqtt": "^4.3.7",
Expand All @@ -71,18 +74,17 @@
"passport-saml": "^3.2.4",
"pem": "^1.14.7",
"pg": "^8.5.1",
"protobufjs": "^6.11.3",
"protobufjs": "^6.11.4",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.5.7",
"swagger-ui-express": "^4.1.5",
"typeorm": "^0.3.10",
"uuid": "^8.3.2",
"vm2": "^3.9.18",
"wait-for-expect": "^3.0.2"
},
"devDependencies": {
"@nestjs/cli": "^9.1.4",
"@nestjs/cli": "^9.3.0",
"@nestjs/testing": "^9.1.2",
"@types/bcryptjs": "^2.4.2",
"@types/bluebird": "^3.5.33",
Expand All @@ -92,7 +94,7 @@
"@types/cron": "^1.7.2",
"@types/crypto-js": "^4.1.1",
"@types/express": "^4.17.9",
"@types/geojson": "^7946.0.7",
"@types/geojson": "^7946.0.13",
"@types/kafkajs": "^1.9.0",
"@types/lodash": "^4.14.165",
"@types/node": "^14.14.14",
Expand All @@ -104,16 +106,25 @@
"@types/uuid": "^8.3.0",
"@types/validator": "^13.7.1",
"@types/ws": "^8.5.3",
"@types/xml2js": "^0.4.7",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"@types/xml2js": "^0.4.14",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"eslint": "^8.24.0",
"eslint-config-prettier": "^7.0.0",
"jest": "26.6.3",
"jest": "^29.7.0",
"prettier": "^2.2.1",
"supertest": "^6.0.1",
"ts-jest": "^26.4.4",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.3"
},
"overrides": {
"@babel/traverse": "^7.23.2",
"webpack": "^5.89.0",
"axios": "^1.6.1",
"xml2js": "^0.6.2",
"jsonwebtoken": "^9.0.0",
"debug": "^4.3.4",
"y18n": "6.0.0-alpha.0"
}
}
18 changes: 11 additions & 7 deletions resources/chirpstack-state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ package gw;

// ConnState contains the connection state of a gateway.
message ConnState {
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
// Gateway ID.
// Deprecated: use gateway_id.
bytes gateway_id_legacy = 1;

enum State {
OFFLINE = 0;
ONLINE = 1;
}
// Gateway ID.
string gateway_id = 3;

State state = 2;
enum State {
OFFLINE = 0;
ONLINE = 1;
}

State state = 2;
}
6 changes: 6 additions & 0 deletions src/auth/swagger-auth-decorator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { applyDecorators } from "@nestjs/common";
import { ApiBearerAuth, ApiSecurity } from "@nestjs/swagger";

export function ApiAuth() {
return applyDecorators(ApiBearerAuth(), ApiSecurity("X-API-KEY"));
}
24 changes: 9 additions & 15 deletions src/config/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,23 @@ export default (): any => {
expiresIn: process.env.JWT_EXPIRESIN || "9h",
},
backend: {
baseurl:
process.env.BACKEND_BASEURL || "https://test-os2iot-backend.os2iot.dk",
deviceStatsIntervalInDays:
parseInt(process.env.DEVICE_STATS_INTERVAL_IN_DAYS, 10) || 29,
baseurl: process.env.BACKEND_BASEURL || "https://localhost:3000",
deviceStatsIntervalInDays: parseInt(process.env.DEVICE_STATS_INTERVAL_IN_DAYS, 10) || 29,
},
kombit: {
entryPoint:
process.env.KOMBIT_ENTRYPOINT ||
"https://adgangsstyring.eksterntest-stoettesystemerne.dk/runtime/saml2/issue.idp",
"https://adgangsstyring.eksterntest-stoettesystemerne.dk/runtime/saml2/issue.idp",
certificatePublicKey: process.env.KOMBIT_CERTIFICATEPUBLICKEY || "INSERT_KOMBIT_CERT", // Public certificate from Kombit Test server
certificatePrivateKey: process.env.KOMBIT_CERTIFICATEPRIVATEKEY || null,
roleUri:
process.env.KOMBIT_ROLE_NAME ||
"http://os2iot.dk/roles/usersystemrole/adgang/",
roleUri: process.env.KOMBIT_ROLE_NAME || "http://os2iot.dk/roles/usersystemrole/adgang/",
},
chirpstack: {
jwtsecret: process.env.CHIRPSTACK_JWTSECRET || "verysecret",
apikey: process.env.CHIRPSTACK_API_KEY || "apikey",
hostname: process.env.CHIRPSTACK_HOSTNAME || "localhost",
port: process.env.CHIRPSTACK_PORT || 8080,
},
logLevels: process.env.LOG_LEVEL
? GetLogLevels(process.env.LOG_LEVEL)
: GetLogLevels("debug"),
logLevels: process.env.LOG_LEVEL ? GetLogLevels(process.env.LOG_LEVEL) : GetLogLevels("debug"),
email: {
host: process.env.EMAIL_HOST || "smtp.ethereal.email",
port: process.env.EMAIL_PORT || 587,
Expand All @@ -45,9 +41,7 @@ export default (): any => {
* Can be formatted to show a user-friendly name before the e-mail.
* E.g. "OS2iot <[email protected]>"
*/
from: process.env.EMAIL_FROM
? formatEmail(process.env.EMAIL_FROM)
: "OS2iot [email protected]",
from: process.env.EMAIL_FROM ? formatEmail(process.env.EMAIL_FROM) : "OS2iot [email protected]",
},
frontend: {
baseurl: process.env.FRONTEND_BASEURL || "http://localhost:8081",
Expand Down
Loading

0 comments on commit 5e68b86

Please sign in to comment.