mirror of
https://github.com/samsonjs/agate.git
synced 2026-03-25 09:05:50 +00:00
adjust configuration format info
also corrected some spelling mistakes
This commit is contained in:
parent
544f577b59
commit
e91c99ddab
1 changed files with 8 additions and 5 deletions
13
README.md
13
README.md
|
|
@ -48,7 +48,7 @@ agate --content path/to/content/ \
|
|||
|
||||
All of the command-line arguments are optional. Run `agate --help` to see the default values used when arguments are omitted.
|
||||
|
||||
When a client requests the URL `gemini://example.com/foo/bar`, Agate will respond with the file at `path/to/content/foo/bar`. If any segment of the requested path starts with a dot, agate will respond with a status code 52, wether the file exists or not (this behaviour can be disabled with `--serve-secret`). If there is a directory at that path, Agate will look for a file named `index.gmi` inside that directory.
|
||||
When a client requests the URL `gemini://example.com/foo/bar`, Agate will respond with the file at `path/to/content/foo/bar`. If any segment of the requested path starts with a dot, agate will respond with a status code 52, whether the file exists or not (this behaviour can be disabled with `--serve-secret`). If there is a directory at that path, Agate will look for a file named `index.gmi` inside that directory.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
|
@ -58,15 +58,16 @@ Agate by default supports TLSv1.2 and TLSv1.3. You can disable support for TLSv1
|
|||
|
||||
### Directory listing
|
||||
|
||||
You can enable a basic directory listing for a directory by putting a file called `.directory-listing-ok` in that directory. This does not have an effect on subdirectories.
|
||||
You can enable a basic directory listing for a directory by putting a file called `.directory-listing-ok` in that directory. This does not have an effect on sub-directories.
|
||||
The directory listing will hide files and directories whose name starts with a dot (e.g. the `.directory-listing-ok` file itself or also the `.meta` configuration file).
|
||||
|
||||
A file called `index.gmi` will always take precedence over a directory listing.
|
||||
|
||||
### Meta-Presets
|
||||
|
||||
You can put a file called `.meta` in a directory that stores some metadata about these files which Agate will use when serving these files. The file should be UTF-8 encoded. Like the `.directory-listing-ok` file, this file does not have an effect on subdirectories.
|
||||
Lines starting with a `#` are comments and will be ignored like empty lines. All other lines must start with a file name (not a path), followed by a colon and then the metadata.
|
||||
You can put a file called `.meta` in a directory. This file stores some metadata about these files which Agate will use when serving these files. The file should be UTF-8 encoded. Like the `.directory-listing-ok` file, this file does not have an effect on sub-directories. (*1)
|
||||
This file is parsed as a YAML file and should contain a "hash" datatype with file names as the keys. This means:
|
||||
Lines starting with a `#` are comments and will be ignored like empty lines. All other lines must start with a file name, followed by a colon and then the metadata.
|
||||
|
||||
The metadata can take one of four possible forms:
|
||||
1. empty
|
||||
|
|
@ -74,7 +75,7 @@ The metadata can take one of four possible forms:
|
|||
2. starting with a semicolon followed by MIME parameters
|
||||
Agate will append the specified string onto the MIME type, if the file is found.
|
||||
3. starting with a gemini status code (i.e. a digit 1-6 inclusive followed by another digit) and a space
|
||||
Agate will send the metadata wether the file exists or not. The file will not be sent or accessed.
|
||||
Agate will send the metadata whether the file exists or not. The file will not be sent or accessed.
|
||||
4. a MIME type, may include parameters
|
||||
Agate will use this MIME type instead of what it would guess, if the file is found.
|
||||
The default language parameter will not be used, even if it was specified on the command line.
|
||||
|
|
@ -89,6 +90,8 @@ LICENSE:text/plain;charset=UTF-8
|
|||
gone.gmi:52 This file is no longer here, sorry.
|
||||
```
|
||||
|
||||
(*1) It is *theoretically* possible to specify information on files which are in sub-directories. The problem would only be to make sure that this file is loaded before the respective path/file is requested. This is because Agate does not actively check that the "no sub-directories" regulation is met. In fact this might be dropped in a change of configuration format in the foreseeable future.
|
||||
|
||||
### Logging Verbosity
|
||||
|
||||
Agate uses the `env_logger` crate and allows you to set the logging verbosity by setting the default `RUST_LOG` environment variable. For more information, please see the [documentation of `env_logger`].
|
||||
|
|
|
|||
Loading…
Reference in a new issue