Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
v7.6

See merge request JuniperBot/Backend!167
  • Loading branch information
GoldRenard committed Nov 23, 2019
2 parents 308c94e + c947e29 commit 9ccea6e
Show file tree
Hide file tree
Showing 80 changed files with 1,709 additions and 1,468 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:

variables:
DOCKER_DRIVER: overlay
CI_VERSION: '7.4.$CI_PIPELINE_IID'
CI_VERSION: '7.6.$CI_PIPELINE_IID'

stages:
- build
Expand Down
52 changes: 36 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@
buildscript {
ext {
springBootVersion = '2.1.7.RELEASE'
kotlinVersion = '1.3.60'
}
repositories {
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion")
}
}

Expand Down Expand Up @@ -57,23 +61,30 @@ subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'io.spring.dependency-management'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

compileKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
compileTestKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()

compileJava.options.encoding = 'UTF-8'
compileJava.options.compilerArgs << "-Xlint:deprecation"

ext {
generatedMainJava = "${buildDir}/generated"
generatedMainJava = "$buildDir/generated"

//@formatter:off

// Common Properties
springBootVersion = "${springBootVersion}"
springBootVersion = "$springBootVersion"
kotlinVersion = "$kotlinVersion"
springCloudVersion = 'Greenwich.RELEASE'
springConsulVersion = '2.1.2.RELEASE'
springRetryVersion = "1.2.4.RELEASE"
hibernateVersion = '5.3.7.Final'
lombokVersion = '1.18.4'
jsonVersion = '20160810'
Expand All @@ -92,15 +103,17 @@ subprojects {
mapstructVersion = '1.2.0.Final'
opencvVersion = '3.2.0'
jacksonVersion = '2.9.7'
evalExVersion = '2.4'
time4jVersion = '5.5'

jmxRemote = '4.1.1'
jmxRemoteLegacy = '1.0-b01-ea'

// Integration Properties
jdaVersion = '4.0.0_61'
jdaVersion = '4.0.0_62'
discordWebhookVersion = '0.1.7'
lavaplayerVersion = '1.3.23'
lavalinkVersion = '4.17'
lavaplayerVersion = '1.3.27'
lavalinkVersion = '4.18'
googleApiServicesYoutubeVersion = 'v3-rev205-1.25.0'
jwbfVersion = '4.0.0-SNAPSHOT'
wikitextVersion = '3.1.6'
Expand All @@ -111,7 +124,6 @@ subprojects {
prometheusVersion = '0.6.0'
jasyptVersion = '1.9.3'
jasperReportsVersion = '6.10.0'
evalExVersion = '2.4'

//@formatter:on
}
Expand All @@ -131,20 +143,28 @@ subprojects {
}

dependencies {
compileOnly "org.mapstruct:mapstruct-jdk8:${mapstructVersion}"
compileOnly "org.mapstruct:mapstruct-processor:${mapstructVersion}"
compileOnly "org.projectlombok:lombok:${lombokVersion}"
compileOnly "org.mapstruct:mapstruct-jdk8:$mapstructVersion"
compileOnly "org.mapstruct:mapstruct-processor:$mapstructVersion"
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "javax.xml.bind:jaxb-api"
annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernateVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.hibernate:hibernate-jpamodelgen:$hibernateVersion"
annotationProcessor "org.mapstruct:mapstruct-processor:$mapstructVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"

compile "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion"

testCompile "org.projectlombok:lombok:${lombokVersion}"
testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompile "org.projectlombok:lombok:$lombokVersion"
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
}

dependencyManagement {
imports { mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES) }
imports {
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES) {
bomProperty("kotlin.version", "$kotlinVersion")
}
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# JuniperBot Changelog:

## Version 7.6
- **[Аудит]** Новый тип действия для перехода из голосового канала в канал;
- Исправлена работа пользовательских команд через упоминание;
- Всяческие исправления команды `вычислить/math`:
- Точность вычислений теперь 32 знака;
- Корректная обработка ошибок;
- Исправлены текстовки временных интервалов мьюта, опять;
- Исправлен конфликт выдачи ролей по голосовой связи (конфликт роли в голосовом канале и наградной роли за опыт);
- Роль мьюта теперь добавляет свои права в категории каналов и не должна ломать синхронизацию прав;
- Переменная шаблона `{content}` теперь поддерживает параметры по их номеру (разделенные пробелами): `{content:1}`, `{content:2}` и т.д.;
- Некоторые мелкие фиксы и исправления.

## Version 7.5
- **[Аудит]** Исправлено логгирование смены ника;
- **[Рейтинг]** Улучшение системы рейтинга:
Expand Down
12 changes: 12 additions & 0 deletions changelog_en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# JuniperBot Changelog:

## Version 7.6
- **[Audit]** New action type for voice move event;
- Fixed custom commands invocations via @mention;
- `вычислить/math` command improvements:
- Precision is 32 digits now;
- Fixed error handling;
- Fixed duration texts for mute commands, again;
- Fixed role granting conflict using voice channels (between In-Voice role and ranking reward);
- Mute role now configures category permissions according to text channel;
- Custom command template variable `{content}` now supports parameters by their sequence number (divided by space): `{content:1}`, `{content:2}` and so on;
- Some small fixes and improvements.

## Version 7.5
- **[Audit]** Fixed name changing logging;
- **[Ranking]** Ranking system improvements:
Expand Down
18 changes: 9 additions & 9 deletions jb-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ext {
moduleName = 'JuniperBot-Web'
}

mainClassName = 'ru.juniperbot.api.JuniperApiApplication'
mainClassName = 'ru.juniperbot.api.Launcher'

bootJar {
archiveFileName = "JuniperBot-API.jar"
Expand All @@ -34,25 +34,25 @@ bootJar {
dependencies {

implementation project(':jb-common')
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:$mapstructVersion"

implementation "org.springframework.boot:spring-boot-starter-web"
implementation "org.springframework.boot:spring-boot-starter-security"
implementation "org.springframework.security:spring-security-acl"
implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:${springBootVersion}"
implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:$springBootVersion"

implementation "org.glassfish.main.external:jmxremote_optional-repackaged:${jmxRemote}"
implementation "org.glassfish.external:opendmk_jmxremote_optional_jar:${jmxRemoteLegacy}"
implementation "org.glassfish.main.external:jmxremote_optional-repackaged:$jmxRemote"
implementation "org.glassfish.external:opendmk_jmxremote_optional_jar:$jmxRemoteLegacy"

implementation "org.openpnp:opencv:${opencvVersion}-0"
implementation "org.opencv:opencv:${opencvVersion}"
implementation "org.opencv:opencv:$opencvVersion"

// SOCIAL DEPENDENCIES
implementation ("com.github.twitch4j:twitch4j:${twitch4jVersion}") {
implementation ("com.github.twitch4j:twitch4j:$twitch4jVersion") {
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
}
implementation "com.vk.api:sdk:${vkSdkVersion}"
implementation "com.rometools:rome:${romeVersion}"
implementation "com.vk.api:sdk:$vkSdkVersion"
implementation "com.rometools:rome:$romeVersion"

testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.springframework.security:spring-security-test"
Expand Down
78 changes: 0 additions & 78 deletions jb-api/src/main/java/ru/juniperbot/api/JuniperApiApplication.java

This file was deleted.

75 changes: 75 additions & 0 deletions jb-api/src/main/java/ru/juniperbot/api/Launcher.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* This file is part of JuniperBot.
*
* JuniperBot is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* JuniperBot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with JuniperBot. If not, see <http://www.gnu.org/licenses/>.
*/
package ru.juniperbot.api

import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration
import org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
import org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration
import org.springframework.boot.autoconfigure.security.servlet.SecurityRequestMatcherProviderAutoConfiguration
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Import
import org.springframework.context.annotation.ImportResource
import org.springframework.web.method.support.HandlerMethodArgumentResolver
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
import ru.juniperbot.api.common.ApiRequestLoggingFilter
import ru.juniperbot.api.common.AtomFeedArgumentResolver
import ru.juniperbot.common.configuration.CommonConfiguration
import ru.juniperbot.common.support.ModuleMessageSource
import ru.juniperbot.common.support.ModuleMessageSourceImpl


@Import(CommonConfiguration::class)
@ImportResource("classpath:security-context.xml")
@SpringBootApplication(exclude = [
SecurityAutoConfiguration::class,
SecurityFilterAutoConfiguration::class,
SecurityRequestMatcherProviderAutoConfiguration::class,
OAuth2ClientAutoConfiguration::class,
OAuth2ResourceServerAutoConfiguration::class
])
class JuniperApiApplication : WebMvcConfigurer {

@Bean
fun webMessages(): ModuleMessageSource = ModuleMessageSourceImpl("web-jbmessages")

override fun addArgumentResolvers(argumentResolvers: MutableList<HandlerMethodArgumentResolver>?) {
argumentResolvers!!.add(AtomFeedArgumentResolver())
}

@Bean
fun requestLoggingFilter(): ApiRequestLoggingFilter = ApiRequestLoggingFilter().apply {
this.setBeforeMessagePrefix("Before Request ")
this.setAfterMessagePrefix("After Request ")
this.setBeforeMessageSuffix("")
this.setAfterMessageSuffix("")
this.setMaxPayloadLength(10000)
this.setIncludeClientInfo(true)
this.setIncludeQueryString(true)
this.setIncludePayload(true)
}
}

object Launcher {

@JvmStatic
fun main(args: Array<String>) {
SpringApplication(JuniperApiApplication::class.java).run(*args)
}
}
Loading

0 comments on commit 9ccea6e

Please sign in to comment.