doc: added some config instructions
Massimo Melina committed
Oct 5, 2023 at 14:10 UTC
4d3cf9adeb21fc1ab3da3a92de31060a79dde37c
2 files changed
+39
-14
README.md
+2
-12
@@ -116,21 +116,11 @@ To update
116
117
## Console commands
118
119
-If you have access to HFS' console, you can enter commands. Start with `help` to have a full list.
119
+If you have full access to HFS' console, you can enter commands. Start with `help` to have a full list.
120
121
## Configuration
122
123
-Configuration can be done in several ways
124
-- accessing the Admin-panel with your browser
125
- - it will automatically open when you start HFS. Bookmark it. if your port is 8000 the address will be http://localhost:8000/~/admin
126
-- passing via command line at start in the form `--NAME VALUE`
127
-- using envs in the form `HFS_NAME` (eg: `HFS_PORT`)
128
-- directly editing the `config.yaml` file. As soon as you save it is reloaded and changes are applied
129
-- after HFS has started you can enter console command in the form `config NAME VALUE`
130
-
131
-`NAME` stands for the property name that you want to change. See the [complete list](config.md).
132
-
133
-You can specify a different `config.yaml` at command line with `--config PATH` or similarly with an env `HFS_CONFIG`.
123
+For configuration please see [file config.md](config.md).
124
125
### Where is it stored
126
config.md
+37
-2
@@ -4,9 +4,38 @@ This file contains details about the configuration files.
4
5
Configuration is stored in the file `config.yaml`, exception made for custom HTML which is stored in `custom.html`.
6
7
-These files are kept in the Current Working Directory (cwd), which is by default the same folder of `hfs.exe`
7
+These files are kept in the Current Working Directory (cwd), which is by default the same folder of `hfs.exe`.
8
if you are using this kind of distribution on Windows, or `USER_FOLDER/.hfs` on other systems.
9
-You can decide a different cwd passing `--cwd SOME_FOLDER` parameter at command line.
9
+Many things are stored in the CWD, like the plugins you install.
10
+You can decide a different CWD passing `--cwd SOME_FOLDER` parameter at command line.
11
+
12
+If you are not sure what your `cwd` is, look in the console, and you'll see that it is printed in one of the first lines.
13
+Here is an example, look at the 7th line:
14
+```
15
+HFS ~ HTTP File Server - Copyright 2021-2023, Massimo Melina <a@rejetto.com>
16
+License https://www.gnu.org/licenses/gpl-3.0.txt
17
+started 10/5/2023, 10:03:23 AM
18
+version 0.49.0
19
+build 2023-10-04T19:46:22.610Z
20
+pid 27302
21
+cwd /Users/rejetto/.hfs
22
+node v18.17.1
23
+config config.yaml
24
+```
25
+
26
+### How to modify configuration
27
+
28
+Configuration can be done in several ways
29
+- accessing the Admin-panel with your browser
30
+ - it will automatically open when you start HFS. Bookmark it. if your port is 8000 the address will be http://localhost:8000/~/admin
31
+- passing via command line at start in the form `--NAME VALUE`
32
+- using envs in the form `HFS_NAME` (eg: `HFS_PORT`)
33
+- directly editing the `config.yaml` file. As soon as you save it is reloaded and changes are applied
34
+ - if you don't want to use an editor, consider typing this command inside the folder where the config file is:
35
+ `echo "port: 1080" > config.yaml`. Be careful as it will overwrite the whole file.
36
+- after HFS has started you can enter console command in the form `config NAME VALUE`
37
+
38
+`NAME` stands for the property name that you want to change. See the complete list below.
39
40
### Configuration properties
41
- `port` where to accept http connections. Default is 80.
@@ -124,3 +153,9 @@ For each account entries, this is the list of properties you can have:
153
- `redirect` provide a URL if you want the user to be redirected upon login. Default is none.
154
- `admin` set `true` if you want to let this account log in to the Admin-panel. Default is `false`.
155
- `belongs` an array of usernames of other accounts from which to inherit their permissions. Default is none.
156
+
157
+### Specify another file
158
+
159
+Do you need to load a different config file, even from a different folder?
160
+Use this parameter at command line `--config PATH` or similarly with an env `HFS_CONFIG`.
161
+The path you specify can be either a folder, or full-path to the file.