-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcli_input.go
More file actions
73 lines (71 loc) · 8.73 KB
/
Copy pathcli_input.go
File metadata and controls
73 lines (71 loc) · 8.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package main
import "github.com/alecthomas/kong"
// CLIInput stores all configuration flags and arguments thant can be passed to the application
type CLIInput struct {
Version kong.VersionFlag `short:"v" name:"version" help:"Get version number."`
// LibPath holds the absolute path to the folder containing the documents
LibPath string `arg:"" env:"LIB_PATH" help:"Absolute path to the folder containing the documents." type:"path"`
// CacheDir defines where cache files will be stored
CacheDir string `env:"CACHE_DIR" short:"c" name:"cache-dir" help:"Directory where to store cache files. Defaults to ~/.coreander/cache"`
// FQDN stores the domain name of the server. If the server is listening on a non-standard HTTP / HTTPS port, include it using a colon (e. g. example.com:3000)
FQDN string `env:"FQDN" short:"d" default:"localhost" name:"fqdn" help:"Domain name of the server. If the server is listening on a non-standard HTTP / HTTPS port, include it using a colon (e. g. example:3000)"`
// Port defines the port number in which the webserver listens for requests
Port int `env:"PORT" short:"p" default:"3000" name:"port" help:"Port number in which the webserver listens for requests"`
// BatchSize indicates the number of documents persisted by the indexer in one operation
BatchSize int `env:"BATCH_SIZE" short:"b" default:"100" name:"batch-size" help:"Number of documents persisted by the indexer in one operation"`
// IndexWorkers is the number of goroutines used to extract metadata in parallel during indexing. 0 (default) chooses CPU count; 1 is sequential; 2+ sets an explicit pool size.
IndexWorkers int `env:"INDEX_WORKERS" name:"index-workers" default:"0" help:"Parallel workers for metadata extraction during indexing. 0 = automatic (CPU count); 1 = sequential; 2+ = explicit pool size."`
// AuthorImageMaxWidth sets the maximum horizontal size for author images in pixels. Set to 0 to keep original image size
AuthorImageMaxWidth int `env:"AUTHOR_IMAGE_MAX_WIDTH" default:"600" name:"author-image-max-width" help:"Maximum horizontal size for author images in pixels. Set to 0 to keep original image size"`
// CoverMaxWidth sets the maximum horizontal size for documents cover thumbnails in pixels
CoverMaxWidth int `env:"COVER_MAX_WIDTH" default:"600" name:"cover-max-width" help:"Maximum horizontal size for documents cover thumbnails in pixels"`
// CacheMaxSize sets the maximum total size of the cache directory in megabytes. Set to 0 for unlimited.
CacheMaxSize int `env:"CACHE_MAX_SIZE" default:"500" name:"cache-max-size" help:"Maximum total size of the cache directory in megabytes. Set to 0 for unlimited."`
// IllustratedMinAmount is the minimum number of illustrations (excluding cover) for a document to be considered illustrated
IllustratedMinAmount int `env:"ILLUSTRATED_MIN_AMOUNT" default:"2" name:"illustrated-min-amount" help:"Minimum number of illustrations (excluding cover) for a document to be considered illustrated"`
// IllustratedMinSize is the minimum size in megapixels for an image to count as an illustration
IllustratedMinSize float64 `env:"ILLUSTRATED_MIN_SIZE" default:"0.25" name:"illustrated-min-size" help:"Minimum size in megapixels for an image to count as an illustration"`
// ForceIndexing signals whether to force indexing already indexed documents or not
ForceIndexing bool `env:"FORCE_INDEXING" short:"f" default:"false" name:"force-indexing" help:"Force indexing already indexed documents"`
// SmtpServer points to the address of the send mail server
SmtpServer string `env:"SMTP_SERVER" name:"smtp-server" help:"Address of the send mail server"`
// SmtpPort defines the port in which the mail server listens for requests
SmtpPort int `env:"SMTP_PORT" default:"587" name:"smtp-port" help:"Port in which the mail server listens for requests"`
// SmtpUser holds the user to authenticate against the SMTP server
SmtpUser string `env:"SMTP_USER" name:"smtp-user" help:"User to authenticate against the SMTP server"`
// SmtpUser holds the password to authenticate against the SMTP server
SmtpPassword string `env:"SMTP_PASSWORD" name:"smtp-password" help:"Password to authenticate against the SMTP server"`
// JwtSecret stores the string to use to sign JWTs
JwtSecret string `env:"JWT_SECRET" short:"s" name:"jwt-secret" help:"String to use to sign JWTs"`
// RequireAuth is a switch to enable the application to require authentication to access any route if true
RequireAuth bool `env:"REQUIRE_AUTH" short:"a" default:"false" name:"require-auth" help:"Require authentication to access any route"`
// MinPasswordLength is the minimum length acceptable for passwords
MinPasswordLength int `env:"MIN_PASSWORD_LENGTH" default:"5" name:"min-password-length" help:"Minimum length acceptable for passwords"`
// WordsPerMinute defines a default words per minute reading speed that will be used for not logged-in users
WordsPerMinute float64 `env:"WORDS_PER_MINUTE" default:"250" name:"words-per-minute" help:"Default words per minute reading speed that will be used for not logged-in users"`
// SessionTimeout specifies the maximum time a user session may last in hours
SessionTimeout float64 `env:"SESSION_TIMEOUT" default:"24" name:"session-timeout" help:"Maximum time a user session may last in hours"`
// RecoveryTimeout specifies the maximum time a user recovery link may last in hours
RecoveryTimeout float64 `env:"RECOVERY_TIMEOUT" default:"2" name:"recovery-timeout" help:"Maximum time a user recovery link may last in hours"`
// InvitationTimeout specifies the maximum time a user invitation link may last in hours
InvitationTimeout float64 `env:"INVITATION_TIMEOUT" default:"72" name:"invitation-timeout" help:"Maximum time a user invitation link may last in hours"`
// UploadDocumentMaxSize is the maximum document size allowed to be uploaded to the library, in megabytes.
// Set this to 0 to unlimit upload size. Defaults to 20 megabytes.
UploadDocumentMaxSize int `env:"UPLOAD_DOCUMENT_MAX_SIZE" short:"u" default:"20" name:"upload-document-max-size" help:"Maximum document size allowed to be uploaded to the library, in megabytes. Set this to 0 to unlimit upload size."`
// ClientStaticCacheTTL defines the cache duration for static assets (CSS, JS, images) in seconds. Defaults to 1 year.
ClientStaticCacheTTL int `env:"CLIENT_STATIC_CACHE_TTL" default:"31536000" name:"client-static-cache-ttl" help:"Client-side cache duration for static assets (CSS, JS, images) in seconds. Defaults to 1 year (31536000 seconds)."`
// ClientDynamicImageCacheTTL defines the cache duration for dynamically generated images (covers, author images) in seconds. Defaults to 24 hours.
ClientDynamicImageCacheTTL int `env:"CLIENT_DYNAMIC_IMAGE_CACHE_TTL" default:"86400" name:"client-dynamic-image-cache-ttl" help:"Client-side cache duration for dynamically generated images (covers, author images) in seconds. Defaults to 24 hours (86400 seconds)."`
// ServerStaticCacheTTL defines the server-side cache duration for static assets (CSS, JS, images) in seconds. Defaults to 1 year.
ServerStaticCacheTTL int `env:"SERVER_STATIC_CACHE_TTL" default:"31536000" name:"server-static-cache-ttl" help:"Server-side cache duration for static assets (CSS, JS, images) in seconds. Defaults to 1 year (31536000 seconds)."`
// ServerDynamicImageCacheTTL defines the server-side cache duration for dynamically generated images (covers, author images) in seconds. Defaults to 24 hours.
ServerDynamicImageCacheTTL int `env:"SERVER_DYNAMIC_IMAGE_CACHE_TTL" default:"86400" name:"server-dynamic-image-cache-ttl" help:"Server-side cache duration for dynamically generated images (covers, author images) in seconds. Defaults to 24 hours (86400 seconds)."`
// ShareCommentMaxSize defines the maximum length for share comments in characters. Defaults to 280.
ShareCommentMaxSize int `env:"SHARE_COMMENT_MAX_SIZE" short:"m" default:"280" name:"share-comment-max-size" help:"Maximum length for share comments in characters. Defaults to 280."`
// ShareMaxRecipients defines the maximum number of recipients allowed when sharing a document. Defaults to 10.
ShareMaxRecipients int `env:"SHARE_MAX_RECIPIENTS" default:"10" name:"share-max-recipients" help:"Maximum number of recipients allowed when sharing a document. Defaults to 10."`
// InviteEmailListMaxLength is the maximum length (in bytes) of the comma-separated invite email field. Defaults to 2000.
InviteEmailListMaxLength int `env:"INVITE_EMAIL_LIST_MAX_LENGTH" default:"2000" name:"invite-email-list-max-length" help:"Maximum length in bytes of the invitation email list field. Defaults to 2000."`
// InviteMaxRecipients is the maximum number of distinct addresses per invitation submit. Defaults to 50.
InviteMaxRecipients int `env:"INVITE_MAX_RECIPIENTS" default:"50" name:"invite-max-recipients" help:"Maximum number of distinct email addresses per invitation form submit. Defaults to 50."`
}