config

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package config gère le chargement et la validation de la configuration de JellyGate à partir des variables d'environnement.

Seules les variables essentielles au démarrage sont gérées ici :

  • JELLYGATE_* : Application (port, URL, data, secret)
  • JELLYFIN_* : Connexion à Jellyfin

Les paramètres LDAP, SMTP et Webhooks sont stockés en base SQL (table `settings`) et gérés via l'interface d'administration.

Index

Constants

View Source
const AppVersion = "1.5.0"

AppVersion is the current JellyGate release version.

Variables

View Source
var SupportedLanguageOrder = []string{
	"fr",
	"en",
	"de",
	"es",
	"it",
	"nl",
	"pl",
	"pt-br",
	"ru",
	"zh",
}

SupportedLanguageOrder conserve un ordre stable pour l'UI et les defaults.

View Source
var SupportedLanguages = map[string]bool{
	"fr":    true,
	"en":    true,
	"de":    true,
	"es":    true,
	"it":    true,
	"nl":    true,
	"pl":    true,
	"pt-br": true,
	"ru":    true,
	"zh":    true,
}

SupportedLanguages contient les langues officiellement supportees par l'UI. Les cles sont stockees en lowercase pour faciliter la comparaison.

Functions

func DefaultEmailAutomaticFooterForLanguage

func DefaultEmailAutomaticFooterForLanguage(lang string) string

func DefaultEmailBaseFooter

func DefaultEmailBaseFooter() string

func DefaultEmailBaseHeader

func DefaultEmailBaseHeader() string

func DefaultEmailPreviewDurationForLanguage

func DefaultEmailPreviewDurationForLanguage(lang string) string

func DefaultEmailPreviewMessageForLanguage

func DefaultEmailPreviewMessageForLanguage(lang string) string

func DefaultEmailTemplateMetaJSONForLanguage

func DefaultEmailTemplateMetaJSONForLanguage(lang string) ([]byte, error)

func DefaultEmailTemplateSubjectForLanguage

func DefaultEmailTemplateSubjectForLanguage(lang, key string) string

func DefaultNoCodeEmailTemplateBodyForLanguage

func DefaultNoCodeEmailTemplateBodyForLanguage(lang, key string) string

func EditableEmailTemplateBody

func EditableEmailTemplateBody(content string) string

EditableEmailTemplateBody retire l'habillage HTML standard pour presenter uniquement le contenu utile dans l'interface d'administration.

func EditableEmailTemplateBodyWithBase

func EditableEmailTemplateBodyWithBase(content, baseHeader, baseFooter string) string

func EditableNoCodeEmailTemplateBody

func EditableNoCodeEmailTemplateBody(templateKey, content, baseHeader, baseFooter string) string

func EditableNoCodeEmailTemplateBodyForLanguage

func EditableNoCodeEmailTemplateBodyForLanguage(lang, templateKey, content, baseHeader, baseFooter string) string

func EmailTemplateBodyByKey

func EmailTemplateBodyByKey(cfg EmailTemplatesConfig, key string) (string, bool)

func EmailTemplateDefaultsDir

func EmailTemplateDefaultsDir() string

EmailTemplateDefaultsDir retourne le dossier lisible contenant les defaults.

func EmailTemplateDefaultsPath

func EmailTemplateDefaultsPath() string

EmailTemplateDefaultsPath resout le dossier des templates en fichiers.

func EmailTemplateKeyFromDir

func EmailTemplateKeyFromDir(dir string) (string, bool)

EmailTemplateKeyFromDir resout un nom de dossier import/export vers une cle.

func EmailTemplateSubjectByKey

func EmailTemplateSubjectByKey(cfg EmailTemplatesConfig, key string) (string, bool)

func IsSupportedLanguage

func IsSupportedLanguage(lang string) bool

IsSupportedLanguage indique si la langue est supportee apres normalisation.

func NormalizeLanguageTag

func NormalizeLanguageTag(lang string) string

NormalizeLanguageTag normalise un tag de langue vers un code interne stable. Exemples: EN-us -> en, pt_BR -> pt-br, zh-CN -> zh.

func PrepareEmailTemplateBody

func PrepareEmailTemplateBody(content string) string

PrepareEmailTemplateBody accepte soit un contenu simple, soit un HTML deja complet. Le contenu simple est injecte dans la carte email standard.

func PrepareEmailTemplateBodyFor

func PrepareEmailTemplateBodyFor(templateKey, content, baseHeader, baseFooter string) string

func PrepareEmailTemplateBodyForLanguage

func PrepareEmailTemplateBodyForLanguage(lang, templateKey, content, baseHeader, baseFooter string) string

func SetEmailTemplateBodyByKey

func SetEmailTemplateBodyByKey(cfg *EmailTemplatesConfig, key, value string) bool

func SetEmailTemplateSubjectByKey

func SetEmailTemplateSubjectByKey(cfg *EmailTemplatesConfig, key, value string) bool

func SupportedLanguageTags

func SupportedLanguageTags() []string

func UpgradeLegacyEmailTemplates

func UpgradeLegacyEmailTemplates(cfg *EmailTemplatesConfig)

UpgradeLegacyEmailTemplates remplace uniquement les anciens textes par defaut enregistres en base afin d'aligner le wording avec un compte/acces Jellyfin.

Types

type AdminTimelineConfig

type AdminTimelineConfig struct {
	Enabled bool `json:"enabled"`
	Limit   int  `json:"limit"`
}

type AntiAbuseConfig

type AntiAbuseConfig struct {
	Enabled       bool `json:"enabled"`
	Captcha       bool `json:"captcha"`
	MaxFailures   int  `json:"max_failures"`
	WindowMinutes int  `json:"window_minutes"`
	BlockMinutes  int  `json:"block_minutes"`
}

type AuditConfig

type AuditConfig struct {
	Enabled       bool `json:"enabled"`
	BeforeAfter   bool `json:"before_after"`
	RetentionDays int  `json:"retention_days"`
}

type BackupConfig

type BackupConfig struct {
	Enabled        bool `json:"enabled"`
	Hour           int  `json:"hour"`            // 0-23
	Minute         int  `json:"minute"`          // 0-59
	RetentionCount int  `json:"retention_count"` // Nombre de sauvegardes à conserver
}

BackupConfig contient la configuration des sauvegardes automatiques.

func DefaultBackupConfig

func DefaultBackupConfig() BackupConfig

DefaultBackupConfig retourne une configuration backup par défaut.

type Config

type Config struct {
	// Application
	Port              int    // Port d'écoute HTTP (défaut: 8097)
	BaseURL           string // URL de base publique
	DataDir           string // Répertoire des données (SQLite, etc.)
	SecretKey         string // Clé secrète pour sessions/tokens (min 32 chars)
	TLSCert           string // Chemin vers le certificat TLS
	TLSKey            string // Chemin vers la clé privée TLS
	DefaultLang       string // Langue par défaut de l'interface (défaut: fr)
	EnableDebugRoutes bool   // Active les routes /admin/debug (dev uniquement)
	TrustProxyHeaders bool   // Autorise X-Forwarded-For/X-Real-IP via reverse proxy de confiance

	// Base de donnees (sqlite ou postgres)
	Database DatabaseConfig

	// Jellyfin (seul service externe requis au démarrage)
	Jellyfin JellyfinConfig

	// Intégrations tierces optionnelles (provisionnement compte)
	ThirdParty ThirdPartyConfig
}

Config contient la configuration chargée depuis les variables d'environnement. Ne contient que les paramètres essentiels au démarrage de l'application.

func Load

func Load() (*Config, error)

Load charge la configuration depuis les variables d'environnement, applique les valeurs par défaut, et valide les champs requis.

Seuls les paramètres App + Jellyfin sont chargés ici. LDAP, SMTP et Webhooks sont chargés depuis la base de données.

type ContactLinkingConfig

type ContactLinkingConfig struct {
	Enabled       bool `json:"enabled"`
	AllowDiscord  bool `json:"allow_discord"`
	AllowTelegram bool `json:"allow_telegram"`
	AllowMatrix   bool `json:"allow_matrix"`
	RequireProof  bool `json:"require_proof"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Type     string
	Host     string
	Port     int
	User     string
	Password string
	Name     string
	SSLMode  string
}

DatabaseConfig contient la configuration de la base SQL principale.

type DiscordWebhook

type DiscordWebhook struct {
	URL string `json:"url"`
}

DiscordWebhook contient la configuration du webhook Discord.

type EmailTemplateFileKey

type EmailTemplateFileKey struct {
	Key string
	Dir string
}

EmailTemplateFileKey decrit un modele e-mail stocke sous forme de fichiers.

func EmailTemplateFileKeys

func EmailTemplateFileKeys() []EmailTemplateFileKey

EmailTemplateFileKeys retourne l'ordre canonique des fichiers de modeles.

type EmailTemplatesConfig

type EmailTemplatesConfig struct {
	BaseTemplateHeader          string `json:"base_template_header"`
	BaseTemplateFooter          string `json:"base_template_footer"`
	EmailLogoURL                string `json:"email_logo_url"`
	Confirmation                string `json:"confirmation"`
	ConfirmationSubject         string `json:"confirmation_subject"`
	DisableConfirmationEmail    bool   `json:"disable_confirmation_email"`
	EmailVerificationSubject    string `json:"email_verification_subject"`
	EmailVerification           string `json:"email_verification"`
	ExpiryReminder              string `json:"expiry_reminder"`
	ExpiryReminderSubject       string `json:"expiry_reminder_subject"`
	DisableExpiryReminderEmails bool   `json:"disable_expiry_reminder_emails"`
	ExpiryReminderDays          int    `json:"expiry_reminder_days"`
	ExpiryReminder14            string `json:"expiry_reminder_14"`
	ExpiryReminder7             string `json:"expiry_reminder_7"`
	ExpiryReminder1             string `json:"expiry_reminder_1"`
	Invitation                  string `json:"invitation"`
	InvitationSubject           string `json:"invitation_subject"`
	InviteExpiry                string `json:"invite_expiry"`
	InviteExpirySubject         string `json:"invite_expiry_subject"`
	DisableInviteExpiryEmail    bool   `json:"disable_invite_expiry_email"`
	PasswordReset               string `json:"password_reset"`
	PasswordResetSubject        string `json:"password_reset_subject"`
	PreSignupHelp               string `json:"pre_signup_help"`
	DisablePreSignupHelpEmail   bool   `json:"disable_pre_signup_help_email"`
	PostSignupHelp              string `json:"post_signup_help"`
	DisablePostSignupHelpEmail  bool   `json:"disable_post_signup_help_email"`
	UserCreation                string `json:"user_creation"`
	UserCreationSubject         string `json:"user_creation_subject"`
	DisableUserCreationEmail    bool   `json:"disable_user_creation_email"`
	UserDeletion                string `json:"user_deletion"`
	UserDeletionSubject         string `json:"user_deletion_subject"`
	DisableUserDeletionEmail    bool   `json:"disable_user_deletion_email"`
	UserDisabled                string `json:"user_disabled"`
	UserDisabledSubject         string `json:"user_disabled_subject"`
	DisableUserDisabledEmail    bool   `json:"disable_user_disabled_email"`
	UserEnabled                 string `json:"user_enabled"`
	UserEnabledSubject          string `json:"user_enabled_subject"`
	DisableUserEnabledEmail     bool   `json:"disable_user_enabled_email"`
	UserExpired                 string `json:"user_expired"`
	UserExpiredSubject          string `json:"user_expired_subject"`
	DisableUserExpiredEmail     bool   `json:"disable_user_expired_email"`
	ExpiryAdjusted              string `json:"expiry_adjusted"`
	ExpiryAdjustedSubject       string `json:"expiry_adjusted_subject"`
	DisableExpiryAdjustedEmail  bool   `json:"disable_expiry_adjusted_email"`
	Welcome                     string `json:"welcome"`
	WelcomeSubject              string `json:"welcome_subject"`
	DisableWelcomeEmail         bool   `json:"disable_welcome_email"`
}

EmailTemplatesConfig contient les modèles de courriels personnalisés configurables (JFA-Go).

func DefaultEmailTemplates

func DefaultEmailTemplates() EmailTemplatesConfig

DefaultEmailTemplates returns the basic base translations of email models

func DefaultEmailTemplatesForLanguage

func DefaultEmailTemplatesForLanguage(lang string) EmailTemplatesConfig

type GroupPolicyMapping

type GroupPolicyMapping struct {
	GroupName      string `json:"group_name"`
	Source         string `json:"source"` // internal|ldap
	LDAPGroupDN    string `json:"ldap_group_dn"`
	PolicyPresetID string `json:"policy_preset_id"`
	Priority       int    `json:"priority"`
}

GroupPolicyMapping lie un groupe (interne ou LDAP) à un preset Jellyfin.

type InvitationProfileConfig

type InvitationProfileConfig struct {
	PolicyPresetID           string `json:"policy_preset_id"`
	TemplateUserID           string `json:"template_user_id"`
	EnableDownloads          bool   `json:"enable_downloads"`
	RequireEmail             bool   `json:"require_email"`
	RequireEmailVerification bool   `json:"require_email_verification"`
	EmailVerificationPolicy  string `json:"email_verification_policy"`
	AutoDeleteClosedLinks    bool   `json:"auto_delete_closed_links"`
	DisableAfterDays         int    `json:"disable_after_days"`
	DeleteAfterDays          int    `json:"delete_after_days"`
	ExpiryAction             string `json:"expiry_action"`
	AllowInviterGrant        bool   `json:"allow_inviter_grant_invite"`
	AllowInviterUserExpiry   bool   `json:"allow_inviter_user_expiry"`
	InviterMaxUses           int    `json:"inviter_max_uses"`
	InviterMaxLinkHours      int    `json:"inviter_max_link_hours"`
	InviterQuotaDay          int    `json:"inviter_quota_day"`
	InviterQuotaWeek         int    `json:"inviter_quota_week"`
	InviterQuotaMonth        int    `json:"inviter_quota_month"`
	UsernameMinLength        int    `json:"username_min_length"`
	UsernameMaxLength        int    `json:"username_max_length"`
	PasswordMinLength        int    `json:"password_min_length"`
	PasswordMaxLength        int    `json:"password_max_length"`
	PasswordRequireUpper     bool   `json:"password_require_upper"`
	PasswordRequireLower     bool   `json:"password_require_lower"`
	PasswordRequireDigit     bool   `json:"password_require_digit"`
	PasswordRequireSpecial   bool   `json:"password_require_special"`
}

InvitationProfileConfig contient la politique appliquee a chaque nouvelle invitation. Les champs correspondent aux options de "Profil utilisateur" cote interface admin.

func DefaultInvitationProfileConfig

func DefaultInvitationProfileConfig() InvitationProfileConfig

DefaultInvitationProfileConfig retourne la configuration par defaut appliquee quand aucune politique d'invitation n'est encore enregistree.

type JellyfinConfig

type JellyfinConfig struct {
	URL    string // URL de l'instance Jellyfin (ex: http://jellyfin:8096)
	APIKey string // Clé API d'administration
}

JellyfinConfig contient les paramètres de connexion à Jellyfin.

type JellyfinPolicyPreset

type JellyfinPolicyPreset struct {
	ID                               string                           `json:"id"`
	Name                             string                           `json:"name"`
	Description                      string                           `json:"description"`
	IsAdministrator                  bool                             `json:"is_administrator"`
	IsHidden                         bool                             `json:"is_hidden"`
	IsDisabled                       bool                             `json:"is_disabled"`
	EnableAllFolders                 bool                             `json:"enable_all_folders"`
	EnabledFolderIDs                 []string                         `json:"enabled_folder_ids"`
	BlockedMediaFolders              []string                         `json:"blocked_media_folders"`
	EnableDownload                   bool                             `json:"enable_download"`
	EnableRemoteAccess               bool                             `json:"enable_remote_access"`
	EnableAllDevices                 bool                             `json:"enable_all_devices"`
	EnabledDevices                   []string                         `json:"enabled_devices"`
	EnableAllChannels                bool                             `json:"enable_all_channels"`
	EnabledChannels                  []string                         `json:"enabled_channels"`
	BlockedChannels                  []string                         `json:"blocked_channels"`
	EnableMediaPlayback              bool                             `json:"enable_media_playback"`
	EnableAudioPlaybackTranscoding   bool                             `json:"enable_audio_playback_transcoding"`
	EnableVideoPlaybackTranscoding   bool                             `json:"enable_video_playback_transcoding"`
	EnablePlaybackRemuxing           bool                             `json:"enable_playback_remuxing"`
	ForceRemoteSourceTranscoding     bool                             `json:"force_remote_source_transcoding"`
	EnableLiveTvAccess               bool                             `json:"enable_live_tv_access"`
	EnableLiveTvManagement           bool                             `json:"enable_live_tv_management"`
	EnableSharedDeviceControl        bool                             `json:"enable_shared_device_control"`
	EnableContentDeletion            bool                             `json:"enable_content_deletion"`
	EnableContentDeletionFromFolders []string                         `json:"enable_content_deletion_from_folders"`
	EnablePublicSharing              bool                             `json:"enable_public_sharing"`
	EnableSyncTranscoding            bool                             `json:"enable_sync_transcoding"`
	EnableMediaConversion            bool                             `json:"enable_media_conversion"`
	SyncPlayAccess                   string                           `json:"syncplay_access"`
	InvalidLoginAttemptCount         int                              `json:"invalid_login_attempt_count"`
	LoginAttemptsBeforeLockout       int                              `json:"login_attempts_before_lockout"`
	MaxSessions                      int                              `json:"max_sessions"`
	BitrateLimit                     int                              `json:"bitrate_limit"`
	TemplateUserID                   string                           `json:"template_user_id"`
	UserConfiguration                JellyfinPresetUserConfiguration  `json:"user_configuration"`
	DisplayPreferences               JellyfinPresetDisplayPreferences `json:"display_preferences"`
	AllowedTags                      []string                         `json:"allowed_tags"`
	BlockedTags                      []string                         `json:"blocked_tags"`
	MaxParentalRating                int                              `json:"max_parental_rating"`
	BlockUnratedItems                []string                         `json:"block_unrated_items"`
	AccessSchedules                  []JellyfinPresetAccessSchedule   `json:"access_schedules"`
	UsernameMinLength                int                              `json:"username_min_length"`
	UsernameMaxLength                int                              `json:"username_max_length"`
	PasswordMinLength                int                              `json:"password_min_length"`
	PasswordMaxLength                int                              `json:"password_max_length"`
	RequireUpper                     bool                             `json:"require_upper"`
	RequireLower                     bool                             `json:"require_lower"`
	RequireDigit                     bool                             `json:"require_digit"`
	RequireSpecial                   bool                             `json:"require_special"`
	DisableAfterDays                 int                              `json:"disable_after_days"`
	ExpiryAction                     string                           `json:"expiry_action"`
	DeleteAfterDays                  int                              `json:"delete_after_days"`
	IsTemporary                      bool                             `json:"is_temporary"`
	DefaultAccountDurationDays       int                              `json:"default_account_duration_days"`
	MaxAccountDurationDays           int                              `json:"max_account_duration_days"`
	LDAPGroups                       []string                         `json:"ldap_groups"`

	// Parrainage / Sponsorship
	CanInvite                     bool     `json:"can_invite"`
	CanCreateInvitations          bool     `json:"can_create_invitations"`
	TargetPresetID                string   `json:"target_preset_id"`          // Le preset assigne aux personnes invitees
	AllowedTargetPresetIDs        []string `json:"allowed_target_preset_ids"` // Profils cibles autorises
	InviteQuota                   int      `json:"invite_quota"`              // Legacy: quota mensuel d'invitations
	InviteQuotaDay                int      `json:"invite_quota_day"`          // Quota journalier d'invitations
	InviteQuotaMonth              int      `json:"invite_quota_month"`        // Quota mensuel d'invitations
	InviteMaxUses                 int      `json:"invite_max_uses"`           // Nombre d'utilisations par lien d'invitation
	InviteMaxLinkHours            int      `json:"invite_max_link_hours"`     // Legacy: duree de validite d'un lien en heures
	InviteLinkValidityDays        int      `json:"invite_link_validity_days"` // Duree de validite d'un lien en jours
	InviteAllowLanguage           bool     `json:"invite_allow_language"`     // Si vrai, le parrain peut choisir la langue de l'invitation
	CanCreateTemporaryInvitations bool     `json:"can_create_temporary_invitations"`
	AllowedTemporaryPresetIDs     []string `json:"allowed_temporary_preset_ids"`
	DefaultTemporaryDurationDays  int      `json:"default_temporary_duration_days"`
	MaxTemporaryDurationDays      int      `json:"max_temporary_duration_days"`
}

JellyfinPolicyPreset décrit un preset réutilisable pour les politiques Jellyfin.

func DefaultJellyfinPolicyPresets

func DefaultJellyfinPolicyPresets() []JellyfinPolicyPreset

DefaultJellyfinPolicyPresets retourne un ensemble de presets initiaux.

type JellyfinPresetAccessSchedule

type JellyfinPresetAccessSchedule struct {
	DayOfWeek string `json:"day_of_week"`
	StartHour int    `json:"start_hour"`
	EndHour   int    `json:"end_hour"`
}

JellyfinPresetAccessSchedule represente une plage horaire d'acces Jellyfin.

type JellyfinPresetDisplayPreferences

type JellyfinPresetDisplayPreferences struct {
	ScreenSaver                    string   `json:"screensaver"`
	ScreensaverTime                int      `json:"screensaver_time"`
	BackdropScreensaverInterval    int      `json:"backdrop_screensaver_interval"`
	SlideshowInterval              int      `json:"slideshow_interval"`
	EnableFastFadeIn               bool     `json:"enable_fast_fadein"`
	EnableBlurHash                 bool     `json:"enable_blurhash"`
	EnableBackdrops                bool     `json:"enable_backdrops"`
	EnableThemeSongs               bool     `json:"enable_theme_songs"`
	EnableThemeVideos              bool     `json:"enable_theme_videos"`
	DetailsBanner                  bool     `json:"details_banner"`
	LibraryPageSize                int      `json:"library_page_size"`
	MaxDaysForNextUp               int      `json:"max_days_for_next_up"`
	EnableRewatchingInNextUp       bool     `json:"enable_rewatching_next_up"`
	UseEpisodeImagesInNextUpResume bool     `json:"use_episode_images_next_up_resume"`
	HomeSections                   []string `json:"home_sections"`
}

JellyfinPresetDisplayPreferences regroupe les preferences web sauvegardees dans DisplayPreferences/usersettings.

func DefaultJellyfinPresetDisplayPreferences

func DefaultJellyfinPresetDisplayPreferences() JellyfinPresetDisplayPreferences

DefaultJellyfinPresetDisplayPreferences retourne les defaults observes dans Jellyfin Web pour usersettings.

func NormalizeJellyfinPresetDisplayPreferences

func NormalizeJellyfinPresetDisplayPreferences(cfg JellyfinPresetDisplayPreferences) JellyfinPresetDisplayPreferences

NormalizeJellyfinPresetDisplayPreferences complete les anciens presets et borne les valeurs numeriques connues.

type JellyfinPresetUserConfiguration

type JellyfinPresetUserConfiguration struct {
	DisplayMissingEpisodes bool     `json:"display_missing_episodes"`
	HidePlayedInLatest     bool     `json:"hide_played_in_latest"`
	OrderedViews           []string `json:"ordered_views"`
	GroupedFolders         []string `json:"grouped_folders"`
	MyMediaExcludes        []string `json:"my_media_excludes"`
	LatestItemsExcludes    []string `json:"latest_items_excludes"`
}

JellyfinPresetUserConfiguration regroupe les reglages stockes dans User.Configuration cote Jellyfin.

func DefaultJellyfinPresetUserConfiguration

func DefaultJellyfinPresetUserConfiguration() JellyfinPresetUserConfiguration

DefaultJellyfinPresetUserConfiguration retourne les defaults serveur Jellyfin pour les reglages d'accueil qui ne sont pas deja des preferences web.

func NormalizeJellyfinPresetUserConfiguration

func NormalizeJellyfinPresetUserConfiguration(cfg JellyfinPresetUserConfiguration) JellyfinPresetUserConfiguration

NormalizeJellyfinPresetUserConfiguration nettoie les listes sans modifier les booleens qui peuvent volontairement etre a false.

type LDAPConfig

type LDAPConfig struct {
	Enabled              bool   `json:"enabled"`                // Intégration LDAP activée
	Host                 string `json:"host"`                   // Hostname du serveur LDAP
	Port                 int    `json:"port"`                   // Port (défaut: 636 pour LDAPS)
	UseTLS               bool   `json:"use_tls"`                // Utiliser LDAPS (TLS)
	SkipVerify           bool   `json:"skip_verify"`            // Ignorer la vérification du certificat TLS
	BindDN               string `json:"bind_dn"`                // DN de l'utilisateur pour le bind
	BindPassword         string `json:"bind_password"`          // Mot de passe de bind
	BaseDN               string `json:"base_dn"`                // Base DN de recherche
	SearchFilter         string `json:"search_filter"`          // Filtre de recherche LDAP (supporte {username})
	SearchAttributes     string `json:"search_attributes"`      // Attributs de recherche (liste CSV)
	UIDAttribute         string `json:"uid_attribute"`          // Attribut UID LDAP (ex: uid)
	UsernameAttribute    string `json:"username_attribute"`     // Attribut de nom d'utilisateur LDAP
	AdminFilter          string `json:"admin_filter"`           // Filtre administrateur LDAP
	AdminFilterMemberUID bool   `json:"admin_filter_memberuid"` // Active le mode memberUid pour le filtre admin
	UserObjectClass      string `json:"user_object_class"`      // objectClass utilisateur (auto|user|person|posixAccount|...)
	GroupMemberAttr      string `json:"group_member_attr"`      // Attribut membre groupe (auto|member|memberUid|...)
	UserOU               string `json:"user_ou"`                // OU pour la création des utilisateurs
	UserGroup            string `json:"user_group"`             // Legacy: fallback groupe utilisateur

	// Mode de provisioning: "hybrid" (LDAP + Jellyfin) ou "ldap_only".
	ProvisionMode string `json:"provision_mode"`

	// Groupes LDAP cibles pour l'affectation automatique des comptes.
	JellyfinGroup       string `json:"jellyfin_group"`
	InviterGroup        string `json:"inviter_group"`
	AdministratorsGroup string `json:"administrators_group"`

	// Providers Jellyfin utilises pour les comptes miroir LDAP.
	JellyfinLDAPAuthProviderID          string `json:"jellyfin_ldap_auth_provider_id"`
	JellyfinLDAPPasswordResetProviderID string `json:"jellyfin_ldap_password_reset_provider_id"`

	Domain string `json:"domain"` // Domaine AD (ex: home.lan)
}

LDAPConfig contient les paramètres de connexion annuaire (LDAP/LDAPS).

type LifecycleConfig

type LifecycleConfig struct {
	Enabled                 bool  `json:"enabled"`
	ExpiryReminderDays      []int `json:"expiry_reminder_days"`
	DisableInactiveDays     int   `json:"disable_inactive_days"`
	DeleteDisabledAfterDays int   `json:"delete_disabled_after_days"`
}

type MatrixWebhook

type MatrixWebhook struct {
	URL    string `json:"url"`
	RoomID string `json:"room_id"`
	Token  string `json:"token"`
}

MatrixWebhook contient la configuration de la connexion Matrix.

type PortalHealthConfig

type PortalHealthConfig struct {
	Enabled bool `json:"enabled"`
}

type PortalLinksConfig

type PortalLinksConfig struct {
	JellyGateURL       string `json:"jellygate_url"`
	JellyfinURL        string `json:"jellyfin_url"`
	JellyfinServerName string `json:"jellyfin_server_name"`
	JellyseerrURL      string `json:"jellyseerr_url"`
	JellyTrackURL      string `json:"jellytrack_url"`
}

PortalLinksConfig contient les URLs publiques exposees dans l'UI et les emails.

func DefaultPortalLinks() PortalLinksConfig

DefaultPortalLinks retourne une configuration de liens vide.

type ProductContentConfig

type ProductContentConfig struct {
	InviteIntroMarkdown   string `json:"invite_intro_markdown"`
	InviteSuccessMarkdown string `json:"invite_success_markdown"`
	AccountMarkdown       string `json:"account_markdown"`
}

type ProductFeaturesConfig

type ProductFeaturesConfig struct {
	AntiAbuse     AntiAbuseConfig      `json:"anti_abuse"`
	Content       ProductContentConfig `json:"content"`
	Setup         SetupWizardConfig    `json:"setup"`
	Contacts      ContactLinkingConfig `json:"contacts"`
	AdminTimeline AdminTimelineConfig  `json:"admin_timeline"`
	Simulation    SimulationConfig     `json:"simulation"`
	PortalHealth  PortalHealthConfig   `json:"portal_health"`
	Sponsorship   SponsorshipConfig    `json:"sponsorship"`
	Lifecycle     LifecycleConfig      `json:"lifecycle"`
	Audit         AuditConfig          `json:"audit"`
}

ProductFeaturesConfig regroupe les options produit avancees pilotees depuis l'admin.

func DefaultProductFeaturesConfig

func DefaultProductFeaturesConfig() ProductFeaturesConfig

DefaultProductFeaturesConfig retourne les defaults prudents des modules produit.

func NormalizeProductFeaturesConfig

func NormalizeProductFeaturesConfig(cfg ProductFeaturesConfig) ProductFeaturesConfig

NormalizeProductFeaturesConfig corrige les valeurs hors bornes sans casser les anciennes configs.

type SMTPConfig

type SMTPConfig struct {
	Host     string `json:"host"`     // Serveur SMTP
	Port     int    `json:"port"`     // Port SMTP (défaut: 587)
	Username string `json:"username"` // Utilisateur SMTP
	Password string `json:"password"` // Mot de passe SMTP
	From     string `json:"from"`     // Adresse expéditeur
	UseTLS   bool   `json:"use_tls"`  // Utiliser STARTTLS
}

SMTPConfig contient les paramètres d'envoi d'emails.

type SetupWizardConfig

type SetupWizardConfig struct {
	Enabled     bool   `json:"enabled"`
	Completed   bool   `json:"completed"`
	CompletedAt string `json:"completed_at"`
}

type SimulationConfig

type SimulationConfig struct {
	Enabled                  bool `json:"enabled"`
	RequirePreviewBeforeBulk bool `json:"require_preview_before_bulk"`
}

type SponsorshipConfig

type SponsorshipConfig struct {
	Enabled bool `json:"enabled"`
}

type TelegramWebhook

type TelegramWebhook struct {
	Token  string `json:"token"`
	ChatID string `json:"chat_id"`
}

TelegramWebhook contient la configuration du bot Telegram.

type ThirdPartyConfig

type ThirdPartyConfig struct {
	JellyseerrURL    string
	JellyseerrAPIKey string
	JellyTrackURL    string
	JellyTrackAPIKey string
}

ThirdPartyConfig contient les paramètres optionnels pour Jellyseerr et JellyTrack.

type WebhooksConfig

type WebhooksConfig struct {
	Discord  DiscordWebhook  `json:"discord"`
	Telegram TelegramWebhook `json:"telegram"`
	Matrix   MatrixWebhook   `json:"matrix"`
}

WebhooksConfig contient les paramètres des webhooks sortants (optionnels).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL