mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-01-08 02:17:48 +00:00
[OPB-36] adding oneplus bot stats dashboard
restructuring oneplus bot status dashboard to include jda events and remove less relevant metrics
This commit is contained in:
36
application/database/pom.xml
Normal file
36
application/database/pom.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.5.4-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>database</artifactId>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/liquibase.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
18
application/database/src/main/assembly/liquibase.xml
Normal file
18
application/database/src/main/assembly/liquibase.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
|
||||
<id>liquibase</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<outputDirectory>.</outputDirectory>
|
||||
<directory>${project.basedir}/src/main/resources/migrations</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<include file="structure/structure.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<changeSet author="Sheldan" id="create_grafana_user">
|
||||
<sql>
|
||||
CREATE USER ${abstractografanadbuser} WITH PASSWORD '${abstractografanadbpass}';
|
||||
GRANT CONNECT ON DATABASE abstracto TO ${abstractografanadbuser};
|
||||
GRANT USAGE ON SCHEMA abstracto TO ${abstractografanadbuser};
|
||||
GRANT SELECT ON ALL TABLES IN SCHEMA abstracto TO ${abstractografanadbuser};
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA abstracto
|
||||
GRANT SELECT ON TABLES TO ${abstractografanadbuser};
|
||||
</sql>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<include file="grafana_user.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<include file="1.5.4/collection.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
1386
application/database/src/main/resources/migrations/dbchangelog.xsd
Normal file
1386
application/database/src/main/resources/migrations/dbchangelog.xsd
Normal file
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,7 @@
|
||||
<module>executable</module>
|
||||
<module>oneplus-bot-customizations</module>
|
||||
<module>oneplus-bot-modules</module>
|
||||
<module>database</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -4,6 +4,8 @@ DATABASE_PORT=5432
|
||||
DATABASE_USER=abstracto
|
||||
DATABASE_NAME=abstracto
|
||||
DATABASE_PASSWORD=abstracto
|
||||
GRAFANA_DATABASE_PASSWORD=grafana
|
||||
GRAFANA_DATABASE_USER=grafana
|
||||
# deployment configuration, whether or not the container should execute the parts on startup
|
||||
EXECUTE_DEPLOYMENT=true
|
||||
EXECUTE_LIQUIBASE=true
|
||||
@@ -26,4 +28,4 @@ PGADMIN_DEFAULT_EMAIL=sheldan@sheldan.dev
|
||||
PGADMIN_DEFAULT_PASSWORD=admin
|
||||
TOKEN=<INSERT TOKEN>
|
||||
YOUTUBE_API_KEY=<INSERT KEY>
|
||||
ONEPLUS_BOT_VERSION=1.5.3
|
||||
ONEPLUS_BOT_VERSION=1.5.4
|
||||
@@ -25,6 +25,8 @@ services:
|
||||
DB_PORT: ${DATABASE_PORT}
|
||||
DB_USER: ${DATABASE_USER}
|
||||
DB_NAME: ${DATABASE_NAME}
|
||||
ABSTRACTO_GRAFANA_DB_PASS: ${GRAFANA_DATABASE_PASSWORD}
|
||||
ABSTRACTO_GRAFANA_DB_USER: ${GRAFANA_DATABASE_USER}
|
||||
EXECUTE_DEPLOYMENT: ${EXECUTE_DEPLOYMENT}
|
||||
EXECUTE_LIQUIBASE: ${EXECUTE_LIQUIBASE}
|
||||
EXECUTE_TEMPLATES: ${EXECUTE_TEMPLATES}
|
||||
@@ -95,6 +97,14 @@ services:
|
||||
ports:
|
||||
- "127.0.0.1:${GRAFANA_PORT}:3000"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
DB_PASS: ${GRAFANA_DATABASE_PASSWORD}
|
||||
DB_HOST: ${DATABASE_HOST}
|
||||
DB_PORT: ${DATABASE_PORT}
|
||||
DB_USER: ${GRAFANA_DATABASE_USER}
|
||||
DB_NAME: ${DATABASE_NAME}
|
||||
PROMETHEUS_HOST: 'prometheus'
|
||||
PROMETHEUS_PORT: 9090
|
||||
volumes:
|
||||
- grafana-user-data:/var/lib/grafana
|
||||
networks:
|
||||
|
||||
@@ -834,6 +834,17 @@
|
||||
<destFileName>faq.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>database</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>database.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<!-- overrides -->
|
||||
|
||||
<artifactItem>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
{ "zip": "anti-raid", "file": "antiRaid-changeLog.xml"},
|
||||
{ "zip": "dynamic-activity", "file": "dynamicActivity-changeLog.xml"},
|
||||
{ "zip": "setup", "file": "setup-changeLog.xml"},
|
||||
{ "zip": "database", "file": "changeLog.xml"},
|
||||
{ "zip": "referral", "file": "referral-changeLog.xml"},
|
||||
{ "zip": "starboard-custom", "file": "starboard-custom-changeLog.xml"},
|
||||
{ "zip": "moderation-custom", "file": "moderation-custom-changeLog.xml"},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
apiVersion: 1
|
||||
datasources:
|
||||
- access: 'proxy'
|
||||
editable: true
|
||||
@@ -5,5 +6,18 @@ datasources:
|
||||
name: 'prometheus'
|
||||
org_id: 1
|
||||
type: 'prometheus'
|
||||
url: 'http://prometheus:9090'
|
||||
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
|
||||
4
pom.xml
4
pom.xml
@@ -19,8 +19,8 @@
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<!-- edit in release.yml as well -->
|
||||
<!-- when releasing a new opbot version, update the .env as well-->
|
||||
<abstracto.version>1.3.4</abstracto.version>
|
||||
<abstracto.templates.version>1.2.17</abstracto.templates.version>
|
||||
<abstracto.version>1.3.5-SNAPSHOT</abstracto.version>
|
||||
<abstracto.templates.version>1.2.18-SNAPSHOT</abstracto.templates.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
||||
Reference in New Issue
Block a user