4 Commits
1.2.4 ... 1.2.6

Author SHA1 Message Date
99845a7b94 Try different URL schema
Some checks failed
CI / build (push) Failing after 26s
2023-11-29 13:32:57 +01:00
60b0c2f577 Switch back to older version of safe_mongo, since the new one is esm only
All checks were successful
CI / build (push) Successful in 21m31s
2023-11-29 12:04:45 +01:00
58e4ab1886 Merge branch 'master' of https://git.hibas.dev/OpenServer/OpenAuth_server 2023-11-29 10:25:12 +01:00
26f9b8d208 use modern version
Some checks failed
CI / build (push) Failing after 4m25s
2023-11-29 01:19:36 +01:00
5 changed files with 64 additions and 25 deletions

View File

@ -5,6 +5,7 @@ database=openauth
[core]
name = OpenAuthService
secret = dev
url=http://localhost:3000
[web]
port = 3000

View File

@ -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",

View File

@ -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;

View File

@ -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",

View File

@ -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
@ -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
@ -2258,6 +2258,13 @@ __metadata:
languageName: node
linkType: hard
"bson@npm:^5.5.0":
version: 5.5.1
resolution: "bson@npm:5.5.1"
checksum: f49730504e8362e2c8d1eb0c272e5e125392c41fb7196fc35ccbc39718ee62569a1d197bd2342c3334cd420073d3fd5dc7dea764a7f219dcd79e0ce473dd2772
languageName: node
linkType: hard
"bson@npm:^6.2.0":
version: 6.2.0
resolution: "bson@npm:6.2.0"
@ -5726,7 +5733,39 @@ __metadata:
languageName: node
linkType: hard
"mongodb@npm:^6.0.0, 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: ^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.0.0
kerberos: ^1.0.0 || ^2.0.0
mongodb-client-encryption: ">=2.3.0 <3"
snappy: ^7.2.2
dependenciesMeta:
"@mongodb-js/saslprep":
optional: true
peerDependenciesMeta:
"@aws-sdk/credential-providers":
optional: true
"@mongodb-js/zstd":
optional: true
kerberos:
optional: true
mongodb-client-encryption:
optional: true
snappy:
optional: true
checksum: a827937120cd7eecafc0ad5657b40536774f0b09582a9363db0a192149ba20eae80a33fccf573f5ce69a20aca6759c40b4961d9d1d4de2a350c543030055e0f6
languageName: node
linkType: hard
"mongodb@npm:^6.3.0":
version: 6.3.0
resolution: "mongodb@npm:6.3.0"
dependencies: