mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-02 07:44:19 +00:00
Compare commits
69 Commits
sissi-1.3.
...
sissi-1.4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e9518de71 | ||
|
|
0ecab3b21b | ||
|
|
5e0e546eb4 | ||
|
|
ade0d4e57d | ||
|
|
26b08c593c | ||
|
|
888f2bd402 | ||
|
|
eb369d9116 | ||
|
|
f2acdbdd81 | ||
|
|
d65f6d380f | ||
|
|
30d45952be | ||
|
|
068cbdb33c | ||
|
|
effca93b7a | ||
|
|
ac815b5972 | ||
|
|
e6cccef48d | ||
|
|
4f35aa56f4 | ||
|
|
66204ca061 | ||
|
|
2960173517 | ||
|
|
b810c25613 | ||
|
|
583c2cc4be | ||
|
|
0c36564331 | ||
|
|
d7bd458bed | ||
|
|
bbcd77e3c8 | ||
|
|
ec166167f4 | ||
|
|
d5b4835d1f | ||
|
|
41304551e4 | ||
|
|
279959f256 | ||
|
|
7cc0e8e21c | ||
|
|
87e9122c41 | ||
|
|
f22cc03e14 | ||
|
|
84b103cfba | ||
|
|
a015e01c40 | ||
|
|
981db7b43f | ||
|
|
65560991bc | ||
|
|
b914ba035f | ||
|
|
d3e77f17ec | ||
|
|
9498458165 | ||
|
|
03a112fb43 | ||
|
|
782773fef5 | ||
|
|
5076e79c1d | ||
|
|
ac1baa4734 | ||
|
|
2c508665be | ||
|
|
1023951a76 | ||
|
|
a1923427a0 | ||
|
|
4c8ca91712 | ||
|
|
f78ab3372e | ||
|
|
c70815f25d | ||
|
|
7ee3653ab9 | ||
|
|
bb60d767a7 | ||
|
|
5a34447abe | ||
|
|
bbcfcfcc6f | ||
|
|
75187cae00 | ||
|
|
710a039707 | ||
|
|
b7dcb72e7a | ||
|
|
ead142cf5d | ||
|
|
11bf8cc9bc | ||
|
|
1083f93d2c | ||
|
|
6de38d3bea | ||
|
|
9de6eb4b8b | ||
|
|
df1392bf84 | ||
|
|
6e065de915 | ||
|
|
a1820aea67 | ||
|
|
09c113c6bc | ||
|
|
d080292e85 | ||
|
|
0e9ea8cf1a | ||
|
|
5d1037f66d | ||
|
|
eb6251aae0 | ||
|
|
caccf8b405 | ||
|
|
5390c0e53e | ||
|
|
8732064764 |
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@@ -17,11 +17,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
java-version: 1.8
|
||||
persist-credentials: false
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: 17
|
||||
- name: Build with Maven
|
||||
run: mvn -s settings.xml -B install --file pom.xml
|
||||
env:
|
||||
|
||||
36
.github/workflows/release.yml
vendored
36
.github/workflows/release.yml
vendored
@@ -6,13 +6,14 @@ jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up Java for publishing to GitHub Packages
|
||||
uses: actions/setup-java@v1
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 1.8
|
||||
distribution: 'corretto'
|
||||
java-version: 17
|
||||
- name: Load current version
|
||||
id: version
|
||||
run: echo "version=$(mvn -s settings.xml --file pom.xml -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
|
||||
@@ -22,17 +23,26 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
user: Sheldan
|
||||
token: ${{ secrets.ABSTRACTO_PAT }}
|
||||
- name: Login to GitHub Packages Docker Registry
|
||||
uses: docker/login-action@v1
|
||||
- name: Login to Harbor
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: docker.pkg.github.com
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Push deployment container
|
||||
registry: harbor.sheldan.dev
|
||||
username: ${{ secrets.HARBOR_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_TOKEN }}
|
||||
- name: Load env files
|
||||
id: dotenv
|
||||
uses: falti/dotenv-action@v1.0.4
|
||||
with:
|
||||
path: ./deployment/image-packaging/src/main/docker/.env
|
||||
- name: Push container
|
||||
working-directory: ./deployment/image-packaging/src/main/docker
|
||||
run: docker-compose build && docker-compose push
|
||||
env:
|
||||
REGISTRY_PREFIX: docker.pkg.github.com/sheldan/sissi/
|
||||
VERSION: ${{ env.version }}
|
||||
ABSTRACTO_VERSION: 1.4.14
|
||||
ABSTRACTO_REGISTRY_PREFIX: docker.pkg.github.com/sheldan/abstracto/
|
||||
REGISTRY_PREFIX: ${{ steps.dotenv.outputs.registry_prefix }}
|
||||
VERSION: ${{ steps.dotenv.outputs.version }}
|
||||
- name: Helm push
|
||||
working-directory: ./deployment/helm/
|
||||
run: |-
|
||||
helm registry login -u '${{ secrets.HARBOR_USERNAME }}' -p '${{ secrets.HARBOR_TOKEN }}' harbor.sheldan.dev
|
||||
helm package sissi
|
||||
helm push sissi*.tgz oci://harbor.sheldan.dev/sissi
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Sheldan
|
||||
Copyright (c) 2023 Sheldan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
37
Tiltfile
Normal file
37
Tiltfile
Normal file
@@ -0,0 +1,37 @@
|
||||
allow_k8s_contexts('k8s-cluster')
|
||||
|
||||
load('ext://restart_process', 'docker_build_with_restart')
|
||||
registry = 'harbor.sheldan.dev/sissi/'
|
||||
|
||||
local_resource(
|
||||
'sissi-java-compile',
|
||||
'mvn install && ' +
|
||||
'rm -rf application/executable/target/jar-staging && ' +
|
||||
'unzip -o application/executable/target/sissi-exec.jar -d application/executable/target/jar-staging && ' +
|
||||
'rsync --delete --inplace --checksum -r application/executable/target/jar-staging/ application/executable/target/jar && ' +
|
||||
'mkdir application/executable/target/jar/snapshots && ' +
|
||||
'rsync --delete --inplace --checksum -r application/executable/target/jar/BOOT-INF/lib/*-SNAPSHOT.jar application/executable/target/jar/snapshots && ' +
|
||||
'rm -f application/executable/target/jar/BOOT-INF/lib/*-SNAPSHOT.jar ',
|
||||
deps=['pom.xml'])
|
||||
|
||||
docker_build_with_restart(
|
||||
registry + 'sissi',
|
||||
'./application/executable/target/jar',
|
||||
entrypoint=['java', '-noverify', '-cp', '.:./lib/*', 'dev.sheldan.sissi.executable.Application'],
|
||||
dockerfile='./application/executable/Dockerfile',
|
||||
live_update=[
|
||||
sync('./application/executable/target/jar/BOOT-INF/lib', '/app/lib'),
|
||||
sync('./application/executable/target/jar/META-INF', '/app/META-INF'),
|
||||
sync('./application/executable/target/jar/BOOT-INF/classes', '/app'),
|
||||
sync('./application/executable/target/jar/snapshots', '/app/lib')
|
||||
],
|
||||
)
|
||||
|
||||
docker_build(registry + 'sissi-db-data', 'deployment/image-packaging/src/main/docker/db-data/')
|
||||
docker_build(registry + 'sissi-template-data', 'deployment/image-packaging/src/main/docker/template-data/')
|
||||
|
||||
|
||||
k8s_yaml(helm('deployment/helm/sissi', values=
|
||||
['./../Sissi-environments/values/local/values.yaml',
|
||||
'secrets://./../Sissi-environments/values/local/values.secrets.yaml']
|
||||
))
|
||||
10
application/executable/Dockerfile
Normal file
10
application/executable/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM amazoncorretto:17.0.8-alpine3.18
|
||||
RUN apk add entr
|
||||
|
||||
WORKDIR /app
|
||||
ADD BOOT-INF/lib/ /app/lib
|
||||
ADD snapshots/ /app/lib
|
||||
ADD META-INF /app/META-INF
|
||||
ADD BOOT-INF/classes /app
|
||||
|
||||
ENTRYPOINT java -cp .:./lib/* dev.sheldan.sissi.executable.Application
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.3.15</version>
|
||||
<version>1.4.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>executable</artifactId>
|
||||
@@ -14,6 +14,7 @@
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<finalName>sissi</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -75,6 +76,11 @@
|
||||
<artifactId>webservices-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>twitch-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>utility-impl</artifactId>
|
||||
@@ -130,6 +136,11 @@
|
||||
<artifactId>logging-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>statistic-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- sissi modules -->
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package dev.sheldan.sissi.executable;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
|
||||
@Configuration
|
||||
public class SecurityConfig {
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().permitAll());
|
||||
return http.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/abstracto
|
||||
spring.datasource.username=abstracto
|
||||
spring.datasource.password=abstracto
|
||||
spring.jpa.properties.hibernate.default_schema=abstracto
|
||||
spring.quartz.jdbc.initialize-schema=never
|
||||
|
||||
spring.jpa.hibernate.ddl-auto = none
|
||||
|
||||
spring.jpa.show-sql = false
|
||||
|
||||
spring.jpa.properties.hibernate.format_sql = true
|
||||
log4j.logger.org.hibernate.SQL=trace
|
||||
log4j.logger.org.hibernate.type.descriptor.sql=trace
|
||||
log4j.logger.org.hibernate.type=trace
|
||||
|
||||
management.metrics.tags.application=sissi
|
||||
spring.security.user.name=abstracto
|
||||
spring.security.user.password=password
|
||||
spring.security.user.roles=USER
|
||||
|
||||
spring.application.name=Sissi
|
||||
@@ -1,11 +1,13 @@
|
||||
spring.datasource.url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}
|
||||
spring.datasource.username= ${DB_USER}
|
||||
spring.datasource.password= ${DB_PASS}
|
||||
spring.jpa.hibernate.default_schema=${DB_NAME}
|
||||
spring.jpa.hibernate.default_schema=abstracto
|
||||
spring.jpa.properties.hibernate.default_schema=abstracto
|
||||
spring.quartz.jdbc.initialize-schema=never
|
||||
management.metrics.tags.application=Sissi
|
||||
spring.security.user.name= ${REST_USER_NAME}
|
||||
spring.security.user.password= ${REST_PASSWORD}
|
||||
spring.security.user.roles=USER
|
||||
management.endpoint.health.probes.enabled=true
|
||||
management.health.livenessState.enabled=true
|
||||
management.health.readinessState.enabled=true
|
||||
spring.application.name=Sissi
|
||||
|
||||
spring.application.name=Sissi
|
||||
spring.main.allow-circular-references=true
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<version>1.3.15</version>
|
||||
<version>1.4.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application.module.custom</groupId>
|
||||
<artifactId>sissi-customizations</artifactId>
|
||||
<version>1.3.15</version>
|
||||
<version>1.4.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>application</artifactId>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<version>1.3.15</version>
|
||||
<version>1.4.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,13 +3,20 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.3.15</version>
|
||||
<version>1.4.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>dev.sheldan.sissi.application.module</groupId>
|
||||
<artifactId>debra</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
@@ -4,24 +4,32 @@ import dev.sheldan.abstracto.core.command.UtilityModuleDefinition;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
|
||||
import dev.sheldan.abstracto.core.interaction.InteractionService;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
|
||||
import dev.sheldan.abstracto.core.service.ChannelService;
|
||||
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.templating.service.TemplateService;
|
||||
import dev.sheldan.abstracto.core.utils.FutureUtils;
|
||||
import dev.sheldan.sissi.module.debra.config.DebraFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.debra.config.DebraSlashCommandNames;
|
||||
import dev.sheldan.sissi.module.debra.converter.DonationConverter;
|
||||
import dev.sheldan.sissi.module.debra.model.api.DonationsResponse;
|
||||
import dev.sheldan.sissi.module.debra.model.commands.DonationsModel;
|
||||
import dev.sheldan.sissi.module.debra.service.DonationService;
|
||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
||||
@@ -30,6 +38,8 @@ public class Donations extends AbstractConditionableCommand {
|
||||
|
||||
private static final String DONATIONS_COMMAND_NAME = "donations";
|
||||
private static final String DONATIONS_RESPONSE_TEMPLATE_KEY = "donations_response";
|
||||
private static final String SELECTION_PARAMETER = "type";
|
||||
private static final String SELECTION_VALUE_PARAMETER = "parametervalue";
|
||||
|
||||
@Autowired
|
||||
private ChannelService channelService;
|
||||
@@ -43,26 +53,81 @@ public class Donations extends AbstractConditionableCommand {
|
||||
@Autowired
|
||||
private TemplateService templateService;
|
||||
|
||||
@Autowired
|
||||
private DonationConverter donationConverter;
|
||||
|
||||
@Autowired
|
||||
private SlashCommandParameterService slashCommandParameterService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
MessageToSend messageToSend = getDonationMessageToSend();
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
MessageToSend messageToSend;
|
||||
if(parameters.isEmpty()) {
|
||||
messageToSend = getDonationMessageToSend(commandContext.getGuild().getIdLong(), null, null);
|
||||
} else {
|
||||
String type = (String) parameters.get(0);
|
||||
Integer selectionValue = (Integer) parameters.get(1);
|
||||
Integer top = null;
|
||||
Integer latest = null;
|
||||
switch (type) {
|
||||
case "top": top = selectionValue; break;
|
||||
default:
|
||||
case "latest" :
|
||||
latest = selectionValue; break;
|
||||
}
|
||||
messageToSend = getDonationMessageToSend(commandContext.getGuild().getIdLong(), top, latest);
|
||||
}
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendMessageToSendToChannel(messageToSend, commandContext.getChannel()))
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
|
||||
MessageToSend messageToSend = getDonationMessageToSend();
|
||||
String selectionType = null;
|
||||
if(slashCommandParameterService.hasCommandOption(SELECTION_PARAMETER, event)) {
|
||||
selectionType = slashCommandParameterService.getCommandOption(SELECTION_PARAMETER, event, String.class);
|
||||
}
|
||||
Integer selectionValue = 5;
|
||||
if(slashCommandParameterService.hasCommandOption(SELECTION_VALUE_PARAMETER, event)) {
|
||||
selectionValue = slashCommandParameterService.getCommandOption(SELECTION_VALUE_PARAMETER, event, Integer.class);
|
||||
}
|
||||
if(selectionValue > 20) {
|
||||
selectionValue = 5;
|
||||
}
|
||||
Integer top = null;
|
||||
Integer latest = null;
|
||||
if(selectionType != null) {
|
||||
switch (selectionType) {
|
||||
case "top": top = selectionValue; break;
|
||||
default:
|
||||
case "latest" :
|
||||
latest = selectionValue; break;
|
||||
}
|
||||
}
|
||||
|
||||
MessageToSend messageToSend = getDonationMessageToSend(event.getGuild().getIdLong(), top, latest);
|
||||
return interactionService.replyMessageToSend(messageToSend, event)
|
||||
.thenApply(interactionHook -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
private MessageToSend getDonationMessageToSend() {
|
||||
BigDecimal currentDonationAmount = donationService.fetchCurrentDonationAmount();
|
||||
DonationsModel donationModel = DonationsModel
|
||||
.builder()
|
||||
.donationAmount(currentDonationAmount)
|
||||
.build();
|
||||
private MessageToSend getDonationMessageToSend(Long serverId, Integer top, Integer latest) {
|
||||
DonationsModel donationModel;
|
||||
try {
|
||||
DonationsResponse donationResponse = donationService.fetchCurrentDonationAmount(serverId);
|
||||
donationModel = donationConverter.convertDonationResponse(donationResponse);
|
||||
if(top != null) {
|
||||
donationModel.setDonations(donationService.getHighestDonations(donationResponse, top));
|
||||
donationModel.setType(DonationsModel.DonationType.TOP);
|
||||
} else if(latest != null) {
|
||||
donationModel.setType(DonationsModel.DonationType.LATEST);
|
||||
donationModel.setDonations(donationService.getLatestDonations(donationResponse, latest));
|
||||
} else {
|
||||
donationModel.setDonations(new ArrayList<>());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new AbstractoRunTimeException("Failed to load donation amount.", e);
|
||||
}
|
||||
return templateService.renderEmbedTemplate(DONATIONS_RESPONSE_TEMPLATE_KEY, donationModel);
|
||||
}
|
||||
|
||||
@@ -77,15 +142,35 @@ public class Donations extends AbstractConditionableCommand {
|
||||
.builder()
|
||||
.enabled(true)
|
||||
.rootCommandName(DebraSlashCommandNames.DEBRA)
|
||||
.commandName("donations")
|
||||
.commandName(DONATIONS_COMMAND_NAME)
|
||||
.build();
|
||||
|
||||
Parameter selectionParameter = Parameter
|
||||
.builder()
|
||||
.templated(true)
|
||||
.name(SELECTION_PARAMETER)
|
||||
.optional(true)
|
||||
.type(String.class)
|
||||
.build();
|
||||
|
||||
|
||||
Parameter selectionValueParameter = Parameter
|
||||
.builder()
|
||||
.templated(true)
|
||||
.name(SELECTION_VALUE_PARAMETER)
|
||||
.optional(true)
|
||||
.type(Integer.class)
|
||||
.build();
|
||||
|
||||
List<Parameter> parameters = Arrays.asList(selectionParameter, selectionValueParameter);
|
||||
|
||||
return CommandConfiguration.builder()
|
||||
.name(DONATIONS_COMMAND_NAME)
|
||||
.module(UtilityModuleDefinition.UTILITY)
|
||||
.templated(true)
|
||||
.slashCommandConfig(slashCommandConfig)
|
||||
.async(true)
|
||||
.parameters(parameters)
|
||||
.supportsEmbedException(true)
|
||||
.causesReaction(false)
|
||||
.help(helpInfo)
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.List;
|
||||
public class DebraFeatureConfig implements FeatureConfig {
|
||||
|
||||
public static final String DEBRA_DONATION_NOTIFICATION_DELAY_CONFIG_KEY = "debraDonationNotificationDelayMillis";
|
||||
public static final String DEBRA_DONATION_API_FETCH_SIZE_KEY = "debraDonationApiFetchSize";
|
||||
public static final String DEBRA_DONATION_NOTIFICATION_SERVER_ID_ENV_NAME = "DEBRA_DONATION_NOTIFICATION_SERVER_ID";
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
@@ -25,6 +26,6 @@ public class DebraFeatureConfig implements FeatureConfig {
|
||||
|
||||
@Override
|
||||
public List<String> getRequiredSystemConfigKeys() {
|
||||
return Arrays.asList(DEBRA_DONATION_NOTIFICATION_DELAY_CONFIG_KEY);
|
||||
return Arrays.asList(DEBRA_DONATION_NOTIFICATION_DELAY_CONFIG_KEY, DEBRA_DONATION_API_FETCH_SIZE_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,5 +11,5 @@ import org.springframework.context.annotation.Configuration;
|
||||
@ConfigurationProperties(prefix = "sissi.debra")
|
||||
public class DebraProperties {
|
||||
private String websocketURL;
|
||||
private String donationsPageURL;
|
||||
private String donationAPIUrl;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.sheldan.sissi.module.debra.converter;
|
||||
|
||||
import dev.sheldan.sissi.module.debra.model.api.Donation;
|
||||
import dev.sheldan.sissi.module.debra.model.api.DonationsResponse;
|
||||
import dev.sheldan.sissi.module.debra.model.commands.DonationItemModel;
|
||||
import dev.sheldan.sissi.module.debra.model.commands.DonationsModel;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class DonationConverter {
|
||||
public DonationItemModel convertDonation(Donation donation) {
|
||||
return DonationItemModel
|
||||
.builder()
|
||||
.donationAmount(donation.getAmount())
|
||||
.firstName(donation.getFirstname())
|
||||
.lastName(donation.getLastname())
|
||||
.anonymous(BooleanUtils.toBoolean(donation.getAnonym()))
|
||||
.build();
|
||||
}
|
||||
|
||||
public DonationsModel convertDonationResponse(DonationsResponse response) {
|
||||
return DonationsModel
|
||||
.builder()
|
||||
.totalAmount(response.getPage().getCollected())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package dev.sheldan.sissi.module.debra.listener;
|
||||
import dev.sheldan.abstracto.core.listener.AsyncStartupListener;
|
||||
import dev.sheldan.abstracto.core.service.ConfigService;
|
||||
import dev.sheldan.sissi.module.debra.config.DebraProperties;
|
||||
import dev.sheldan.sissi.module.debra.model.Donation;
|
||||
import dev.sheldan.sissi.module.debra.model.listener.DonationResponseModel;
|
||||
import dev.sheldan.sissi.module.debra.service.DonationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
@@ -49,7 +49,7 @@ public class WebsocketListener extends WebSocketListener implements AsyncStartup
|
||||
log.info("Waiting {} milli seconds to send notification.", delayMillis);
|
||||
Thread.sleep(delayMillis);
|
||||
log.info("Loading new donation amount and sending notification.");
|
||||
Donation donation = donationService.parseDonationFromMessage(text);
|
||||
DonationResponseModel donation = donationService.parseDonationFromMessage(text);
|
||||
donationService.sendDonationNotification(donation).thenAccept(unused -> {
|
||||
log.info("Successfully notified about donation.");
|
||||
}).exceptionally(throwable -> {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package dev.sheldan.sissi.module.debra.model.api;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class Description {
|
||||
private BigDecimal collected;
|
||||
private BigDecimal target;
|
||||
private String currency;
|
||||
private String slug;
|
||||
private String displayName;
|
||||
private BigDecimal collectedNet;
|
||||
private BigDecimal percent;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package dev.sheldan.sissi.module.debra.model.api;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class Donation {
|
||||
private BigDecimal amount;
|
||||
private String currency;
|
||||
private String text;
|
||||
private Integer anonym;
|
||||
private String firstname;
|
||||
private String lastname;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.sheldan.sissi.module.debra.model.api;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class DonationsResponse {
|
||||
private Description page;
|
||||
private BigInteger donationCount;
|
||||
private List<Donation> donations;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.sheldan.sissi.module.debra.model.commands;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class DonationItemModel {
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
private BigDecimal donationAmount;
|
||||
private Boolean anonymous;
|
||||
}
|
||||
@@ -2,11 +2,21 @@ package dev.sheldan.sissi.module.debra.model.commands;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Setter
|
||||
public class DonationsModel {
|
||||
private BigDecimal donationAmount;
|
||||
private BigDecimal totalAmount;
|
||||
private DonationType type;
|
||||
private List<DonationItemModel> donations;
|
||||
|
||||
public enum DonationType {
|
||||
LATEST, TOP
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package dev.sheldan.sissi.module.debra.model.listener;
|
||||
|
||||
import dev.sheldan.sissi.module.debra.model.Donation;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -9,6 +8,6 @@ import java.math.BigDecimal;
|
||||
@Getter
|
||||
@Builder
|
||||
public class DonationNotificationModel {
|
||||
private Donation donation;
|
||||
private DonationResponseModel donation;
|
||||
private BigDecimal totalDonationAmount;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.sheldan.sissi.module.debra.model;
|
||||
package dev.sheldan.sissi.module.debra.model.listener;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
@@ -9,7 +9,7 @@ import java.math.BigDecimal;
|
||||
@Getter
|
||||
@Builder
|
||||
@ToString
|
||||
public class Donation {
|
||||
public class DonationResponseModel {
|
||||
private String donatorName;
|
||||
private BigDecimal amount;
|
||||
private String message;
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.sheldan.sissi.module.debra.service;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class BigDecimalGsonAdapter implements JsonDeserializer<BigDecimal> {
|
||||
@Override
|
||||
public BigDecimal deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
try {
|
||||
return new BigDecimal(json.getAsString()
|
||||
.replace(".", "")
|
||||
.replace(',', '.'));
|
||||
} catch (NumberFormatException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package dev.sheldan.sissi.module.debra.service;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import dev.sheldan.abstracto.core.service.ConfigService;
|
||||
import dev.sheldan.abstracto.core.service.PostTargetService;
|
||||
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.templating.service.TemplateService;
|
||||
@@ -7,25 +10,32 @@ import dev.sheldan.abstracto.core.utils.FutureUtils;
|
||||
import dev.sheldan.sissi.module.debra.DonationAmountNotFoundException;
|
||||
import dev.sheldan.sissi.module.debra.config.DebraPostTarget;
|
||||
import dev.sheldan.sissi.module.debra.config.DebraProperties;
|
||||
import dev.sheldan.sissi.module.debra.model.Donation;
|
||||
import dev.sheldan.sissi.module.debra.converter.DonationConverter;
|
||||
import dev.sheldan.sissi.module.debra.model.api.Donation;
|
||||
import dev.sheldan.sissi.module.debra.model.api.DonationsResponse;
|
||||
import dev.sheldan.sissi.module.debra.model.commands.DonationItemModel;
|
||||
import dev.sheldan.sissi.module.debra.model.commands.DonationsModel;
|
||||
import dev.sheldan.sissi.module.debra.model.listener.DonationResponseModel;
|
||||
import dev.sheldan.sissi.module.debra.model.listener.DonationNotificationModel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URL;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static dev.sheldan.sissi.module.debra.config.DebraFeatureConfig.DEBRA_DONATION_API_FETCH_SIZE_KEY;
|
||||
import static dev.sheldan.sissi.module.debra.config.DebraFeatureConfig.DEBRA_DONATION_NOTIFICATION_SERVER_ID_ENV_NAME;
|
||||
|
||||
@Component
|
||||
@@ -41,19 +51,27 @@ public class DonationService {
|
||||
@Autowired
|
||||
private TemplateService templateService;
|
||||
|
||||
@Autowired
|
||||
private OkHttpClient okHttpClient;
|
||||
|
||||
@Autowired
|
||||
private DonationConverter donationConverter;
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
private static final String DEBRA_DONATION_NOTIFICATION_TEMPLATE_KEY = "debra_donation_notification";
|
||||
|
||||
private static final Pattern MESSAGE_PATTERN = Pattern.compile("(.*) hat (\\d{1,9},\\d{2}) Euro gespendet!<br \\/>Vielen Dank!<br \\/>Nachricht:<br \\/>(.*)");
|
||||
private static final Pattern DONATION_PAGE_AMOUNT_PARTNER = Pattern.compile("\"metric4\",\\s*\"(.*)\"");
|
||||
|
||||
public Donation parseDonationFromMessage(String message) {
|
||||
public DonationResponseModel parseDonationFromMessage(String message) {
|
||||
Matcher matcher = MESSAGE_PATTERN.matcher(message);
|
||||
if (matcher.find()) {
|
||||
String donatorName = matcher.group(1);
|
||||
String amountString = matcher.group(2);
|
||||
BigDecimal amount = new BigDecimal(amountString.replace(',', '.'));
|
||||
String donationMessage = Optional.ofNullable(matcher.group(3)).map(msg -> msg.replaceAll("(<br>)+", " ")).map(String::trim).orElse("");
|
||||
return Donation
|
||||
return DonationResponseModel
|
||||
.builder()
|
||||
.message(donationMessage)
|
||||
.donatorName(donatorName)
|
||||
@@ -64,32 +82,67 @@ public class DonationService {
|
||||
}
|
||||
}
|
||||
|
||||
public BigDecimal fetchCurrentDonationAmount() {
|
||||
try (InputStream is = new URL(debraProperties.getDonationsPageURL()).openStream()) {
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
Matcher matcher = DONATION_PAGE_AMOUNT_PARTNER.matcher(line);
|
||||
if (matcher.find()) {
|
||||
return new BigDecimal(matcher.group(1).replace(',', '.'));
|
||||
}
|
||||
}
|
||||
log.warn("Did not find the donation amount in the configured URL {}", debraProperties.getDonationsPageURL());
|
||||
throw new DonationAmountNotFoundException();
|
||||
} catch (IOException ex) {
|
||||
log.warn("Failed to load page for parsing donation amount {}.", debraProperties.getDonationsPageURL(), ex);
|
||||
throw new DonationAmountNotFoundException();
|
||||
}
|
||||
public List<DonationItemModel> getHighestDonations(DonationsResponse response, Integer maxCount) {
|
||||
List<Donation> topDonations = response
|
||||
.getDonations()
|
||||
.stream()
|
||||
.sorted(Comparator.comparing(Donation::getAmount)
|
||||
.reversed())
|
||||
.collect(Collectors.toList());
|
||||
return topDonations
|
||||
.stream()
|
||||
.limit(maxCount)
|
||||
.map(donation -> donationConverter.convertDonation(donation))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> sendDonationNotification(Donation donation) {
|
||||
public List<DonationItemModel> getLatestDonations(DonationsResponse response, Integer maxCount) {
|
||||
return response
|
||||
.getDonations()
|
||||
.stream()
|
||||
.limit(maxCount)
|
||||
.map(donation -> donationConverter.convertDonation(donation))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public DonationsResponse fetchCurrentDonationAmount(Long serverId) throws IOException {
|
||||
Long fetchSize = configService.getLongValueOrConfigDefault(DEBRA_DONATION_API_FETCH_SIZE_KEY, serverId);
|
||||
Request request = new Request.Builder()
|
||||
.url(String.format(debraProperties.getDonationAPIUrl(), fetchSize))
|
||||
.get()
|
||||
.build();
|
||||
Response response = okHttpClient.newCall(request).execute();
|
||||
if(!response.isSuccessful()) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.error("Failed to retrieve urban dictionary definition. Response had code {} with body {}.",
|
||||
response.code(), response.body());
|
||||
}
|
||||
throw new DonationAmountNotFoundException();
|
||||
}
|
||||
Gson gson = getGson();
|
||||
|
||||
return gson.fromJson(response.body().string(), DonationsResponse.class);
|
||||
}
|
||||
|
||||
private Gson getGson() {
|
||||
return new GsonBuilder()
|
||||
.registerTypeAdapter(BigDecimal.class, new BigDecimalGsonAdapter())
|
||||
.create();
|
||||
}
|
||||
|
||||
private DonationsModel getDonationInfoModel(Long serverId) throws IOException {
|
||||
return donationConverter.convertDonationResponse(fetchCurrentDonationAmount(serverId));
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> sendDonationNotification(DonationResponseModel donation) throws IOException {
|
||||
Long targetServerId = Long.parseLong(System.getenv(DEBRA_DONATION_NOTIFICATION_SERVER_ID_ENV_NAME));
|
||||
DonationsModel donationInfoModel = getDonationInfoModel(targetServerId);
|
||||
DonationNotificationModel model = DonationNotificationModel
|
||||
.builder()
|
||||
.donation(donation)
|
||||
.totalDonationAmount(fetchCurrentDonationAmount())
|
||||
.totalDonationAmount(donationInfoModel.getTotalAmount())
|
||||
.build();
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(DEBRA_DONATION_NOTIFICATION_TEMPLATE_KEY, model);
|
||||
Long targetServerId = Long.parseLong(System.getenv(DEBRA_DONATION_NOTIFICATION_SERVER_ID_ENV_NAME));
|
||||
List<CompletableFuture<Message>> firstMessage = postTargetService.sendEmbedInPostTarget(messageToSend, DebraPostTarget.DEBRA_DONATION_NOTIFICATION, targetServerId);
|
||||
List<CompletableFuture<Message>> secondMessage = postTargetService.sendEmbedInPostTarget(messageToSend, DebraPostTarget.DEBRA_DONATION_NOTIFICATION2, targetServerId);
|
||||
firstMessage.addAll(secondMessage);
|
||||
|
||||
@@ -5,7 +5,10 @@ abstracto.postTargets.debraDonationNotification.name=debraDonationNotification
|
||||
abstracto.postTargets.debraDonationNotification2.name=debraDonationNotification2
|
||||
|
||||
sissi.debra.websocketURL=ws://spenden.baba.fm:8765/
|
||||
sissi.debra.donationsPageURL=https://em.altruja.de/discord-fuer-debra-2022
|
||||
sissi.debra.donationAPIUrl=https://www.altruja.de/api/page/discord-fuer-debra-2022?details=1&num=%s&ort=0
|
||||
|
||||
abstracto.systemConfigs.debraDonationNotificationDelayMillis.name=debraDonationNotificationDelayMillis
|
||||
abstracto.systemConfigs.debraDonationNotificationDelayMillis.longValue=60000
|
||||
abstracto.systemConfigs.debraDonationNotificationDelayMillis.longValue=60000
|
||||
|
||||
abstracto.systemConfigs.debraDonationApiFetchSize.name=debraDonationApiFetchSize
|
||||
abstracto.systemConfigs.debraDonationApiFetchSize.longValue=1000
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.3.15</version>
|
||||
<version>1.4.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
package dev.sheldan.sissi.module.meetup.commands;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.UtilityModuleDefinition;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.interaction.InteractionService;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
|
||||
import dev.sheldan.sissi.module.meetup.config.MeetupFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.meetup.config.MeetupSlashCommandNames;
|
||||
import dev.sheldan.sissi.module.meetup.exception.NotMeetupOrganizerException;
|
||||
import dev.sheldan.sissi.module.meetup.model.database.Meetup;
|
||||
import dev.sheldan.sissi.module.meetup.service.MeetupServiceBean;
|
||||
import dev.sheldan.sissi.module.meetup.service.management.MeetupManagementServiceBean;
|
||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class ChangeMeetup extends AbstractConditionableCommand {
|
||||
|
||||
private static final String CHANGE_MEETUP_COMMAND = "changeMeetup";
|
||||
private static final String MEETUP_ID_PARAMETER = "meetupId";
|
||||
private static final String MEETUP_NEW_VALUE_PARAMETER = "newValue";
|
||||
private static final String MEETUP_PROPERTY_PARAMETER = "property";
|
||||
|
||||
@Autowired
|
||||
private SlashCommandParameterService slashCommandParameterService;
|
||||
|
||||
@Autowired
|
||||
private MeetupManagementServiceBean meetupManagementServiceBean;
|
||||
|
||||
@Autowired
|
||||
private MeetupServiceBean meetupServiceBean;
|
||||
|
||||
@Autowired
|
||||
private InteractionService interactionService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
Long meetupId = (Long) parameters.get(0);
|
||||
Meetup meetup = meetupManagementServiceBean.getMeetup(meetupId, commandContext.getGuild().getIdLong());
|
||||
if(!meetup.getOrganizer().getUserReference().getId().equals(commandContext.getAuthor().getIdLong())) {
|
||||
throw new NotMeetupOrganizerException();
|
||||
}
|
||||
String property = (String) parameters.get(1);
|
||||
MeetupProperty propertyEnum = MeetupProperty.valueOf(property);
|
||||
String newValue = (String) parameters.get(2);
|
||||
return updateMeetup(meetup, propertyEnum, newValue).thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
private CompletableFuture<Void> updateMeetup(Meetup meetup, MeetupProperty propertyEnum, String newValue) {
|
||||
CompletableFuture<Void> future;
|
||||
switch (propertyEnum) {
|
||||
case TOPIC:
|
||||
future = meetupServiceBean.changeMeetupTopic(meetup, newValue);
|
||||
break;
|
||||
case LOCATION:
|
||||
future = meetupServiceBean.changeMeetupLocation(meetup, newValue);
|
||||
break;
|
||||
default:
|
||||
case DESCRIPTION:
|
||||
future = meetupServiceBean.changeMeetupDescription(meetup, newValue);
|
||||
break;
|
||||
}
|
||||
return future;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
|
||||
Long meetupId = slashCommandParameterService.getCommandOption(MEETUP_ID_PARAMETER, event, Integer.class).longValue();
|
||||
Meetup meetup = meetupManagementServiceBean.getMeetup(meetupId, event.getGuild().getIdLong());
|
||||
if(!meetup.getOrganizer().getUserReference().getId().equals(event.getMember().getIdLong())) {
|
||||
throw new NotMeetupOrganizerException();
|
||||
}
|
||||
String newValue = slashCommandParameterService.getCommandOption(MEETUP_NEW_VALUE_PARAMETER, event, String.class);
|
||||
String property = slashCommandParameterService.getCommandOption(MEETUP_PROPERTY_PARAMETER, event, String.class);
|
||||
MeetupProperty propertyEnum = MeetupProperty.valueOf(property);
|
||||
return updateMeetup(meetup, propertyEnum, newValue)
|
||||
.thenCompose(commandResult -> interactionService.replyEmbed("changeMeetup_response", event))
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
Parameter meetupIdParameter = Parameter
|
||||
.builder()
|
||||
.templated(true)
|
||||
.name(MEETUP_ID_PARAMETER)
|
||||
.type(Long.class)
|
||||
.build();
|
||||
|
||||
List<String> meetupProperties = Arrays
|
||||
.stream(MeetupProperty.values())
|
||||
.map(Enum::name)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Parameter meetupPropertyParameter = Parameter
|
||||
.builder()
|
||||
.templated(true)
|
||||
.name(MEETUP_PROPERTY_PARAMETER)
|
||||
.type(String.class)
|
||||
.choices(meetupProperties)
|
||||
.build();
|
||||
|
||||
Parameter newValueParameter = Parameter
|
||||
.builder()
|
||||
.templated(true)
|
||||
.name(MEETUP_NEW_VALUE_PARAMETER)
|
||||
.type(String.class)
|
||||
.build();
|
||||
|
||||
List<Parameter> parameters = Arrays.asList(meetupIdParameter, meetupPropertyParameter, newValueParameter);
|
||||
HelpInfo helpInfo = HelpInfo
|
||||
.builder()
|
||||
.templated(true)
|
||||
.build();
|
||||
|
||||
SlashCommandConfig slashCommandConfig = SlashCommandConfig
|
||||
.builder()
|
||||
.enabled(true)
|
||||
.rootCommandName(MeetupSlashCommandNames.MEETUP)
|
||||
.commandName("changeMeetup")
|
||||
.build();
|
||||
|
||||
return CommandConfiguration.builder()
|
||||
.name(CHANGE_MEETUP_COMMAND)
|
||||
.module(UtilityModuleDefinition.UTILITY)
|
||||
.templated(true)
|
||||
.async(true)
|
||||
.slashCommandConfig(slashCommandConfig)
|
||||
.supportsEmbedException(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return MeetupFeatureDefinition.MEETUP;
|
||||
}
|
||||
|
||||
public enum MeetupProperty {
|
||||
DESCRIPTION, TOPIC, LOCATION
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,9 @@ public class CreateMeetup extends AbstractConditionableCommand {
|
||||
private static final String MEETUP_TIME_PARAMETER = "meetupTime";
|
||||
private static final String TOPIC_PARAMETER = "topic";
|
||||
private static final String DESCRIPTION_PARAMETER = "description";
|
||||
private static final String LOCATION_PARAMETER = "location";
|
||||
private static final String CONFIRMATION_TEMPLATE = "createMeetup_confirmation";
|
||||
private static final String DEFAULT_LOCATION_STRING = "\"\"";
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
@@ -86,7 +88,7 @@ public class CreateMeetup extends AbstractConditionableCommand {
|
||||
}
|
||||
AUserInAServer organizer = userInServerManagementService.loadOrCreateUser(commandContext.getAuthor());
|
||||
AChannel meetupChannel = channelManagementService.loadChannel(commandContext.getChannel().getIdLong());
|
||||
Meetup meetup = meetupManagementServiceBean.createMeetup(meetupTime, meetupTopic, description, organizer, meetupChannel);
|
||||
Meetup meetup = meetupManagementServiceBean.createMeetup(meetupTime, meetupTopic, description, organizer, meetupChannel, DEFAULT_LOCATION_STRING);
|
||||
String confirmationId = componentService.generateComponentId();
|
||||
String cancelId = componentService.generateComponentId();
|
||||
MeetupConfirmationModel model = MeetupConfirmationModel
|
||||
@@ -95,6 +97,7 @@ public class CreateMeetup extends AbstractConditionableCommand {
|
||||
.guildId(commandContext.getGuild().getIdLong())
|
||||
.description(description)
|
||||
.topic(meetupTopic)
|
||||
.location(meetup.getLocation())
|
||||
.confirmationId(confirmationId)
|
||||
.cancelId(cancelId)
|
||||
.meetupId(meetup.getId().getId())
|
||||
@@ -117,10 +120,17 @@ public class CreateMeetup extends AbstractConditionableCommand {
|
||||
} else {
|
||||
description = "";
|
||||
}
|
||||
|
||||
String location;
|
||||
if(slashCommandParameterService.hasCommandOption(LOCATION_PARAMETER, event)) {
|
||||
location = slashCommandParameterService.getCommandOption(LOCATION_PARAMETER, event, String.class);
|
||||
} else {
|
||||
location = DEFAULT_LOCATION_STRING;
|
||||
}
|
||||
Instant meetupTime = Instant.ofEpochSecond(time);
|
||||
AUserInAServer organizer = userInServerManagementService.loadOrCreateUser(event.getMember());
|
||||
AChannel meetupChannel = channelManagementService.loadChannel(event.getChannel().getIdLong());
|
||||
Meetup meetup = meetupManagementServiceBean.createMeetup(meetupTime, topic, description, organizer, meetupChannel);
|
||||
Meetup meetup = meetupManagementServiceBean.createMeetup(meetupTime, topic, description, organizer, meetupChannel, location);
|
||||
String confirmationId = componentService.generateComponentId();
|
||||
String cancelId = componentService.generateComponentId();
|
||||
MeetupConfirmationModel model = MeetupConfirmationModel
|
||||
@@ -129,6 +139,7 @@ public class CreateMeetup extends AbstractConditionableCommand {
|
||||
.guildId(event.getGuild().getIdLong())
|
||||
.description(description)
|
||||
.topic(topic)
|
||||
.location(meetup.getLocation())
|
||||
.confirmationId(confirmationId)
|
||||
.cancelId(cancelId)
|
||||
.meetupId(meetup.getId().getId())
|
||||
@@ -166,7 +177,17 @@ public class CreateMeetup extends AbstractConditionableCommand {
|
||||
.type(String.class)
|
||||
.build();
|
||||
|
||||
List<Parameter> parameters = Arrays.asList(timeParameter, topicParameter, descriptionParameter);
|
||||
Parameter locationParameter = Parameter
|
||||
.builder()
|
||||
.templated(true)
|
||||
.name(LOCATION_PARAMETER)
|
||||
.remainder(true)
|
||||
.optional(true)
|
||||
.slashCommandOnly(true)
|
||||
.type(String.class)
|
||||
.build();
|
||||
|
||||
List<Parameter> parameters = Arrays.asList(timeParameter, topicParameter, descriptionParameter, locationParameter);
|
||||
HelpInfo helpInfo = HelpInfo
|
||||
.builder()
|
||||
.templated(true)
|
||||
|
||||
@@ -49,19 +49,19 @@ public class ListMeetups extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
MessageToSend messageToSend = getMessageToSend(commandContext.getGuild().getIdLong());
|
||||
MessageToSend messageToSend = getMessageToSend(commandContext.getGuild().getIdLong(), commandContext.getChannel().getIdLong());
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendMessageToSendToChannel(messageToSend, commandContext.getChannel()))
|
||||
.thenApply(unused -> CommandResult.fromIgnored());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
|
||||
return interactionService.replyMessageToSend(getMessageToSend(event.getGuild().getIdLong()), event)
|
||||
return interactionService.replyMessageToSend(getMessageToSend(event.getGuild().getIdLong(), event.getChannel().getIdLong()), event)
|
||||
.thenApply(interactionHook -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
private MessageToSend getMessageToSend(Long serverId) {
|
||||
List<Meetup> meetups = meetupManagementServiceBean.getIncomingMeetups();
|
||||
private MessageToSend getMessageToSend(Long serverId, Long channelId) {
|
||||
List<Meetup> meetups = meetupManagementServiceBean.getIncomingMeetups(serverId, channelId);
|
||||
List<MeetupListItemModel> listItems = meetups
|
||||
.stream()
|
||||
.map(MeetupListItemModel::fromMeetup)
|
||||
|
||||
@@ -15,6 +15,7 @@ import dev.sheldan.sissi.module.meetup.config.MeetupFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.meetup.config.MeetupSlashCommandNames;
|
||||
import dev.sheldan.sissi.module.meetup.exception.NotMeetupOrganizerException;
|
||||
import dev.sheldan.sissi.module.meetup.model.database.Meetup;
|
||||
import dev.sheldan.sissi.module.meetup.model.database.MeetupDecision;
|
||||
import dev.sheldan.sissi.module.meetup.service.MeetupServiceBean;
|
||||
import dev.sheldan.sissi.module.meetup.service.management.MeetupManagementServiceBean;
|
||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||||
@@ -24,6 +25,7 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class NotifyMeetupParticipants extends AbstractConditionableCommand {
|
||||
@@ -42,6 +44,7 @@ public class NotifyMeetupParticipants extends AbstractConditionableCommand {
|
||||
|
||||
private static final String MEETUP_ID_PARAMETER = "meetupId";
|
||||
private static final String NOTIFICATION_MESSAGE_PARAMETER = "notificationMessage";
|
||||
private static final String NOTIFICATION_MEETUP_DECISION = "decision";
|
||||
private static final String NOTIFY_MEETUP_PARTICIPANTS_COMMAND = "notifyMeetupParticipants";
|
||||
private static final String NOTIFY_MEETUP_PARTICIPANTS_RESPONSE = "notifyMeetupParticipants_response";
|
||||
|
||||
@@ -54,7 +57,7 @@ public class NotifyMeetupParticipants extends AbstractConditionableCommand {
|
||||
throw new NotMeetupOrganizerException();
|
||||
}
|
||||
String notificationMessage = (String) parameters.get(1);
|
||||
return meetupServiceBean.notifyMeetupParticipants(meetup, notificationMessage)
|
||||
return meetupServiceBean.notifyMeetupParticipants(meetup, notificationMessage, null)
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@@ -65,8 +68,12 @@ public class NotifyMeetupParticipants extends AbstractConditionableCommand {
|
||||
if(!meetup.getOrganizer().getUserReference().getId().equals(event.getMember().getIdLong())) {
|
||||
throw new NotMeetupOrganizerException();
|
||||
}
|
||||
MeetupDecision toNotify = null;
|
||||
if(slashCommandParameterService.hasCommandOption(NOTIFICATION_MEETUP_DECISION, event)) {
|
||||
toNotify = MeetupDecision.valueOf(slashCommandParameterService.getCommandOption(NOTIFICATION_MEETUP_DECISION, event, String.class));
|
||||
}
|
||||
String notificationMessage = slashCommandParameterService.getCommandOption(NOTIFICATION_MESSAGE_PARAMETER, event, String.class);
|
||||
return meetupServiceBean.notifyMeetupParticipants(meetup, notificationMessage)
|
||||
return meetupServiceBean.notifyMeetupParticipants(meetup, notificationMessage, toNotify)
|
||||
.thenCompose(unused -> interactionService.replyEmbed(NOTIFY_MEETUP_PARTICIPANTS_RESPONSE, event))
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
@@ -88,7 +95,22 @@ public class NotifyMeetupParticipants extends AbstractConditionableCommand {
|
||||
.remainder(true)
|
||||
.build();
|
||||
|
||||
List<Parameter> parameters = Arrays.asList(meetupIdParameter, notificationMessage);
|
||||
List<String> meetupDecisions = Arrays
|
||||
.stream(MeetupDecision.values())
|
||||
.map(Enum::name)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Parameter meetupDecisionChoice = Parameter
|
||||
.builder()
|
||||
.templated(true)
|
||||
.name(NOTIFICATION_MEETUP_DECISION)
|
||||
.type(String.class)
|
||||
.optional(true)
|
||||
.choices(meetupDecisions)
|
||||
.slashCommandOnly(true)
|
||||
.build();
|
||||
|
||||
List<Parameter> parameters = Arrays.asList(meetupIdParameter, notificationMessage, meetupDecisionChoice);
|
||||
HelpInfo helpInfo = HelpInfo
|
||||
.builder()
|
||||
.templated(true)
|
||||
|
||||
@@ -2,8 +2,14 @@ package dev.sheldan.sissi.module.meetup.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureConfig;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.config.FeatureMode;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static dev.sheldan.sissi.module.meetup.config.MeetupFeatureMode.ATTACH_ICS_FILE;
|
||||
|
||||
@Component
|
||||
public class MeetupFeatureConfig implements FeatureConfig {
|
||||
@Override
|
||||
@@ -11,4 +17,8 @@ public class MeetupFeatureConfig implements FeatureConfig {
|
||||
return MeetupFeatureDefinition.MEETUP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FeatureMode> getAvailableModes() {
|
||||
return Arrays.asList(ATTACH_ICS_FILE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.sheldan.sissi.module.meetup.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureMode;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum MeetupFeatureMode implements FeatureMode {
|
||||
ATTACH_ICS_FILE("attachIcsFile");
|
||||
|
||||
private final String key;
|
||||
|
||||
MeetupFeatureMode(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import dev.sheldan.abstracto.core.service.MessageService;
|
||||
import dev.sheldan.abstracto.core.service.management.ChannelManagementService;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.utils.FileService;
|
||||
import dev.sheldan.abstracto.core.utils.FutureUtils;
|
||||
import dev.sheldan.sissi.module.meetup.config.MeetupFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.meetup.model.database.Meetup;
|
||||
@@ -76,6 +77,9 @@ public class MeetupConfirmationListener implements ButtonClickedListener {
|
||||
@Autowired
|
||||
private MeetupComponentManagementServiceBean meetupComponentManagementServiceBean;
|
||||
|
||||
@Autowired
|
||||
private FileService fileService;
|
||||
|
||||
@Override
|
||||
public ButtonClickedListenerResult execute(ButtonClickedListenerModel model) {
|
||||
MeetupConfirmationPayload payload = (MeetupConfirmationPayload) model.getDeserializedPayload();
|
||||
@@ -104,6 +108,10 @@ public class MeetupConfirmationListener implements ButtonClickedListener {
|
||||
messageModel.setNoId(noButtonId);
|
||||
messageModel.setMaybeId(maybeButtonId);
|
||||
messageModel.setNoTimeId(noTimeButtonId);
|
||||
meetup.setYesButtonId(yesButtonId);
|
||||
meetup.setMaybeButtonId(maybeButtonId);
|
||||
meetup.setNoTimeButtonId(noTimeButtonId);
|
||||
meetup.setNotInterestedButtonId(noButtonId);
|
||||
messageModel.setCancelled(false);
|
||||
Long meetupId = payload.getMeetupId();
|
||||
Long serverId = payload.getGuildId();
|
||||
@@ -111,6 +119,9 @@ public class MeetupConfirmationListener implements ButtonClickedListener {
|
||||
List<CompletableFuture<Message>> messageFutures = channelService.sendMessageToSendToChannel(messageToSend, model.getEvent().getMessageChannel());
|
||||
FutureUtils.toSingleFutureGeneric(messageFutures).thenAccept(unused -> {
|
||||
messageService.deleteMessage(model.getEvent().getMessage());
|
||||
messageToSend.getAttachedFiles().forEach(attachedFile -> {
|
||||
fileService.safeDeleteIgnoreException(attachedFile.getFile());
|
||||
});
|
||||
Message meetupMessage = messageFutures.get(0).join();
|
||||
messageService.pinMessage(meetupMessage);
|
||||
self.persistPayloads(meetupId, serverId, yesButtonId, noButtonId, maybeButtonId, noTimeButtonId, meetupMessage);
|
||||
|
||||
@@ -14,6 +14,7 @@ public class MeetupConfirmationModel {
|
||||
private MemberDisplay organizer;
|
||||
private Instant meetupTime;
|
||||
private Long meetupId;
|
||||
private String location;
|
||||
private String topic;
|
||||
private String description;
|
||||
private Long guildId;
|
||||
|
||||
@@ -6,7 +6,7 @@ import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import jakarta.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -43,6 +43,26 @@ public class Meetup {
|
||||
@Column(name = "message_id")
|
||||
private Long messageId;
|
||||
|
||||
@Getter
|
||||
@Column(name = "location")
|
||||
private String location;
|
||||
|
||||
@Getter
|
||||
@Column(name = "yes_button_id")
|
||||
private String yesButtonId;
|
||||
|
||||
@Getter
|
||||
@Column(name = "maybe_button_id")
|
||||
private String maybeButtonId;
|
||||
|
||||
@Getter
|
||||
@Column(name = "no_time_button_id")
|
||||
private String noTimeButtonId;
|
||||
|
||||
@Getter
|
||||
@Column(name = "not_interested_button_id")
|
||||
private String notInterestedButtonId;
|
||||
|
||||
@OneToMany(
|
||||
fetch = FetchType.LAZY,
|
||||
orphanRemoval = true,
|
||||
|
||||
@@ -4,7 +4,7 @@ import dev.sheldan.abstracto.core.models.database.ComponentPayload;
|
||||
import dev.sheldan.sissi.module.meetup.model.database.embed.MeetupComponentId;
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import jakarta.persistence.*;
|
||||
import java.time.Instant;
|
||||
|
||||
@Builder
|
||||
|
||||
@@ -4,7 +4,7 @@ import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import dev.sheldan.sissi.module.meetup.model.database.embed.MeetupParticipationId;
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import jakarta.persistence.*;
|
||||
import java.time.Instant;
|
||||
|
||||
@Builder
|
||||
|
||||
@@ -2,8 +2,8 @@ package dev.sheldan.sissi.module.meetup.model.database.embed;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embeddable;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Embeddable
|
||||
|
||||
@@ -2,8 +2,8 @@ package dev.sheldan.sissi.module.meetup.model.database.embed;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embeddable;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Embeddable
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.sheldan.sissi.module.meetup.model.template;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Setter
|
||||
public class MeetupIcsModel {
|
||||
private Boolean attachIcsFile;
|
||||
private String iceFileName;
|
||||
private String icsFormattedCreationTime;
|
||||
private String icsFormattedStartTime;
|
||||
private String icsFormattedEndTime;
|
||||
}
|
||||
@@ -15,6 +15,8 @@ public class MeetupMessageModel {
|
||||
private String topic;
|
||||
private String description;
|
||||
private Instant meetupTime;
|
||||
private String location;
|
||||
private String decodedLocation;
|
||||
private MemberDisplay organizer;
|
||||
private Long meetupId;
|
||||
private String yesId;
|
||||
@@ -26,4 +28,5 @@ public class MeetupMessageModel {
|
||||
private List<MemberDisplay> maybeParticipants;
|
||||
private List<MemberDisplay> noTimeParticipants;
|
||||
private List<MemberDisplay> declinedParticipants;
|
||||
private MeetupIcsModel meetupIcsModel;
|
||||
}
|
||||
|
||||
@@ -11,4 +11,7 @@ import java.util.List;
|
||||
public class MeetupNotificationModel {
|
||||
private List<MemberDisplay> participants;
|
||||
private String notificationMessage;
|
||||
private Long meetupMessageId;
|
||||
private String meetupTopic;
|
||||
private Long meetupId;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface MeetupRepository extends JpaRepository<Meetup, ServerSpecificId> {
|
||||
List<Meetup> findByMeetupTimeLessThan(Instant date);
|
||||
List<Meetup> findByMeetupTimeGreaterThan(Instant date);
|
||||
List<Meetup> findByMeetupTimeGreaterThanAndState(Instant date, MeetupState state);
|
||||
List<Meetup> findByMeetupTimeGreaterThanAndStateAndServer_IdAndMeetupChannel_Id(Instant date, MeetupState state, Long serverId, Long channelId);
|
||||
List<Meetup> findByState(MeetupState state);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package dev.sheldan.sissi.module.meetup.service;
|
||||
|
||||
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
|
||||
import dev.sheldan.abstracto.core.interaction.ComponentPayloadManagementService;
|
||||
import dev.sheldan.abstracto.core.interaction.ComponentPayloadService;
|
||||
import dev.sheldan.abstracto.core.models.ServerChannelMessage;
|
||||
@@ -9,9 +10,12 @@ import dev.sheldan.abstracto.core.service.*;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.templating.service.TemplateService;
|
||||
import dev.sheldan.abstracto.core.utils.FileService;
|
||||
import dev.sheldan.abstracto.core.utils.FutureUtils;
|
||||
import dev.sheldan.abstracto.scheduling.model.JobParameters;
|
||||
import dev.sheldan.abstracto.scheduling.service.SchedulerService;
|
||||
import dev.sheldan.sissi.module.meetup.config.MeetupFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.meetup.config.MeetupFeatureMode;
|
||||
import dev.sheldan.sissi.module.meetup.model.command.MeetupChangeTimeConfirmationModel;
|
||||
import dev.sheldan.sissi.module.meetup.model.command.MeetupConfirmationModel;
|
||||
import dev.sheldan.sissi.module.meetup.model.database.Meetup;
|
||||
@@ -20,6 +24,7 @@ import dev.sheldan.sissi.module.meetup.model.database.MeetupParticipant;
|
||||
import dev.sheldan.sissi.module.meetup.model.database.MeetupState;
|
||||
import dev.sheldan.sissi.module.meetup.model.payload.MeetupChangeTimeConfirmationPayload;
|
||||
import dev.sheldan.sissi.module.meetup.model.payload.MeetupConfirmationPayload;
|
||||
import dev.sheldan.sissi.module.meetup.model.template.MeetupIcsModel;
|
||||
import dev.sheldan.sissi.module.meetup.model.template.MeetupMessageModel;
|
||||
import dev.sheldan.sissi.module.meetup.model.template.MeetupNotificationModel;
|
||||
import dev.sheldan.sissi.module.meetup.model.template.MeetupTimeChangedNotificationModel;
|
||||
@@ -33,7 +38,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -75,6 +86,9 @@ public class MeetupServiceBean {
|
||||
@Autowired
|
||||
private MeetupServiceBean self;
|
||||
|
||||
@Autowired
|
||||
private FileService fileService;
|
||||
|
||||
@Autowired
|
||||
private ChannelService channelService;
|
||||
|
||||
@@ -87,11 +101,16 @@ public class MeetupServiceBean {
|
||||
@Autowired
|
||||
private SchedulerService schedulerService;
|
||||
|
||||
@Autowired
|
||||
private FeatureModeService featureModeService;
|
||||
|
||||
@Autowired
|
||||
private MeetupParticipatorManagementServiceBean meetupParticipatorManagementServiceBean;
|
||||
|
||||
@Autowired
|
||||
private MeetupComponentManagementServiceBean meetupComponentManagementServiceBean;
|
||||
private static final String ICS_TIME_STAMP_FORMAT = "yMMdd'T'kkmmss'Z'";
|
||||
private static final DateTimeFormatter ICS_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern(ICS_TIME_STAMP_FORMAT);
|
||||
|
||||
public void storeMeetupConfirmation(MeetupConfirmationModel model) {
|
||||
AServer server = serverManagementService.loadServer(model.getGuildId());
|
||||
@@ -122,6 +141,22 @@ public class MeetupServiceBean {
|
||||
componentPayloadService.createButtonPayload(model.getCancelId(), confirmationPayload, MEETUP_CHANGE_TIME_CONFIRMATION_BUTTON, server);
|
||||
}
|
||||
|
||||
private MeetupIcsModel getMeetupICSModel(Meetup meetup) {
|
||||
ZonedDateTime startTime = meetup.getMeetupTime().atZone(ZoneId.of("UTC"));
|
||||
ZonedDateTime endTime = meetup.getMeetupTime().plus(1, ChronoUnit.HOURS).atZone(ZoneId.of("UTC"));
|
||||
String icsFormattedStartTime = startTime.format(ICS_DATE_TIME_FORMATTER);
|
||||
String icsFormattedEndTime = endTime.format(ICS_DATE_TIME_FORMATTER);
|
||||
String icsFormattedMeetupCreationTime = Instant.now().atZone(ZoneId.of("UTC"))
|
||||
.format(ICS_DATE_TIME_FORMATTER);
|
||||
boolean attachIcsFile = featureModeService.featureModeActive(MeetupFeatureDefinition.MEETUP, meetup.getServer().getId(), MeetupFeatureMode.ATTACH_ICS_FILE);
|
||||
return MeetupIcsModel
|
||||
.builder()
|
||||
.attachIcsFile(attachIcsFile)
|
||||
.icsFormattedCreationTime(icsFormattedMeetupCreationTime)
|
||||
.icsFormattedStartTime(icsFormattedStartTime)
|
||||
.icsFormattedEndTime(icsFormattedEndTime)
|
||||
.build();
|
||||
}
|
||||
|
||||
public MeetupMessageModel getMeetupMessageModel(Meetup meetup) {
|
||||
List<MeetupParticipant> allParticipants = meetup.getParticipants();
|
||||
@@ -141,10 +176,17 @@ public class MeetupServiceBean {
|
||||
.stream()
|
||||
.filter(meetupParticipator -> meetupParticipator.getDecision().equals(MeetupDecision.NO_TIME))
|
||||
.collect(Collectors.toList());
|
||||
String rawLocation = java.net.URLDecoder.decode(meetup.getLocation(), StandardCharsets.UTF_8);
|
||||
return MeetupMessageModel
|
||||
.builder()
|
||||
.description(meetup.getDescription())
|
||||
.topic(meetup.getTopic())
|
||||
.location(meetup.getLocation())
|
||||
.decodedLocation(rawLocation)
|
||||
.noTimeId(meetup.getNoTimeButtonId())
|
||||
.yesId(meetup.getYesButtonId())
|
||||
.maybeId(meetup.getMaybeButtonId())
|
||||
.noId(meetup.getNotInterestedButtonId())
|
||||
.meetupTime(meetup.getMeetupTime())
|
||||
.meetupId(meetup.getId().getId())
|
||||
.participants(getMemberDisplays(participating))
|
||||
@@ -153,6 +195,7 @@ public class MeetupServiceBean {
|
||||
.maybeParticipants(getMemberDisplays(maybe))
|
||||
.cancelled(meetup.getState().equals(MeetupState.CANCELLED))
|
||||
.organizer(MemberDisplay.fromAUserInAServer(meetup.getOrganizer()))
|
||||
.meetupIcsModel(getMeetupICSModel(meetup))
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -250,8 +293,8 @@ public class MeetupServiceBean {
|
||||
}
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> notifyMeetupParticipants(Meetup meetup, String message) {
|
||||
List<MeetupDecision> decisionsToBeNotified = Arrays.asList(MeetupDecision.MAYBE, MeetupDecision.YES);
|
||||
public CompletableFuture<Void> notifyMeetupParticipants(Meetup meetup, String message, MeetupDecision toNotify) {
|
||||
List<MeetupDecision> decisionsToBeNotified = toNotify == null ? Arrays.asList(MeetupDecision.MAYBE, MeetupDecision.YES) : Arrays.asList(toNotify);
|
||||
List<MemberDisplay> participants = meetup
|
||||
.getParticipants()
|
||||
.stream()
|
||||
@@ -262,6 +305,9 @@ public class MeetupServiceBean {
|
||||
MeetupNotificationModel model = MeetupNotificationModel
|
||||
.builder()
|
||||
.notificationMessage(message)
|
||||
.meetupId(meetup.getId().getId())
|
||||
.meetupMessageId(meetup.getMessageId())
|
||||
.meetupTopic(meetup.getTopic())
|
||||
.participants(participants)
|
||||
.build();
|
||||
MessageChannel channel = channelService.getMessageChannelFromServer(meetup.getServer().getId(), meetup.getMeetupChannel().getId());
|
||||
@@ -379,8 +425,43 @@ public class MeetupServiceBean {
|
||||
|
||||
MessageToSend updatedMeetupMessage = getMeetupMessage(meetupMessageModel);
|
||||
GuildMessageChannel meetupChannel = channelService.getMessageChannelFromServer(serverId, meetup.getMeetupChannel().getId());
|
||||
return channelService.editEmbedMessageInAChannel(updatedMeetupMessage.getEmbeds().get(0), meetupChannel, meetup.getMessageId())
|
||||
return channelService.editMessageInAChannelFuture(updatedMeetupMessage, meetupChannel, meetup.getMessageId())
|
||||
.thenAccept(message -> log.info("Updated message of meetup {} in channel {} in server {}.", meetupId, meetup.getMeetupChannel().getId(), serverId))
|
||||
.thenAccept(unused -> fileService.safeDeleteIgnoreException(updatedMeetupMessage.getAttachedFiles().get(0).getFile()))
|
||||
.exceptionally(throwable -> {
|
||||
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetupId, meetup.getMeetupChannel().getId(), serverId, throwable);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> changeMeetupDescription(Meetup meetup, String newDescription) {
|
||||
meetup.setDescription(newDescription);
|
||||
return updateMeetupMessage(meetup);
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> changeMeetupLocation(Meetup meetup, String newLocation) {
|
||||
try {
|
||||
meetup.setLocation(URLEncoder.encode(newLocation, StandardCharsets.UTF_8.toString()));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new AbstractoRunTimeException(e);
|
||||
}
|
||||
return updateMeetupMessage(meetup);
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> changeMeetupTopic(Meetup meetup, String newTopic) {
|
||||
meetup.setTopic(newTopic);
|
||||
return updateMeetupMessage(meetup);
|
||||
}
|
||||
|
||||
private CompletableFuture<Void> updateMeetupMessage(Meetup meetup) {
|
||||
Long meetupId = meetup.getId().getId();
|
||||
Long serverId = meetup.getId().getServerId();
|
||||
MeetupMessageModel meetupMessageModel = getMeetupMessageModel(meetup);
|
||||
MessageToSend updatedMeetupMessage = getMeetupMessage(meetupMessageModel);
|
||||
GuildMessageChannel meetupChannel = channelService.getMessageChannelFromServer(serverId, meetup.getMeetupChannel().getId());
|
||||
return channelService.editMessageInAChannelFuture(updatedMeetupMessage, meetupChannel, meetup.getMessageId())
|
||||
.thenAccept(message -> log.info("Updated message of meetup {} in channel {} in server {}.", meetupId, meetup.getMeetupChannel().getId(), serverId))
|
||||
.thenAccept(unused -> fileService.safeDeleteIgnoreException(updatedMeetupMessage.getAttachedFiles().get(0).getFile()))
|
||||
.exceptionally(throwable -> {
|
||||
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetupId, meetup.getMeetupChannel().getId(), serverId, throwable);
|
||||
return null;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package dev.sheldan.sissi.module.meetup.service.management;
|
||||
|
||||
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
|
||||
import dev.sheldan.abstracto.core.models.ServerSpecificId;
|
||||
import dev.sheldan.abstracto.core.models.database.AChannel;
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
@@ -12,6 +13,9 @@ import dev.sheldan.sissi.module.meetup.repository.MeetupRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,22 +30,28 @@ public class MeetupManagementServiceBean {
|
||||
|
||||
public static final String MEETUP_COUNTER_KEY = "meetup";
|
||||
|
||||
public Meetup createMeetup(Instant timeStamp, String topic, String description, AUserInAServer organizer, AChannel meetupChannel) {
|
||||
public Meetup createMeetup(Instant timeStamp, String topic, String description, AUserInAServer organizer, AChannel meetupChannel, String location) {
|
||||
if(timeStamp.isBefore(Instant.now())) {
|
||||
throw new MeetupPastTimeException();
|
||||
}
|
||||
Long meetupId = counterService.getNextCounterValue(organizer.getServerReference(), MEETUP_COUNTER_KEY);
|
||||
Meetup meetup = Meetup
|
||||
.builder()
|
||||
.meetupTime(timeStamp)
|
||||
.description(description)
|
||||
.topic(topic)
|
||||
.organizer(organizer)
|
||||
.server(organizer.getServerReference())
|
||||
.meetupChannel(meetupChannel)
|
||||
.state(MeetupState.NEW)
|
||||
.id(new ServerSpecificId(organizer.getServerReference().getId(), meetupId))
|
||||
.build();
|
||||
Meetup meetup = null;
|
||||
try {
|
||||
meetup = Meetup
|
||||
.builder()
|
||||
.meetupTime(timeStamp)
|
||||
.description(description)
|
||||
.topic(topic)
|
||||
.location(URLEncoder.encode(location, StandardCharsets.UTF_8.toString()))
|
||||
.organizer(organizer)
|
||||
.server(organizer.getServerReference())
|
||||
.meetupChannel(meetupChannel)
|
||||
.state(MeetupState.NEW)
|
||||
.id(new ServerSpecificId(organizer.getServerReference().getId(), meetupId))
|
||||
.build();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new AbstractoRunTimeException(e);
|
||||
}
|
||||
return meetupRepository.save(meetup);
|
||||
}
|
||||
|
||||
@@ -62,12 +72,8 @@ public class MeetupManagementServiceBean {
|
||||
return meetupRepository.findByState(MeetupState.CANCELLED);
|
||||
}
|
||||
|
||||
public List<Meetup> getFutureMeetups() {
|
||||
return meetupRepository.findByMeetupTimeGreaterThan(Instant.now());
|
||||
}
|
||||
|
||||
public List<Meetup> getIncomingMeetups() {
|
||||
return meetupRepository.findByMeetupTimeGreaterThanAndState(Instant.now(), MeetupState.CONFIRMED);
|
||||
public List<Meetup> getIncomingMeetups(Long serverId, Long channelId) {
|
||||
return meetupRepository.findByMeetupTimeGreaterThanAndStateAndServer_IdAndMeetupChannel_Id(Instant.now(), MeetupState.CONFIRMED, serverId, channelId);
|
||||
}
|
||||
|
||||
public void deleteMeetups(List<Meetup> meetups) {
|
||||
|
||||
@@ -5,4 +5,8 @@ abstracto.systemConfigs.meetupEarlyReminderSeconds.name=meetupEarlyReminderSecon
|
||||
abstracto.systemConfigs.meetupEarlyReminderSeconds.longValue=604800
|
||||
|
||||
abstracto.systemConfigs.meetupLateReminderSeconds.name=meetupLateReminderSeconds
|
||||
abstracto.systemConfigs.meetupLateReminderSeconds.longValue=86400
|
||||
abstracto.systemConfigs.meetupLateReminderSeconds.longValue=86400
|
||||
|
||||
abstracto.featureModes.attachIcsFile.featureName=meetup
|
||||
abstracto.featureModes.attachIcsFile.mode=attachIcsFile
|
||||
abstracto.featureModes.attachIcsFile.enabled=false
|
||||
@@ -0,0 +1,11 @@
|
||||
<?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="tables/tables.xml" relativeToChangelogFile="true"/>
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?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" >
|
||||
<property name="utilityModule" value="(SELECT id FROM module WHERE name = 'utility')"/>
|
||||
<property name="meetupFeature" value="(SELECT id FROM feature WHERE key = 'meetup')"/>
|
||||
|
||||
<changeSet author="Sheldan" id="meetup-change_command">
|
||||
<insert tableName="command">
|
||||
<column name="name" value="changeMeetup"/>
|
||||
<column name="module_id" valueComputed="${utilityModule}"/>
|
||||
<column name="feature_id" valueComputed="${meetupFeature}"/>
|
||||
</insert>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
@@ -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="command.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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="meetup-add_info_columns">
|
||||
<addColumn tableName="meetup">
|
||||
<column name="location" type="VARCHAR(100)" />
|
||||
</addColumn>
|
||||
<addColumn tableName="meetup">
|
||||
<column name="yes_button_id" type="VARCHAR(100)" />
|
||||
</addColumn>
|
||||
<addColumn tableName="meetup">
|
||||
<column name="maybe_button_id" type="VARCHAR(100)" />
|
||||
</addColumn>
|
||||
<addColumn tableName="meetup">
|
||||
<column name="no_time_button_id" type="VARCHAR(100)" />
|
||||
</addColumn>
|
||||
<addColumn tableName="meetup">
|
||||
<column name="not_interested_button_id" type="VARCHAR(100)" />
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
@@ -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="meetup.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -8,4 +8,5 @@
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<include file="1.1.0/collection.xml" relativeToChangelogFile="true"/>
|
||||
<include file="1.2.0/collection.xml" relativeToChangelogFile="true"/>
|
||||
<include file="1.3.18/collection.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.3.15</version>
|
||||
<version>1.4.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.3.15</version>
|
||||
<version>1.4.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import jakarta.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -2,7 +2,7 @@ package dev.sheldan.sissi.module.quotes.model.database;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import jakarta.persistence.*;
|
||||
|
||||
@Builder
|
||||
@Entity
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?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.sissi</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.3.15</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
<artifactId>docker-compose</artifactId>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>assembly-docker-compose-configuration</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/docker-compose.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,19 +0,0 @@
|
||||
<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>docker-compose</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<outputDirectory>./docker-compose</outputDirectory>
|
||||
<directory>${project.basedir}/src/main/resources/</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<filtered>true</filtered>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -1,34 +0,0 @@
|
||||
COMPOSE_PROJECT_NAME=sissi
|
||||
# database configuration
|
||||
DATABASE_HOST=database
|
||||
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
|
||||
EXECUTE_TEMPLATES=true
|
||||
# whether or not remote debug should be enabled on the application
|
||||
REMOTE_DEBUG=false
|
||||
DEBUG_PORT=5005
|
||||
TOMCAT_PORT=8080
|
||||
# authentication for actuator endpoints
|
||||
REST_USER_NAME=abstracto
|
||||
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
|
||||
# default authentication for pg admin
|
||||
PGADMIN_DEFAULT_EMAIL=sheldan@sheldan.dev
|
||||
DEBRA_DONATION_NOTIFICATION_SERVER_ID=0
|
||||
PGADMIN_DEFAULT_PASSWORD=admin
|
||||
TOKEN=<INSERT TOKEN>
|
||||
YOUTUBE_API_KEY=<INSERT KEY>
|
||||
SISSI_VERSION=1.3.15
|
||||
@@ -1,10 +0,0 @@
|
||||
# Setup for local docker-compose deployment
|
||||
|
||||
* Install docker [here](https://docs.docker.com/get-docker/)
|
||||
* Install docker-compose [here](https://docs.docker.com/compose/install/).
|
||||
* Execute `docker-compose build` in `image-packaging`.
|
||||
* Fill out values in `.env` for token and database password. There are some default values, but token is required to be changed.
|
||||
* Execute `fill-prometheus-file-sh` in order to populate the prometheus config with the correct password (https://github.com/prometheus/prometheus/issues/2357)
|
||||
* Execute `docker-compose up` in this directory and wait for completion.
|
||||
* Per default pgAdmin is available on `localhost:5050` with the configured user and password. It will contain a configuration in the servers list.
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: ${REGISTRY_PREFIX}sissi_database:${SISSI_VERSION}
|
||||
container_name: ${COMPOSE_PROJECT_NAME}_database
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
|
||||
POSTGRES_USER: ${DATABASE_USER}
|
||||
ports:
|
||||
- "127.0.0.1:${DATABASE_PORT}:5432"
|
||||
networks:
|
||||
- sissi
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql/data
|
||||
deployment_container:
|
||||
container_name: ${COMPOSE_PROJECT_NAME}_deployment
|
||||
image: ${REGISTRY_PREFIX}sissi_deployment:${SISSI_VERSION}
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
DB_PASS: ${DATABASE_PASSWORD}
|
||||
DB_HOST: ${COMPOSE_PROJECT_NAME}_${DATABASE_HOST}
|
||||
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}
|
||||
LIQUIBASE_PATH: ${LIQUIBASE_PATH:-/liquibase}
|
||||
POSTGRES_DRIVER_PATH: ${EXECUTE_DEPLOYMENT:-/postgres/driver.jar}
|
||||
WAIT_HOSTS: ${COMPOSE_PROJECT_NAME}_${DATABASE_HOST}:${DATABASE_PORT}
|
||||
networks:
|
||||
- sissi
|
||||
bot:
|
||||
image: ${REGISTRY_PREFIX}sissi:${SISSI_VERSION}
|
||||
depends_on:
|
||||
- db
|
||||
- deployment_container
|
||||
restart: on-failure
|
||||
container_name: ${COMPOSE_PROJECT_NAME}bot
|
||||
environment:
|
||||
TOKEN: ${TOKEN}
|
||||
REMOTE_DEBUG: ${REMOTE_DEBUG}
|
||||
DB_PASS: ${DATABASE_PASSWORD}
|
||||
DB_HOST: ${COMPOSE_PROJECT_NAME}_${DATABASE_HOST}
|
||||
DB_PORT: ${DATABASE_PORT}
|
||||
DB_USER: ${DATABASE_USER}
|
||||
DB_NAME: ${DATABASE_NAME}
|
||||
REST_USER_NAME: ${REST_USER_NAME}
|
||||
REST_PASSWORD: ${REST_PASSWORD}
|
||||
YOUTUBE_API_KEY: ${YOUTUBE_API_KEY}
|
||||
command: sh -c "while ping -c1 deployment_container &>/dev/null; do sleep 1; done; echo 'Liquibase finished!' && ./start.sh"
|
||||
ports:
|
||||
- "127.0.0.1:${DEBUG_PORT}:5005"
|
||||
- "127.0.0.1:${TOMCAT_PORT}:8080"
|
||||
networks:
|
||||
- sissi
|
||||
volumes:
|
||||
- bot-logs:/logs
|
||||
- ./config:/config
|
||||
pgadmin:
|
||||
container_name: ${COMPOSE_PROJECT_NAME}_pgadmin
|
||||
image: ${REGISTRY_PREFIX}sissi_pg_admin:${SISSI_VERSION}
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
|
||||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
|
||||
ports:
|
||||
- "127.0.0.1:${PGADMIN_PORT}:80"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- sissi
|
||||
prometheus:
|
||||
container_name: ${COMPOSE_PROJECT_NAME}_prometheus
|
||||
image: ${REGISTRY_PREFIX}sissi_prometheus:${SISSI_VERSION}
|
||||
depends_on:
|
||||
- bot
|
||||
ports:
|
||||
- "127.0.0.1:${PROMETHEUS_PORT}:9090"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- sissi
|
||||
volumes:
|
||||
- ./res/prometheus-scrapper-password-filled:/etc/prometheus/micrometer_password
|
||||
- prometheus-data:/prometheus
|
||||
grafana:
|
||||
container_name: ${COMPOSE_PROJECT_NAME}_grafana
|
||||
image: ${REGISTRY_PREFIX}sissi_grafana:${SISSI_VERSION}
|
||||
depends_on:
|
||||
- prometheus
|
||||
- bot
|
||||
ports:
|
||||
- "127.0.0.1:${GRAFANA_PORT}:3000"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
DB_PASS: ${GRAFANA_DATABASE_PASSWORD}
|
||||
DB_HOST: ${COMPOSE_PROJECT_NAME}_${DATABASE_HOST}
|
||||
DB_PORT: ${DATABASE_PORT}
|
||||
DB_USER: ${GRAFANA_DATABASE_USER}
|
||||
DB_NAME: ${DATABASE_NAME}
|
||||
PROMETHEUS_HOST: '${COMPOSE_PROJECT_NAME}_prometheus'
|
||||
PROMETHEUS_PORT: 9090
|
||||
LOKI_HOST: '${COMPOSE_PROJECT_NAME}_loki'
|
||||
LOKI_PORT: ${LOKI_PORT}
|
||||
volumes:
|
||||
- grafana-user-data:/var/lib/grafana
|
||||
networks:
|
||||
- sissi
|
||||
promtail:
|
||||
container_name: ${COMPOSE_PROJECT_NAME}_promtail
|
||||
image: ${REGISTRY_PREFIX}sissi_promtail:${SISSI_VERSION}
|
||||
depends_on:
|
||||
- bot
|
||||
restart: unless-stopped
|
||||
command: -config.file=/mnt/config/promtail-config.yaml
|
||||
volumes:
|
||||
- bot-logs:/logs
|
||||
networks:
|
||||
- sissi
|
||||
loki:
|
||||
container_name: ${COMPOSE_PROJECT_NAME}_loki
|
||||
image: ${REGISTRY_PREFIX}sissi_loki:${SISSI_VERSION}
|
||||
depends_on:
|
||||
- promtail
|
||||
command: -config.file=/mnt/config/loki-config.yaml
|
||||
ports:
|
||||
- "127.0.0.1:${LOKI_PORT}:3100"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- sissi
|
||||
|
||||
networks:
|
||||
sissi:
|
||||
driver: bridge
|
||||
name: sissi-network
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
grafana-user-data:
|
||||
prometheus-data:
|
||||
bot-logs:
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -o allexport
|
||||
source .env
|
||||
set +o allexport
|
||||
envsubst < res/prometheus-scrapper-password > res/prometheus-scrapper-password-filled
|
||||
@@ -1 +0,0 @@
|
||||
${REST_PASSWORD}
|
||||
23
deployment/helm/sissi/.helmignore
Normal file
23
deployment/helm/sissi/.helmignore
Normal file
@@ -0,0 +1,23 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
24
deployment/helm/sissi/Chart.yaml
Normal file
24
deployment/helm/sissi/Chart.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: v2
|
||||
name: sissi
|
||||
description: A Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "1.4.4"
|
||||
4
deployment/helm/sissi/configuration/grafana/config.yaml
Normal file
4
deployment/helm/sissi/configuration/grafana/config.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
base_url: {{ $.Values.grafanaDeployment.grafana.host }}
|
||||
username: {{ $.Values.grafanaDeployment.grafana.basicAuth.username }}
|
||||
password: {{ $.Values.grafanaDeployment.grafana.basicAuth.password }}
|
||||
folder_name: Sissi
|
||||
@@ -0,0 +1,929 @@
|
||||
{
|
||||
"dashboard": {
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 1,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(discord_api_interactions_total[1m]) /2",
|
||||
"instant": false,
|
||||
"legendFormat": "{{ "{{" }} action {{ "}}" }}",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Discord API Interaction",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 0
|
||||
},
|
||||
"id": 2,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(command_processed_total[1m]) / 2 ",
|
||||
"instant": false,
|
||||
"legendFormat": "{{ "{{" }}type{{ "}}" }}-{{ "{{" }}status{{ "}}" }}",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Commands processed",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 8
|
||||
},
|
||||
"id": 3,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(message_total[1m]) / 2",
|
||||
"instant": false,
|
||||
"legendFormat": "{{ "{{" }} action {{ "}}" }}",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Message events",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 8
|
||||
},
|
||||
"id": 4,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(okhttp_request_total[1m]) / 2",
|
||||
"instant": false,
|
||||
"legendFormat": "{{ "{{" }} http_code {{ "}}" }}",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "HTTP Reponse codes",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 16
|
||||
},
|
||||
"id": 5,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(cache_evictions_total{application=\"$application\", cache=\"messages\"}[1m]) / 2",
|
||||
"instant": false,
|
||||
"legendFormat": "Cache evictions",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(cache_gets_total{application=\"$application\", cache=\"messages\"}[1m]) / 2",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "Cache gets {{ "{{" }} result {{ "}}" }}",
|
||||
"range": true,
|
||||
"refId": "B"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(cache_puts_total{application=\"$application\", cache=\"messages\"}[1m]) / 2",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "Cache puts",
|
||||
"range": true,
|
||||
"refId": "C"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(cache_removals{application=\"$application\", cache=\"messages\"}[1m]) / 2",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "Cache removals",
|
||||
"range": true,
|
||||
"refId": "D"
|
||||
}
|
||||
],
|
||||
"title": "Message cache statistic",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 16
|
||||
},
|
||||
"id": 6,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "discord_gateway_ping",
|
||||
"instant": false,
|
||||
"legendFormat": "Gateway ping",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Gateway ping",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 24
|
||||
},
|
||||
"id": 7,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(starboard_stars_total[1m]) / 2",
|
||||
"instant": false,
|
||||
"legendFormat": "{{ "{{" }} action {{ "}}" }}",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Starboard reactions",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 24
|
||||
},
|
||||
"id": 8,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(emote_usages_total[1m]) / 2",
|
||||
"instant": false,
|
||||
"legendFormat": "Used emotes",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Used tracked emotes",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 16,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 32
|
||||
},
|
||||
"id": 9,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "increase(jda_event_total[1m]) / 2",
|
||||
"instant": false,
|
||||
"legendFormat": "{{ "{{" }} event_class {{ "}}" }}",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "JDA Events",
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"refresh": "",
|
||||
"schemaVersion": 38,
|
||||
"style": "dark",
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"hide": 2,
|
||||
"label": "",
|
||||
"name": "application",
|
||||
"query": "Sissi",
|
||||
"skipUrlSync": false,
|
||||
"type": "constant"
|
||||
}
|
||||
]
|
||||
},
|
||||
"time": {
|
||||
"from": "now-30m",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "Sissi Discord status",
|
||||
"uid": "a7b3297d-972e-4dbd-9223-88d589817d34",
|
||||
"version": 1,
|
||||
"weekStart": ""
|
||||
},
|
||||
"overwrite": true
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
{
|
||||
"dashboard": {
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"description": "Overview over logging outputs of Sissi bot",
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "loki",
|
||||
"uid": "loki"
|
||||
},
|
||||
"description": "Display logs and search for logs",
|
||||
"gridPos": {
|
||||
"h": 13,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 4,
|
||||
"options": {
|
||||
"dedupStrategy": "none",
|
||||
"enableLogDetails": true,
|
||||
"prettifyLogMessage": false,
|
||||
"showCommonLabels": false,
|
||||
"showLabels": false,
|
||||
"showTime": false,
|
||||
"sortOrder": "Ascending",
|
||||
"wrapLogMessage": true
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "loki",
|
||||
"uid": "loki"
|
||||
},
|
||||
"editorMode": "builder",
|
||||
"expr": "{app=\"sissi\"} |= `$logFilter`",
|
||||
"maxLines": 5000,
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Sissi Logs",
|
||||
"type": "logs"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "loki",
|
||||
"uid": "loki"
|
||||
},
|
||||
"description": "Any line on level ERROR",
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 13
|
||||
},
|
||||
"id": 2,
|
||||
"options": {
|
||||
"dedupStrategy": "none",
|
||||
"enableLogDetails": true,
|
||||
"prettifyLogMessage": false,
|
||||
"showCommonLabels": false,
|
||||
"showLabels": false,
|
||||
"showTime": false,
|
||||
"sortOrder": "Ascending",
|
||||
"wrapLogMessage": true
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "loki",
|
||||
"uid": "loki"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "{app=\"sissi\"} |= \"ERROR\"",
|
||||
"maxLines": 5000,
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Sissi Error Logs",
|
||||
"type": "logs"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "loki",
|
||||
"uid": "loki"
|
||||
},
|
||||
"description": "Number of log events",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 13
|
||||
},
|
||||
"id": 3,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "loki",
|
||||
"uid": "loki"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "rate({app=\"sissi\"}[$__interval])",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Log Rate",
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"refresh": "",
|
||||
"schemaVersion": 38,
|
||||
"style": "dark",
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"current": {
|
||||
"selected": false,
|
||||
"text": "",
|
||||
"value": ""
|
||||
},
|
||||
"description": "What to search in the logs",
|
||||
"hide": 0,
|
||||
"name": "logFilter",
|
||||
"options": [
|
||||
{
|
||||
"selected": true,
|
||||
"text": "",
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"query": "",
|
||||
"skipUrlSync": false,
|
||||
"type": "textbox"
|
||||
}
|
||||
]
|
||||
},
|
||||
"time": {
|
||||
"from": "now-30m",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "Sissi Logs",
|
||||
"uid": "a5b429af-860c-4438-a575-24bed6dcba09",
|
||||
"version": 2,
|
||||
"weekStart": ""
|
||||
},
|
||||
"overwrite": true
|
||||
}
|
||||
62
deployment/helm/sissi/templates/_helpers.tpl
Normal file
62
deployment/helm/sissi/templates/_helpers.tpl
Normal file
@@ -0,0 +1,62 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "sissi.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "sissi.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "sissi.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "sissi.labels" -}}
|
||||
helm.sh/chart: {{ include "sissi.chart" . }}
|
||||
{{ include "sissi.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "sissi.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "sissi.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "sissi.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "sissi.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
10
deployment/helm/sissi/templates/api-keys.yaml
Normal file
10
deployment/helm/sissi/templates/api-keys.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: api-keys
|
||||
data:
|
||||
discordToken: {{ $.Values.apiKeys.discord.token | b64enc }} # b64enc is needed, because a stringData secret field cannot hold numeric values
|
||||
youtubeApiKey: {{ $.Values.apiKeys.youtube.apiKey | b64enc }}
|
||||
twitchClientId: {{ $.Values.apiKeys.twitch.clientId | b64enc }}
|
||||
twitchSecret: {{ $.Values.apiKeys.twitch.secret | b64enc }}
|
||||
openWeatherMapApiKey: {{ $.Values.apiKeys.openWeatherMap.apiKey | b64enc }}
|
||||
@@ -0,0 +1,69 @@
|
||||
{{- if .Values.dbConfigDeployment.enabled -}}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
{{- $deploymentJobName := print ((include "sissi.fullname" .) | trunc 39) "-db-config-deployment-job" }}
|
||||
name: {{ $deploymentJobName | trunc 63 }}
|
||||
annotations:
|
||||
"helm.sh/hook": post-install
|
||||
"helm.sh/hook-weight": "-5"
|
||||
"helm.sh/hook-delete-policy": hook-succeeded
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: db-config-deployment-job
|
||||
image: "{{ $.Values.dbConfigDeployment.repository }}/{{ $.Values.dbConfigDeployment.image }}:{{ $.Values.dbConfigDeployment.tag | default .Chart.AppVersion}}"
|
||||
imagePullPolicy: {{ $.Values.dbConfigDeployment.pullPolicy }}
|
||||
args:
|
||||
- "/var/db-config/"
|
||||
env:
|
||||
- name: DB_PASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbPassword
|
||||
- name: DB_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbHost
|
||||
- name: DB_PORT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbPort
|
||||
- name: DB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbUser
|
||||
- name: DB_NAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbName
|
||||
- name: DB_SCHEME
|
||||
value: "abstracto"
|
||||
volumeMounts:
|
||||
- mountPath: "/var/db-config/"
|
||||
name: database-config-mount
|
||||
restartPolicy: Never
|
||||
initContainers:
|
||||
- name: database-config-data
|
||||
image: "{{ $.Values.dbConfigDeploymentData.repository }}/{{ $.Values.dbConfigDeploymentData.image }}:{{ $.Values.dbConfigDeploymentData.tag | default .Chart.AppVersion}}"
|
||||
imagePullPolicy: {{ $.Values.dbConfigDeploymentData.pullPolicy }}
|
||||
volumeMounts:
|
||||
- mountPath: "/var/run-config"
|
||||
name: database-config-mount
|
||||
volumes:
|
||||
- name: database-config-mount
|
||||
emptyDir: {}
|
||||
backoffLimit: 4
|
||||
{{- end }}
|
||||
|
||||
|
||||
10
deployment/helm/sissi/templates/db-credentials.yaml
Normal file
10
deployment/helm/sissi/templates/db-credentials.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: db-credentials
|
||||
data:
|
||||
dbPassword: {{ $.Values.dbCredentials.password | b64enc }} # b64enc is needed, because a stringData secret field cannot hold numeric values
|
||||
dbUser: {{ $.Values.dbCredentials.userName | b64enc }}
|
||||
dbHost: {{ $.Values.dbCredentials.host | b64enc }}
|
||||
dbPort: {{ $.Values.dbCredentials.port | b64enc }}
|
||||
dbName: {{ $.Values.dbCredentials.name | b64enc }}
|
||||
116
deployment/helm/sissi/templates/deployment.yaml
Normal file
116
deployment/helm/sissi/templates/deployment.yaml
Normal file
@@ -0,0 +1,116 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "sissi.fullname" . }}
|
||||
labels:
|
||||
{{- include "sissi.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "sissi.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "sissi.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "sissi.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.bot.repository }}/{{ .Values.bot.image }}:{{ .Values.bot.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.bot.pullPolicy }}
|
||||
env:
|
||||
- name: DB_PASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbPassword
|
||||
- name: DB_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbHost
|
||||
- name: DB_PORT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbPort
|
||||
- name: DB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbUser
|
||||
- name: DB_NAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbName
|
||||
- name: DEBRA_DONATION_NOTIFICATION_SERVER_ID
|
||||
value: "297910194841583616"
|
||||
- name: TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: api-keys
|
||||
key: discordToken
|
||||
- name: YOUTUBE_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: api-keys
|
||||
key: youtubeApiKey
|
||||
- name: OPEN_WEATHER_MAP_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: api-keys
|
||||
key: openWeatherMapApiKey
|
||||
- name: TWITCH_CLIENT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: api-keys
|
||||
key: twitchClientId
|
||||
- name: TWITCH_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: api-keys
|
||||
key: twitchSecret
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: 8080
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/readiness
|
||||
port: 8080
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 3
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
10
deployment/helm/sissi/templates/grafana-credentials.yaml
Normal file
10
deployment/helm/sissi/templates/grafana-credentials.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: grafana-credentials
|
||||
data:
|
||||
dbPassword: {{ $.Values.dbCredentials.password | b64enc }} # b64enc is needed, because a stringData secret field cannot hold numeric values
|
||||
dbUser: {{ $.Values.dbCredentials.userName | b64enc }}
|
||||
dbHost: {{ $.Values.dbCredentials.host | b64enc }}
|
||||
dbPort: {{ $.Values.dbCredentials.port | b64enc }}
|
||||
dbName: {{ $.Values.dbCredentials.name | b64enc }}
|
||||
@@ -0,0 +1,42 @@
|
||||
{{- if $.Values.grafanaDeployment.enabled }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: grafana-dashboard-deployment-job
|
||||
annotations:
|
||||
"helm.sh/hook": post-install
|
||||
"helm.sh/hook-weight": "-4"
|
||||
"helm.sh/hook-delete-policy": hook-succeeded
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: template-deployment-job
|
||||
image: "{{ $.Values.grafanaDeployment.repository }}/{{ $.Values.grafanaDeployment.image }}:{{ $.Values.grafanaDeployment.tag }}"
|
||||
imagePullPolicy: {{ $.Values.grafanaDeployment.pullPolicy }}
|
||||
args:
|
||||
- "/var/userconfig"
|
||||
volumeMounts:
|
||||
- mountPath: "/var/userconfig"
|
||||
name: grafana-dashboard-config
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: grafana-dashboard-config
|
||||
secret:
|
||||
secretName: grafana-dashboard-config
|
||||
restartPolicy: Never
|
||||
backoffLimit: 4
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: grafana-dashboard-config
|
||||
data:
|
||||
config.yaml: {{ (tpl (.Files.Get "configuration/grafana/config.yaml") . ) | b64enc }}
|
||||
log-dashboard.json: {{ (tpl (.Files.Get "configuration/grafana/sissi-log-dashboard.json") . ) | b64enc }}
|
||||
discord-dashboard.json: {{ (tpl (.Files.Get "configuration/grafana/sissi-discord-dashboard.json") . ) | b64enc }}
|
||||
{{- end }}
|
||||
19
deployment/helm/sissi/templates/service.yaml
Normal file
19
deployment/helm/sissi/templates/service.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "sissi.fullname" . }}
|
||||
labels:
|
||||
{{- include "sissi.labels" . | nindent 4 }}
|
||||
{{- with .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "sissi.selectorLabels" . | nindent 4 }}
|
||||
12
deployment/helm/sissi/templates/serviceaccount.yaml
Normal file
12
deployment/helm/sissi/templates/serviceaccount.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "sissi.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "sissi.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
69
deployment/helm/sissi/templates/template-deployment-job.yaml
Normal file
69
deployment/helm/sissi/templates/template-deployment-job.yaml
Normal file
@@ -0,0 +1,69 @@
|
||||
{{- if .Values.dbConfigDeployment.enabled -}}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
{{- $deploymentJobName := print ((include "sissi.fullname" .) | trunc 39) "-template-deployment-job" }}
|
||||
name: {{ $deploymentJobName | trunc 63 }}
|
||||
annotations:
|
||||
"helm.sh/hook": post-install
|
||||
"helm.sh/hook-weight": "-4"
|
||||
"helm.sh/hook-delete-policy": hook-succeeded
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: template-deployment-job
|
||||
image: "{{ $.Values.templateDeployment.repository }}/{{ $.Values.templateDeployment.image }}:{{ $.Values.templateDeployment.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ $.Values.templateDeployment.pullPolicy }}
|
||||
args:
|
||||
- "/var/template-config/"
|
||||
env:
|
||||
- name: DB_PASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbPassword
|
||||
- name: DB_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbHost
|
||||
- name: DB_PORT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbPort
|
||||
- name: DB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbUser
|
||||
- name: DB_NAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-credentials
|
||||
key: dbName
|
||||
- name: DB_SCHEME
|
||||
value: "abstracto."
|
||||
volumeMounts:
|
||||
- mountPath: "/var/template-config/"
|
||||
name: template-config-mount
|
||||
initContainers:
|
||||
- name: database-config-data
|
||||
image: "{{ $.Values.templateDeploymentData.repository }}/{{ $.Values.templateDeploymentData.image }}:{{ $.Values.templateDeploymentData.tag | default .Chart.AppVersion}}"
|
||||
imagePullPolicy: {{ $.Values.templateDeploymentData.pullPolicy }}
|
||||
volumeMounts:
|
||||
- mountPath: "/var/run-config"
|
||||
name: template-config-mount
|
||||
volumes:
|
||||
- name: template-config-mount
|
||||
emptyDir: {}
|
||||
restartPolicy: Never
|
||||
backoffLimit: 4
|
||||
{{- end }}
|
||||
|
||||
|
||||
117
deployment/helm/sissi/values.yaml
Normal file
117
deployment/helm/sissi/values.yaml
Normal file
@@ -0,0 +1,117 @@
|
||||
# Default values for sissi.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
bot:
|
||||
repository: harbor.sheldan.dev/testing
|
||||
pullPolicy: IfNotPresent
|
||||
image: sissi
|
||||
tag: 1.4.4
|
||||
|
||||
templateDeployment:
|
||||
enabled: true
|
||||
repository: harbor.sheldan.dev/abstracto
|
||||
pullPolicy: Always
|
||||
image: abstracto-template-deployment
|
||||
tag: 1.5.5
|
||||
|
||||
templateDeploymentData:
|
||||
repository: harbor.sheldan.dev/sissi
|
||||
pullPolicy: Always
|
||||
image: sissi-template-data
|
||||
tag: 1.4.4
|
||||
|
||||
dbConfigDeployment:
|
||||
enabled: true
|
||||
repository: harbor.sheldan.dev/abstracto
|
||||
pullPolicy: Always
|
||||
image: abstracto-db-deployment
|
||||
tag: 1.5.5
|
||||
|
||||
dbConfigDeploymentData:
|
||||
repository: harbor.sheldan.dev/sissi
|
||||
pullPolicy: Always
|
||||
image: sissi-db-data
|
||||
tag: 1.4.4
|
||||
|
||||
dbCredentials:
|
||||
host:
|
||||
port:
|
||||
userName:
|
||||
password:
|
||||
name:
|
||||
|
||||
grafanaDeployment:
|
||||
repository: harbor.sheldan.dev/grafana-tools
|
||||
pullPolicy: Always
|
||||
image: grafana-dashboard-deployment
|
||||
tag: 0.0.2
|
||||
enabled: true
|
||||
grafana:
|
||||
host:
|
||||
basicAuth:
|
||||
username:
|
||||
password:
|
||||
|
||||
apiKeys:
|
||||
discord:
|
||||
token:
|
||||
youtube:
|
||||
apiKey:
|
||||
openWeatherMap:
|
||||
apiKey:
|
||||
twitch:
|
||||
secret:
|
||||
clientId:
|
||||
|
||||
|
||||
imagePullSecrets:
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 8080
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/path: "/actuator/prometheus"
|
||||
prometheus.io/port: "8080"
|
||||
|
||||
resources:
|
||||
limits:
|
||||
cpu:
|
||||
memory:
|
||||
requests:
|
||||
cpu:
|
||||
memory:
|
||||
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.3.15</version>
|
||||
<version>1.4.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>core.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -59,17 +59,27 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>assignable-roles.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<artifactId>twitch</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>twitch.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<artifactId>experience-tracking</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>experience-tracking.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -79,7 +89,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>modmail.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -89,7 +99,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -99,7 +109,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>logging.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -109,7 +119,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>webservices.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -119,7 +129,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>remind.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -129,7 +139,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>suggestion.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -139,7 +149,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>link-embed.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -149,7 +159,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>starboard.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -159,7 +169,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>moderation.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -169,7 +179,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>entertainment.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -179,10 +189,20 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>custom-command.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<artifactId>statistic</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>statistic.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<!-- sissi template artefacts -->
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
@@ -190,7 +210,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>quotes.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -200,7 +220,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>meetup.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -210,7 +230,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>debra.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -222,7 +242,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>moderation-custom.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -234,7 +254,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>core.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -244,7 +264,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>link-embed.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -254,17 +274,27 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>experience-tracking.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>twitch</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>twitch.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>modmail</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>modmail.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -274,7 +304,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>assignable-roles.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -284,7 +314,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -294,7 +324,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>webservices.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -304,7 +334,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>remind.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -314,7 +344,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>suggestion.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -324,7 +354,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>starboard.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -334,7 +364,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>moderation.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -344,7 +374,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>entertainment.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -354,7 +384,7 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>logging.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -364,10 +394,20 @@
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>custom-command.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>statistic</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>statistic.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<!-- sissi translation artefacts -->
|
||||
|
||||
<artifactItem>
|
||||
@@ -376,7 +416,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>quotes.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -386,7 +426,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>meetup.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -396,7 +436,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>debra.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -410,7 +450,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>scheduling.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -421,7 +461,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>core.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -432,10 +472,21 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>link-embed.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>twitch-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>twitch.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>experience-tracking-impl</artifactId>
|
||||
@@ -443,7 +494,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>experience-tracking.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -454,7 +505,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>logging.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -465,7 +516,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>starboard.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -476,7 +527,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>assignable-roles.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -487,7 +538,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -498,7 +549,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>modmail.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -509,7 +560,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -520,7 +571,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>webservices.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -531,7 +582,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>remind.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -542,7 +593,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>suggestion.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -553,7 +604,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>moderation.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -564,7 +615,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>entertainment.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -575,7 +626,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>custom-command.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -588,7 +639,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>quotes.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -599,7 +650,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>meetup.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -610,10 +661,21 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>debra.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>statistic-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>statistic.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<!-- customizations -->
|
||||
|
||||
<artifactItem>
|
||||
@@ -623,7 +685,7 @@
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/db-data/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>moderation-custom.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -633,7 +695,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>moderation-custom.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -645,7 +707,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>moderation-template-overrides.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -655,7 +717,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>experience-template-overrides.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -665,7 +727,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/template-artifacts/</outputDirectory>
|
||||
<destFileName>logging-template-overrides.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -677,7 +739,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>moderation-translation-overrides.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -687,7 +749,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>experience-translation-overrides.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
@@ -697,7 +759,7 @@
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<outputDirectory>${file.basedir}/template-data/translation-artifacts/</outputDirectory>
|
||||
<destFileName>logging-translation-overrides.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
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
|
||||
REGISTRY_PREFIX=harbor.sheldan.dev/sissi/
|
||||
VERSION=1.4.4
|
||||
@@ -1,5 +0,0 @@
|
||||
ARG POSTGRES_VERSION
|
||||
FROM postgres:${POSTGRES_VERSION}
|
||||
MAINTAINER Sheldan
|
||||
VOLUME /tmp
|
||||
ADD sql/init.sql /docker-entrypoint-initdb.d/init.sql
|
||||
@@ -1 +0,0 @@
|
||||
CREATE SCHEMA abstracto
|
||||
@@ -0,0 +1,6 @@
|
||||
FROM alpine:3.18.0
|
||||
MAINTAINER Sheldan
|
||||
ADD config/ /var/db-config/
|
||||
ADD liquibase-artifacts /var/db-config/liquibase-zips
|
||||
|
||||
CMD ["/bin/sh", "/var/db-config/move.sh"]
|
||||
@@ -1,23 +1,11 @@
|
||||
{
|
||||
"template_artifacts": [
|
||||
"core","starboard", "link-embed", "moderation", "entertainment", "custom-command", "utility", "webservices", "remind", "suggestion", "modmail", "assignable-roles", "experience-tracking", "logging",
|
||||
"quotes", "meetup", "debra",
|
||||
"moderation-custom",
|
||||
"moderation-template-overrides", "experience-template-overrides", "logging-template-overrides"
|
||||
],
|
||||
"translation_artifacts": [
|
||||
"core",
|
||||
"starboard", "link-embed", "moderation", "entertainment", "custom-command", "utility", "webservices", "suggestion", "remind", "modmail", "assignable-roles", "experience-tracking", "logging",
|
||||
"quotes", "meetup", "debra",
|
||||
"moderation-custom",
|
||||
"moderation-translation-overrides", "experience-translation-overrides", "logging-translation-overrides"
|
||||
],
|
||||
"liquibase_artifacts": [
|
||||
{ "zip": "scheduling", "file": "scheduling-changeLog.xml" },
|
||||
{ "zip": "core", "file": "core-changeLog.xml" },
|
||||
{ "zip": "link-embed", "file": "link-embed-changeLog.xml"},
|
||||
{ "zip": "experience-tracking", "file": "experience-changeLog.xml"},
|
||||
{ "zip": "logging", "file": "logging-changeLog.xml"},
|
||||
{ "zip": "statistic", "file": "statistic-changeLog.xml"},
|
||||
{ "zip": "starboard", "file": "starboard-changeLog.xml"},
|
||||
{ "zip": "quotes", "file": "quotes-changeLog.xml"},
|
||||
{ "zip": "meetup", "file": "meetup-changeLog.xml"},
|
||||
@@ -30,6 +18,7 @@
|
||||
{ "zip": "remind", "file": "remind-changeLog.xml"},
|
||||
{ "zip": "suggestion", "file": "suggestion-changeLog.xml"},
|
||||
{ "zip": "modmail", "file": "modMail-changeLog.xml"},
|
||||
{ "zip": "twitch", "file": "twitch-changeLog.xml"},
|
||||
{ "zip": "assignable-roles", "file": "assignableRoles-changeLog.xml"},
|
||||
{ "zip": "moderation-custom", "file": "moderation-custom-changeLog.xml"}
|
||||
]
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
mv /var/db-config/* /var/run-config/
|
||||
@@ -1,8 +0,0 @@
|
||||
ARG ABSTRACTO_REGISTRY_PREFIX
|
||||
ARG ABSTRACTO_VERSION=latest
|
||||
FROM ${ABSTRACTO_REGISTRY_PREFIX}abstracto_deployment:${ABSTRACTO_VERSION:-latest}
|
||||
MAINTAINER Sheldan
|
||||
ADD template-artifacts /templates
|
||||
ADD translation-artifacts /translations
|
||||
ADD liquibase-artifacts /liquibase-zips
|
||||
ADD config /
|
||||
@@ -5,46 +5,11 @@ services:
|
||||
build:
|
||||
context: sissi
|
||||
image: ${REGISTRY_PREFIX}sissi:${VERSION:-latest}
|
||||
database:
|
||||
db-data:
|
||||
build:
|
||||
context: database
|
||||
args:
|
||||
POSTGRES_VERSION: ${POSTGRES_VERSION}
|
||||
image: ${REGISTRY_PREFIX}sissi_database:${VERSION:-latest}
|
||||
pg_admin:
|
||||
context: db-data
|
||||
image: ${REGISTRY_PREFIX}sissi-db-data:${VERSION:-latest}
|
||||
template-data:
|
||||
build:
|
||||
context: pgAdmin
|
||||
args:
|
||||
PG_ADMIN_VERSION: ${PG_ADMIN_VERSION}
|
||||
image: ${REGISTRY_PREFIX}sissi_pg_admin:${VERSION:-latest}
|
||||
deployment_container:
|
||||
build:
|
||||
context: deployment
|
||||
args:
|
||||
ABSTRACTO_REGISTRY_PREFIX: ${ABSTRACTO_REGISTRY_PREFIX}
|
||||
ABSTRACTO_VERSION: ${ABSTRACTO_VERSION}
|
||||
image: ${REGISTRY_PREFIX}sissi_deployment:${VERSION:-latest}
|
||||
prometheus:
|
||||
build:
|
||||
context: prometheus
|
||||
args:
|
||||
PROMETHEUS_VERSION: ${PROMETHEUS_VERSION}
|
||||
image: ${REGISTRY_PREFIX}sissi_prometheus:${VERSION:-latest}
|
||||
grafana:
|
||||
build:
|
||||
context: grafana
|
||||
args:
|
||||
GRAFANA_VERSION: ${GRAFANA_VERSION}
|
||||
image: ${REGISTRY_PREFIX}sissi_grafana:${VERSION:-latest}
|
||||
promtail:
|
||||
build:
|
||||
context: promtail
|
||||
args:
|
||||
PROMTAIL_VERSION: ${PROMTAIL_VERSION}
|
||||
image: ${REGISTRY_PREFIX}sissi_promtail:${VERSION:-latest}
|
||||
loki:
|
||||
build:
|
||||
context: loki
|
||||
args:
|
||||
LOKI_VERSION: ${LOKI_VERSION}
|
||||
image: ${REGISTRY_PREFIX}sissi_loki:${VERSION:-latest}
|
||||
context: template-data
|
||||
image: ${REGISTRY_PREFIX}sissi-template-data:${VERSION:-latest}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
ARG GRAFANA_VERSION
|
||||
FROM grafana/grafana:${GRAFANA_VERSION}
|
||||
MAINTAINER Sheldan
|
||||
ADD ./provisioning /etc/grafana/provisioning
|
||||
ADD ./config.ini /etc/grafana/config.ini
|
||||
ADD ./dashboards /var/lib/grafana/dashboards
|
||||
@@ -1,2 +0,0 @@
|
||||
[paths]
|
||||
provisioning = conf/provisioning
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,65 +0,0 @@
|
||||
{
|
||||
"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": 14,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 2,
|
||||
"options": {
|
||||
"dedupStrategy": "none",
|
||||
"enableLogDetails": true,
|
||||
"showLabels": false,
|
||||
"showTime": false,
|
||||
"sortOrder": "Descending",
|
||||
"wrapLogMessage": true
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "{job=\"sissi-logs\", filename=\"/logs/log.log\"}",
|
||||
"queryType": "randomWalk",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Sissi logs",
|
||||
"type": "logs"
|
||||
}
|
||||
],
|
||||
"refresh": "",
|
||||
"schemaVersion": 30,
|
||||
"style": "dark",
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-3h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "Sissi logs",
|
||||
"uid": "1uGb0q4nz",
|
||||
"version": 2
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
- name: 'sissi-bot-dashboards'
|
||||
org_id: 1
|
||||
folder: ''
|
||||
type: 'file'
|
||||
options:
|
||||
folder: '/var/lib/grafana/dashboards'
|
||||
@@ -1,29 +0,0 @@
|
||||
apiVersion: 1
|
||||
datasources:
|
||||
- access: 'proxy'
|
||||
editable: true
|
||||
is_default: true
|
||||
name: 'prometheus'
|
||||
org_id: 1
|
||||
type: 'prometheus'
|
||||
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
|
||||
- name: Loki
|
||||
type: loki
|
||||
access: proxy
|
||||
url: 'http://${LOKI_HOST}:${LOKI_PORT}'
|
||||
jsonData:
|
||||
maxLines: 2000
|
||||
@@ -1,4 +0,0 @@
|
||||
ARG LOKI_VERSION
|
||||
FROM grafana/loki:${LOKI_VERSION}
|
||||
MAINTAINER Sheldan
|
||||
ADD loki.yml /mnt/config/loki-config.yaml
|
||||
@@ -1,66 +0,0 @@
|
||||
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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user