Documentation ¶
Index ¶
- Variables
- func AppPath() string
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func CheckRunUser(runUser string) (string, bool)
- func CurrentUsername() string
- func CustomDir() string
- func HomeDir() string
- func Init(customConf string) error
- func IsProdMode() bool
- func IsWindowsRuntime() bool
- func MustAsset(name string) []byte
- func WorkDir() string
Constants ¶
This section is empty.
Variables ¶
var ( BuildTime string BuildCommit string )
Build time and commit information.
⚠️ WARNING: should only be set by "-ldflags".
var ( App struct { // ⚠️ WARNING: Should only be set by the main package (i.e. "imail.go"). Version string `ini:"-"` Name string BrandName string RunUser string RunMode string TemplateFs embed.FS } Admin struct { AdminPath string } Debug struct { Port string } // log Log struct { Format string RootPath string } // Cache settings Cache struct { Adapter string Interval int Host string } // web settings Web struct { HttpAddr string `ini:"http_addr"` HttpPort string `ini:"http_port"` Domain string AppDataPath string AccessControlAllowOrigin string ExternalURL string `ini:"EXTERNAL_URL"` Protocol string CertFile string KeyFile string TLSMinVersion string `ini:"TLS_MIN_VERSION"` UnixSocketPermission string LocalRootURL string `ini:"LOCAL_ROOT_URL"` OfflineMode bool DisableRouterLog bool EnableGzip bool LoadAssetsFromDisk bool LandingURL string `ini:"LANDING_URL"` } Mongodb struct { Addr string Db string } // Session settings Session struct { Provider string ProviderConfig string CookieName string CookieSecure bool GCInterval int64 `ini:"gc_interval"` MaxLifeTime int64 CSRFCookieName string `ini:"csrf_cookie_name"` } // Security settings Security struct { InstallLock bool SecretKey string LoginRememberDays int CookieRememberName string CookieUsername string CookieSecure bool EnableLoginStatusCookie bool LoginStatusCookieName string } // Other settings Other struct { ShowFooterBranding bool ShowFooterTemplateLoadTime bool } // Global setting HasRobotsTxt bool )
var CustomConf string
CustomConf returns the absolute path of custom configuration file that is used.
var File *ini.File
File is the configuration object.
var I18n *i18nConf
I18n settings
Functions ¶
func CheckRunUser ¶
CheckRunUser returns false if configured run user does not match actual user that runs the app. The first return value is the actual user name. This check is ignored under Windows since SSH remote login is not the main method to login on Windows.
func CurrentUsername ¶
func CurrentUsername() string
CurrentUsername returns the username of the current user.
func CustomDir ¶
func CustomDir() string
CustomDir returns the absolute path of the custom directory that contains local overrides. It reads the value of environment variable GOGS_CUSTOM. When not set, it uses the work directory returned by WorkDir function.
func HomeDir ¶
func HomeDir() string
HomeDir returns the home directory by reading environment variables. It may return empty string when environment variables are not set.
func IsProdMode ¶
func IsProdMode() bool
IsProdMode returns true if the application is running in production mode.
func IsWindowsRuntime ¶
func IsWindowsRuntime() bool
IsWindowsRuntime returns true if the current runtime in Windows.
Types ¶
This section is empty.