Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Fabian Stamm | 8135190cd8 | |
Fabian Stamm | abe9bb28a4 | |
Fabian Stamm | 99845a7b94 | |
Fabian Stamm | 60b0c2f577 | |
Fabian Stamm | 58e4ab1886 | |
Fabian Stamm | 26f9b8d208 |
|
@ -17,8 +17,8 @@ jobs:
|
|||
steps:
|
||||
- uses: https://github.com/earthly/actions-setup@v1
|
||||
with:
|
||||
version: v0.7.20
|
||||
- uses: actions/checkout@v2
|
||||
version: v0.8.0
|
||||
- uses: actions/checkout@v4
|
||||
- name: Put back the git branch into git (Earthly uses it for tagging)
|
||||
run: |
|
||||
branch=""
|
||||
|
|
|
@ -5,6 +5,7 @@ database=openauth
|
|||
[core]
|
||||
name = OpenAuthService
|
||||
secret = dev
|
||||
url=http://localhost:3000
|
||||
|
||||
[web]
|
||||
port = 3000
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
"@hibas123/nodeloggingserver_client": "^1.1.2",
|
||||
"@hibas123/openauth-internalapi": "workspace:^",
|
||||
"@hibas123/openauth-views-v1": "workspace:^",
|
||||
"@hibas123/safe_mongo": "^2.1.0",
|
||||
"@hibas123/safe_mongo": "2.0.1",
|
||||
"@simplewebauthn/server": "^7.2.0",
|
||||
"body-parser": "^1.20.2",
|
||||
"compression": "^1.7.4",
|
||||
|
@ -64,7 +64,7 @@
|
|||
"joi": "^17.11.0",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"moment": "^2.29.4",
|
||||
"mongodb": "^6.3.0",
|
||||
"mongodb": "^5.2.0",
|
||||
"node-rsa": "^1.1.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"qrcode": "^1.5.3",
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
import SafeMongo from "@hibas123/safe_mongo";
|
||||
import Config from "./config";
|
||||
let dbname = "openauth";
|
||||
let host = "localhost";
|
||||
if (Config.database) {
|
||||
if (Config.database.database) dbname = Config.database.database;
|
||||
if (Config.database.host) host = Config.database.host;
|
||||
}
|
||||
if (Config.core.dev) dbname += "_dev";
|
||||
|
||||
let auth = undefined;
|
||||
if (Config.database.username) {
|
||||
auth = {
|
||||
username: Config.database.username,
|
||||
password: Config.database.password
|
||||
}
|
||||
|
||||
const host = Config.database.host || "localhost";
|
||||
// const port = Config.database.port || "27017";
|
||||
const port = "27017";
|
||||
const database = Config.database.database || "openauth";
|
||||
const url = new URL(`mongodb://${host}:${port}/${database}`);
|
||||
|
||||
const user = Config.database.username || undefined;
|
||||
const passwd = Config.database.password || undefined;
|
||||
|
||||
if (user) {
|
||||
url.username = user;
|
||||
if (passwd) url.password = passwd;
|
||||
}
|
||||
|
||||
const DB = new SafeMongo("mongodb://" + host, dbname, {
|
||||
auth
|
||||
});
|
||||
|
||||
const DB = new SafeMongo(url.href, database);
|
||||
export default DB;
|
||||
|
|
|
@ -46,7 +46,7 @@ export default class Web {
|
|||
resave: false,
|
||||
saveUninitialized: false,
|
||||
store: MongoStore.create({
|
||||
client: DB.getClient(),
|
||||
client: DB.getClient() as any,
|
||||
dbName: DB.db.databaseName,
|
||||
collectionName: "sessions",
|
||||
autoRemove: "native",
|
||||
|
|
95
yarn.lock
95
yarn.lock
|
@ -485,7 +485,7 @@ __metadata:
|
|||
"@hibas123/nodeloggingserver_client": ^1.1.2
|
||||
"@hibas123/openauth-internalapi": "workspace:^"
|
||||
"@hibas123/openauth-views-v1": "workspace:^"
|
||||
"@hibas123/safe_mongo": ^2.1.0
|
||||
"@hibas123/safe_mongo": 2.0.1
|
||||
"@simplewebauthn/server": ^7.2.0
|
||||
"@types/body-parser": ^1.19.2
|
||||
"@types/compression": ^1.7.2
|
||||
|
@ -518,7 +518,7 @@ __metadata:
|
|||
joi: ^17.11.0
|
||||
jsonwebtoken: ^9.0.0
|
||||
moment: ^2.29.4
|
||||
mongodb: ^6.3.0
|
||||
mongodb: ^5.2.0
|
||||
node-rsa: ^1.1.1
|
||||
nodemon: ^3.0.1
|
||||
npm-run-all: ^4.1.5
|
||||
|
@ -612,13 +612,13 @@ __metadata:
|
|||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@hibas123/safe_mongo@npm:^2.1.0":
|
||||
version: 2.1.0
|
||||
resolution: "@hibas123/safe_mongo@npm:2.1.0"
|
||||
"@hibas123/safe_mongo@npm:2.0.1":
|
||||
version: 2.0.1
|
||||
resolution: "@hibas123/safe_mongo@npm:2.0.1"
|
||||
dependencies:
|
||||
"@hibas123/logging": ^3.1.2
|
||||
mongodb: ^6.0.0
|
||||
checksum: 8c8125a9f50d26494094315029e7ce352cf19469e6c5f5a727e3c643e66c2b87b3e3587b6b4d9b3d28835f095512b9b9de0a2e5532e20d53d5f9c64ad7983480
|
||||
mongodb: ^5.2.0
|
||||
checksum: 6d02d6803312a61de23a741eb7b72b92e7443f76ffecce7faa4887109f6478ed5ad2920bd92371db23e1108fb6dfd83a0adcedf1448708c03ba51f564ba20afd
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
@ -1569,15 +1569,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/whatwg-url@npm:^11.0.2":
|
||||
version: 11.0.3
|
||||
resolution: "@types/whatwg-url@npm:11.0.3"
|
||||
dependencies:
|
||||
"@types/webidl-conversions": "*"
|
||||
checksum: 400ae723edb3132e7e8fd49a526d108832c1b5a09245511d5175d56a5dc9ae567dd7bbd058bcc799364fed84fbff324736493557913fe9ef3fffb1ad4cff3044
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/whatwg-url@npm:^8.2.1":
|
||||
version: 8.2.2
|
||||
resolution: "@types/whatwg-url@npm:8.2.2"
|
||||
|
@ -2258,10 +2249,10 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"bson@npm:^6.2.0":
|
||||
version: 6.2.0
|
||||
resolution: "bson@npm:6.2.0"
|
||||
checksum: 950fccd2abd0ff5a1bd3637f4697631298f1538314994ab8c9e13f1c9851d0fd042b54fe8340e00151c2acee43917ea40e64b800ceeea811b00f2de3e900c77e
|
||||
"bson@npm:^5.5.0":
|
||||
version: 5.5.1
|
||||
resolution: "bson@npm:5.5.1"
|
||||
checksum: f49730504e8362e2c8d1eb0c272e5e125392c41fb7196fc35ccbc39718ee62569a1d197bd2342c3334cd420073d3fd5dc7dea764a7f219dcd79e0ce473dd2772
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
@ -5690,16 +5681,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"mongodb-connection-string-url@npm:^3.0.0":
|
||||
version: 3.0.0
|
||||
resolution: "mongodb-connection-string-url@npm:3.0.0"
|
||||
dependencies:
|
||||
"@types/whatwg-url": ^11.0.2
|
||||
whatwg-url: ^13.0.0
|
||||
checksum: 9d4885377345b14e2ba2ee63cb3085364a01aeae3aca622bbd568e7761caa58fdc664528f19f125c762cff230c9349f99e98396dd2271a4260286cf241a8c477
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"mongodb@npm:*":
|
||||
version: 5.2.0
|
||||
resolution: "mongodb@npm:5.2.0"
|
||||
|
@ -5726,37 +5707,35 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"mongodb@npm:^6.0.0, mongodb@npm:^6.3.0":
|
||||
version: 6.3.0
|
||||
resolution: "mongodb@npm:6.3.0"
|
||||
"mongodb@npm:^5.2.0":
|
||||
version: 5.9.1
|
||||
resolution: "mongodb@npm:5.9.1"
|
||||
dependencies:
|
||||
"@mongodb-js/saslprep": ^1.1.0
|
||||
bson: ^6.2.0
|
||||
mongodb-connection-string-url: ^3.0.0
|
||||
bson: ^5.5.0
|
||||
mongodb-connection-string-url: ^2.6.0
|
||||
socks: ^2.7.1
|
||||
peerDependencies:
|
||||
"@aws-sdk/credential-providers": ^3.188.0
|
||||
"@mongodb-js/zstd": ^1.1.0
|
||||
gcp-metadata: ^5.2.0
|
||||
kerberos: ^2.0.1
|
||||
mongodb-client-encryption: ">=6.0.0 <7"
|
||||
"@mongodb-js/zstd": ^1.0.0
|
||||
kerberos: ^1.0.0 || ^2.0.0
|
||||
mongodb-client-encryption: ">=2.3.0 <3"
|
||||
snappy: ^7.2.2
|
||||
socks: ^2.7.1
|
||||
dependenciesMeta:
|
||||
"@mongodb-js/saslprep":
|
||||
optional: true
|
||||
peerDependenciesMeta:
|
||||
"@aws-sdk/credential-providers":
|
||||
optional: true
|
||||
"@mongodb-js/zstd":
|
||||
optional: true
|
||||
gcp-metadata:
|
||||
optional: true
|
||||
kerberos:
|
||||
optional: true
|
||||
mongodb-client-encryption:
|
||||
optional: true
|
||||
snappy:
|
||||
optional: true
|
||||
socks:
|
||||
optional: true
|
||||
checksum: ebc5d9dbd1299321b6873e86eb4ea635316f97450644811db24ce2b01432b1c641def864facf2eab6f0c0c5c360c318108ea5555142f55177ca4c33991c6d7c4
|
||||
checksum: a827937120cd7eecafc0ad5657b40536774f0b09582a9363db0a192149ba20eae80a33fccf573f5ce69a20aca6759c40b4961d9d1d4de2a350c543030055e0f6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
@ -7248,13 +7227,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"punycode@npm:^2.3.0":
|
||||
version: 2.3.1
|
||||
resolution: "punycode@npm:2.3.1"
|
||||
checksum: bb0a0ceedca4c3c57a9b981b90601579058903c62be23c5e8e843d2c2d4148a3ecf029d5133486fb0e1822b098ba8bba09e89d6b21742d02fa26bda6441a6fb2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"pvtsutils@npm:^1.3.2":
|
||||
version: 1.3.2
|
||||
resolution: "pvtsutils@npm:1.3.2"
|
||||
|
@ -8645,15 +8617,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tr46@npm:^4.1.1":
|
||||
version: 4.1.1
|
||||
resolution: "tr46@npm:4.1.1"
|
||||
dependencies:
|
||||
punycode: ^2.3.0
|
||||
checksum: aeeb821ac2cd792e63ec84888b4fd6598ac6ed75d861579e21a5cf9d4ee78b2c6b94e7d45036f2ca2088bc85b9b46560ad23c4482979421063b24137349dbd96
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tr46@npm:~0.0.3":
|
||||
version: 0.0.3
|
||||
resolution: "tr46@npm:0.0.3"
|
||||
|
@ -9078,16 +9041,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"whatwg-url@npm:^13.0.0":
|
||||
version: 13.0.0
|
||||
resolution: "whatwg-url@npm:13.0.0"
|
||||
dependencies:
|
||||
tr46: ^4.1.1
|
||||
webidl-conversions: ^7.0.0
|
||||
checksum: 7f69272a1bfd5f0d994988b9e234e35d21071a9bffe0d6fd4477d295552665c566b176ff8e0251a0a79c61c5a67a7a392e248aae5887d7e22bdff0125209e26b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"whatwg-url@npm:^5.0.0":
|
||||
version: 5.0.0
|
||||
resolution: "whatwg-url@npm:5.0.0"
|
||||
|
|
Loading…
Reference in New Issue