78 lines
1.8 KiB
Go
78 lines
1.8 KiB
Go
// OSGOS server
|
|
// =======================================================================================================
|
|
// Author: LLC Texnico <main@texnico.ru>
|
|
// All rights reserved
|
|
// Russia, Chelyabinsk, 2024
|
|
|
|
package common
|
|
|
|
import (
|
|
log "github.com/sirupsen/logrus"
|
|
"os"
|
|
)
|
|
|
|
const (
|
|
defaultWebPort = 8070
|
|
|
|
PathWebAdminFiles = "/web/"
|
|
PathWebAppFiles = "/app/"
|
|
PathImageFiles = "/images/"
|
|
PathPackageFiles = "/packages/"
|
|
|
|
MasterLogin = "admin"
|
|
MasterReader = "osgos"
|
|
|
|
OptionsFile = "options.json"
|
|
RegsFile = "regs.json"
|
|
PackagesFile = "packages.json"
|
|
ErrorHtml = "index.html"
|
|
|
|
LogName = "log.txt"
|
|
DelaySecond = 1
|
|
NameSessionCookie = "_identid"
|
|
LengthRandomSalt = 16
|
|
rotationNumFiles = 10
|
|
maxLogFileMb = 50
|
|
StartId = 100000
|
|
|
|
UploadBufferBytes = 1024 * 1024 * 205
|
|
UploadImageSizeLimit = 1024 * 1024 * 100
|
|
UploadFileSizeLimit = 1024 * 1024 * 200
|
|
UploadImagesWidthLimitPx = 2000
|
|
TemplateNameCompany = `ОСГОС`
|
|
)
|
|
|
|
var (
|
|
// Options опции по-умолчанию
|
|
Options = options{
|
|
Key: RandomString(LengthRandomSalt),
|
|
TypeLog: log.DebugLevel,
|
|
WebPort: defaultWebPort,
|
|
Backup: true,
|
|
NameHeaderRemoteIp: "X-Remote-IP",
|
|
MasterPassword: RandomString(LengthRandomSalt),
|
|
ReaderPassword: RandomString(LengthRandomSalt),
|
|
WebAppDomainPrefix: "shop",
|
|
}
|
|
|
|
//Файл для хранения лога
|
|
logFile *os.File
|
|
)
|
|
|
|
type options struct {
|
|
Backup bool
|
|
WebPort int
|
|
TypeLog log.Level
|
|
Key string
|
|
MasterPassword string
|
|
ReaderPassword string
|
|
NameHeaderRemoteIp string
|
|
WebAppDomainPrefix string
|
|
|
|
//настройки smtp сервера
|
|
ServerSMTP string
|
|
PortSMTP int
|
|
LoginSMTP string
|
|
PassSMTP string
|
|
}
|