Initial commit
This commit is contained in:
5
src/app/configs/app.config.ts
Normal file
5
src/app/configs/app.config.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { env } from '@extollo/lib'
|
||||
|
||||
export default {
|
||||
name: env('APP_NAME', 'Extollo'),
|
||||
}
|
||||
21
src/app/configs/auth.config.ts
Normal file
21
src/app/configs/auth.config.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import {AuthenticationConfig, CoreIDLoginProvider, OAuth2LoginProviderConfig, ORMUserRepository, env} from '@extollo/lib'
|
||||
|
||||
const authConfig: AuthenticationConfig = {
|
||||
storage: ORMUserRepository,
|
||||
providers: {
|
||||
coreid: {
|
||||
driver: CoreIDLoginProvider,
|
||||
config: {
|
||||
default: true,
|
||||
displayName: 'Starship CoreID',
|
||||
clientId: env('COREID_CLIENT_ID'),
|
||||
clientSecret: env('COREID_CLIENT_SECRET'),
|
||||
loginUrl: env('COREID_BASE', '') + '/auth/service/oauth2/authorize?client_id=%c&redirect_uri=%r',
|
||||
tokenUrl: env('COREID_BASE', '') + '/auth/service/oauth2/redeem',
|
||||
userUrl: env('COREID_BASE', '') + '/api/v1/auth/users/me',
|
||||
} as OAuth2LoginProviderConfig,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default authConfig
|
||||
14
src/app/configs/database.config.ts
Normal file
14
src/app/configs/database.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { env } from "@extollo/lib";
|
||||
|
||||
export default {
|
||||
connections: {
|
||||
default: {
|
||||
user: env('DATABASE_USERNAME', 'extollo'),
|
||||
password: env('DATABASE_PASSWORD'),
|
||||
host: env('DATABASE_HOST', 'localhost'),
|
||||
port: env('DATABASE_PORT', 5432),
|
||||
database: env('DATABASE_NAME', 'extollo'),
|
||||
dialect: env('DATABASE_DIALECT', 'postgres'),
|
||||
},
|
||||
},
|
||||
}
|
||||
5
src/app/configs/lang/common.config.ts
Normal file
5
src/app/configs/lang/common.config.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { env } from "@extollo/lib"
|
||||
|
||||
export default {
|
||||
app_name: env('APP_NAME', 'Extollo'),
|
||||
}
|
||||
6
src/app/configs/lang/en_US.config.ts
Normal file
6
src/app/configs/lang/en_US.config.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import {env} from '@extollo/lib'
|
||||
|
||||
export default {
|
||||
welcome_to_extollo: 'Welcome to Extollo!',
|
||||
viewed_page_num_times: 'You have viewed this page :num: times.',
|
||||
}
|
||||
24
src/app/configs/oauth2.config.ts
Normal file
24
src/app/configs/oauth2.config.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {OAuth2Client, OAuth2Scope, env, /*uuid4*/} from '@extollo/lib'
|
||||
|
||||
export default {
|
||||
secret: env('OAUTH2_SECRET'),
|
||||
scopes: {
|
||||
'user-info': {
|
||||
id: 'user-info',
|
||||
name: 'user-info',
|
||||
description: 'access basic information about your account',
|
||||
},
|
||||
} as {[key: string]: OAuth2Scope},
|
||||
clients: {
|
||||
// 'test-1': {
|
||||
// id: 'test-1',
|
||||
// display: 'Test 1',
|
||||
// secret: env('TEST_CLIENT_SECRET', uuid4()),
|
||||
// allowedFlows: ['code'],
|
||||
// allowedScopeIds: ['user-info'],
|
||||
// allowedRedirectUris: [
|
||||
// 'http://localhost:1234/callback',
|
||||
// ],
|
||||
// },
|
||||
} as {[key: string]: OAuth2Client},
|
||||
}
|
||||
66
src/app/configs/server.config.ts
Normal file
66
src/app/configs/server.config.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import {
|
||||
env,
|
||||
basePath,
|
||||
ORMSession,
|
||||
LocalFilesystem,
|
||||
LocalFilesystemConfig,
|
||||
RedisCache,
|
||||
CacheQueue,
|
||||
BusConnectorConfig, QueueConfig, SyncQueue
|
||||
} from "@extollo/lib"
|
||||
import {LogRequest} from "../http/middlewares/LogRequest.middleware";
|
||||
|
||||
export default {
|
||||
debug: env('DEBUG_MODE', false),
|
||||
|
||||
session: {
|
||||
/* The implementation of @extollo/lib.Session that serves as the session backend. */
|
||||
driver: ORMSession,
|
||||
},
|
||||
|
||||
bus: {
|
||||
connectors: [
|
||||
{type: 'redis'},
|
||||
] as BusConnectorConfig[],
|
||||
},
|
||||
|
||||
queue: {
|
||||
driver: CacheQueue,
|
||||
} as QueueConfig,
|
||||
|
||||
cache: {
|
||||
driver: RedisCache,
|
||||
},
|
||||
|
||||
/*
|
||||
* Here, you can define various filesystem drivers that can be used in
|
||||
* your application to store/retrieve files.
|
||||
*
|
||||
* The key in the object is the 'name' of the filesystem as it will be
|
||||
* fetched in code. For example, if you have a `fubar: { ... }` item,
|
||||
* then you can retrieve that filesystem using the Files service like
|
||||
* so:
|
||||
*
|
||||
* files.getFilesystem('fubar') // => Filesystem { ... }
|
||||
*/
|
||||
filesystems: {
|
||||
default: {
|
||||
/* If true, this will serve as the default filesystem for modules in your application. */
|
||||
isDefault: true,
|
||||
|
||||
/* The implementation of @extollo/lib.Filesystem that serves as the backend. */
|
||||
driver: LocalFilesystem,
|
||||
|
||||
/* The config required by the filesystem driver. */
|
||||
config: {
|
||||
baseDir: basePath('..', 'uploads').toLocal,
|
||||
} as LocalFilesystemConfig,
|
||||
}
|
||||
},
|
||||
|
||||
middleware: {
|
||||
global: {
|
||||
pre: [LogRequest],
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user