Добавил переменные для прокси

This commit is contained in:
Struchkov Mark 2022-12-13 18:43:51 +03:00
parent ba0388e9fd
commit 34c3370483
4 changed files with 18 additions and 18 deletions

View File

@ -1,17 +0,0 @@
package dev.struchkov.bot.gitlab.core.config.properties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Getter
@Setter
@Component
@ConfigurationProperties(prefix = "bitbucketbot.init")
public class InitProperty {
private Long startCommentId;
private boolean use = false;
}

View File

@ -19,6 +19,14 @@ spring:
telegram-config:
bot-username: ${TELEGRAM_BOT_USERNAME}
bot-token: ${TELEGRAM_BOT_TOKEN}
proxy-config:
enable: ${PROXY_ENABLE:false}
host: ${PROXY_HOST:host}
port: ${PROXY_PORT:8080}
type: ${PROXY_TYPE:SOCKS5}
user: ${PROXY_USERNAME:}
password: ${PROXY_PASSWORD:}
gitlab-bot:
version: 0.0.7 Beta
person:

View File

@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<godfather.telegram.core.version>0.0.41</godfather.telegram.core.version>
<godfather.telegram.core.version>0.0.42</godfather.telegram.core.version>
<javax.persistance.version>2.2</javax.persistance.version>

View File

@ -15,6 +15,7 @@ import dev.struchkov.godfather.simple.core.service.UnitPointerServiceImpl;
import dev.struchkov.godfather.simple.data.repository.impl.PersonSettingLocalRepository;
import dev.struchkov.godfather.simple.data.repository.impl.StorylineMapRepository;
import dev.struchkov.godfather.simple.data.repository.impl.UnitPointLocalRepository;
import dev.struchkov.godfather.telegram.domain.config.ProxyConfig;
import dev.struchkov.godfather.telegram.domain.config.TelegramConnectConfig;
import dev.struchkov.godfather.telegram.main.context.TelegramConnect;
import dev.struchkov.godfather.telegram.simple.consumer.EventDistributorService;
@ -24,6 +25,7 @@ import dev.struchkov.godfather.telegram.simple.core.MailAutoresponderTelegram;
import dev.struchkov.godfather.telegram.simple.core.TelegramConnectBot;
import dev.struchkov.godfather.telegram.simple.core.service.SenderMapRepository;
import dev.struchkov.godfather.telegram.simple.sender.TelegramSender;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -93,6 +95,13 @@ public class TelegramBotConfig {
return new TelegramConnectBot(telegramConfig);
}
@Bean
@ConfigurationProperties("telegram-proxy-config")
@ConditionalOnProperty(prefix = "telegram-config.proxy-config.enable", value = "true")
public ProxyConfig proxyConfig() {
return new ProxyConfig();
}
@Bean
@ConfigurationProperties("telegram-config")
public TelegramConnectConfig telegramConfig() {