From 25a6758c405b9886304b160913af165979a7bd03 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 23 Oct 2022 15:32:03 +0200 Subject: [PATCH] Improved dev stack #70 --- kdb-bot/docker-compose.dev.yml | 2 +- .../bot/config/appsettings.development.json | 39 +++++++++++++------ .../config/apisettings.development.json | 25 ++++++++++++ kdb-bot/tools/post_build/appsettings.json | 2 + kdb-web/angular.json | 6 +++ .../environments/environment.development.ts | 17 ++++++++ 6 files changed, 79 insertions(+), 12 deletions(-) create mode 100644 kdb-web/src/environments/environment.development.ts diff --git a/kdb-bot/docker-compose.dev.yml b/kdb-bot/docker-compose.dev.yml index d92640a1..858554dd 100644 --- a/kdb-bot/docker-compose.dev.yml +++ b/kdb-bot/docker-compose.dev.yml @@ -20,7 +20,7 @@ services: restart: 'no' ports: - '8044:80' - command: bash /app/bot/bot -stage + command: bash /app/bot/bot -dev kdb_web_dev_1: image: kdb-web/kdb-web:0.3 diff --git a/kdb-bot/src/bot/config/appsettings.development.json b/kdb-bot/src/bot/config/appsettings.development.json index 84e61a33..98c4bdb8 100644 --- a/kdb-bot/src/bot/config/appsettings.development.json +++ b/kdb-bot/src/bot/config/appsettings.development.json @@ -6,44 +6,61 @@ "DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S" }, "LoggingSettings": { - "Path": "logs/", + "Path": "logs/$date_now/", "Filename": "bot.log", "ConsoleLogLevel": "DEBUG", - "FileLogLevel": "DEBUG" + "FileLogLevel": "TRACE" }, "BotLoggingSettings": { - "Command": { + "Api": { "Path": "logs/", + "Filename": "api.log", + "ConsoleLogLevel": "DEBUG", + "FileLogLevel": "TRACE" + }, + "Command": { + "Path": "logs/$date_now/", "Filename": "commands.log", "ConsoleLogLevel": "DEBUG", - "FileLogLevel": "DEBUG" + "FileLogLevel": "TRACE" }, "Database": { - "Path": "logs/", + "Path": "logs/$date_now/", "Filename": "database.log", "ConsoleLogLevel": "DEBUG", "FileLogLevel": "DEBUG" }, "Message": { - "Path": "logs/", + "Path": "logs/$date_now/", "Filename": "message.log", "ConsoleLogLevel": "DEBUG", - "FileLogLevel": "DEBUG" + "FileLogLevel": "TRACE" } }, + "DiscordBot": { + "Token": "OTk4MTU5NjczODkzMDYwNzM4.GN3QyA.yvWO6L7Eu36gXQ7ARDs0Jg2J1VqIDnHLou5lT4", + "Prefix": "!kd " + }, "Translation": { "DefaultLanguage": "de", "Languages": [ "de" ] }, - "DiscordBot": { - "Token": "OTk4MTU5NjczODkzMDYwNzM4.GN3QyA.yvWO6L7Eu36gXQ7ARDs0Jg2J1VqIDnHLou5lT4", - "Prefix": "!kd " + "DatabaseSettings": { + "Host": "kdb_db_dev_1", + "User": "kd_kdb", + "Password": "a2Rfa2Ri", + "Database": "kd_kdb", + "Port": "3306", + "Charset": "utf8mb4", + "UseUnicode": "true", + "Buffered": "true", + "AuthPlugin": "mysql_native_password" }, "Bot": { "910199451145076828": { - "MessageDeleteTimer": 6 + "MessageDeleteTimer": 4 }, "Technicians": [ 240160344557879316, diff --git a/kdb-bot/src/bot_api/config/apisettings.development.json b/kdb-bot/src/bot_api/config/apisettings.development.json index 534e5087..41cb1f57 100644 --- a/kdb-bot/src/bot_api/config/apisettings.development.json +++ b/kdb-bot/src/bot_api/config/apisettings.development.json @@ -1,4 +1,29 @@ { + "Api": { + "Port": 80, + "Host": "0.0.0.0", + "RedirectToHTTPS": false + }, + "Authentication": { + "SecretKey": "RjNiNUxEeisjSnZ6Zz1XIUBnc2EleHNG", + "Issuer": "http://localhost:8044", + "Audience": "http://localhost:8043", + "TokenExpireTime": 1, + "RefreshTokenExpireTime": 7 + }, + "DiscordAuthentication": { + "ClientSecret": "cmhqYmF4MXBCd2IzeEZoSXRZQ29vY3NwUWwxQzFTZng=", + "RedirectURL": "http://localhost:8043/auth/register", + "Scope": [ + "identify", + "email" + ], + "TokenURL": "https://discordapp.com/api/oauth2/token", + "AuthURL": "https://discordapp.com/api/oauth2/authorize" + }, + "Frontend": { + "URL": "http://localhost:8043/" + }, "EMailClientSettings": { "Host": "mail.sh-edraft.de", "Port": "587", diff --git a/kdb-bot/tools/post_build/appsettings.json b/kdb-bot/tools/post_build/appsettings.json index 0575b494..1b98dab0 100644 --- a/kdb-bot/tools/post_build/appsettings.json +++ b/kdb-bot/tools/post_build/appsettings.json @@ -16,10 +16,12 @@ "PostBuild": { "KeepConfigs": [ "appsettings.json", + "appsettings.development.json", "appsettings.staging.json", "appsettings.production.json", "feature-flags.json", "apisettings.json", + "apisettings.development.json", "apisettings.staging.json", "apisettings.production.json" ], diff --git a/kdb-web/angular.json b/kdb-web/angular.json index 74bfc464..95493524 100644 --- a/kdb-web/angular.json +++ b/kdb-web/angular.json @@ -66,6 +66,12 @@ ] }, "development": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.development.ts" + } + ], "buildOptimizer": false, "optimization": false, "vendorChunk": true, diff --git a/kdb-web/src/environments/environment.development.ts b/kdb-web/src/environments/environment.development.ts new file mode 100644 index 00000000..f5bb9730 --- /dev/null +++ b/kdb-web/src/environments/environment.development.ts @@ -0,0 +1,17 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false, + apiURL: "http://localhost:8044", +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.