mirror of
https://github.com/opengram-server/opengram.git
synced 2026-07-19 04:00:18 +03:00
Initial commit
This commit is contained in:
@@ -0,0 +1,247 @@
|
||||
# MyTelegram servers version
|
||||
MyTelegramVersion=0.32.206.802
|
||||
MyTelegramRegistry=mytelegram
|
||||
|
||||
# Build configuration for compiling from source
|
||||
BUILD_CONFIGURATION=Release
|
||||
# RabbitMQ
|
||||
RabbitMQ__Connections__Default__HostName=rabbitmq
|
||||
RabbitMQ__Connections__Default__Port=5672
|
||||
RabbitMQ__Connections__Default__UserName=test
|
||||
RabbitMQ__Connections__Default__Password=test
|
||||
RabbitMQ__EventBus__ExchangeName=mytelegram_exchange
|
||||
|
||||
# Redis
|
||||
Redis__Configuration=redis:6379,password=CHANGE_ME
|
||||
|
||||
# MongoDB
|
||||
ConnectionStrings__Default=mongodb://mongodb:27017
|
||||
|
||||
# Minio
|
||||
Minio__Endpoint=minio:9000
|
||||
Minio__AccessKey=minioadmin
|
||||
Minio__SecretKey=CHANGE_ME
|
||||
Minio__BucketName=tg-files
|
||||
# Minio__CreateBucketIfNotExists=True
|
||||
|
||||
# TwilioSms
|
||||
# TwilioSms__Enabled=False
|
||||
# TwilioSms__AccountSId=
|
||||
# TwilioSms__AuthToken=
|
||||
# TwilioSms__FromNumber=
|
||||
# TwilioSms__MessagingServiceSId=
|
||||
|
||||
# VonageSms
|
||||
# VonageSms__Enabled=False
|
||||
# VonageSms__BrandName=
|
||||
# VonageSms__ApiKey=
|
||||
# VonageSms__ApiSecret=
|
||||
|
||||
# EmailSenderOptions
|
||||
# EmailSenderOptions__FromAddress=
|
||||
# EmailSenderOptions__FromDisplayName=MyTelegram
|
||||
# EmailSenderOptions__SmtpEmailOptions__Host=
|
||||
# EmailSenderOptions__SmtpEmailOptions__Port=
|
||||
# EmailSenderOptions__SmtpEmailOptions__UserName=
|
||||
# EmailSenderOptions__SmtpEmailOptions__Password=
|
||||
# EmailSenderOptions__SmtpEmailOptions__Domain=localhost
|
||||
# EmailSenderOptions__SmtpEmailOptions__EnableSsl=False
|
||||
# EmailSenderOptions__MailKitOptions__SecureSocketOptions=0
|
||||
|
||||
# App
|
||||
# App__PrivateKeyFilePath=private.pkcs8.key
|
||||
# App__IdGeneratorGrpcServiceUrl=http://localhost:10002
|
||||
App__DatabaseName=tg
|
||||
App__ReadModelDatabaseName=tg
|
||||
App__CreateTestUsers=False
|
||||
App__AccessHashSecretKey=CHANGE_ME
|
||||
# App__MyTelegramBotOptions__BotApiBaseUrl=http://bot-server:8080
|
||||
# App__MyTelegramBotOptions__Token=
|
||||
# App__MyTelegramBotOptions__WebHookUrl=http://localhost:10004/bot/ProcessBotCommand
|
||||
# App__SubscribeLocalRequest=True
|
||||
# App__SubscribeRemoteRequest=True
|
||||
# App__UseExternalWebHookSender=False
|
||||
# App__WebHookSenderUrl=https://xxx/api/bot/sendWebHook
|
||||
# App=
|
||||
App__ThisDcId=1
|
||||
App__MediaDcId=2
|
||||
# App__UploadRootPath=uploads
|
||||
# App__MediaOnly=False
|
||||
App__Servers__0__Enabled=True
|
||||
# App__Servers__0__ServerType=0
|
||||
# App__Servers__0__Ip=
|
||||
# App__Servers__0__Ipv6=True
|
||||
App__Servers__0__Port=20443
|
||||
# App__Servers__0__Ssl=False
|
||||
# App__Servers__0__CertPemFilePath=
|
||||
# App__Servers__0__KeyPemFilePath=
|
||||
# App__Servers__0__EnableProxyProtocolV2=False
|
||||
# App__Servers__0__MediaOnly=False
|
||||
App__Servers__1__Enabled=True
|
||||
# App__Servers__1__ServerType=0
|
||||
# App__Servers__1__Ip=
|
||||
# App__Servers__1__Ipv6=True
|
||||
App__Servers__1__Port=20543
|
||||
# App__Servers__1__Ssl=False
|
||||
# App__Servers__1__CertPemFilePath=
|
||||
# App__Servers__1__KeyPemFilePath=
|
||||
# App__Servers__1__EnableProxyProtocolV2=False
|
||||
# App__Servers__1__MediaOnly=False
|
||||
# App__Servers__2__Enabled=True
|
||||
# App__Servers__2__ServerType=0
|
||||
# App__Servers__2__Ip=
|
||||
# App__Servers__2__Ipv6=True
|
||||
App__Servers__2__Port=20643
|
||||
# App__Servers__2__Ssl=False
|
||||
# App__Servers__2__CertPemFilePath=
|
||||
# App__Servers__2__KeyPemFilePath=
|
||||
# App__Servers__2__EnableProxyProtocolV2=False
|
||||
# App__Servers__2__MediaOnly=True
|
||||
App__Servers__3__Enabled=True
|
||||
# App__Servers__3__ServerType=0
|
||||
# App__Servers__3__Ip=
|
||||
# App__Servers__3__Ipv6=True
|
||||
App__Servers__3__Port=20644
|
||||
# App__Servers__3__Ssl=False
|
||||
# App__Servers__3__CertPemFilePath=
|
||||
# App__Servers__3__KeyPemFilePath=
|
||||
# App__Servers__3__EnableProxyProtocolV2=False
|
||||
# App__Servers__3__MediaOnly=True
|
||||
App__Servers__4__Enabled=True
|
||||
# App__Servers__4__ServerType=1
|
||||
# App__Servers__4__Ip=
|
||||
# App__Servers__4__Ipv6=True
|
||||
App__Servers__4__Port=30443
|
||||
# App__Servers__4__Ssl=True
|
||||
# App__Servers__4__CertPemFilePath=_wildcard.telegram2.com.pem
|
||||
# App__Servers__4__KeyPemFilePath=_wildcard.telegram2.com-key.pem
|
||||
# App__Servers__4__EnableProxyProtocolV2=False
|
||||
# App__Servers__4__MediaOnly=False
|
||||
App__Servers__5__Enabled=True
|
||||
# App__Servers__5__ServerType=1
|
||||
# App__Servers__5__Ip=
|
||||
# App__Servers__5__Ipv6=True
|
||||
App__Servers__5__Port=30444
|
||||
# App__Servers__5__Ssl=False
|
||||
# App__Servers__5__CertPemFilePath=
|
||||
# App__Servers__5__KeyPemFilePath=
|
||||
# App__Servers__5__EnableProxyProtocolV2=False
|
||||
# App__Servers__5__MediaOnly=False
|
||||
App__QueryServerEventStoreDatabaseName=tg
|
||||
App__QueryServerReadModelDatabaseName=tg
|
||||
App__BotDatabaseName=tg
|
||||
App__FileServerGrpcServiceUrl=http://file-server:8080
|
||||
App__FixedVerifyCode=22222
|
||||
# App__FixedEmailVerificationCode=
|
||||
App__VerificationCodeLength=5
|
||||
App__VerificationCodeExpirationSeconds=300
|
||||
# App__JoinChatDomain=https://t.me
|
||||
# App__ChannelGetDifferenceIntervalSeconds=60
|
||||
# App__UseInMemoryFilters=True
|
||||
# App__IsMediaDc=False
|
||||
# App__AutoCreateSuperGroup=True
|
||||
# App__EnableFutureAuthToken=True
|
||||
# App__SetPremiumToTrueAfterUserCreated=True
|
||||
# App__SendWelcomeMessageAfterUserSignIn=False
|
||||
# App__SetupPasswordRequired=False
|
||||
App__EnableEmailLogin=False
|
||||
# App__SupportUserId=
|
||||
App__CheckPhoneNumberFormat=True
|
||||
App__EnableSearchNonContacts=True
|
||||
# WebRTC / TURN / STUN configuration for voice and video calls
|
||||
# TURN/STUN enabled for voice and video calls
|
||||
App__WebRtcConnections__0__Ip=127.0.0.1
|
||||
App__WebRtcConnections__0__Ipv6=::
|
||||
App__WebRtcConnections__0__Port=3478
|
||||
App__WebRtcConnections__0__Turn=true
|
||||
App__WebRtcConnections__0__Stun=true
|
||||
App__WebRtcConnections__0__UserName=mytelegram
|
||||
App__WebRtcConnections__0__Password=CHANGE_ME
|
||||
TURN_EXTERNAL_IP=127.0.0.1
|
||||
App__DcOptions__0__Id=1
|
||||
App__DcOptions__0__IpAddress=127.0.0.1
|
||||
App__DcOptions__0__Port=20443
|
||||
# App__DcOptions__0__TcpoOnly=True
|
||||
# App__DcOptions__0__ThisPortOnly=True
|
||||
# App__DcOptions__0__Ipv6=False
|
||||
# App__DcOptions__0__Cdn=False
|
||||
# App__DcOptions__0__MediaOnly=False
|
||||
# App__DcOptions__0__Static=False
|
||||
App__DcOptions__1__Id=2
|
||||
App__DcOptions__1__IpAddress=127.0.0.1
|
||||
App__DcOptions__1__Port=20543
|
||||
# App__DcOptions__1__TcpoOnly=True
|
||||
# App__DcOptions__1__ThisPortOnly=True
|
||||
# App__DcOptions__1__Ipv6=False
|
||||
# App__DcOptions__1__Cdn=False
|
||||
# App__DcOptions__1__MediaOnly=False
|
||||
# App__DcOptions__1__Static=False
|
||||
App__DcOptions__2__Id=2
|
||||
App__DcOptions__2__IpAddress=127.0.0.1
|
||||
App__DcOptions__2__Port=20643
|
||||
# App__DcOptions__2__TcpoOnly=True
|
||||
# App__DcOptions__2__ThisPortOnly=True
|
||||
# App__DcOptions__2__Ipv6=False
|
||||
# App__DcOptions__2__Cdn=False
|
||||
# App__DcOptions__2__MediaOnly=True
|
||||
# App__DcOptions__2__Static=False
|
||||
App__DcOptions__0__Enabled=True
|
||||
App__DcOptions__1__Enabled=True
|
||||
App__DcOptions__2__Enabled=True
|
||||
App__DcOptions__3__Enabled=True
|
||||
App__DcOptions__3__Id=2
|
||||
App__DcOptions__3__IpAddress=127.0.0.1
|
||||
App__DcOptions__3__Port=20644
|
||||
# App__DcOptions__3__TcpoOnly=False
|
||||
# App__DcOptions__3__ThisPortOnly=True
|
||||
# App__DcOptions__3__Ipv6=False
|
||||
# App__DcOptions__3__Cdn=False
|
||||
# App__DcOptions__3__MediaOnly=True
|
||||
# App__DcOptions__3__Static=False
|
||||
# App__ServiceAccountKeyJsonFileName=serviceAccountKey.json
|
||||
# App__MessengerServerGrpcServiceUrl=http://messenger-grpc-service:8080
|
||||
# App__DispatchUnknownObjectToMessengerServer=True
|
||||
# App__TempAuthKeyExpirationMinutes=720
|
||||
# App__CommandServerObjectIds=
|
||||
# App__ChannelMemberMaxCountAllowedForPush=100
|
||||
# App__EnablePushNotification=True
|
||||
# App__ForceDownload=False
|
||||
# App__AllowedUserIds__0=2000001
|
||||
# App__AllowedUserIds__1=2000004
|
||||
# App__OfficialTelegramBotOptions__Token=
|
||||
# App__OfficialTelegramBotOptions__ProxyUrl=socks5://localhost:10808
|
||||
# App__OfficialTelegramBotOptions__UseProxy=False
|
||||
# App__LoadAllStickersIntoMemory=True
|
||||
|
||||
# Serilog
|
||||
# Serilog__Using__0=Serilog.Sinks.Console
|
||||
# Serilog__Using__1=Serilog.Sinks.File
|
||||
# Serilog__Using__2=Serilog.Sinks.Async
|
||||
Serilog__MinimumLevel__Default=Information
|
||||
Serilog__MinimumLevel__Override__Microsoft=Warning
|
||||
# Serilog__WriteTo__0__Name=Async
|
||||
# Serilog__WriteTo__0__Args__configure__0__Name=Console
|
||||
# Serilog__WriteTo__0__Args__configure__0__Args__MinimumLevel=Information
|
||||
# Serilog__WriteTo__0__Args__configure__0__Args__outputTemplate=[{Timestamp:yyyy-MM-dd HH:mm:ss:ffffff} [{Level:u3}] {Message}{NewLine}{Exception}
|
||||
# Serilog__WriteTo__0__Args__configure__0__Args__theme=Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console
|
||||
# Serilog__WriteTo__1__Name=Async
|
||||
# Serilog__WriteTo__1__Args__configure__0__Name=File
|
||||
# Serilog__WriteTo__1__Args__configure__0__Args__rollingInterval=Day
|
||||
# Serilog__WriteTo__1__Args__configure__0__Args__path=./Logs/log-.txt
|
||||
# Serilog__WriteTo__1__Args__configure__0__Args__outputTemplate={Timestamp:o} [{Level:u3}] {Message}{NewLine}{Exception}
|
||||
# Serilog__MinimumLevel__Override__Grpc=Debug
|
||||
# Serilog__WriteTo__1__Args__configure__0__Args__MinimumLevel=Debug
|
||||
# Serilog__MinimumLevel__Override__System.Net.Http.HttpClient.Default=Warning
|
||||
# Serilog__MinimumLevel__Override__EventFlow=Information
|
||||
|
||||
# Fragment
|
||||
FRAGMENT_BOT_TOKEN=
|
||||
|
||||
# Database Passwords
|
||||
MONGODB_PASSWORD=CHANGE_ME
|
||||
RABBITMQ_PASSWORD=CHANGE_ME
|
||||
REDIS_PASSWORD=CHANGE_ME
|
||||
MINIO_PASSWORD=CHANGE_ME
|
||||
|
||||
# Admin API Key
|
||||
ADMIN_API_KEY=CHANGE_ME
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env powershell
|
||||
# Полный перезапуск MongoDB с включённой аутентификацией
|
||||
# Скрипт корректно сбрасывает состояние MongoDB и поднимает его заново
|
||||
|
||||
Write-Host "======================================" -ForegroundColor Green
|
||||
Write-Host "MongoDB Authentication Fix - Restart" -ForegroundColor Green
|
||||
Write-Host "======================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
|
||||
$compose_dir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
Set-Location $compose_dir
|
||||
|
||||
Write-Host "[1/5] Stopping all services..." -ForegroundColor Yellow
|
||||
docker-compose down
|
||||
|
||||
Write-Host "[2/5] Removing MongoDB data volume to reinitialize..." -ForegroundColor Yellow
|
||||
if (Test-Path "./data/mongo") {
|
||||
Remove-Item -Recurse -Force "./data/mongo"
|
||||
Write-Host " MongoDB data directory removed" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " MongoDB data directory not found (this is fine)" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
Write-Host "[3/5] Waiting a moment before starting services..." -ForegroundColor Yellow
|
||||
Start-Sleep -Seconds 2
|
||||
|
||||
Write-Host "[4/5] Building and starting services with MongoDB authentication..." -ForegroundColor Yellow
|
||||
docker-compose up --build -d
|
||||
|
||||
Write-Host "[5/5] Waiting for MongoDB to initialize..." -ForegroundColor Yellow
|
||||
Start-Sleep -Seconds 10
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "======================================" -ForegroundColor Green
|
||||
Write-Host "Restart Complete!" -ForegroundColor Green
|
||||
Write-Host "======================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "Next steps:" -ForegroundColor Cyan
|
||||
Write-Host "1. Check MongoDB initialization: docker-compose logs mongodb"
|
||||
Write-Host "2. Check data-seeder: docker-compose logs data-seeder"
|
||||
Write-Host "3. Check admin-api: docker-compose logs admin-api"
|
||||
Write-Host "4. Monitor bot-api: docker-compose logs bot-api-server"
|
||||
Write-Host ""
|
||||
Write-Host "MongoDB Authentication Details:" -ForegroundColor Cyan
|
||||
Write-Host " Username: admin" -ForegroundColor Gray
|
||||
Write-Host " Auth Database: admin" -ForegroundColor Gray
|
||||
Write-Host " Target Database: tg" -ForegroundColor Gray
|
||||
Write-Host ""
|
||||
@@ -0,0 +1,39 @@
|
||||
# Simple script to create chat themes in MongoDB
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Creating chat themes in MongoDB..." -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
|
||||
# Copy seed script to MongoDB container
|
||||
Write-Host "Copying seed script to container..." -ForegroundColor Gray
|
||||
docker cp "$scriptDir\seed-chat-themes-unicode.js" compose-mongodb-1:/tmp/seed-themes.js
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Failed to copy seed script!" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Execute seed script
|
||||
Write-Host "Creating themes..." -ForegroundColor Gray
|
||||
docker exec compose-mongodb-1 mongosh tg /tmp/seed-themes.js
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Failed to create themes!" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Done! 8 chat themes created successfully!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "Themes:" -ForegroundColor Cyan
|
||||
Write-Host " - Home (Blue)" -ForegroundColor White
|
||||
Write-Host " - Love (Pink)" -ForegroundColor White
|
||||
Write-Host " - Party (Orange)" -ForegroundColor White
|
||||
Write-Host " - Ocean (Cyan)" -ForegroundColor White
|
||||
Write-Host " - Flower (Rose)" -ForegroundColor White
|
||||
Write-Host " - Night (Purple)" -ForegroundColor White
|
||||
Write-Host " - Fire (Red)" -ForegroundColor White
|
||||
Write-Host " - Green (Emerald)" -ForegroundColor White
|
||||
Write-Host ""
|
||||
@@ -0,0 +1,11 @@
|
||||
// Script to delete old StarsSnapshot from MongoDB
|
||||
// Run this in MongoDB shell or via mongosh
|
||||
|
||||
use MyTelegram;
|
||||
|
||||
// Delete all StarsSnapshots with old version
|
||||
db['eventflow.snapshots'].deleteMany({
|
||||
'Metadata.AggregateId': { $regex: '^stars-' }
|
||||
});
|
||||
|
||||
print('Old StarsSnapshots deleted');
|
||||
@@ -0,0 +1,653 @@
|
||||
version: "3.9"
|
||||
|
||||
networks:
|
||||
tg-net:
|
||||
driver: bridge
|
||||
|
||||
services:
|
||||
### Redis
|
||||
redis:
|
||||
image: redis:alpine
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
#ports:
|
||||
#- "6379:6379"
|
||||
volumes:
|
||||
- ./data/redis:/data
|
||||
|
||||
### RabbitMq
|
||||
rabbitmq:
|
||||
image: rabbitmq:3-management-alpine
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
#ports:
|
||||
# - "5672:5672"
|
||||
# - "15672:15672"
|
||||
volumes:
|
||||
- ./data/rabbitmq:/var/lib/rabbitmq
|
||||
environment:
|
||||
# RABBITMQ_DEFAULT_USER: ${RabbitMQ__Connections__Default__UserName}
|
||||
# RABBITMQ_DEFAULT_PASS: ${RabbitMQ__Connections__Default__Password}
|
||||
RABBITMQ_DEFAULT_USER: test
|
||||
RABBITMQ_DEFAULT_PASS: test
|
||||
|
||||
### MongoDb
|
||||
mongodb:
|
||||
image: mongo:latest
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- ./data/mongo/:/data
|
||||
#- ./data/mongo/db:/data/db
|
||||
#- ./data/mongo/configdb:/data/configdb
|
||||
#environment:
|
||||
# MONGO_INITDB_ROOT_USERNAME: admin
|
||||
# MONGO_INITDB_ROOT_PASSWORD: admin
|
||||
|
||||
### Minio
|
||||
minio:
|
||||
image: minio/minio:latest
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
ports:
|
||||
- "9000:9000"
|
||||
- "9001:9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${Minio__AccessKey}
|
||||
MINIO_ROOT_PASSWORD: ${Minio__SecretKey}
|
||||
volumes:
|
||||
- ./data/minio:/data
|
||||
#- /docker/minio/config:/root/./minio/
|
||||
command: server /data --console-address ":9001"
|
||||
#privileged: true
|
||||
|
||||
################### MyTelegram server
|
||||
|
||||
### Data seeder
|
||||
data-seeder:
|
||||
build:
|
||||
context: ../../source
|
||||
dockerfile: src/MyTelegram.DataSeeder/Dockerfile
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
environment:
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
ConnectionStrings__Default: ${ConnectionStrings__Default}
|
||||
App__DatabaseName: tg
|
||||
App__ReadModelDatabaseName: tg
|
||||
App__CreateTestUsers: ${App__CreateTestUsers}
|
||||
# App__LoadAllStickersIntoMemory: ${App__LoadAllStickersIntoMemory}
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
# RabbitMQ__EventBus__ClientName: ${RabbitMQ__EventBus__ClientName}
|
||||
# RabbitMQ__EventBus__ExchangeName: ${RabbitMQ__EventBus__ExchangeName}
|
||||
volumes:
|
||||
- ./data/mytelegram/data-seeder/logs:/app/Logs
|
||||
depends_on:
|
||||
- mongodb
|
||||
|
||||
### Admin API
|
||||
admin-api:
|
||||
build:
|
||||
context: ../../source
|
||||
dockerfile: src/MyTelegram.Admin.Api/Dockerfile
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
ports:
|
||||
- "5555:5000"
|
||||
environment:
|
||||
ASPNETCORE_URLS: http://+:5000
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
ConnectionStrings__Default: ${ConnectionStrings__Default}
|
||||
App__DatabaseName: tg
|
||||
App__ReadModelDatabaseName: tg
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
ADMIN_API_KEY: ${ADMIN_API_KEY}
|
||||
volumes:
|
||||
- ./data/mytelegram/admin-api/logs:/app/Logs
|
||||
depends_on:
|
||||
- mongodb
|
||||
- rabbitmq
|
||||
|
||||
### 1.Gateway server
|
||||
gateway-server:
|
||||
build:
|
||||
context: ../../source
|
||||
dockerfile: src/MyTelegram.GatewayServer/Dockerfile
|
||||
args:
|
||||
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION}
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
ports:
|
||||
- "${App__Servers__0__Port}:${App__Servers__0__Port}"
|
||||
- "${App__Servers__1__Port}:${App__Servers__1__Port}"
|
||||
- "${App__Servers__2__Port}:${App__Servers__2__Port}"
|
||||
- "${App__Servers__3__Port}:${App__Servers__3__Port}"
|
||||
- "${App__Servers__4__Port}:${App__Servers__4__Port}"
|
||||
- "${App__Servers__5__Port}:${App__Servers__5__Port}"
|
||||
volumes:
|
||||
- ./data/mytelegram/gateway/logs:/app/Logs
|
||||
- ./secrets/mtproto:/app/secrets/mtproto:ro
|
||||
environment:
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
App__ThisDcId: ${App__ThisDcId}
|
||||
App__MediaDcId: ${App__MediaDcId}
|
||||
# App__MediaOnly: ${App__MediaOnly}
|
||||
# App__Servers__0__Enabled: ${App__Servers__0__Enabled}
|
||||
# App__Servers__0__ServerType: ${App__Servers__0__ServerType}
|
||||
# App__Servers__0__Ip: ${App__Servers__0__Ip}
|
||||
# App__Servers__0__Ipv6: ${App__Servers__0__Ipv6}
|
||||
App__Servers__0__Port: ${App__Servers__0__Port}
|
||||
# App__Servers__0__Ssl: ${App__Servers__0__Ssl}
|
||||
# App__Servers__0__CertPemFilePath: ${App__Servers__0__CertPemFilePath}
|
||||
# App__Servers__0__KeyPemFilePath: ${App__Servers__0__KeyPemFilePath}
|
||||
# App__Servers__0__EnableProxyProtocolV2: ${App__Servers__0__EnableProxyProtocolV2}
|
||||
# App__Servers__0__MediaOnly: ${App__Servers__0__MediaOnly}
|
||||
App__Servers__1__Enabled: ${App__Servers__1__Enabled}
|
||||
# App__Servers__1__ServerType: ${App__Servers__1__ServerType}
|
||||
# App__Servers__1__Ip: ${App__Servers__1__Ip}
|
||||
# App__Servers__1__Ipv6: ${App__Servers__1__Ipv6}
|
||||
App__Servers__1__Port: ${App__Servers__1__Port}
|
||||
# App__Servers__1__Ssl: ${App__Servers__1__Ssl}
|
||||
# App__Servers__1__CertPemFilePath: ${App__Servers__1__CertPemFilePath}
|
||||
# App__Servers__1__KeyPemFilePath: ${App__Servers__1__KeyPemFilePath}
|
||||
# App__Servers__1__EnableProxyProtocolV2: ${App__Servers__1__EnableProxyProtocolV2}
|
||||
# App__Servers__1__MediaOnly: ${App__Servers__1__MediaOnly}
|
||||
App__Servers__2__Enabled: ${App__Servers__2__Enabled}
|
||||
# App__Servers__2__ServerType: ${App__Servers__2__ServerType}
|
||||
# App__Servers__2__Ip: ${App__Servers__2__Ip}
|
||||
# App__Servers__2__Ipv6: ${App__Servers__2__Ipv6}
|
||||
App__Servers__2__Port: ${App__Servers__2__Port}
|
||||
# App__Servers__2__Ssl: ${App__Servers__2__Ssl}
|
||||
# App__Servers__2__CertPemFilePath: ${App__Servers__2__CertPemFilePath}
|
||||
# App__Servers__2__KeyPemFilePath: ${App__Servers__2__KeyPemFilePath}
|
||||
# App__Servers__2__EnableProxyProtocolV2: ${App__Servers__2__EnableProxyProtocolV2}
|
||||
# App__Servers__2__MediaOnly: ${App__Servers__2__MediaOnly}
|
||||
App__Servers__3__Enabled: ${App__Servers__3__Enabled}
|
||||
# App__Servers__3__ServerType: ${App__Servers__3__ServerType}
|
||||
# App__Servers__3__Ip: ${App__Servers__3__Ip}
|
||||
# App__Servers__3__Ipv6: ${App__Servers__3__Ipv6}
|
||||
App__Servers__3__Port: ${App__Servers__3__Port}
|
||||
# App__Servers__3__Ssl: ${App__Servers__3__Ssl}
|
||||
# App__Servers__3__CertPemFilePath: ${App__Servers__3__CertPemFilePath}
|
||||
# App__Servers__3__KeyPemFilePath: ${App__Servers__3__KeyPemFilePath}
|
||||
# App__Servers__3__EnableProxyProtocolV2: ${App__Servers__3__EnableProxyProtocolV2}
|
||||
# App__Servers__3__MediaOnly: ${App__Servers__3__MediaOnly}
|
||||
# App__Servers__4__Enabled: ${App__Servers__4__Enabled}
|
||||
# App__Servers__4__ServerType: ${App__Servers__4__ServerType}
|
||||
# App__Servers__4__Ip: ${App__Servers__4__Ip}
|
||||
# App__Servers__4__Ipv6: ${App__Servers__4__Ipv6}
|
||||
App__Servers__4__Port: ${App__Servers__4__Port}
|
||||
# App__Servers__4__Ssl: ${App__Servers__4__Ssl}
|
||||
# App__Servers__4__CertPemFilePath: ${App__Servers__4__CertPemFilePath}
|
||||
# App__Servers__4__KeyPemFilePath: ${App__Servers__4__KeyPemFilePath}
|
||||
# App__Servers__4__EnableProxyProtocolV2: ${App__Servers__4__EnableProxyProtocolV2}
|
||||
# App__Servers__4__MediaOnly: ${App__Servers__4__MediaOnly}
|
||||
# App__Servers__5__Enabled: ${App__Servers__5__Enabled}
|
||||
# App__Servers__5__ServerType: ${App__Servers__5__ServerType}
|
||||
# App__Servers__5__Ip: ${App__Servers__5__Ip}
|
||||
# App__Servers__5__Ipv6: ${App__Servers__5__Ipv6}
|
||||
App__Servers__5__Port: ${App__Servers__5__Port}
|
||||
# App__Servers__5__Ssl: ${App__Servers__5__Ssl}
|
||||
# App__Servers__5__CertPemFilePath: ${App__Servers__5__CertPemFilePath}
|
||||
# App__Servers__5__KeyPemFilePath: ${App__Servers__5__KeyPemFilePath}
|
||||
# App__Servers__5__EnableProxyProtocolV2: ${App__Servers__5__EnableProxyProtocolV2}
|
||||
# App__Servers__5__MediaOnly: ${App__Servers__5__MediaOnly}
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
# RabbitMQ__EventBus__ClientName: ${RabbitMQ__EventBus__ClientName}
|
||||
RabbitMQ__EventBus__ExchangeName: ${RabbitMQ__EventBus__ExchangeName}
|
||||
depends_on:
|
||||
- rabbitmq
|
||||
- mongodb
|
||||
- redis
|
||||
|
||||
# ### 2.Seq server
|
||||
# seq-server:
|
||||
# image: mytelegram/mytelegram-seq-server:${MyTelegramVersion}
|
||||
# restart: always
|
||||
# networks:
|
||||
# - tg-net
|
||||
# #ports:
|
||||
# # - "10001:80"
|
||||
# environment:
|
||||
# ConnectionStrings__Default: ${DefaultConnectionStrings}
|
||||
# Serilog__MinimumLevel__Default: ${DefaultLogLevel}
|
||||
# volumes:
|
||||
# - ./data/mytelegram/seq/logs:/data/Logs
|
||||
# depends_on:
|
||||
# - mongodb
|
||||
|
||||
### 2.Auth server
|
||||
auth-server:
|
||||
build:
|
||||
context: ../../source
|
||||
dockerfile: src/MyTelegram.AuthServer/Dockerfile
|
||||
args:
|
||||
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION}
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
environment:
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
App__PrivateKeyFilePath: /app/secrets/mtproto/rsa_private.pem
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
# RabbitMQ__EventBus__ClientName: ${RabbitMQ__EventBus__ClientName}
|
||||
RabbitMQ__EventBus__ExchangeName: ${RabbitMQ__EventBus__ExchangeName}
|
||||
Redis__Configuration: ${Redis__Configuration}
|
||||
volumes:
|
||||
- ./data/mytelegram/auth/logs:/app/Logs
|
||||
- ./secrets/mtproto:/app/secrets/mtproto:ro
|
||||
depends_on:
|
||||
- mongodb
|
||||
- rabbitmq
|
||||
- redis
|
||||
|
||||
### 3.Session server
|
||||
session-server:
|
||||
image: ${MyTelegramRegistry}/mytelegram-session-server:${MyTelegramVersion}
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
environment:
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
ConnectionStrings__Default: ${ConnectionStrings__Default}
|
||||
# App__ThisDcId: ${App__ThisDcId}
|
||||
# App__MediaOnly: ${App__MediaOnly}
|
||||
App__DatabaseName: tg
|
||||
App__ReadModelDatabaseName: tg
|
||||
App__AccessHashSecretKey: ${App__AccessHashSecretKey}
|
||||
# App__IdGeneratorGrpcServiceUrl: ${App__IdGeneratorGrpcServiceUrl}
|
||||
App__MessengerServerGrpcServiceUrl: ${App__MessengerServerGrpcServiceUrl}
|
||||
# App__DispatchUnknownObjectToMessengerServer: ${App__DispatchUnknownObjectToMessengerServer}
|
||||
# App__TempAuthKeyExpirationMinutes: ${App__TempAuthKeyExpirationMinutes}
|
||||
# App__CommandServerObjectIds: ${App__CommandServerObjectIds}
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
# RabbitMQ__EventBus__ClientName: ${RabbitMQ__EventBus__ClientName}
|
||||
# RabbitMQ__EventBus__ExchangeName: ${RabbitMQ__EventBus__ExchangeName}
|
||||
Redis__Configuration: ${Redis__Configuration}
|
||||
volumes:
|
||||
- ./data/mytelegram/session/logs:/app/Logs
|
||||
depends_on:
|
||||
- mongodb
|
||||
- rabbitmq
|
||||
- redis
|
||||
|
||||
# ### 5.Messenger grpc server
|
||||
# messenger-grpc-service:
|
||||
# image: mytelegram/mytelegram-messenger-grpc-service:${MyTelegramVersion}
|
||||
# restart: always
|
||||
# networks:
|
||||
# - tg-net
|
||||
# environment:
|
||||
# Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
# ConnectionStrings__Default: ${ConnectionStrings__Default}
|
||||
# App__DatabaseName: tg
|
||||
# App__ReadModelDatabaseName: tg
|
||||
# volumes:
|
||||
# - ./data/mytelegram/messenger-grpc-service/logs:/app/Logs
|
||||
# depends_on:
|
||||
# - mongodb
|
||||
|
||||
### 4.File server (original - for Telegram)
|
||||
file-server:
|
||||
image: ${MyTelegramRegistry}/mytelegram-file-server:${MyTelegramVersion}
|
||||
restart: always
|
||||
user: "0:0" # Run as root to avoid permission issues
|
||||
networks:
|
||||
- tg-net
|
||||
volumes:
|
||||
- ./data/mytelegram/file/uploads:/app/uploads
|
||||
- ./data/mytelegram/file:/app/Logs
|
||||
environment:
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
ConnectionStrings__Default: ${ConnectionStrings__Default}
|
||||
App__DatabaseName: tg
|
||||
App__ReadModelDatabaseName: tg
|
||||
App__AccessHashSecretKey: ${App__AccessHashSecretKey}
|
||||
Minio__Endpoint: ${Minio__Endpoint}
|
||||
Minio__AccessKey: ${Minio__AccessKey}
|
||||
Minio__SecretKey: ${Minio__SecretKey}
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
Redis__Configuration: ${Redis__Configuration}
|
||||
depends_on:
|
||||
- mongodb
|
||||
- rabbitmq
|
||||
|
||||
### 4.5 File merge proxy (HTTP API for merging file parts from local filesystem)
|
||||
file-merge-proxy:
|
||||
build:
|
||||
context: ../../file-merge-proxy
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
volumes:
|
||||
- ./data/mytelegram/file/uploads:/app/uploads
|
||||
environment:
|
||||
PORT: 5000
|
||||
UPLOAD_PATH: /app/uploads
|
||||
ports:
|
||||
- "5000:5000"
|
||||
|
||||
### 5.Messenger command server
|
||||
messenger-command-server:
|
||||
build:
|
||||
context: ../../source
|
||||
dockerfile: src/MyTelegram.Messenger.CommandServer/Dockerfile
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
environment:
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
ConnectionStrings__Default: ${ConnectionStrings__Default}
|
||||
App__DatabaseName: tg
|
||||
App__ReadModelDatabaseName: tg
|
||||
App__AccessHashSecretKey: ${App__AccessHashSecretKey}
|
||||
App__FileServerGrpcServiceUrl: ${App__FileServerGrpcServiceUrl}
|
||||
App__FixedVerifyCode: ${App__FixedVerifyCode}
|
||||
App__VerificationCodeLength: ${App__VerificationCodeLength}
|
||||
App__VerificationCodeExpirationSeconds: ${App__VerificationCodeExpirationSeconds}
|
||||
App__CheckPhoneNumberFormat: ${App__CheckPhoneNumberFormat}
|
||||
App__EnableSearchNonContacts: ${App__EnableSearchNonContacts}
|
||||
# App__JoinChatDomain: ${App__JoinChatDomain}
|
||||
# App__ChannelGetDifferenceIntervalSeconds: ${App__ChannelGetDifferenceIntervalSeconds}
|
||||
# App__UseInMemoryFilters: ${App__UseInMemoryFilters}
|
||||
# App__IsMediaDc: ${App__IsMediaDc}
|
||||
# App__AutoCreateSuperGroup: ${App__AutoCreateSuperGroup}
|
||||
# App__EnableFutureAuthToken: ${App__EnableFutureAuthToken}
|
||||
# App__SetPremiumToTrueAfterUserCreated: ${App__SetPremiumToTrueAfterUserCreated}
|
||||
# App__SendWelcomeMessageAfterUserSignIn: ${App__SendWelcomeMessageAfterUserSignIn}
|
||||
App__WebRtcConnections__0__Ip: ${App__WebRtcConnections__0__Ip}
|
||||
App__WebRtcConnections__0__Ipv6: ${App__WebRtcConnections__0__Ipv6}
|
||||
App__WebRtcConnections__0__Port: ${App__WebRtcConnections__0__Port}
|
||||
App__WebRtcConnections__0__Turn: ${App__WebRtcConnections__0__Turn}
|
||||
App__WebRtcConnections__0__Stun: ${App__WebRtcConnections__0__Stun}
|
||||
App__WebRtcConnections__0__UserName: ${App__WebRtcConnections__0__UserName}
|
||||
App__WebRtcConnections__0__Password: ${App__WebRtcConnections__0__Password}
|
||||
# App__ThisDcId: ${App__ThisDcId}
|
||||
# App__DcOptions__0__Enabled: ${App__DcOptions__0__Enabled}
|
||||
# App__DcOptions__0__Id: ${App__DcOptions__0__Id}
|
||||
App__DcOptions__0__IpAddress: ${App__DcOptions__0__IpAddress}
|
||||
# App__DcOptions__0__Port: ${App__DcOptions__0__Port}
|
||||
# App__DcOptions__0__TcpoOnly: ${App__DcOptions__0__TcpoOnly}
|
||||
# App__DcOptions__0__ThisPortOnly: ${App__DcOptions__0__ThisPortOnly}
|
||||
# App__DcOptions__0__Ipv6: ${App__DcOptions__0__Ipv6}
|
||||
# App__DcOptions__0__Cdn: ${App__DcOptions__0__Cdn}
|
||||
# App__DcOptions__0__MediaOnly: ${App__DcOptions__0__MediaOnly}
|
||||
# App__DcOptions__0__Static: ${App__DcOptions__0__Static}
|
||||
|
||||
App__DcOptions__1__Enabled: ${App__DcOptions__1__Enabled}
|
||||
# App__DcOptions__1__Id: ${App__DcOptions__1__Id}
|
||||
App__DcOptions__1__IpAddress: ${App__DcOptions__1__IpAddress}
|
||||
App__DcOptions__1__Port: ${App__DcOptions__1__Port}
|
||||
# App__DcOptions__1__TcpoOnly: ${App__DcOptions__1__TcpoOnly}
|
||||
# App__DcOptions__1__ThisPortOnly: ${App__DcOptions__1__ThisPortOnly}
|
||||
# App__DcOptions__1__Ipv6: ${App__DcOptions__1__Ipv6}
|
||||
# App__DcOptions__1__Cdn: ${App__DcOptions__1__Cdn}
|
||||
# App__DcOptions__1__MediaOnly: ${App__DcOptions__1__MediaOnly}
|
||||
# App__DcOptions__1__Static: ${App__DcOptions__1__Static}
|
||||
|
||||
App__DcOptions__2__Enabled: ${App__DcOptions__2__Enabled}
|
||||
# App__DcOptions__2__Id: ${App__DcOptions__2__Id}
|
||||
App__DcOptions__2__IpAddress: ${App__DcOptions__2__IpAddress}
|
||||
# App__DcOptions__2__Port: ${App__DcOptions__2__Port}
|
||||
# App__DcOptions__2__TcpoOnly: ${App__DcOptions__2__TcpoOnly}
|
||||
# App__DcOptions__2__ThisPortOnly: ${App__DcOptions__2__ThisPortOnly}
|
||||
# App__DcOptions__2__Ipv6: ${App__DcOptions__2__Ipv6}
|
||||
# App__DcOptions__2__Cdn: ${App__DcOptions__2__Cdn}
|
||||
# App__DcOptions__2__MediaOnly: ${App__DcOptions__2__MediaOnly}
|
||||
# App__DcOptions__2__Static: ${App__DcOptions__2__Static}
|
||||
|
||||
App__DcOptions__3__Enabled: ${App__DcOptions__3__Enabled}
|
||||
# App__DcOptions__3__Id: ${App__DcOptions__3__Id}
|
||||
App__DcOptions__3__IpAddress: ${App__DcOptions__3__IpAddress}
|
||||
# App__DcOptions__3__Port: ${App__DcOptions__3__Port}
|
||||
# App__DcOptions__3__TcpoOnly: ${App__DcOptions__3__TcpoOnly}
|
||||
# App__DcOptions__3__ThisPortOnly: ${App__DcOptions__3__ThisPortOnly}
|
||||
# App__DcOptions__3__Ipv6: ${App__DcOptions__3__Ipv6}
|
||||
# App__DcOptions__3__Cdn: ${App__DcOptions__3__Cdn}
|
||||
# App__DcOptions__3__MediaOnly: ${App__DcOptions__3__MediaOnly}
|
||||
# App__DcOptions__3__Static: ${App__DcOptions__3__Static}
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
# RabbitMQ__EventBus__ClientName: ${RabbitMQ__EventBus__ClientName}
|
||||
# RabbitMQ__EventBus__ExchangeName: ${RabbitMQ__EventBus__ExchangeName}
|
||||
Redis__Configuration: ${Redis__Configuration}
|
||||
volumes:
|
||||
- ./data/mytelegram/file/uploads:/app/uploads
|
||||
- ./data/mytelegram/command-server/logs:/app/Logs
|
||||
depends_on:
|
||||
- mongodb
|
||||
- rabbitmq
|
||||
- redis
|
||||
|
||||
### 6.Messenger query server
|
||||
messenger-query-server:
|
||||
# CHANGED: Build locally from source instead of using remote image
|
||||
build:
|
||||
context: ../../source
|
||||
dockerfile: src/MyTelegram.Messenger.QueryServer/Dockerfile
|
||||
image: mytelegram-messenger-query-server-local:latest
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
environment:
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
ConnectionStrings__Default: ${ConnectionStrings__Default}
|
||||
App__DatabaseName: tg
|
||||
App__ReadModelDatabaseName: tg
|
||||
App__AccessHashSecretKey: ${App__AccessHashSecretKey}
|
||||
App__FileServerGrpcServiceUrl: ${App__FileServerGrpcServiceUrl}
|
||||
App__FixedVerifyCode: ${App__FixedVerifyCode}
|
||||
App__VerificationCodeLength: ${App__VerificationCodeLength}
|
||||
App__VerificationCodeExpirationSeconds: ${App__VerificationCodeExpirationSeconds}
|
||||
App__EnableSearchNonContacts: ${App__EnableSearchNonContacts}
|
||||
# App__JoinChatDomain: ${App__JoinChatDomain}
|
||||
# App__ChannelGetDifferenceIntervalSeconds: ${App__ChannelGetDifferenceIntervalSeconds}
|
||||
# App__UseInMemoryFilters: ${App__UseInMemoryFilters}
|
||||
# App__IsMediaDc: ${App__IsMediaDc}
|
||||
# App__AutoCreateSuperGroup: ${App__AutoCreateSuperGroup}
|
||||
# App__EnableFutureAuthToken: ${App__EnableFutureAuthToken}
|
||||
# App__SetPremiumToTrueAfterUserCreated: ${App__SetPremiumToTrueAfterUserCreated}
|
||||
# App__SendWelcomeMessageAfterUserSignIn: ${App__SendWelcomeMessageAfterUserSignIn}
|
||||
App__WebRtcConnections__0__Ip: ${App__WebRtcConnections__0__Ip}
|
||||
App__WebRtcConnections__0__Ipv6: ${App__WebRtcConnections__0__Ipv6}
|
||||
App__WebRtcConnections__0__Port: ${App__WebRtcConnections__0__Port}
|
||||
App__WebRtcConnections__0__Turn: ${App__WebRtcConnections__0__Turn}
|
||||
App__WebRtcConnections__0__Stun: ${App__WebRtcConnections__0__Stun}
|
||||
App__WebRtcConnections__0__UserName: ${App__WebRtcConnections__0__UserName}
|
||||
App__WebRtcConnections__0__Password: ${App__WebRtcConnections__0__Password}
|
||||
# App__ThisDcId: ${App__ThisDcId}
|
||||
# App__DcOptions__0__Enabled: ${App__DcOptions__0__Enabled}
|
||||
# App__DcOptions__0__Id: ${App__DcOptions__0__Id}
|
||||
App__DcOptions__0__IpAddress: ${App__DcOptions__0__IpAddress}
|
||||
App__DcOptions__0__Port: ${App__DcOptions__0__Port}
|
||||
# App__DcOptions__0__TcpoOnly: ${App__DcOptions__0__TcpoOnly}
|
||||
# App__DcOptions__0__ThisPortOnly: ${App__DcOptions__0__ThisPortOnly}
|
||||
# App__DcOptions__0__Ipv6: ${App__DcOptions__0__Ipv6}
|
||||
# App__DcOptions__0__Cdn: ${App__DcOptions__0__Cdn}
|
||||
# App__DcOptions__0__MediaOnly: ${App__DcOptions__0__MediaOnly}
|
||||
# App__DcOptions__0__Static: ${App__DcOptions__0__Static}
|
||||
|
||||
App__DcOptions__1__Enabled: ${App__DcOptions__1__Enabled}
|
||||
# App__DcOptions__1__Id: ${App__DcOptions__1__Id}
|
||||
App__DcOptions__1__IpAddress: ${App__DcOptions__1__IpAddress}
|
||||
App__DcOptions__1__Port: ${App__DcOptions__1__Port}
|
||||
# App__DcOptions__1__TcpoOnly: ${App__DcOptions__1__TcpoOnly}
|
||||
# App__DcOptions__1__ThisPortOnly: ${App__DcOptions__1__ThisPortOnly}
|
||||
# App__DcOptions__1__Ipv6: ${App__DcOptions__1__Ipv6}
|
||||
# App__DcOptions__1__Cdn: ${App__DcOptions__1__Cdn}
|
||||
# App__DcOptions__1__MediaOnly: ${App__DcOptions__1__MediaOnly}
|
||||
# App__DcOptions__1__Static: ${App__DcOptions__1__Static}
|
||||
|
||||
App__DcOptions__2__Enabled: ${App__DcOptions__2__Enabled}
|
||||
# App__DcOptions__2__Id: ${App__DcOptions__2__Id}
|
||||
App__DcOptions__2__IpAddress: ${App__DcOptions__2__IpAddress}
|
||||
App__DcOptions__2__Port: ${App__DcOptions__2__Port}
|
||||
# App__DcOptions__2__TcpoOnly: ${App__DcOptions__2__TcpoOnly}
|
||||
# App__DcOptions__2__ThisPortOnly: ${App__DcOptions__2__ThisPortOnly}
|
||||
# App__DcOptions__2__Ipv6: ${App__DcOptions__2__Ipv6}
|
||||
# App__DcOptions__2__Cdn: ${App__DcOptions__2__Cdn}
|
||||
# App__DcOptions__2__MediaOnly: ${App__DcOptions__2__MediaOnly}
|
||||
# App__DcOptions__2__Static: ${App__DcOptions__2__Static}
|
||||
|
||||
App__DcOptions__3__Enabled: ${App__DcOptions__3__Enabled}
|
||||
# App__DcOptions__3__Id: ${App__DcOptions__3__Id}
|
||||
App__DcOptions__3__IpAddress: ${App__DcOptions__3__IpAddress}
|
||||
# App__DcOptions__3__Port: ${App__DcOptions__3__Port}
|
||||
# App__DcOptions__3__TcpoOnly: ${App__DcOptions__3__TcpoOnly}
|
||||
# App__DcOptions__3__ThisPortOnly: ${App__DcOptions__3__ThisPortOnly}
|
||||
# App__DcOptions__3__Ipv6: ${App__DcOptions__3__Ipv6}
|
||||
# App__DcOptions__3__Cdn: ${App__DcOptions__3__Cdn}
|
||||
# App__DcOptions__3__MediaOnly: ${App__DcOptions__3__MediaOnly}
|
||||
# App__DcOptions__3__Static: ${App__DcOptions__3__Static}
|
||||
Minio__Endpoint: ${Minio__Endpoint}
|
||||
Minio__AccessKey: ${Minio__AccessKey}
|
||||
Minio__SecretKey: ${Minio__SecretKey}
|
||||
Minio__BucketName: ${Minio__BucketName}
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
# RabbitMQ__EventBus__ClientName: ${RabbitMQ__EventBus__ClientName}
|
||||
# RabbitMQ__EventBus__ExchangeName: ${RabbitMQ__EventBus__ExchangeName}
|
||||
Redis__Configuration: ${Redis__Configuration}
|
||||
volumes:
|
||||
- ./data/mytelegram/query-server/logs:/app/Logs
|
||||
depends_on:
|
||||
- mongodb
|
||||
- rabbitmq
|
||||
- redis
|
||||
|
||||
### 7.Bot API Server
|
||||
bot-api-server:
|
||||
build:
|
||||
context: ../../source
|
||||
dockerfile: src/MyTelegram.BotApi/Dockerfile
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
ports:
|
||||
- "8081:8081"
|
||||
environment:
|
||||
ASPNETCORE_URLS: http://+:8081
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
ConnectionStrings__Default: ${ConnectionStrings__Default}
|
||||
App__DatabaseName: tg
|
||||
App__ReadModelDatabaseName: tg
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
RabbitMQ__EventBus__ClientProvidedName: MyTelegram.BotApi
|
||||
RabbitMQ__EventBus__ExchangeName: ${RabbitMQ__EventBus__ExchangeName}
|
||||
MongoDB__ConnectionString: ${ConnectionStrings__Default}
|
||||
MongoDB__DatabaseName: tg
|
||||
BotApi__Port: 8081
|
||||
BotApi__LocalMode: true
|
||||
BotApi__MaxFileSize: 2147483648
|
||||
volumes:
|
||||
- ./data/mytelegram/bot-api/logs:/app/Logs
|
||||
depends_on:
|
||||
- mongodb
|
||||
- rabbitmq
|
||||
- redis
|
||||
|
||||
### 8.TURN/STUN server for VoIP
|
||||
turn-server:
|
||||
image: coturn/coturn:latest
|
||||
restart: always
|
||||
network_mode: host
|
||||
# networks:
|
||||
# - tg-net
|
||||
# ports:
|
||||
# - "3478:3478/udp"
|
||||
# - "3478:3478/tcp"
|
||||
# - "5349:5349/tcp"
|
||||
# Note: network_mode: host exposes all ports directly, including relay ports 49152-65535
|
||||
volumes:
|
||||
- ./turnserver.conf:/etc/coturn/turnserver.conf:ro
|
||||
- ./data/coturn/logs:/var/log/coturn
|
||||
environment:
|
||||
TURN_EXTERNAL_IP: "${TURN_EXTERNAL_IP:-auto-detect}"
|
||||
command: ["-c", "/etc/coturn/turnserver.conf"]
|
||||
|
||||
### 9.Sms sender
|
||||
sms-sender:
|
||||
image: ${MyTelegramRegistry}/mytelegram-sms-sender:${MyTelegramVersion}
|
||||
restart: always
|
||||
networks:
|
||||
- tg-net
|
||||
environment:
|
||||
Serilog__MinimumLevel__Default: ${Serilog__MinimumLevel__Default}
|
||||
# TwilioSms__Enabled: ${TwilioSms__Enabled}
|
||||
# TwilioSms__AccountSId: ${TwilioSms__AccountSId}
|
||||
# TwilioSms__AuthToken: ${TwilioSms__AuthToken}
|
||||
# TwilioSms__FromNumber: ${TwilioSms__FromNumber}
|
||||
# TwilioSms__MessagingServiceSId: ${TwilioSms__MessagingServiceSId}
|
||||
# VonageSms__Enabled: ${VonageSms__Enabled}
|
||||
# VonageSms__BrandName: ${VonageSms__BrandName}
|
||||
# VonageSms__ApiKey: ${VonageSms__ApiKey}
|
||||
# VonageSms__ApiSecret: ${VonageSms__ApiSecret}
|
||||
RabbitMQ__Connections__Default__HostName: ${RabbitMQ__Connections__Default__HostName}
|
||||
RabbitMQ__Connections__Default__Port: ${RabbitMQ__Connections__Default__Port}
|
||||
RabbitMQ__Connections__Default__UserName: ${RabbitMQ__Connections__Default__UserName}
|
||||
RabbitMQ__Connections__Default__Password: ${RabbitMQ__Connections__Default__Password}
|
||||
# RabbitMQ__EventBus__ClientName: ${RabbitMQ__EventBus__ClientName}
|
||||
# RabbitMQ__EventBus__ExchangeName: ${RabbitMQ__EventBus__ExchangeName}
|
||||
volumes:
|
||||
- ./data/mytelegram/sms-sender/logs:/app/Logs
|
||||
depends_on:
|
||||
- rabbitmq
|
||||
|
||||
### 10.Fragment Backend API (Run locally with npm run dev)
|
||||
# fragment-backend:
|
||||
# build:
|
||||
# context: ../../fragment/fragment-backend
|
||||
# dockerfile: Dockerfile
|
||||
# restart: always
|
||||
# networks:
|
||||
# - tg-net
|
||||
# ports:
|
||||
# - "3001:3001"
|
||||
# environment:
|
||||
# PORT: 3001
|
||||
# MONGODB_URI: mongodb://mongodb:27017/tg
|
||||
# JWT_SECRET: fragment_secret_key_change_in_production
|
||||
# BOT_API_URL: http://bot-api-server:8081
|
||||
# FRAGMENT_BOT_TOKEN: ${FRAGMENT_BOT_TOKEN}
|
||||
# volumes:
|
||||
# - ./data/fragment/backend/logs:/app/logs
|
||||
# depends_on:
|
||||
# - mongodb
|
||||
# - bot-api-server
|
||||
@@ -0,0 +1,31 @@
|
||||
// Скрипт инициализации MongoDB
|
||||
// Запускается при старте MongoDB с включённой аутентификацией
|
||||
// Гарантирует, что пользователь admin существует с нужными правами
|
||||
|
||||
// Учтите: скрипт выполняется в контексте базы admin
|
||||
|
||||
// Создаём пользователя admin, если его ещё нет
|
||||
try {
|
||||
db.createUser({
|
||||
user: "admin",
|
||||
pwd: "CHANGE_ME",
|
||||
roles: [
|
||||
{ role: "root", db: "admin" },
|
||||
{ role: "dbOwner", db: "tg" },
|
||||
{ role: "readWrite", db: "tg" }
|
||||
]
|
||||
});
|
||||
print("Пользователь admin создан");
|
||||
} catch (e) {
|
||||
if (e.code === 48) {
|
||||
// Пользователь уже существует - это нормально
|
||||
print("Пользователь admin уже существует");
|
||||
} else {
|
||||
print("Ошибка при создании пользователя admin: " + e.message);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
// Создаём базу tg и обеспечиваем доступ к ней
|
||||
db.getSiblingDB("tg").createCollection("dummy", { capped: false });
|
||||
print("База 'tg' готова");
|
||||
@@ -0,0 +1,19 @@
|
||||
@echo off
|
||||
echo Stopping session-server container...
|
||||
docker-compose stop session-server
|
||||
|
||||
echo Removing session-server container...
|
||||
docker-compose rm -f session-server
|
||||
|
||||
echo Removing old session server image (0.33.211.906)...
|
||||
docker rmi mytelegram/mytelegram-session-server:0.33.211.906
|
||||
|
||||
echo Pulling session server image v0.32.206.802...
|
||||
docker pull mytelegram/mytelegram-session-server:0.32.206.802
|
||||
|
||||
echo Starting session-server with version 0.32.206.802...
|
||||
set MyTelegramVersion=0.32.206.802
|
||||
docker-compose up -d session-server
|
||||
|
||||
echo Done.
|
||||
pause
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
# Полный перезапуск MongoDB с включённой аутентификацией
|
||||
# Скрипт корректно сбрасывает состояние MongoDB и поднимает его заново
|
||||
|
||||
echo "======================================"
|
||||
echo "MongoDB Authentication Fix - Restart"
|
||||
echo "======================================"
|
||||
echo ""
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
echo "[1/5] Stopping all services..."
|
||||
docker-compose down
|
||||
|
||||
echo "[2/5] Removing MongoDB data volume to reinitialize..."
|
||||
if [ -d "./data/mongo" ]; then
|
||||
rm -rf "./data/mongo"
|
||||
echo " MongoDB data directory removed"
|
||||
else
|
||||
echo " MongoDB data directory not found (this is fine)"
|
||||
fi
|
||||
|
||||
echo "[3/5] Waiting a moment before starting services..."
|
||||
sleep 2
|
||||
|
||||
echo "[4/5] Building and starting services with MongoDB authentication..."
|
||||
docker-compose up --build -d
|
||||
|
||||
echo "[5/5] Waiting for MongoDB to initialize..."
|
||||
sleep 10
|
||||
|
||||
echo ""
|
||||
echo "======================================"
|
||||
echo "Restart Complete!"
|
||||
echo "======================================"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Check MongoDB initialization: docker-compose logs mongodb"
|
||||
echo "2. Check data-seeder: docker-compose logs data-seeder"
|
||||
echo "3. Check admin-api: docker-compose logs admin-api"
|
||||
echo "4. Monitor bot-api: docker-compose logs bot-api-server"
|
||||
echo ""
|
||||
echo "MongoDB Authentication Details:"
|
||||
echo " Username: admin"
|
||||
echo " Auth Database: admin"
|
||||
echo " Target Database: tg"
|
||||
echo ""
|
||||
@@ -0,0 +1,23 @@
|
||||
# RSA-ключи MTProto
|
||||
|
||||
Здесь должны лежать RSA-ключи сервера. Приватные ключи намеренно не хранятся в
|
||||
репозитории — сгенерируйте свою пару перед запуском.
|
||||
|
||||
```bash
|
||||
# Приватный ключ (PKCS#8)
|
||||
openssl genrsa -out rsa_private.pem 2048
|
||||
|
||||
# Приватный ключ в формате PKCS#1 (используется сервером)
|
||||
openssl rsa -in rsa_private.pem -traditional -out rsa_private_pkcs1.pem
|
||||
|
||||
# Публичный ключ
|
||||
openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem
|
||||
```
|
||||
|
||||
После генерации в этом каталоге должны появиться файлы:
|
||||
|
||||
- `rsa_private.pem`
|
||||
- `rsa_private_pkcs1.pem`
|
||||
- `rsa_public.pem`
|
||||
|
||||
Эти файлы не коммитьте.
|
||||
@@ -0,0 +1,31 @@
|
||||
// Скрипт MongoDB: добавляет упрощённые темы оформления чата (только эмодзи-маркер)
|
||||
// Сделано по образцу официального конструктора chatTheme из Telegram
|
||||
// Запуск: docker exec -i compose-mongodb-1 mongosh tg
|
||||
|
||||
db = db.getSiblingDB('tg');
|
||||
|
||||
// Проверяем, не созданы ли темы оформления ранее
|
||||
const existingCount = db.chat_themes.countDocuments();
|
||||
if (existingCount > 0) {
|
||||
print(`Темы оформления уже есть (${existingCount}), удаляем...`);
|
||||
db.chat_themes.deleteMany({});
|
||||
}
|
||||
|
||||
print('Добавляем упрощённые темы оформления чата (только эмодзи-маркер)...');
|
||||
|
||||
// Официальные темы оформления Telegram - только эмодзи-маркеры
|
||||
const themes = [
|
||||
{ _id: "1", Emoticon: "🏠" }, // Home
|
||||
{ _id: "2", Emoticon: "❤️" }, // Love
|
||||
{ _id: "3", Emoticon: "🎉" }, // Party
|
||||
{ _id: "4", Emoticon: "🌊" }, // Ocean
|
||||
{ _id: "5", Emoticon: "🌸" }, // Flower
|
||||
{ _id: "6", Emoticon: "🌙" }, // Night
|
||||
{ _id: "7", Emoticon: "🔥" }, // Fire
|
||||
{ _id: "8", Emoticon: "💚" } // Green
|
||||
];
|
||||
|
||||
db.chat_themes.insertMany(themes);
|
||||
|
||||
print(`Добавлено упрощённых тем оформления чата: ${themes.length}`);
|
||||
print(`Total chat themes in database: ${db.chat_themes.countDocuments()}`);
|
||||
@@ -0,0 +1,31 @@
|
||||
// Скрипт MongoDB: добавляет темы оформления чата, используя Unicode-escape-последовательности
|
||||
// Так удаётся избежать проблем с кодировкой при передаче через docker exec
|
||||
// Запуск: docker exec -i compose-mongodb-1 mongosh tg < seed-chat-themes-unicode.js
|
||||
|
||||
db = db.getSiblingDB('tg');
|
||||
|
||||
// Удаляем существующие темы
|
||||
print('Удаляем существующие темы оформления чата...');
|
||||
db.chat_themes.deleteMany({});
|
||||
|
||||
print('Добавляем темы оформления через Unicode-escape...');
|
||||
|
||||
// Используем Unicode-escape-последовательности, чтобы избежать проблем с кодировкой
|
||||
const themes = [
|
||||
{ _id: "1", Emoticon: "\uD83C\uDFE0" }, // Home
|
||||
{ _id: "2", Emoticon: "\u2764\uFE0F" }, // Love
|
||||
{ _id: "3", Emoticon: "\uD83C\uDF89" }, // Party
|
||||
{ _id: "4", Emoticon: "\uD83C\uDF0A" }, // Ocean
|
||||
{ _id: "5", Emoticon: "\uD83C\uDF38" }, // Flower
|
||||
{ _id: "6", Emoticon: "\uD83C\uDF19" }, // Night
|
||||
{ _id: "7", Emoticon: "\uD83D\uDD25" }, // Fire
|
||||
{ _id: "8", Emoticon: "\uD83D\uDC9A" } // Green
|
||||
];
|
||||
|
||||
db.chat_themes.insertMany(themes);
|
||||
|
||||
print(`Добавлено тем оформления чата: ${themes.length}`);
|
||||
print('Проверяем темы:');
|
||||
db.chat_themes.find().forEach(function(theme) {
|
||||
print(` ID: ${theme._id}, Emoticon: ${theme.Emoticon}`);
|
||||
});
|
||||
@@ -0,0 +1,302 @@
|
||||
// Скрипт MongoDB: добавляет стандартные темы оформления чата вместе с обоями
|
||||
// Запуск: docker exec -i compose-mongodb-1 mongosh tg
|
||||
|
||||
db = db.getSiblingDB('tg');
|
||||
|
||||
// Проверяем, не созданы ли темы оформления ранее
|
||||
const existingCount = db.chat_themes.countDocuments();
|
||||
if (existingCount > 0) {
|
||||
print(`Chat themes already exist (${existingCount}), skipping...`);
|
||||
} else {
|
||||
print('Добавляем стандартные темы оформления чата...');
|
||||
|
||||
const themes = [
|
||||
{
|
||||
_id: "1",
|
||||
Id: NumberLong("1"),
|
||||
AccessHash: NumberLong("1234567890123456"),
|
||||
Slug: "blue",
|
||||
Title: "Blue",
|
||||
Default: true,
|
||||
ForChat: true,
|
||||
Emoticon: "💙",
|
||||
DocumentId: null,
|
||||
Settings: [
|
||||
{
|
||||
MessageColorsAnimated: false,
|
||||
BaseTheme: NumberLong("2"), // Дневная
|
||||
AccentColor: 0x0f4c81,
|
||||
OutboxAccentColor: null,
|
||||
MessageColors: [0x0f4c81, 0x1a7fc1],
|
||||
WallPaper: {
|
||||
Id: NumberLong("1001"),
|
||||
AccessHash: NumberLong("1001"),
|
||||
Default: true,
|
||||
Pattern: false,
|
||||
Dark: false,
|
||||
Slug: "blue-gradient",
|
||||
DocumentId: null,
|
||||
Settings: {
|
||||
Blur: false,
|
||||
Motion: true,
|
||||
BackgroundColor: 0x0f4c81,
|
||||
SecondBackgroundColor: 0x1a7fc1,
|
||||
ThirdBackgroundColor: null,
|
||||
FourthBackgroundColor: null,
|
||||
Intensity: 50,
|
||||
Rotation: 45,
|
||||
Emoticon: "💙"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
_id: "2",
|
||||
Id: NumberLong("2"),
|
||||
AccessHash: NumberLong("1234567890123457"),
|
||||
Slug: "pink",
|
||||
Title: "Pink",
|
||||
Default: true,
|
||||
ForChat: true,
|
||||
Emoticon: "💗",
|
||||
DocumentId: null,
|
||||
Settings: [
|
||||
{
|
||||
MessageColorsAnimated: false,
|
||||
BaseTheme: NumberLong("2"),
|
||||
AccentColor: 0xff6b9d,
|
||||
OutboxAccentColor: null,
|
||||
MessageColors: [0xff6b9d, 0xffa8c5],
|
||||
WallPaper: {
|
||||
Id: NumberLong("1002"),
|
||||
AccessHash: NumberLong("1002"),
|
||||
Default: true,
|
||||
Pattern: false,
|
||||
Dark: false,
|
||||
Slug: "pink-gradient",
|
||||
DocumentId: null,
|
||||
Settings: {
|
||||
Blur: false,
|
||||
Motion: true,
|
||||
BackgroundColor: 0xff6b9d,
|
||||
SecondBackgroundColor: 0xffa8c5,
|
||||
ThirdBackgroundColor: null,
|
||||
FourthBackgroundColor: null,
|
||||
Intensity: 50,
|
||||
Rotation: 135,
|
||||
Emoticon: "💗"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
_id: "3",
|
||||
Id: NumberLong("3"),
|
||||
AccessHash: NumberLong("1234567890123458"),
|
||||
Slug: "green",
|
||||
Title: "Green",
|
||||
Default: true,
|
||||
ForChat: true,
|
||||
Emoticon: "💚",
|
||||
DocumentId: null,
|
||||
Settings: [
|
||||
{
|
||||
MessageColorsAnimated: false,
|
||||
BaseTheme: NumberLong("2"),
|
||||
AccentColor: 0x0a8754,
|
||||
OutboxAccentColor: null,
|
||||
MessageColors: [0x0a8754, 0x2ecc71],
|
||||
WallPaper: {
|
||||
Id: NumberLong("1003"),
|
||||
AccessHash: NumberLong("1003"),
|
||||
Default: true,
|
||||
Pattern: false,
|
||||
Dark: false,
|
||||
Slug: "green-gradient",
|
||||
DocumentId: null,
|
||||
Settings: {
|
||||
Blur: false,
|
||||
Motion: true,
|
||||
BackgroundColor: 0x0a8754,
|
||||
SecondBackgroundColor: 0x2ecc71,
|
||||
ThirdBackgroundColor: null,
|
||||
FourthBackgroundColor: null,
|
||||
Intensity: 50,
|
||||
Rotation: 90,
|
||||
Emoticon: "💚"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
_id: "4",
|
||||
Id: NumberLong("4"),
|
||||
AccessHash: NumberLong("1234567890123459"),
|
||||
Slug: "orange",
|
||||
Title: "Orange",
|
||||
Default: true,
|
||||
ForChat: true,
|
||||
Emoticon: "🧡",
|
||||
DocumentId: null,
|
||||
Settings: [
|
||||
{
|
||||
MessageColorsAnimated: false,
|
||||
BaseTheme: NumberLong("2"),
|
||||
AccentColor: 0xff6b35,
|
||||
OutboxAccentColor: null,
|
||||
MessageColors: [0xff6b35, 0xffa500],
|
||||
WallPaper: {
|
||||
Id: NumberLong("1004"),
|
||||
AccessHash: NumberLong("1004"),
|
||||
Default: true,
|
||||
Pattern: false,
|
||||
Dark: false,
|
||||
Slug: "orange-gradient",
|
||||
DocumentId: null,
|
||||
Settings: {
|
||||
Blur: false,
|
||||
Motion: true,
|
||||
BackgroundColor: 0xff6b35,
|
||||
SecondBackgroundColor: 0xffa500,
|
||||
ThirdBackgroundColor: null,
|
||||
FourthBackgroundColor: null,
|
||||
Intensity: 50,
|
||||
Rotation: 180,
|
||||
Emoticon: "🧡"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
_id: "5",
|
||||
Id: NumberLong("5"),
|
||||
AccessHash: NumberLong("1234567890123460"),
|
||||
Slug: "purple",
|
||||
Title: "Purple",
|
||||
Default: true,
|
||||
ForChat: true,
|
||||
Emoticon: "💜",
|
||||
DocumentId: null,
|
||||
Settings: [
|
||||
{
|
||||
MessageColorsAnimated: false,
|
||||
BaseTheme: NumberLong("2"),
|
||||
AccentColor: 0x8e44ad,
|
||||
OutboxAccentColor: null,
|
||||
MessageColors: [0x8e44ad, 0xc39bd3],
|
||||
WallPaper: {
|
||||
Id: NumberLong("1005"),
|
||||
AccessHash: NumberLong("1005"),
|
||||
Default: true,
|
||||
Pattern: false,
|
||||
Dark: false,
|
||||
Slug: "purple-gradient",
|
||||
DocumentId: null,
|
||||
Settings: {
|
||||
Blur: false,
|
||||
Motion: true,
|
||||
BackgroundColor: 0x8e44ad,
|
||||
SecondBackgroundColor: 0xc39bd3,
|
||||
ThirdBackgroundColor: null,
|
||||
FourthBackgroundColor: null,
|
||||
Intensity: 50,
|
||||
Rotation: 225,
|
||||
Emoticon: "💜"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
_id: "6",
|
||||
Id: NumberLong("6"),
|
||||
AccessHash: NumberLong("1234567890123461"),
|
||||
Slug: "sunset",
|
||||
Title: "Sunset",
|
||||
Default: true,
|
||||
ForChat: true,
|
||||
Emoticon: "🌅",
|
||||
DocumentId: null,
|
||||
Settings: [
|
||||
{
|
||||
MessageColorsAnimated: true,
|
||||
BaseTheme: NumberLong("2"),
|
||||
AccentColor: 0xff6b35,
|
||||
OutboxAccentColor: null,
|
||||
MessageColors: [0xff6b35, 0xff8c42, 0xffa94d, 0xffc65c],
|
||||
WallPaper: {
|
||||
Id: NumberLong("1006"),
|
||||
AccessHash: NumberLong("1006"),
|
||||
Default: true,
|
||||
Pattern: false,
|
||||
Dark: false,
|
||||
Slug: "sunset-gradient",
|
||||
DocumentId: null,
|
||||
Settings: {
|
||||
Blur: false,
|
||||
Motion: true,
|
||||
BackgroundColor: 0xff6b35,
|
||||
SecondBackgroundColor: 0xff8c42,
|
||||
ThirdBackgroundColor: 0xffa94d,
|
||||
FourthBackgroundColor: 0xffc65c,
|
||||
Intensity: 60,
|
||||
Rotation: 315,
|
||||
Emoticon: "🌅"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
_id: "7",
|
||||
Id: NumberLong("7"),
|
||||
AccessHash: NumberLong("1234567890123462"),
|
||||
Slug: "ocean",
|
||||
Title: "Ocean",
|
||||
Default: true,
|
||||
ForChat: true,
|
||||
Emoticon: "🌊",
|
||||
DocumentId: null,
|
||||
Settings: [
|
||||
{
|
||||
MessageColorsAnimated: true,
|
||||
BaseTheme: NumberLong("2"),
|
||||
AccentColor: 0x006994,
|
||||
OutboxAccentColor: null,
|
||||
MessageColors: [0x006994, 0x0099cc, 0x33b5e5, 0x66ccff],
|
||||
WallPaper: {
|
||||
Id: NumberLong("1007"),
|
||||
AccessHash: NumberLong("1007"),
|
||||
Default: true,
|
||||
Pattern: false,
|
||||
Dark: false,
|
||||
Slug: "ocean-gradient",
|
||||
DocumentId: null,
|
||||
Settings: {
|
||||
Blur: false,
|
||||
Motion: true,
|
||||
BackgroundColor: 0x006994,
|
||||
SecondBackgroundColor: 0x0099cc,
|
||||
ThirdBackgroundColor: 0x33b5e5,
|
||||
FourthBackgroundColor: 0x66ccff,
|
||||
Intensity: 60,
|
||||
Rotation: 0,
|
||||
Emoticon: "🌊"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
db.chat_themes.insertMany(themes);
|
||||
|
||||
print(`Добавлено тем оформления чата: ${themes.length}`);
|
||||
}
|
||||
|
||||
// Выводим итоговое количество
|
||||
print(`Total chat themes in database: ${db.chat_themes.countDocuments()}`);
|
||||
@@ -0,0 +1,81 @@
|
||||
# Coturn TURN/STUN Server Configuration for MyTelegram VoIP
|
||||
# Based on RFC 5766 (TURN) and RFC 5389 (STUN)
|
||||
|
||||
# Listen on all interfaces (Docker compatibility)
|
||||
listening-ip=0.0.0.0
|
||||
|
||||
# Listening port for TURN/STUN
|
||||
listening-port=3478
|
||||
|
||||
# TLS listening port (disabled for local testing)
|
||||
# tls-listening-port=5349
|
||||
|
||||
# Relay ports range for media
|
||||
min-port=49152
|
||||
max-port=65535
|
||||
|
||||
# Server realm (domain)
|
||||
realm=mytelegram.local
|
||||
|
||||
# Authentication
|
||||
# Use long-term credentials
|
||||
lt-cred-mech
|
||||
|
||||
# User credentials (username:password)
|
||||
# Format: user=username:password
|
||||
# In production, use strong passwords and rotate regularly
|
||||
user=user:CHANGE_ME
|
||||
|
||||
# Logging
|
||||
verbose
|
||||
log-file=/var/log/coturn/turnserver.log
|
||||
|
||||
# Performance tuning
|
||||
# Total quota (bytes per allocation)
|
||||
total-quota=100
|
||||
# Bandwidth per session (bytes/sec)
|
||||
bps-capacity=0
|
||||
|
||||
# No multicast
|
||||
no-multicast-peers
|
||||
|
||||
# Disable software attributes
|
||||
no-software-attribute
|
||||
|
||||
# Mobility
|
||||
mobility
|
||||
|
||||
# WebRTC compatibility
|
||||
fingerprint
|
||||
|
||||
# Secure communication (TLS disabled for local testing)
|
||||
# no-tls
|
||||
# no-dtls
|
||||
|
||||
# TLS/DTLS certificate paths (optional, for TLS)
|
||||
# cert=/etc/coturn/cert.pem
|
||||
# pkey=/etc/coturn/key.pem
|
||||
|
||||
# CLI
|
||||
cli-password=CHANGE_CLI_PASSWORD
|
||||
|
||||
# Allow TURN for specific IP ranges (optional)
|
||||
# allowed-peer-ip=10.0.0.0-10.255.255.255
|
||||
# denied-peer-ip=192.168.0.0-192.168.255.255
|
||||
|
||||
# Database for persistent storage (optional)
|
||||
# psql-userdb="host=postgresql dbname=coturn user=coturn password=password"
|
||||
|
||||
# Redis for session management (optional)
|
||||
# redis-userdb="ip=redis dbname=0 password=turn connect_timeout=30"
|
||||
|
||||
# Prometheus metrics (optional)
|
||||
# prometheus
|
||||
|
||||
# Disable UDP relay endpoints
|
||||
# no-udp-relay
|
||||
|
||||
# Use external IP (important for NAT)
|
||||
# Must match App__WebRtcConnections__0__Ip in .env
|
||||
# For local testing use 127.0.0.1, for production use your public IP
|
||||
external-ip=127.0.0.1
|
||||
@@ -0,0 +1,29 @@
|
||||
// Update custom emoji documents to add MinIO file path
|
||||
const db = db.getSiblingDB('tg');
|
||||
const collection = db.getCollection('ReadModel-DocumentReadModel');
|
||||
|
||||
// Find all custom emoji documents
|
||||
const customEmojiDocs = collection.find({
|
||||
'Attributes2._t': 'TDocumentAttributeCustomEmoji'
|
||||
});
|
||||
|
||||
let updated = 0;
|
||||
customEmojiDocs.forEach(doc => {
|
||||
const documentId = doc.DocumentId;
|
||||
const subDir = (documentId % 1000).toString().padStart(3, '0');
|
||||
const filePath = `custom_emoji/${subDir}/${documentId}.tgs`;
|
||||
|
||||
// Update document with file path
|
||||
collection.updateOne(
|
||||
{ _id: doc._id },
|
||||
{
|
||||
$set: {
|
||||
MinIOPath: filePath,
|
||||
MinIOBucket: 'tg-files'
|
||||
}
|
||||
}
|
||||
);
|
||||
updated++;
|
||||
});
|
||||
|
||||
print(`Updated ${updated} custom emoji documents with MinIO paths`);
|
||||
@@ -0,0 +1,19 @@
|
||||
@echo off
|
||||
echo Stopping session-server container...
|
||||
docker-compose stop session-server
|
||||
|
||||
echo Removing session-server container...
|
||||
docker-compose rm -f session-server
|
||||
|
||||
echo Removing old session server image (0.36.220.1231)...
|
||||
docker rmi mytelegram/mytelegram-session-server:0.36.220.1231
|
||||
|
||||
echo Pulling session server image v0.32.206.802...
|
||||
docker pull mytelegram/mytelegram-session-server:0.32.206.802
|
||||
|
||||
echo Starting session-server with version 0.32.206.802...
|
||||
set MyTelegramVersion=0.32.206.802
|
||||
docker-compose up -d session-server
|
||||
|
||||
echo Done.
|
||||
pause
|
||||
Reference in New Issue
Block a user