3d1816a640
- при установке без TLS (--skip-tls, стенд без домена) клиент получает http:// и ws:// вместо неработающих https:// и wss:// - установщик пишет TLS_ENABLED в .env; тесты фиксируют обе схемы
52 lines
1.5 KiB
Go
52 lines
1.5 KiB
Go
package meta
|
|
|
|
import "glchat/internal/config"
|
|
|
|
const APIVersion = "v1"
|
|
|
|
type Features struct {
|
|
RegistrationEnabled bool `json:"registration_enabled"`
|
|
AntiBotEnabled bool `json:"anti_bot_enabled"`
|
|
VoiceEnabled bool `json:"voice_enabled"`
|
|
WebPushEnabled bool `json:"web_push_enabled"`
|
|
OAuthEnabled bool `json:"oauth_enabled"`
|
|
PasskeysEnabled bool `json:"passkeys_enabled"`
|
|
}
|
|
|
|
type Response struct {
|
|
Name string `json:"name"`
|
|
Version string `json:"version"`
|
|
Commit string `json:"commit"`
|
|
BuildDate string `json:"build_date"`
|
|
APIVersion string `json:"api_version"`
|
|
BaseURL string `json:"base_url"`
|
|
FilesURL string `json:"files_url"`
|
|
GatewayURL string `json:"gateway_url"`
|
|
RTCPath string `json:"rtc_path"`
|
|
MaxUploadSize int64 `json:"max_upload_size"`
|
|
Features Features `json:"features"`
|
|
}
|
|
|
|
func New(cfg config.Config) Response {
|
|
return Response{
|
|
Name: cfg.InstanceName,
|
|
Version: cfg.Version,
|
|
Commit: cfg.Commit,
|
|
BuildDate: cfg.BuildDate,
|
|
APIVersion: APIVersion,
|
|
BaseURL: cfg.BaseURL(),
|
|
FilesURL: cfg.FilesURL(),
|
|
GatewayURL: cfg.GatewayURL(),
|
|
RTCPath: "/rtc",
|
|
MaxUploadSize: cfg.MaxUploadSize,
|
|
Features: Features{
|
|
RegistrationEnabled: true,
|
|
AntiBotEnabled: false,
|
|
VoiceEnabled: false,
|
|
WebPushEnabled: false,
|
|
OAuthEnabled: false,
|
|
PasskeysEnabled: false,
|
|
},
|
|
}
|
|
}
|