install

package
v1.7.1-RC2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 35 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const UIStaticPath = "build/static"

Variables

This section is empty.

Functions

func CheckConfigFile

func CheckConfigFile(ctx *gin.Context)

CheckConfigFile check config file if exist when installation @Summary check config file if exist when installation @Description check config file if exist when installation @Tags installation @Accept json @Produce json @Success 200 {object} handler.RespBody{data=install.CheckConfigFileResp{}} @Router /installation/config-file/check [post]

func CheckConfigFileAndRedirectToInstallPage

func CheckConfigFileAndRedirectToInstallPage(ctx *gin.Context)

CheckConfigFileAndRedirectToInstallPage if config file not exist try to redirect to install page @Summary if config file not exist try to redirect to install page @Description if config file not exist try to redirect to install page @Tags installation @Accept json @Produce json @Router / [get]

func CheckDatabase

func CheckDatabase(ctx *gin.Context)

CheckDatabase check database if exist when installation @Summary check database if exist when installation @Description check database if exist when installation @Tags installation @Accept json @Produce json @Param data body install.CheckDatabaseReq true "CheckDatabaseReq" @Success 200 {object} handler.RespBody{data=install.CheckConfigFileResp{}} @Router /installation/db/check [post]

func GetLangMapping

func GetLangMapping(ctx *gin.Context)

GetLangMapping get installation language config mapping @Summary get installation language config mapping @Description get installation language config mapping @Tags Lang @Param lang query string true "installation language" @Produce json @Success 200 {object} handler.RespBody{} @Router /installation/language/config [get]

func InitBaseInfo

func InitBaseInfo(ctx *gin.Context)

InitBaseInfo init base info @Summary init base info @Description init base info @Tags installation @Accept json @Produce json @Param data body install.InitBaseInfoReq true "InitBaseInfoReq" @Success 200 {object} handler.RespBody{} @Router /installation/base-info [post]

func InitEnvironment

func InitEnvironment(ctx *gin.Context)

InitEnvironment init environment @Summary init environment @Description init environment @Tags installation @Accept json @Produce json @Param data body install.CheckDatabaseReq true "CheckDatabaseReq" @Success 200 {object} handler.RespBody{} @Router /installation/init [post]

func LangOptions

func LangOptions(ctx *gin.Context)

LangOptions get installation language options @Summary get installation language options @Description get installation language options @Tags Lang @Produce json @Success 200 {object} handler.RespBody{data=[]translator.LangOption} @Router /installation/language/options [get]

func NewInstallHTTPServer

func NewInstallHTTPServer() *gin.Engine

NewInstallHTTPServer new install http server.

func Run

func Run(configPath string)

func TryToInstallByEnv

func TryToInstallByEnv() (installByEnv bool, err error)

func WebPage

func WebPage(c *gin.Context)

Types

type CheckConfigFileResp

type CheckConfigFileResp struct {
	ConfigFileExist     bool `json:"config_file_exist"`
	DBConnectionSuccess bool `json:"db_connection_success"`
	DbTableExist        bool `json:"db_table_exist"`
}

CheckConfigFileResp check config file if exist or not response

type CheckDatabaseReq

type CheckDatabaseReq struct {
	DbType      string `validate:"required,oneof=postgres sqlite3 mysql" json:"db_type"`
	DbUsername  string `json:"db_username"`
	DbPassword  string `json:"db_password"`
	DbHost      string `json:"db_host"`
	DbName      string `json:"db_name"`
	DbFile      string `json:"db_file"`
	Ssl         bool   `json:"ssl_enabled"`
	SslMode     string `json:"ssl_mode"`
	SslRootCert string `json:"ssl_root_cert"`
	SslKey      string `json:"ssl_key"`
	SslCert     string `json:"ssl_cert"`
}

CheckDatabaseReq check database

func (*CheckDatabaseReq) GetConnection

func (r *CheckDatabaseReq) GetConnection() string

GetConnection get connection string

type CheckDatabaseResp

type CheckDatabaseResp struct {
	ConnectionSuccess bool `json:"connection_success"`
}

CheckDatabaseResp check database response

type Env

type Env struct {
	AutoInstall string `json:"auto_install"`
	DbType      string `json:"db_type"`
	DbUsername  string `json:"db_username"`
	DbPassword  string `json:"db_password"`
	DbHost      string `json:"db_host"`
	DbName      string `json:"db_name"`
	DbFile      string `json:"db_file"`
	Language    string `json:"lang"`

	SiteName               string `json:"site_name"`
	SiteURL                string `json:"site_url"`
	ContactEmail           string `json:"contact_email"`
	AdminName              string `json:"name"`
	AdminPassword          string `json:"password"`
	AdminEmail             string `json:"email"`
	LoginRequired          bool   `json:"login_required"`
	ExternalContentDisplay string `json:"external_content_display"`
}

type InitBaseInfoReq

type InitBaseInfoReq struct {
	Language               string `validate:"required,gt=0,lte=30" json:"lang"`
	SiteName               string `validate:"required,sanitizer,gt=0,lte=30" json:"site_name"`
	SiteURL                string `validate:"required,gt=0,lte=512,url" json:"site_url"`
	ContactEmail           string `validate:"required,email,gt=0,lte=500" json:"contact_email"`
	AdminName              string `validate:"required,gte=2,lte=30" json:"name"`
	AdminPassword          string `validate:"required,gte=8,lte=32" json:"password"`
	AdminEmail             string `validate:"required,email,gt=0,lte=500" json:"email"`
	LoginRequired          bool   `json:"login_required"`
	ExternalContentDisplay string `validate:"required,oneof=always_display ask_before_display" json:"external_content_display"`
}

InitBaseInfoReq init base info request

func (*InitBaseInfoReq) Check

func (r *InitBaseInfoReq) Check() (errFields []*validator.FormErrorField, err error)

func (*InitBaseInfoReq) FormatSiteUrl

func (r *InitBaseInfoReq) FormatSiteUrl()

type InitEnvironmentResp

type InitEnvironmentResp struct {
	Success            bool   `json:"success"`
	CreateConfigFailed bool   `json:"create_config_failed"`
	DefaultConfig      string `json:"default_config"`
	ErrType            string `json:"err_type"`
}

InitEnvironmentResp init environment response

Jump to

Keyboard shortcuts

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