Compare commits

...

6 Commits

Author SHA1 Message Date
Sheldan
d5c8509ab0 [maven-release-plugin] prepare release oneplusbot-1.5.7 2021-09-06 02:21:12 +02:00
Sheldan
eaddea63b3 [OPB-xxx] preparing for release 2021-09-06 02:15:38 +02:00
Sheldan
7dc141a8a4 [OPB-xxx] adding logging dashboard to grafana 2021-09-06 01:34:23 +02:00
Sheldan
6652c90edb [OPB-37] fixing loki data source in docker compose config 2021-08-22 19:09:28 +02:00
Sheldan
d7f5fc21d6 [OPB-38] fixing json validation 2021-08-22 18:39:41 +02:00
Sheldan
bf98d5db3a [maven-release-plugin] prepare for next development iteration 2021-08-10 00:21:38 +02:00
49 changed files with 263 additions and 190 deletions

View File

@@ -34,5 +34,5 @@ jobs:
env:
REGISTRY_PREFIX: docker.pkg.github.com/sheldan/oneplusbot/
VERSION: ${{ env.version }}
ABSTRACTO_VERSION: 1.3.7
ABSTRACTO_VERSION: 1.3.8
ABSTRACTO_REGISTRY_PREFIX: docker.pkg.github.com/sheldan/abstracto/

View File

@@ -1,6 +1,6 @@
# r/oneplus Discord bot privacy policy
Last updated: 04.07.2021
Last updated: 06.09.2021
## Description
@@ -75,6 +75,7 @@ The detailed list of what information is stored and processed is the following:
* this was used for the message used to update the status of a suggestion, but this is currently disabled
* the author of the suggestion and the message which has been posted in the suggestions channel
* every suggestion will be deleted completely from the database a few days after it has reached a final state (rejected, denied, accepted)
* whether you voted for a suggestion and which decision you took
### Leveling system
* the amount of messages which were considered for the leveling system

View File

@@ -17,4 +17,5 @@ Custom features which were ported
- [pgAdmin](https://github.com/postgres/pgadmin4) to view the database
- [prometheus](https://github.com/prometheus/prometheus) for metric collection
- [postgres](https://github.com/postgres/postgres) as a database
- [loki](https://github.com/grafana/loki) for log aggregation

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application</groupId>
<artifactId>application</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application</groupId>
<artifactId>application</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>executable</artifactId>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
<artifactId>oneplus-bot-customizations</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>oneplus-bot-customizations</artifactId>
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application</groupId>
<artifactId>application</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
<artifactId>oneplus-bot-customizations</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>oneplus-bot-modules</artifactId>
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -66,6 +66,7 @@ public class ImportFAQ extends AbstractConditionableCommand {
AServer server = serverManagementService.loadServer(commandContext.getGuild());
List<FaqCommandConfig> commands = faqServiceBean.loadFAQCommandsFromJson(jsonContent);
faqServiceBean.createOrUpdateFAQCommands(commands, server);
return CompletableFuture.completedFuture(CommandResult.fromSuccess());
} else {
List<String> errors = jsonValidationService.getDetailedException(result.getExceptions())
@@ -73,8 +74,8 @@ public class ImportFAQ extends AbstractConditionableCommand {
.map(ValidationException::getMessage)
.collect(Collectors.toList());
channelService.sendTextToChannel(String.join("\n", errors), commandContext.getChannel());
return CompletableFuture.completedFuture(CommandResult.fromError("Incorrect faq config."));
}
return CompletableFuture.completedFuture(CommandResult.fromSuccess());
} catch (IOException e) {
log.error("IO Exception when loading input file.", e);
throw new AbstractoTemplatedException("Failed to load json config.", "failed_to_set_template_exception", e);

View File

@@ -3,143 +3,124 @@
"type": "array",
"minItems": 1,
"maxItems": 30,
"items": [
{
"type": "object",
"properties": {
"faqCommandName": {
"items": {
"type": "object",
"properties": {
"faqCommandName": {
"type": "string",
"minLength": 1,
"maxLength": 30,
"pattern": "\\w*"
},
"global": {
"default": false,
"type": "boolean"
},
"aliases": {
"type": "array",
"minItems": 1,
"maxItems": 20,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 30,
"pattern": "\\w*"
},
"global": {
"default": false,
"type": "boolean"
},
"aliases": {
"type": "array",
"minItems": 1,
"maxItems": 20,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 30,
"pattern": "\\w*"
}
},
"responses": {
"type": "array",
"minItems": 1,
"maxItems": 255,
"items": {
"type": "object",
"properties": {
"channelGroupName": {
"type": "string",
"minLength": 1,
"maxLength": 20,
"pattern": "\\w*"
},
"messages": {
"type": "array",
"minItems": 1,
"maxItems": 3,
"items": [
{
}
},
"responses": {
"type": "array",
"minItems": 1,
"maxItems": 255,
"items": {
"type": "object",
"properties": {
"channelGroupName": {
"type": "string",
"minLength": 1,
"maxLength": 20,
"pattern": "\\w*"
},
"messages": {
"type": "array",
"minItems": 1,
"maxItems": 3,
"items": {
"type": "object",
"properties": {
"position": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"additionalMessage": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"embed": {
"type": "object",
"properties": {
"position": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"additionalMessage": {
"description": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"embed": {
"imageUrl": {
"type": "string",
"minLength": 1,
"maxLength": 2000,
"pattern": "\\s*https?:\/\/\\S+"
},
"color": {
"type": "object",
"properties": {
"description": {
"type": "string",
"minLength": 1,
"maxLength": 2000
"red": {
"type": "integer",
"minimum": 0,
"default": 0,
"maximum": 255
},
"imageUrl": {
"type": "string",
"minLength": 1,
"maxLength": 2000,
"pattern": "\\s*https?:\/\/\\S+"
"green": {
"type": "integer",
"minimum": 0,
"default": 0,
"maximum": 255
},
"color": {
"type": "object",
"properties": {
"red": {
"type": "integer",
"minimum": 0,
"default": 0,
"maximum": 255
},
"green": {
"type": "integer",
"minimum": 0,
"default": 0,
"maximum": 255
},
"blue": {
"type": "integer",
"minimum": 0,
"default": 0,
"maximum": 255
}
},
"required": [
"red",
"green",
"blue"
]
"blue": {
"type": "integer",
"minimum": 0,
"default": 0,
"maximum": 255
}
},
"required": [
"red",
"green",
"blue"
]
},
"author": {
"type": "object",
"properties": {
"userId": {
"minimum": 1,
"maximum": 18446744073709551615,
"type": "integer"
},
"author": {
"type": "object",
"properties": {
"userId": {
"minimum": 1,
"maximum": 18446744073709551615,
"type": "integer"
},
"useBot": {
"type": "boolean"
}
},
"additionalProperties": false,
"anyOf": [
{
"required": [
"userId"
]
},
{
"required": [
"useBot"
]
}
]
"useBot": {
"type": "boolean"
}
},
"additionalProperties": false,
"anyOf": [
{
"required": [
"description",
"author"
"userId"
]
},
{
"required": [
"imageUrl",
"author"
"useBot"
]
}
]
@@ -149,41 +130,56 @@
"anyOf": [
{
"required": [
"additionalMessage",
"position"
"description",
"author"
]
},
{
"required": [
"embed",
"position"
]
},
{
"required": [
"additionalMessage",
"embed",
"position"
"imageUrl",
"author"
]
}
]
}
},
"additionalProperties": false,
"anyOf": [
{
"required": [
"additionalMessage",
"position"
]
},
{
"required": [
"embed",
"position"
]
},
{
"required": [
"additionalMessage",
"embed",
"position"
]
}
]
}
},
"additionalProperties": false,
"required": [
"channelGroupName",
"messages"
]
}
}
},
"additionalProperties": false,
"required": [
"channelGroupName",
"messages"
]
}
},
"additionalProperties": false,
"required": [
"faqCommandName",
"responses"
]
}
]
}
},
"additionalProperties": false,
"required": [
"faqCommandName",
"responses"
]
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
<artifactId>oneplus-bot-modules</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application</groupId>
<artifactId>application</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
<artifactId>oneplus-bot-modules</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>oneplus-bot-modules</artifactId>
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,13 +5,13 @@
<parent>
<groupId>dev.sheldan.oneplus.bot</groupId>
<artifactId>oneplusbot</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<groupId>dev.sheldan.oneplus.bot.application</groupId>
<artifactId>application</artifactId>
<packaging>pom</packaging>
<version>1.5.6</version>
<version>1.5.7</version>
<modules>
<module>executable</module>
<module>oneplus-bot-customizations</module>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.deployment</groupId>
<artifactId>deployment</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -29,4 +29,4 @@ PGADMIN_DEFAULT_EMAIL=sheldan@sheldan.dev
PGADMIN_DEFAULT_PASSWORD=admin
TOKEN=<INSERT TOKEN>
YOUTUBE_API_KEY=<INSERT KEY>
ONEPLUS_BOT_VERSION=1.5.6
ONEPLUS_BOT_VERSION=1.5.7

View File

@@ -32,7 +32,7 @@ services:
EXECUTE_TEMPLATES: ${EXECUTE_TEMPLATES}
LIQUIBASE_PATH: ${LIQUIBASE_PATH:-/liquibase}
POSTGRES_DRIVER_PATH: ${EXECUTE_DEPLOYMENT:-/postgres/driver.jar}
WAIT_HOSTS: database:5432
WAIT_HOSTS: ${DATABASE_HOST}:${DATABASE_PORT}
networks:
- oneplusbot
bot:
@@ -105,6 +105,8 @@ services:
DB_NAME: ${DATABASE_NAME}
PROMETHEUS_HOST: 'prometheus'
PROMETHEUS_PORT: 9090
LOKI_HOST: 'loki'
LOKI_PORT: ${LOKI_PORT}
volumes:
- grafana-user-data:/var/lib/grafana
networks:

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.deployment</groupId>
<artifactId>deployment</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -0,0 +1,66 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 4,
"links": [],
"panels": [
{
"datasource": "Loki",
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"maxDataPoints": 10000,
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"showLabels": false,
"showTime": false,
"sortOrder": "Descending",
"wrapLogMessage": true
},
"targets": [
{
"expr": "{job=\"oneplus-bot-logs\", filename=\"/logs/log.log\"}",
"queryType": "randomWalk",
"refId": "A"
}
],
"title": "OnePlus Bot logs",
"type": "logs"
}
],
"refresh": "",
"schemaVersion": 30,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-3h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "OnePlus Bot logs",
"uid": "1uGb0q4nz",
"version": 1
}

View File

@@ -20,4 +20,10 @@ datasources:
jsonData:
sslmode: 'disable'
version: 1
editable: false
editable: false
- name: Loki
type: loki
access: proxy
url: 'http://${LOKI_HOST}:${LOKI_PORT}'
jsonData:
maxLines: 2000

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>oneplusbot</artifactId>
<groupId>dev.sheldan.oneplus.bot</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -12,15 +12,15 @@
<groupId>dev.sheldan.oneplus.bot</groupId>
<artifactId>oneplusbot</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<!-- edit in release.yml as well -->
<!-- when releasing a new opbot version, update the .env as well-->
<abstracto.version>1.3.7</abstracto.version>
<abstracto.templates.version>1.2.19</abstracto.templates.version>
<abstracto.version>1.3.8</abstracto.version>
<abstracto.templates.version>1.2.20</abstracto.templates.version>
</properties>
<modules>
@@ -56,7 +56,7 @@
<scm>
<url>https://maven.pkg.github.com/Sheldan/OnePlusBot</url>
<developerConnection>scm:git:git@github.com:Sheldan/OnePlusBot.git</developerConnection>
<tag>oneplusbot-1.5.6</tag>
<tag>oneplusbot-1.5.7</tag>
</scm>
</project>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>oneplus-bot-modules-templates</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
<artifactId>oneplus-bot-modules-templates</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,14 +3,14 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
<artifactId>templates</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
<artifactId>oneplus-bot-modules-templates</artifactId>
<packaging>pom</packaging>
<version>1.5.6</version>
<version>1.5.7</version>
<modules>
<module>starboard-custom-templates</module>
<module>news-templates</module>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>oneplus-bot-modules-templates</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
<artifactId>oneplus-bot-modules-templates</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
<artifactId>templates</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>template-overrides</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.overrides.templates</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.overrides.templates</groupId>
<artifactId>template-overrides</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>template-overrides</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.overrides.templates</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>template-overrides</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.overrides.templates</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.overrides</groupId>
<artifactId>overrides</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.overrides.templates</groupId>
<artifactId>template-overrides</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.overrides.templates</groupId>
<artifactId>template-overrides</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.overrides.translations</groupId>
<artifactId>translation-overrides</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>overrides</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.overrides</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot</groupId>
<artifactId>oneplusbot</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modules>
@@ -15,7 +15,7 @@
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
<artifactId>templates</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
<packaging>pom</packaging>
</project>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
<artifactId>translations</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>translations</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>translations</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
<artifactId>translations</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
<artifactId>templates</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>translations</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>translations</artifactId>
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
<artifactId>translations</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>