generated from didinele/typescript-docker-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
158 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,5 @@ ley.config.mjs | |
.gitattributes | ||
.gitignore | ||
|
||
a.ci.sh | ||
a.sh | ||
|
||
LICENSE | ||
**/README.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
P_PASSWORD="only used by parseable. dictates its password - and that'll dictate the token" | ||
|
||
DISCORD_TOKEN= | ||
DISCORD_CLIENT_ID= | ||
PARSEABLE_AUTH= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
REDIS_URL=redis://redis:6379 | ||
DISCORD_PROXY_URL=http://discord-proxy:9000 | ||
POSTGRES_HOST=postgres | ||
POSTGRES_PORT=5432 | ||
POSTGRES_USER=chatsift | ||
POSTGRES_PASSWORD=admin | ||
POSTGRES_DATABASE=chatsift | ||
PARSEABLE_DOMAIN=http://parseable:8000 | ||
PARSEABLE_STREAM=gateway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
!.vscode/settings.json | ||
|
||
node_modules | ||
.env | ||
.env.private | ||
|
||
coverage/* | ||
**/dist/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import process from 'node:process'; | ||
import type { Logger } from 'pino'; | ||
import { INJECTION_TOKENS, globalContainer } from '../container.js'; | ||
|
||
export function setupCrashLogs() { | ||
const logger = globalContainer.get<Logger>(INJECTION_TOKENS.logger); | ||
|
||
process.on('uncaughtExceptionMonitor', (error, origin) => { | ||
logger.fatal({ error, origin }, 'Uncaught exception. Likely a hard crash'); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import 'reflect-metadata'; | ||
import { DependencyManager, globalContainer } from '@automoderator/core'; | ||
import { DependencyManager, globalContainer, setupCrashLogs } from '@automoderator/core'; | ||
import { ProxyServer } from './server.js'; | ||
|
||
const _dependencyManager = globalContainer.get(DependencyManager); | ||
const dependencyManager = globalContainer.get(DependencyManager); | ||
const logger = dependencyManager.registerLogger('discordproxy'); | ||
dependencyManager.registerRedis(); | ||
|
||
setupCrashLogs(); | ||
|
||
const server = globalContainer.get(ProxyServer); | ||
server.listen(8_000); | ||
server.listen(9_000); | ||
logger.info('Listening on port 9000'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import 'reflect-metadata'; | ||
import { globalContainer, DependencyManager } from '@automoderator/core'; | ||
import { globalContainer, DependencyManager, setupCrashLogs } from '@automoderator/core'; | ||
import { Gateway } from './gateway.js'; | ||
|
||
const dependencyManager = globalContainer.get(DependencyManager); | ||
dependencyManager.registerLogger('gateway'); | ||
dependencyManager.registerRedis(); | ||
dependencyManager.registerApi(); | ||
|
||
setupCrashLogs(); | ||
|
||
const gateway = globalContainer.get(Gateway); | ||
await gateway.connect(); |