setting

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2015 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// App settings.
	AppVer    string
	AppName   string
	AppUrl    string
	AppSubUrl string

	// Server settings.
	Protocol           Scheme
	Domain             string
	HttpAddr, HttpPort string
	DisableSSH         bool
	SSHPort            int
	SSHDomain          string
	OfflineMode        bool
	DisableRouterLog   bool
	CertFile, KeyFile  string
	StaticRootPath     string
	EnableGzip         bool
	LandingPageUrl     LandingPage

	// Security settings.
	InstallLock          bool
	SecretKey            string
	LogInRememberDays    int
	CookieUserName       string
	CookieRememberName   string
	ReverseProxyAuthUser string

	// Database settings.
	UseSQLite3    bool
	UseMySQL      bool
	UsePostgreSQL bool

	// Webhook settings.
	Webhook struct {
		QueueLength    int
		DeliverTimeout int
		SkipTLSVerify  bool
	}

	// Repository settings.
	RepoRootPath string
	ScriptType   string
	AnsiCharset  string

	// UI settings.
	IssuePagingNum int

	// Picture settings.
	PictureService   string
	AvatarUploadPath string
	GravatarSource   string
	DisableGravatar  bool

	// Log settings.
	LogRootPath string
	LogModes    []string
	LogConfigs  []string

	// Attachment settings.
	AttachmentPath         string
	AttachmentAllowedTypes string
	AttachmentMaxSize      int64
	AttachmentMaxFiles     int
	AttachmentEnabled      bool

	// Time settings.
	TimeFormat string

	// Cache settings.
	CacheAdapter  string
	CacheInternal int
	CacheConn     string

	EnableRedis    bool
	EnableMemcache bool

	// Session settings.
	SessionConfig session.Options

	// Git settings.
	Git struct {
		MaxGitDiffLines int
		GcArgs          []string `delim:" "`
		Fsck            struct {
			Enable   bool
			Interval int
			Args     []string `delim:" "`
		} `ini:"git.fsck"`
	}

	// I18n settings.
	Langs, Names []string

	// Other settings.
	ShowFooterBranding bool

	// Global setting objects.
	Cfg          *ini.File
	CustomPath   string // Custom directory path.
	CustomConf   string
	ProdMode     bool
	RunUser      string
	IsWindows    bool
	HasRobotsTxt bool
)
View Source
var (
	MailService  *Mailer
	OauthService *Oauther
)
View Source
var Service struct {
	ActiveCodeLives                int
	ResetPwdCodeLives              int
	RegisterEmailConfirm           bool
	DisableRegistration            bool
	ShowRegistrationButton         bool
	RequireSignInView              bool
	EnableCacheAvatar              bool
	EnableNotifyMail               bool
	EnableReverseProxyAuth         bool
	EnableReverseProxyAutoRegister bool
	DisableMinimumKeySizeCheck     bool
}

Functions

func DateLang added in v0.6.5

func DateLang(lang string) string

func ExecPath added in v0.5.0

func ExecPath() (string, error)

func NewConfigContext

func NewConfigContext()

NewConfigContext initializes configuration context. NOTE: do not print any log except error.

func NewServices

func NewServices()

func WorkDir

func WorkDir() (string, error)

WorkDir returns absolute path of work directory.

Types

type LandingPage added in v0.5.9

type LandingPage string
const (
	LANDING_PAGE_HOME    LandingPage = "/"
	LANDING_PAGE_EXPLORE LandingPage = "/explore"
)

type Mailer

type Mailer struct {
	Name              string
	Host              string
	From              string
	User, Passwd      string
	DisableHelo       bool
	HeloHostname      string
	SkipVerify        bool
	UseCertificate    bool
	CertFile, KeyFile string
}

Mailer represents mail service.

type OauthInfo

type OauthInfo struct {
	oauth2.Options
	AuthUrl, TokenUrl string
}

type Oauther

type Oauther struct {
	GitHub, Google, Tencent,
	Twitter, Weibo bool
	OauthInfos map[string]*OauthInfo
}

Oauther represents oauth service.

type Scheme

type Scheme string
const (
	HTTP  Scheme = "http"
	HTTPS Scheme = "https"
	FCGI  Scheme = "fcgi"
)

Jump to

Keyboard shortcuts

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