logging and client info parsing changes, added trusted proxies

This commit is contained in:
Maximilian Wagner
2025-12-27 18:02:02 +01:00
parent 8dcf9fba11
commit ad3825c871
7 changed files with 211 additions and 32 deletions

View File

@@ -5,25 +5,28 @@ import (
"sync"
)
var LogFile *os.File
type Config struct {
// general
LogLevel string `json:"logLevel"`
Timezone string `json:"timezone"`
LogFilePath string `json:"logFilePath"`
LogLevel string `json:"logLevel"`
LogLevelNumeric int
LogFilePath string `json:"logFilePath"`
// latex
LatexEngine string `json:"latexEngine"`
LatexSourceFilePath string `json:"latexSourceFilePath"`
LatexOutputPath string `json:"latexOutputPath"`
LatexEngine string `json:"latexEngine"`
LatexSourceFilePath string `json:"latexSourceFilePath"`
LatexOutputPath string `json:"latexOutputPath"`
// webserver
WebserverDomain string `json:"webserverDomain"`
WebserverPort string `json:"webserverPort"`
WebserverSecure bool `json:"webserverSecure"`
WebserverPortSecure string `json:"webserverPortSecure"`
CertificatePath string `json:"certificatePath"`
CertificateKeyPath string `json:"certificateKeyPath"`
Timezone string `json:"timezone"`
WebserverDomain string `json:"webserverDomain"`
WebserverPort string `json:"webserverPort"`
WebserverSecure bool `json:"webserverSecure"`
WebserverPortSecure string `json:"webserverPortSecure"`
CertificatePath string `json:"certificatePath"`
CertificateKeyPath string `json:"certificateKeyPath"`
TrustedProxies []string `json:"trustedProxies"`
}
var AppConfig Config
@@ -37,5 +40,12 @@ type LatexExecution struct {
}
var LatexExec LatexExecution
var LogFile *os.File
type ClientInfo struct {
ClientIP string
RequestType string
RequestPath string
Proxy string
Proxied bool
ProxyTrusted bool
}