Documentation
¶
Overview ¶
Package config provides functions for setting the initial values of server parameters.
Index ¶
Constants ¶
const LogLevelVariable string = "LOG_LEVEL"
The name of the environment variable for the log level. Allowed values are from 0 to 6. See package "go_multi_log": https://pkg.go.dev/github.com/takecontrolsoft/go_multi_log/logger/levels#LogLevel
const LogPathVariable string = "LOG_PATH"
The name of the environment variable with the path for log files. This value should point to the directory where the log files to be stored. Absolute path is required in DOS or UNC format. Make sure the server process has read/write access to this location.
const MaxUploadFileSize int64 = 5 * 1024 * 1024 * 1024
The maximum stream size that is allowed to be uploaded to the server. The size is set to maximum 5GB.
const PortVariable = "SYNC_SERVER_PORT"
The name of the environment variable with TCP port number on witch the server can be reached.
const UploadPathVariable string = "SYNC_STORAGE_PATH"
The name of the environment variable with the storage path. This value should point to the directory where the uploaded files to be stored. Absolute path is required in DOS or UNC format. Make sure the server process has read/write access to this location.
Variables ¶
var AdminUser, AdminPassword string
AdminUser and AdminPassword bootstrap the first user when the auth DB has no users. Set via SYNC_ADMIN_USER and SYNC_ADMIN_PASSWORD.
var AuthDBPath string
AuthDBPath is the path to the SQLite auth DB for users and sessions. Set via SYNC_AUTH_DB. If unset, defaults to auth.db next to the executable (BinDirectory).
var BinDirectory string
BinDirectory is the directory of the sync_server executable. Place exiftool and ffmpeg executables here so the server finds them.
var DocumentClassifierPath string
DocumentClassifierPath is the path to a Python script (.py) or executable that classifies an image as document vs photo. The server runs it asynchronously after sync with the image path as the only argument; stdout "document" -> move to Trash. Set via SYNC_DOCUMENT_CLASSIFIER_PATH. Example: scripts/document_classifier.py
var DocumentToTrashEnabled bool
DocumentToTrashEnabled, when true, moves document-like images to Trash. If DocumentClassifierPath is set, that Python/exe is run asynchronously after upload; otherwise a built-in heuristic is used. Set via SYNC_DOCUMENT_TO_TRASH=1.
var ErrStoragePathEmpty = errors.Errorf("Storage path is empty.")
An error for empty storage path.
var LogLevel levels.LogLevel
Global variable for log level
var LogPath string
Global variable for log directory path
var PortNumber int
Global variable for port number
var UploadDirectory string
Global variable for storage directory path
Functions ¶
func ErrEnvVariableNotSet ¶
An error for not set value for an environment variable that is needed to run the sync server.
func ErrEnvVariableSetEmpty ¶
An error for empty value for an environment variable that is needed to run the sync server.
func ExiftoolBinary ¶ added in v1.0.7
func ExiftoolBinary() string
ExiftoolBinary returns the path to the exiftool executable (next to sync_server).
func FfmpegBinary ¶ added in v1.0.7
func FfmpegBinary() string
FfmpegBinary returns the path to the ffmpeg executable (next to sync_server).
func InitBinDirectory ¶ added in v1.0.7
func InitBinDirectory()
InitBinDirectory sets BinDirectory to the executable's directory and prepends it to PATH so exiftool and ffmpeg are found when next to sync_server.
func InitFromEnvVariables ¶
func InitFromEnvVariables()
Initialize the variables UploadDirectory, PortNumber, LogPath and LogLevel from the environment variables UploadPathVariable, PortVariable, LogPathVariable and LogLevelVariable.
Types ¶
This section is empty.