{"modulePath":"github.com/devfans/gogs","version":"v0.11.53","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package setting\n\n## Variables\n\n```go\nvar (\n\t// Build information should only be set by -ldflags.\n\tBuildTime    string\n\tBuildGitHash string\n\n\t// App settings\n\tAppVer         string\n\tAppName        string\n\tAppURL         string\n\tAppSubURL      string\n\tAppSubURLDepth int // Number of slashes\n\tAppPath        string\n\tAppDataPath    string\n\n\t// Server settings\n\tProtocol             Scheme\n\tDomain               string\n\tHTTPAddr             string\n\tHTTPPort             string\n\tLocalURL             string\n\tOfflineMode          bool\n\tDisableRouterLog     bool\n\tCertFile, KeyFile    string\n\tTLSMinVersion        string\n\tStaticRootPath       string\n\tEnableGzip           bool\n\tLandingPageURL       LandingPage\n\tUnixSocketPermission uint32\n\n\tHTTP struct {\n\t\tAccessControlAllowOrigin string\n\t}\n\n\tSSH struct {\n\t\tDisabled                     bool           `ini:\"DISABLE_SSH\"`\n\t\tStartBuiltinServer           bool           `ini:\"START_SSH_SERVER\"`\n\t\tDomain                       string         `ini:\"SSH_DOMAIN\"`\n\t\tPort                         int            `ini:\"SSH_PORT\"`\n\t\tListenHost                   string         `ini:\"SSH_LISTEN_HOST\"`\n\t\tListenPort                   int            `ini:\"SSH_LISTEN_PORT\"`\n\t\tRootPath                     string         `ini:\"SSH_ROOT_PATH\"`\n\t\tRewriteAuthorizedKeysAtStart bool           `ini:\"REWRITE_AUTHORIZED_KEYS_AT_START\"`\n\t\tServerCiphers                []string       `ini:\"SSH_SERVER_CIPHERS\"`\n\t\tKeyTestPath                  string         `ini:\"SSH_KEY_TEST_PATH\"`\n\t\tKeygenPath                   string         `ini:\"SSH_KEYGEN_PATH\"`\n\t\tMinimumKeySizeCheck          bool           `ini:\"MINIMUM_KEY_SIZE_CHECK\"`\n\t\tMinimumKeySizes              map[string]int `ini:\"-\"`\n\t}\n\n\t// Security settings\n\tInstallLock             bool\n\tSecretKey               string\n\tLoginRememberDays       int\n\tCookieUserName          string\n\tCookieRememberName      string\n\tCookieSecure            bool\n\tReverseProxyAuthUser    string\n\tEnableLoginStatusCookie bool\n\tLoginStatusCookieName   string\n\n\t// Database settings\n\tUseSQLite3    bool\n\tUseMySQL      bool\n\tUsePostgreSQL bool\n\tUseMSSQL      bool\n\n\t// Repository settings\n\tRepository struct {\n\t\tAnsiCharset              string\n\t\tForcePrivate             bool\n\t\tMaxCreationLimit         int\n\t\tMirrorQueueLength        int\n\t\tPullRequestQueueLength   int\n\t\tPreferredLicenses        []string\n\t\tDisableHTTPGit           bool `ini:\"DISABLE_HTTP_GIT\"`\n\t\tEnableLocalPathMigration bool\n\t\tCommitsFetchConcurrency  int\n\t\tEnableRawFileRenderMode  bool\n\n\t\t// Repository editor settings\n\t\tEditor struct {\n\t\t\tLineWrapExtensions   []string\n\t\t\tPreviewableFileModes []string\n\t\t} `ini:\"-\"`\n\n\t\t// Repository upload settings\n\t\tUpload struct {\n\t\t\tEnabled      bool\n\t\t\tTempPath     string\n\t\t\tAllowedTypes []string `delim:\"|\"`\n\t\t\tFileMaxSize  int64\n\t\t\tMaxFiles     int\n\t\t} `ini:\"-\"`\n\t}\n\tRepoRootPath string\n\tScriptType   string\n\n\t// Webhook settings\n\tWebhook struct {\n\t\tTypes          []string\n\t\tQueueLength    int\n\t\tDeliverTimeout int\n\t\tSkipTLSVerify  bool `ini:\"SKIP_TLS_VERIFY\"`\n\t\tPagingNum      int\n\t}\n\n\t// Release settigns\n\tRelease struct {\n\t\tAttachment struct {\n\t\t\tEnabled      bool\n\t\t\tTempPath     string\n\t\t\tAllowedTypes []string `delim:\"|\"`\n\t\t\tMaxSize      int64\n\t\t\tMaxFiles     int\n\t\t} `ini:\"-\"`\n\t}\n\n\t// Markdown sttings\n\tMarkdown struct {\n\t\tEnableHardLineBreak bool\n\t\tCustomURLSchemes    []string `ini:\"CUSTOM_URL_SCHEMES\"`\n\t\tFileExtensions      []string\n\t}\n\n\t// Smartypants settings\n\tSmartypants struct {\n\t\tEnabled      bool\n\t\tFractions    bool\n\t\tDashes       bool\n\t\tLatexDashes  bool\n\t\tAngledQuotes bool\n\t}\n\n\t// Admin settings\n\tAdmin struct {\n\t\tDisableRegularOrgCreation bool\n\t}\n\n\t// Picture settings\n\tAvatarUploadPath      string\n\tGravatarSource        string\n\tDisableGravatar       bool\n\tEnableFederatedAvatar bool\n\tLibravatarService     *libravatar.Libravatar\n\n\t// Log settings\n\tLogRootPath string\n\tLogModes    []string\n\tLogConfigs  []interface{}\n\n\t// Attachment settings\n\tAttachmentPath         string\n\tAttachmentAllowedTypes string\n\tAttachmentMaxSize      int64\n\tAttachmentMaxFiles     int\n\tAttachmentEnabled      bool\n\n\t// Time settings\n\tTimeFormat string\n\n\t// Cache settings\n\tCacheAdapter  string\n\tCacheInterval int\n\tCacheConn     string\n\n\t// Session settings\n\tSessionConfig  session.Options\n\tCSRFCookieName string\n\n\t// Cron tasks\n\tCron struct {\n\t\tUpdateMirror struct {\n\t\t\tEnabled    bool\n\t\t\tRunAtStart bool\n\t\t\tSchedule   string\n\t\t} `ini:\"cron.update_mirrors\"`\n\t\tRepoHealthCheck struct {\n\t\t\tEnabled    bool\n\t\t\tRunAtStart bool\n\t\t\tSchedule   string\n\t\t\tTimeout    time.Duration\n\t\t\tArgs       []string `delim:\" \"`\n\t\t} `ini:\"cron.repo_health_check\"`\n\t\tCheckRepoStats struct {\n\t\t\tEnabled    bool\n\t\t\tRunAtStart bool\n\t\t\tSchedule   string\n\t\t} `ini:\"cron.check_repo_stats\"`\n\t\tRepoArchiveCleanup struct {\n\t\t\tEnabled    bool\n\t\t\tRunAtStart bool\n\t\t\tSchedule   string\n\t\t\tOlderThan  time.Duration\n\t\t} `ini:\"cron.repo_archive_cleanup\"`\n\t}\n\n\t// Git settings\n\tGit struct {\n\t\tVersion                  string `ini:\"-\"`\n\t\tDisableDiffHighlight     bool\n\t\tMaxGitDiffLines          int\n\t\tMaxGitDiffLineCharacters int\n\t\tMaxGitDiffFiles          int\n\t\tGCArgs                   []string `ini:\"GC_ARGS\" delim:\" \"`\n\t\tTimeout                  struct {\n\t\t\tMigrate int\n\t\t\tMirror  int\n\t\t\tClone   int\n\t\t\tPull    int\n\t\t\tGC      int `ini:\"GC\"`\n\t\t} `ini:\"git.timeout\"`\n\t}\n\n\t// Mirror settings\n\tMirror struct {\n\t\tDefaultInterval int\n\t}\n\n\t// API settings\n\tAPI struct {\n\t\tMaxResponseItems int\n\t}\n\n\t// UI settings\n\tUI struct {\n\t\tExplorePagingNum   int\n\t\tIssuePagingNum     int\n\t\tFeedMaxCommitNum   int\n\t\tThemeColorMetaTag  string\n\t\tMaxDisplayFileSize int64\n\n\t\tAdmin struct {\n\t\t\tUserPagingNum   int\n\t\t\tRepoPagingNum   int\n\t\t\tNoticePagingNum int\n\t\t\tOrgPagingNum    int\n\t\t} `ini:\"ui.admin\"`\n\t\tUser struct {\n\t\t\tRepoPagingNum     int\n\t\t\tNewsFeedPagingNum int\n\t\t\tCommitsPagingNum  int\n\t\t} `ini:\"ui.user\"`\n\t}\n\n\t// I18n settings\n\tLangs []string\n\tNames []string\n\n\t// Other settings\n\tShowFooterBranding         bool\n\tShowFooterVersion          bool\n\tShowFooterTemplateLoadTime bool\n\tSupportMiniWinService      bool\n\n\t// Global setting objects\n\tCfg          *ini.File\n\tCustomPath   string // Custom directory path\n\tCustomConf   string\n\tProdMode     bool\n\tRunUser      string\n\tIsWindows    bool\n\tHasRobotsTxt bool\n)\n```\n\n```go\nvar HookMode bool\n```\nHookMode indicates whether program starts as Git server-side hook callback.\n\n```go\nvar Service struct {\n\tActiveCodeLives                int\n\tResetPwdCodeLives              int\n\tRegisterEmailConfirm           bool\n\tDisableRegistration            bool\n\tShowRegistrationButton         bool\n\tRequireSignInView              bool\n\tEnableNotifyMail               bool\n\tEnableReverseProxyAuth         bool\n\tEnableReverseProxyAutoRegister bool\n\tEnableCaptcha                  bool\n}\n```\n\n## Functions\n\n```go\nfunc DateLang(lang string) string\n```\nDateLang transforms standard language locale name to corresponding value in datetime plugin.\n\n```go\nfunc IsRunUserMatchCurrentUser(runUser string) (string, bool)\n```\nIsRunUserMatchCurrentUser 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.\n\n```go\nfunc NewContext()\n```\nNewContext initializes configuration context. NOTE: do not print any log except error.\n\n```go\nfunc NewPostReceiveHookServices()\n```\nNewPostReceiveHookServices initializes all services that are needed by Git server-side post-receive hook callback.\n\n```go\nfunc NewService()\n```\n\n```go\nfunc NewServices()\n```\n\n```go\nfunc WorkDir() (string, error)\n```\nWorkDir returns absolute path of work directory.\n\n## Types\n\n```go\ntype LandingPage string\n```\n\n```go\nconst (\n\tLANDING_PAGE_HOME    LandingPage = \"/\"\n\tLANDING_PAGE_EXPLORE LandingPage = \"/explore\"\n)\n```\n\n```go\ntype Mailer struct {\n\tQueueLength       int\n\tSubjectPrefix     string\n\tHost              string\n\tFrom              string\n\tFromEmail         string\n\tUser, Passwd      string\n\tDisableHelo       bool\n\tHeloHostname      string\n\tSkipVerify        bool\n\tUseCertificate    bool\n\tCertFile, KeyFile string\n\tUsePlainText      bool\n}\n```\nMailer represents mail service.\n\n```go\nvar (\n\tMailService *Mailer\n)\n```\n\n```go\ntype Scheme string\n```\n\n```go\nconst (\n\tSCHEME_HTTP        Scheme = \"http\"\n\tSCHEME_HTTPS       Scheme = \"https\"\n\tSCHEME_FCGI        Scheme = \"fcgi\"\n\tSCHEME_UNIX_SOCKET Scheme = \"unix\"\n)\n```\n\n","path":"github.com/devfans/gogs/pkg/setting","name":"setting","synopsis":"","isRedistributable":true}
