You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-27
Original file line number
Diff line number
Diff line change
@@ -59,13 +59,13 @@ Environment="LIB_PATH=<absolute path to the library>"
59
59
60
60
then, start the service with `service coreander start`. You can manage it with the usual commands `start`, `stop` and `status`. Refer to your service manager documentation for more information.
61
61
62
-
Coreander requires a `LIB_PATH` environment variable to be set, which tells the application where your documents are located.
62
+
Coreander requires the absolute path where your documents are located as an argument. You can also pass it through the `LIB_PATH` environment variable.
63
63
64
64
On first run, Coreander will index the documents in your library, creating a database with those entries located at `$home/coreander/index`. Depending on your system's performance and the size of your library this may take a while. Also, the database can grow fairly big, so make sure you have enough free space on disk.
65
65
66
-
Every time is run, the application scans the library folder only for documents not yet indexed and adds them to the index. You can force to index all documents wether they were previously indexed or not by setting the environment variable `FORCE_INDEXING` to `true`.
66
+
Every time is run, the application scans the library folder only for documents not yet indexed and adds them to the index. You can force to index all documents wether they were previously indexed or not by passing the `--force-indexing` flag or setting the environment variable `FORCE_INDEXING` to `true`.
67
67
68
-
Even if the application is still indexing entries, you can access its web interface right away. Just open a web browser and go to `localhost:3000` (replace `localhost` with the hostname / IP address of the machine where the server is running if you want to access it from another system). It is possible to change the listening port just executing the application with the `PORT` environment variable (e. g. `PORT=4000 coreander`)
68
+
Even if the application is still indexing entries, you can access its web interface right away. Just open a web browser and go to `localhost:3000` (replace `localhost` with the hostname / IP address of the machine where the server is running if you want to access it from another system). It is possible to change the listening port just executing the application with the `-p` or `--port` flags, or the `PORT` environment variable (e. g.`coreander -p 4000` or`PORT=4000 coreander`)
69
69
70
70
### Setting up an Internet-facing server
71
71
@@ -88,12 +88,14 @@ Some features rely on having an SMTP email service set up, and won't be availabl
88
88
* Send document to email.
89
89
* Recover user password.
90
90
91
-
You can use any email service that allow sending emails using the SMTP protocol, like [GMX](https://gmx.com/mail). The following environment variables need to be defined:
91
+
You can use any email service that allow sending emails using the SMTP protocol, like [GMX](https://gmx.com/mail). The following flags or environment variables need to be defined:
92
92
93
-
*`SMTP_SERVER`: The URL of the SMTP server to be used, for example `mail.gmx.com`.
94
-
*`SMTP_PORT`: The port number used by the email service, defaults to `587`.
95
-
*`SMTP_USER`: The user name.
96
-
*`SMTP_PASSWORD`: User's password.
93
+
|Flag|Environment variable|Description|
94
+
|----|--------------------|-----------|
95
+
|`--smtp-server`|`SMTP_SERVER`| The URL of the SMTP server to be used, for example `mail.gmx.com`.|
96
+
|`--smtp-port`|`SMTP_PORT`| The port number used by the email service, defaults to `587`. |
@@ -103,7 +105,7 @@ Coreander can send documents through email. This way, you can take advantage of
103
105
104
106
Coreander distinguish between two kinds of users: regular users and administrator users, with the latter being the only ones with the ability to create new users and upload and delete documents.
105
107
106
-
By default, Coreander allow unrestricted access to its contents, except management areas which require an administrator user. To allow access only to registered users in the whole application, pass the `REQUIRE_AUTH=true` environment variable.
108
+
By default, Coreander allow unrestricted access to its contents, except management areas which require an administrator user. To allow access only to registered users in the whole application, pass the `-a` or `--require-auth` flags, or the `REQUIRE_AUTH=true` environment variable.
107
109
108
110
On first run, Coreander creates an admin user with the following credentials:
109
111
@@ -114,23 +116,31 @@ On first run, Coreander creates an admin user with the following credentials:
114
116
115
117
### Settings
116
118
117
-
*`LIB_PATH`: Absolute path to the folder containing the documents.
118
-
*`PORT`: Port number in which the webserver listens for requests. Defaults to 3000.
119
-
*`BATCH_SIZE`: Number of documents persisted by the indexer in one write operation. Defaults to 100.
120
-
*`COVER_MAX_WIDTH`: Maximum horizontal size for documents cover thumbnails in pixels. Defaults to 600.
121
-
*`FORCE_INDEXING`: Whether to force indexing already indexed documents or not. Defaults to false.
122
-
*`SMTP_SERVER`: Address of the send mail server.
123
-
*`SMTP_PORT`: Port number of the send mail server. Defaults to 587.
124
-
*`SMTP_USER`: User to authenticate against the SMTP server.
125
-
*`SMTP_PASSWORD`: User's password to authenticate against the SMTP server.
126
-
*`JWT_SECRET`: String to use to sign JWTs.
127
-
*`REQUIRE_AUTH`: Require authentication to access the application if true. Defaults to false.
128
-
*`MIN_PASSWORD_LENGTH`: Minimum length acceptable for passwords. Defaults to 5.
129
-
*`WORDS_PER_MINUTE`: Defines a default words per minute reading speed that will be used for not logged-in users. Defaults to 250.
130
-
*`SESSION_TIMEOUT`: Specifies the maximum time a user session may last, in hours. Floating-point values are allowed. Defaults to 24 hours.
131
-
*`RECOVERY_TIMEOUT`: Specifies the maximum time a user recovery link may last, in hours. Floating-point values are allowed. Defaults to 2 hours.
132
-
*`UPLOAD_DOCUMENT_MAX_SIZE`: Maximum document size allowed to be uploaded to the library, in megabytes. Set this to 0 to unlimit upload size. Defaults to 20 megabytes.
133
-
*`FQDN`: Domain name of the server. If Coreander is listening to a non-standard HTTP / HTTPS port, include it using a colon (e. g. example.com:3000). Defaults to `localhost`.
119
+
Run `coreander -h` or `coreander --help` to see help.
120
+
121
+
In case both a flag and its equivalent environment variable are passed, flag takes precendence.
122
+
123
+
|Flag|Environment variable|Description|
124
+
|----|--------------------|-----------|
125
+
|`--lib-path` |`LIB_PATH` | Absolute path to the folder containing the documents.
126
+
|`-p` or `--port` |`PORT` | Port number in which the webserver listens for requests. Defaults to 3000.
127
+
|`-b` or `--batch-size` |`BATCH_SIZE` | Number of documents persisted by the indexer in one write operation. Defaults to 100.
128
+
|`--cover-max-width` |`COVER_MAX_WIDTH` | Maximum horizontal size for documents cover thumbnails in pixels. Defaults to 600.
129
+
|`-f` or `--force-indexing` |`FORCE_INDEXING` | Whether to force indexing already indexed documents or not. Defaults to false.
130
+
|`--smtp-server` |`SMTP_SERVER` | Address of the send mail server.
131
+
|`--smtp-port` |`SMTP_PORT` | Port number of the send mail server. Defaults to 587.
132
+
|`--smtp-user` |`SMTP_USER` | User to authenticate against the SMTP server.
133
+
|`--smtp-password` |`SMTP_PASSWORD` | User's password to authenticate against the SMTP server.
134
+
|`-s` or `--jwt-secret` |`JWT_SECRET` | String to use to sign JWTs.
135
+
|`-a` or `--require-auth` |`REQUIRE_AUTH` | Require authentication to access the application if true. Defaults to false.
136
+
|`--min-password-length` |`MIN_PASSWORD_LENGTH` | Minimum length acceptable for passwords. Defaults to 5.
137
+
|`--words-per-minute` |`WORDS_PER_MINUTE` | Defines a default words per minute reading speed that will be used for not logged-in users. Defaults to 250.
138
+
|`--session-timeout` |`SESSION_TIMEOUT` | Specifies the maximum time a user session may last, in hours. Floating-point values are allowed. Defaults to 24 hours.
139
+
|`--recovery-timeout` |`RECOVERY_TIMEOUT` | Specifies the maximum time a user recovery link may last, in hours. Floating-point values are allowed. Defaults to 2 hours.
140
+
|`-u` or `--upload-document-max-size` |`UPLOAD_DOCUMENT_MAX_SIZE`| Maximum document size allowed to be uploaded to the library, in megabytes. Set this to 0 to unlimit upload size. Defaults to 20 megabytes.
141
+
|`-d` or `--fqdn` |`FQDN` | Domain name of the server. If Coreander is listening to a non-standard HTTP / HTTPS port, include it using a colon (e. g. example.com:3000). Defaults to `localhost`.
142
+
|`-v` or `--version` | | Show version number.
143
+
134
144
135
145
## Screenshots
136
146
@@ -139,4 +149,4 @@ On first run, Coreander creates an admin user with the following credentials:
// CLIInput stores all configuration flags and arguments thant can be passed to the application
6
+
typeCLIInputstruct {
7
+
Version kong.VersionFlag`short:"v" name:"version" help:"Get version number."`
8
+
// LibPath holds the absolute path to the folder containing the documents
9
+
LibPathstring`arg:"" env:"LIB_PATH" help:"Absolute path to the folder containing the documents." type:"path"`
10
+
// 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)
11
+
FQDNstring`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)"`
12
+
// Port defines the port number in which the webserver listens for requests
13
+
Portint`env:"PORT" short:"p" default:"3000" help:"Port number in which the webserver listens for requests"`
14
+
// BatchSize indicates the number of documents persisted by the indexer in one operation
15
+
BatchSizeint`env:"BATCH_SIZE" short:"b" default:"100" name:"batch-size" help:"Number of documents persisted by the indexer in one operation"`
16
+
// CoverMaxWidth sets the maximum horizontal size for documents cover thumbnails in pixels
17
+
CoverMaxWidthint`env:"COVER_MAX_WIDTH" default:"600" name:"cover-max-width" help:"Maximum horizontal size for documents cover thumbnails in pixels"`
18
+
// ForceIndexing signals whether to force indexing already indexed documents or not
// SmtpServer points to the address of the send mail server
21
+
SmtpServerstring`env:"SMTP_SERVER" name:"smtp-server" help:"Address of the send mail server"`
22
+
// SmtpPort defines the port in which the mail server listens for requests
23
+
SmtpPortint`env:"SMTP_PORT" default:"587" name:"smtp-port" help:"Port in which the mail server listens for requests"`
24
+
// SmtpUser holds the user to authenticate against the SMTP server
25
+
SmtpUserstring`env:"SMTP_USER" name:"smtp-user" help:"User to authenticate against the SMTP server"`
26
+
// SmtpUser holds the password to authenticate against the SMTP server
27
+
SmtpPasswordstring`env:"SMTP_PASSWORD" name:"smtp-password" help:"Password to authenticate against the SMTP server"`
28
+
// JwtSecret stores the string to use to sign JWTs
29
+
JwtSecretstring`env:"JWT_SECRET" short:"s" name:"jwt-secret" help:"String to use to sign JWTs"`
30
+
// RequireAuth is a switch to enable the application to require authentication to access any route if true
31
+
RequireAuthbool`env:"REQUIRE_AUTH" short:"a" default:"false" name:"require-auth" help:"Require authentication to access any route"`
32
+
// MinPasswordLength is the minimum length acceptable for passwords
33
+
MinPasswordLengthint`env:"MIN_PASSWORD_LENGTH" default:"5" name:"min-password-length" help:"Minimum length acceptable for passwords"`
34
+
// WordsPerMinute defines a default words per minute reading speed that will be used for not logged-in users
35
+
WordsPerMinutefloat64`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"`
36
+
// SessionTimeout specifies the maximum time a user session may last in hours
37
+
SessionTimeoutfloat64`env:"SESSION_TIMEOUT" default:"24" name:"session-timeout" help:"Maximum time a user session may last in hours"`
38
+
// RecoveryTimeout specifies the maximum time a user recovery link may last in hours
39
+
RecoveryTimeoutfloat64`env:"RECOVERY_TIMEOUT" default:"2" name:"recovery-timeout" help:"Maximum time a user recovery link may last in hours"`
40
+
// UploadDocumentMaxSize is the maximum document size allowed to be uploaded to the library, in megabytes.
41
+
// Set this to 0 to unlimit upload size. Defaults to 20 megabytes.
42
+
UploadDocumentMaxSizeint`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."`
0 commit comments