Compare commits

...

11 Commits

Author SHA1 Message Date
Sheldan
57fb34920d [maven-release-plugin] prepare release oneplusbot-1.5.6 2021-08-10 00:21:31 +02:00
Sheldan
3f959f3bbb [OPB-37] adding loki log collector
upgrading to newer abstracto version
adding some info to readme
2021-08-09 23:42:23 +02:00
Sheldan
0380720ec8 [maven-release-plugin] prepare for next development iteration 2021-07-26 02:08:06 +02:00
Sheldan
5bea74cb22 [maven-release-plugin] prepare release oneplusbot-1.5.5 2021-07-26 02:07:58 +02:00
Sheldan
1b970ba0a8 [OPB-xxx] updating to hotfix and preparing for release 2021-07-26 01:46:13 +02:00
Sheldan
a707b10cfd [maven-release-plugin] prepare for next development iteration 2021-07-25 20:58:31 +02:00
Sheldan
124d29769e [maven-release-plugin] prepare release oneplusbot-1.5.4 2021-07-25 20:58:23 +02:00
Sheldan
d1aa2d5276 [OPB-xxx] preparing for release 2021-07-25 20:37:33 +02:00
Sheldan
4d569d4ec0 [OPB-32] fixing always exporting user ID in faq config when in reality it was bot ID
sorting faq commands and channel groups in export response alphabetically
2021-07-25 16:31:27 +02:00
Sheldan
81e58c3f7b [OPB-36] adding oneplus bot stats dashboard
restructuring oneplus bot status dashboard to include jda events and remove less relevant metrics
2021-07-25 15:25:30 +02:00
Sheldan
c04041cb35 [maven-release-plugin] prepare for next development iteration 2021-07-21 23:59:17 +02:00
65 changed files with 6669 additions and 740 deletions

View File

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

View File

@@ -1,11 +1,20 @@
# r/oneplus Discord server bot
This repository contains the rewrite of the [Bot](https://github.com/Rithari/OnePlusBot), which is still in use. The features will be gradually be ported
and most of them will be in [abstracto](https://github.com/Sheldan/abstracto), but some of the features need to be customized, as they are r/oneplus specific.
This repository contains the rewrite of the [Bot](https://github.com/Rithari/OnePlusBot). It is developed by customizing [abstracto](https://github.com/Sheldan/abstracto), because some features are r/oneplus specific.
The migration of the existing data from the database is handled via one time migration, and can be found [here](https://github.com/Sheldan/OnePlusBot-migration).
The FAQ configuration can be found [here](https://github.com/Sheldan/OnePlusBot-faq/).
Custom features which were ported
- [x] FAQ
- [x] Setup channel handling
- [x] Referral link handling
# Technologies used in addition to the ones provided in abstracto
- [grafana](https://github.com/grafana/grafana) for visualization of the bot status and metrics
- [Loki](https://github.com/grafana/loki) to visualize and query log files
- [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

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>dev.sheldan.oneplus.bot.application</groupId>
<artifactId>application</artifactId>
<version>1.5.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>database</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/liquibase.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,18 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
<id>liquibase</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<outputDirectory>.</outputDirectory>
<directory>${project.basedir}/src/main/resources/migrations</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@@ -0,0 +1,10 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
<include file="structure/structure.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View File

@@ -0,0 +1,19 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
<changeSet author="Sheldan" id="create_grafana_user">
<sql>
CREATE USER ${abstractografanadbuser} WITH PASSWORD '${abstractografanadbpass}';
GRANT CONNECT ON DATABASE abstracto TO ${abstractografanadbuser};
GRANT USAGE ON SCHEMA abstracto TO ${abstractografanadbuser};
GRANT SELECT ON ALL TABLES IN SCHEMA abstracto TO ${abstractografanadbuser};
ALTER DEFAULT PRIVILEGES IN SCHEMA abstracto
GRANT SELECT ON TABLES TO ${abstractografanadbuser};
</sql>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,10 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
<include file="grafana_user.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View File

@@ -0,0 +1,10 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
<include file="1.5.4/collection.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application</groupId>
<artifactId>application</artifactId>
<version>1.5.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -1,6 +1,7 @@
package dev.sheldan.oneplus.bot.modules.faq.converter;
import com.google.gson.Gson;
import dev.sheldan.abstracto.core.service.BotService;
import dev.sheldan.oneplus.bot.modules.faq.models.command.config.*;
import dev.sheldan.oneplus.bot.modules.faq.models.database.FAQChannelGroupCommand;
import dev.sheldan.oneplus.bot.modules.faq.models.database.FAQCommand;
@@ -9,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
@@ -18,9 +20,16 @@ public class FAQCommandConfigConverter {
@Autowired
private Gson gson;
@Autowired
private BotService botService;
public String serializeCommands(List<FAQCommand> asList) {
Long botId = botService.getInstance().getSelfUser().getIdLong();
asList.sort(Comparator.comparing(FAQCommand::getName));
List<FaqCommandConfig> config = asList.stream().map(faqCommand -> {
List<FaqCommandResponseConfig> commandResponseConfigs = convertGroupCommands(faqCommand.getGroupResponses());
List<FAQChannelGroupCommand> responses = faqCommand.getGroupResponses();
responses.sort(Comparator.comparing(groupCommand -> groupCommand.getChannelGroup().getChannelGroup().getGroupName()));
List<FaqCommandResponseConfig> commandResponseConfigs = convertGroupCommands(responses, botId);
List<String> aliases;
if(faqCommand.getAliases() != null) {
aliases = faqCommand.getAliases().stream().map(faqCommandAlias -> faqCommandAlias.getId().getAlias()).collect(Collectors.toList());
@@ -39,9 +48,9 @@ public class FAQCommandConfigConverter {
return gson.toJson(config);
}
private List<FaqCommandResponseConfig> convertGroupCommands(List<FAQChannelGroupCommand> responses) {
private List<FaqCommandResponseConfig> convertGroupCommands(List<FAQChannelGroupCommand> responses, Long botUserId) {
return responses.stream().map(faqChannelGroupCommand -> {
List<FaqCommandResponseMessageConfig> responseConfigs = convertCommandResponses(faqChannelGroupCommand.getResponses());
List<FaqCommandResponseMessageConfig> responseConfigs = convertCommandResponses(faqChannelGroupCommand.getResponses(), botUserId);
return FaqCommandResponseConfig
.builder()
.channelGroupName(faqChannelGroupCommand.getChannelGroup().getChannelGroup().getGroupName())
@@ -50,13 +59,14 @@ public class FAQCommandConfigConverter {
}).collect(Collectors.toList());
}
private List<FaqCommandResponseMessageConfig> convertCommandResponses(List<FAQCommandResponse> responses) {
return responses.stream().map(this::convertCommandResponse).collect(Collectors.toList());
private List<FaqCommandResponseMessageConfig> convertCommandResponses(List<FAQCommandResponse> responses, Long botUserId) {
return responses.stream().map(response -> convertCommandResponse(response, botUserId)).collect(Collectors.toList());
}
private FaqCommandResponseMessageConfig convertCommandResponse(FAQCommandResponse response) {
private FaqCommandResponseMessageConfig convertCommandResponse(FAQCommandResponse response, Long botUserId) {
FaqCommandResponseEmbedConfig embedConfig = null;
if(response.getDescription() != null) {
boolean useBot = response.getAuthorUserId().equals(botUserId);
FaqCommandResponseEmbedColorConfig colorConfig = FaqCommandResponseEmbedColorConfig
.builder()
.red(response.getRed())
@@ -65,8 +75,8 @@ public class FAQCommandConfigConverter {
.build();
FaqCommandResponseEmbedAuthorConfig authorConfig = FaqCommandResponseEmbedAuthorConfig
.builder()
.userId(response.getAuthorUserId())
.useBot(null)
.userId(useBot ? null : response.getAuthorUserId())
.useBot(useBot)
.build();
embedConfig = FaqCommandResponseEmbedConfig
.builder()

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
<artifactId>oneplus-bot-modules</artifactId>
<version>1.5.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,17 +5,18 @@
<parent>
<groupId>dev.sheldan.oneplus.bot</groupId>
<artifactId>oneplusbot</artifactId>
<version>1.5.3</version>
<version>1.5.6</version>
</parent>
<groupId>dev.sheldan.oneplus.bot.application</groupId>
<artifactId>application</artifactId>
<packaging>pom</packaging>
<version>1.5.3</version>
<version>1.5.6</version>
<modules>
<module>executable</module>
<module>oneplus-bot-customizations</module>
<module>oneplus-bot-modules</module>
<module>database</module>
</modules>
<dependencyManagement>

View File

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

View File

@@ -4,6 +4,8 @@ DATABASE_PORT=5432
DATABASE_USER=abstracto
DATABASE_NAME=abstracto
DATABASE_PASSWORD=abstracto
GRAFANA_DATABASE_PASSWORD=grafana
GRAFANA_DATABASE_USER=grafana
# deployment configuration, whether or not the container should execute the parts on startup
EXECUTE_DEPLOYMENT=true
EXECUTE_LIQUIBASE=true
@@ -18,6 +20,7 @@ REST_PASSWORD=password
# port grafana will be reachable
GRAFANA_PORT=3000
# port prometheus will be reachable
LOKI_PORT=3100
PROMETHEUS_PORT=9090
# port pg admin will be reachable
PGADMIN_PORT=5050
@@ -26,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.3
ONEPLUS_BOT_VERSION=1.5.6

View File

@@ -25,6 +25,8 @@ services:
DB_PORT: ${DATABASE_PORT}
DB_USER: ${DATABASE_USER}
DB_NAME: ${DATABASE_NAME}
ABSTRACTO_GRAFANA_DB_PASS: ${GRAFANA_DATABASE_PASSWORD}
ABSTRACTO_GRAFANA_DB_USER: ${GRAFANA_DATABASE_USER}
EXECUTE_DEPLOYMENT: ${EXECUTE_DEPLOYMENT}
EXECUTE_LIQUIBASE: ${EXECUTE_LIQUIBASE}
EXECUTE_TEMPLATES: ${EXECUTE_TEMPLATES}
@@ -95,10 +97,40 @@ services:
ports:
- "127.0.0.1:${GRAFANA_PORT}:3000"
restart: unless-stopped
environment:
DB_PASS: ${GRAFANA_DATABASE_PASSWORD}
DB_HOST: ${DATABASE_HOST}
DB_PORT: ${DATABASE_PORT}
DB_USER: ${GRAFANA_DATABASE_USER}
DB_NAME: ${DATABASE_NAME}
PROMETHEUS_HOST: 'prometheus'
PROMETHEUS_PORT: 9090
volumes:
- grafana-user-data:/var/lib/grafana
networks:
- oneplusbot
promtail:
container_name: promtail
image: ${REGISTRY_PREFIX}oneplus_bot_promtail:${ONEPLUS_BOT_VERSION}
depends_on:
- bot
restart: unless-stopped
command: -config.file=/mnt/config/promtail-config.yaml
volumes:
- bot-logs:/logs
networks:
- oneplusbot
loki:
container_name: loki
image: ${REGISTRY_PREFIX}oneplus_bot_loki:${ONEPLUS_BOT_VERSION}
depends_on:
- promtail
command: -config.file=/mnt/config/loki-config.yaml
ports:
- "127.0.0.1:${LOKI_PORT}:3100"
restart: unless-stopped
networks:
- oneplusbot
networks:
oneplusbot:

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.oneplus.bot.deployment</groupId>
<artifactId>deployment</artifactId>
<version>1.5.3</version>
<version>1.5.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -834,6 +834,17 @@
<destFileName>faq.zip</destFileName>
</artifactItem>
<artifactItem>
<groupId>dev.sheldan.oneplus.bot.application</groupId>
<artifactId>database</artifactId>
<version>${project.version}</version>
<classifier>liquibase</classifier>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
<destFileName>database.zip</destFileName>
</artifactItem>
<!-- overrides -->
<artifactItem>

View File

@@ -0,0 +1,6 @@
PROMTAIL_VERSION=2.2.1
LOKI_VERSION=2.2.1
PROMETHEUS_VERSION=v2.28.1
PG_ADMIN_VERSION=5.5
GRAFANA_VERSION=8.0.6
POSTGRES_VERSION=13.3-buster

View File

@@ -1,4 +1,5 @@
FROM postgres
ARG POSTGRES_VERSION
FROM postgres:${POSTGRES_VERSION}
MAINTAINER Sheldan
VOLUME /tmp
ADD sql/init.sql /docker-entrypoint-initdb.d/init.sql

View File

@@ -34,6 +34,7 @@
{ "zip": "anti-raid", "file": "antiRaid-changeLog.xml"},
{ "zip": "dynamic-activity", "file": "dynamicActivity-changeLog.xml"},
{ "zip": "setup", "file": "setup-changeLog.xml"},
{ "zip": "database", "file": "changeLog.xml"},
{ "zip": "referral", "file": "referral-changeLog.xml"},
{ "zip": "starboard-custom", "file": "starboard-custom-changeLog.xml"},
{ "zip": "moderation-custom", "file": "moderation-custom-changeLog.xml"},

View File

@@ -2,13 +2,20 @@ version: "3.7"
services:
bot:
build: oneplusbot
build:
context: oneplusbot
image: ${REGISTRY_PREFIX}oneplus_bot:${VERSION:-latest}
database:
build: database
build:
context: database
args:
POSTGRES_VERSION: ${POSTGRES_VERSION}
image: ${REGISTRY_PREFIX}oneplus_bot_database:${VERSION:-latest}
pg_admin:
build: pgAdmin
build:
context: pgAdmin
args:
PG_ADMIN_VERSION: ${PG_ADMIN_VERSION}
image: ${REGISTRY_PREFIX}oneplus_bot_pg_admin:${VERSION:-latest}
deployment_container:
build:
@@ -18,8 +25,26 @@ services:
ABSTRACTO_VERSION: ${ABSTRACTO_VERSION}
image: ${REGISTRY_PREFIX}oneplus_bot_deployment:${VERSION:-latest}
prometheus:
build: prometheus
build:
context: prometheus
args:
PROMETHEUS_VERSION: ${PROMETHEUS_VERSION}
image: ${REGISTRY_PREFIX}oneplus_bot_prometheus:${VERSION:-latest}
grafana:
build: grafana
build:
context: grafana
args:
GRAFANA_VERSION: ${GRAFANA_VERSION}
image: ${REGISTRY_PREFIX}oneplus_bot_grafana:${VERSION:-latest}
promtail:
build:
context: promtail
args:
PROMTAIL_VERSION: ${PROMTAIL_VERSION}
image: ${REGISTRY_PREFIX}oneplus_bot_promtail:${VERSION:-latest}
loki:
build:
context: loki
args:
LOKI_VERSION: ${LOKI_VERSION}
image: ${REGISTRY_PREFIX}oneplus_bot_loki:${VERSION:-latest}

View File

@@ -1,4 +1,5 @@
FROM grafana/grafana
ARG GRAFANA_VERSION
FROM grafana/grafana:${GRAFANA_VERSION}
MAINTAINER Sheldan
ADD ./provisioning /etc/grafana/provisioning
ADD ./config.ini /etc/grafana/config.ini

View File

@@ -1,3 +1,4 @@
apiVersion: 1
datasources:
- access: 'proxy'
editable: true
@@ -5,5 +6,18 @@ datasources:
name: 'prometheus'
org_id: 1
type: 'prometheus'
url: 'http://prometheus:9090'
version: 1
url: 'http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT}'
version: 1
- name: 'postgres-db'
type: postgres
access: 'proxy'
url: '${DB_HOST}:${DB_PORT}'
password: '${DB_PASS}'
user: '${DB_USER}'
database: '${DB_NAME}'
basicAuth: false
is_default: false
jsonData:
sslmode: 'disable'
version: 1
editable: false

View File

@@ -0,0 +1,4 @@
ARG LOKI_VERSION
FROM grafana/loki:${LOKI_VERSION}
MAINTAINER Sheldan
ADD loki.yml /mnt/config/loki-config.yaml

View File

@@ -0,0 +1,66 @@
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
ingester:
wal:
enabled: true
dir: /tmp/wal
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 1h
max_chunk_age: 1h
chunk_target_size: 1048576
chunk_retain_period: 30s
max_transfer_retries: 0
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
active_index_directory: /tmp/loki/boltdb-shipper-active
cache_location: /tmp/loki/boltdb-shipper-cache
cache_ttl: 24h
shared_store: filesystem
filesystem:
directory: /tmp/loki/chunks
compactor:
working_directory: /tmp/loki/boltdb-shipper-compactor
shared_store: filesystem
limits_config:
reject_old_samples: true
reject_old_samples_max_age: 168h
chunk_store_config:
max_look_back_period: 0s
table_manager:
retention_deletes_enabled: true
retention_period: 360h
ruler:
storage:
type: local
local:
directory: /tmp/loki/rules
rule_path: /tmp/loki/rules-temp
ring:
kvstore:
store: inmemory

View File

@@ -1,4 +1,5 @@
FROM dpage/pgadmin4
ARG PG_ADMIN_VERSION
FROM dpage/pgadmin4:${PG_ADMIN_VERSION}
MAINTAINER Sheldan
VOLUME /tmp
ADD config/servers.json /pgadmin4/servers.json

View File

@@ -1,3 +1,4 @@
FROM prom/prometheus
ARG PROMETHEUS_VERSION
FROM prom/prometheus:${PROMETHEUS_VERSION}
MAINTAINER Sheldan
ADD prometheus.yml /etc/prometheus/prometheus.yml

View File

@@ -0,0 +1,4 @@
ARG PROMTAIL_VERSION
FROM grafana/promtail:${PROMTAIL_VERSION}
MAINTAINER Sheldan
ADD promtail.yaml /mnt/config/promtail-config.yaml

View File

@@ -0,0 +1,17 @@
server:
disable: true
positions:
filename: /tmp/positions.yaml
clients:
- url: http://loki:3100/loki/api/v1/push
scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: oneplus-bot-logs
__path__: /logs/*.log

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>oneplusbot</artifactId>
<groupId>dev.sheldan.oneplus.bot</groupId>
<version>1.5.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.4</abstracto.version>
<abstracto.templates.version>1.2.17</abstracto.templates.version>
<abstracto.version>1.3.7</abstracto.version>
<abstracto.templates.version>1.2.19</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.3</tag>
<tag>oneplusbot-1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</version>
</parent>
<modules>
@@ -15,7 +15,7 @@
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
<artifactId>templates</artifactId>
<version>1.5.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</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.3</version>
<version>1.5.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>