Skip to content

Commit

Permalink
Merge pull request #4 from dignityofwar/ps2-verify
Browse files Browse the repository at this point in the history
Planetside 2 verification mechanism
  • Loading branch information
Matt Cavanagh authored Aug 13, 2023
2 parents 3746140 + adf2bc5 commit d7d6c22
Show file tree
Hide file tree
Showing 33 changed files with 2,482 additions and 1,210 deletions.
17 changes: 17 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
VERSION="dev"
TOKEN="TOKEN"
GUILD_ID_WITH_COMMANDS=0123456789
DISCORD_DEVUSER_ID=yourDiscordUserID1234667

# Albion Channels & Roles
CHANNEL_ALBION_REGISTER=1234567
CHANNEL_ALBION_WELCOME=1234567
ROLE_ALBION_INITIATE=1234567

# PS2 Channels & Roles
CHANNEL_PS2_VERIFY=1234567
CHANNEL_PS2_PRIVATE=1234567
CHANNEL_PS2_HOW_TO_RANK_UP=1234567
ROLE_PS2_VERIFIED=1234567
ROLE_PS2_ZEALOT=1234567

# PS2 Specific
PS2_CENSUS_SERVICE_ID=foobar

# Database
DB_HOST=foo
DB_PORT=3306
DB_USERNAME=root
Expand Down
39 changes: 39 additions & 0 deletions mikro-orm.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { SqlHighlighter } from '@mikro-orm/sql-highlighter';
import { Logger } from '@nestjs/common';
import { MySqlOptions } from '@mikro-orm/mysql/MySqlMikroORM';

const logger = new Logger('MikroORM');

const dbURL = `mysql://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}:3306/${process.env.DB_NAME}?sslaccept=strict`;
console.log(dbURL);

const config: MySqlOptions = {
entities: ['./dist/src/database/entities'],
entitiesTs: ['./src/database/entities'],
type: 'mysql',
highlighter: new SqlHighlighter(),
// clientUrl: dbURL,
host: process.env.DB_HOST,
port: 3306,
user: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
dbName: process.env.DB_NAME,
// extensions: [SeedManager, EntityGenerator],
debug: true,
driverOptions: {
connection: {
ssl: {
rejectUnauthorized: false,
},
},
},
migrations: {
path: './src/database/migrations',
},
logger: logger.log.bind(logger),
forceUtcTimezone: true,
allowGlobalContext: true,
};

export default config;

28 changes: 0 additions & 28 deletions ormconfig.js

This file was deleted.

23 changes: 17 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
"license": "UNLICENSED",
"scripts": {
"prebuild": "rimraf dist",
"dev": "nest start --watch",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"seed:config": "ts-node ./node_modules/typeorm-seeding/dist/cli.js config",
"seed:run": "ts-node ./node_modules/typeorm-seeding/dist/cli.js seed",
"migration:generate": "ts-node node_modules/@mikro-orm/cli/cli.js migration:generate",
"migration:up": "ts-node node_modules/@mikro-orm/cli/cli.js migration:up",
"migration:down": "ts-node node_modules/@mikro-orm/cli/cli.js migration:down",
"migration:list": "ts-node node_modules/@mikro-orm/cli/cli.js migration:list",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/src/main",
"start:prod": "ts-node node_modules/@mikro-orm/cli/cli.js migration:up && node dist/src/main",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
Expand All @@ -22,22 +25,30 @@
"dependencies": {
"@discord-nestjs/common": "5.2.3",
"@discord-nestjs/core": "5.3.5",
"@mikro-orm/core": "^5.7.14",
"@mikro-orm/migrations": "^5.7.14",
"@mikro-orm/mysql": "^5.7.14",
"@mikro-orm/nestjs": "^5.2.0",
"@mikro-orm/seeder": "^5.7.14",
"@mikro-orm/sql-highlighter": "^1.0.1",
"@nestjs/common": "9.4.0",
"@nestjs/config": "2.3.1",
"@nestjs/core": "9.4.0",
"@nestjs/typeorm": "^9.0.1",
"axios": "^1.4.0",
"bufferutil": "^4.0.7",
"class-transformer": "0.5.1",
"discord.js": "14.10.2",
"lodash": "^4.17.21",
"mysql2": "^3.3.1",
"ps2census": "^4.6.0",
"reflect-metadata": "0.1.13",
"rimraf": "5.0.0",
"rxjs": "7.8.1",
"typeorm": "^0.3.16",
"typeorm-seeding": "^1.6.1"
"utf-8-validate": "^6.0.3",
"websocket-ts": "^1.1.1"
},
"devDependencies": {
"@mikro-orm/cli": "^5.7.14",
"@nestjs/cli": "9.4.2",
"@nestjs/schematics": "9.1.0",
"@nestjs/testing": "^9.4.1",
Expand Down
Loading

0 comments on commit d7d6c22

Please sign in to comment.