1
0
Fork 0
mirror of https://codeberg.org/Reuh/feather.git synced 2025-10-27 18:19:32 +00:00

docs: add environment variables names to defautl config

This commit is contained in:
Étienne Fildadut 2025-10-09 16:59:22 +02:00
parent 2ce0861c6a
commit ffdb8a98b9
2 changed files with 14 additions and 3 deletions

View file

@ -1,22 +1,29 @@
[server] [server]
# (Required) URL of your server's Google Reader API endpoint # (Required) URL of your server's Google Reader API endpoint
# Can be set through the environment variable SERVER_URL.
url = "https://rss.example.com/" url = "https://rss.example.com/"
# (Required) Username/email-adress used to connect to the server # (Required) Username/email-adress used to connect to the server
# Can be set through the environment variable SERVER_USER.
user = "username" user = "username"
# (Required) Password/API password used to connect to the server # (Required) Password/API password used to connect to the server
# Can be set through the environment variable SERVER_PASSWORD.
password = "password" password = "password"
# How many items to retrieve at most from the server in a single request. Lower values will make synchronization slower, higher values might make the server complain. # How many items to retrieve at most from the server in a single request. Lower values will make synchronization slower, higher values might make the server complain.
# Most servers are supposedly okay with up to 1000, but tt-rss complained so I dropped it to 500 here. # Most servers are supposedly okay with up to 1000, but tt-rss complained so I dropped it to 500 here.
# Can be set through the environment variable SERVER_ITEMS_PER_REQUEST.
items_per_request = 500 items_per_request = 500
[directories] [directories]
# Directory path where the internal feather data will be stored. # Directory path where the internal feather data will be stored.
# Can be set through the environment variable DIRECTORIES_DATA.
data = "data" data = "data"
# Directory path where the user-facing files will be stored. # Directory path where the user-facing files will be stored.
# Can be set through the environment variable DIRECTORIES_READER.
reader = "reader" reader = "reader"
[html] [html]
# HTML template used for generating item HTML files. All templates are Jinja2 templates. # HTML template used for generating item HTML files. All templates are Jinja2 templates.
# Can be set through the environment variable HTML_TEMPLATE.
template = ''' template = '''
<!doctype html> <!doctype html>
<html lang="en-US"> <html lang="en-US">
@ -41,15 +48,19 @@ template = '''
</html> </html>
''' '''
# Filename template for generated HTML files. # Filename template for generated HTML files.
# Can be set through the environment variable HTML_FILENAME_TEMPLATE.
filename_template = "{{ published_formatted }}\t[{{ origin_title }}]\t{{ title }}.html" filename_template = "{{ published_formatted }}\t[{{ origin_title }}]\t{{ title }}.html"
# Maximum allowed filename length (in bytes assuming UTF-8 encoding) before truncating. Depending on your filesystem filename's limits it may be possible to increase the value, ask Wikipedia for details. # Maximum allowed filename length (in bytes assuming UTF-8 encoding) before truncating. Depending on your filesystem filename's limits it may be possible to increase the value, ask Wikipedia for details.
# Can be set through the environment variable HTML_MAX_FILENAME_LENGTH.
max_filename_length = 250 max_filename_length = 250
# Table mapping characters to what they will be replaced with in filenames. Useful to remove/replace characters that are not allowed in filename by your filesystem. The default should be fine for most Unix filesystems. # Table mapping characters to what they will be replaced with in filenames. Useful to remove/replace characters that are not allowed in filename by your filesystem. The default should be fine for most Unix filesystems.
filename_replacement = { "/" = "", "\u0000" = "" } filename_replacement = { "/" = "", "\u0000" = "" }
[datetime] [datetime]
# Which timezone to use when writing date and time. # Which timezone to use when writing date and time.
# Can be set through the environment variable DATETIME_TIMEZONE.
timezone = "Etc/UTC" timezone = "Etc/UTC"
# How date and time are formatted. See https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior for the supported codes. # How date and time are formatted. See https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior for the supported codes.
# This will be used in filenames so it's a good idea to use something sortable... # This will be used in filenames so it's a good idea to use something sortable...
# Can be set through the environment variable DATETIME_FORMAT.
format = "%Y-%m-%d %H:%M" format = "%Y-%m-%d %H:%M"

View file

@ -44,10 +44,10 @@ class Config:
self.server_user: str = str(get_config("server", "user", False)) self.server_user: str = str(get_config("server", "user", False))
self.server_password: str = str(get_config("server", "password", False)) self.server_password: str = str(get_config("server", "password", False))
self.items_per_query: int = int(get_config("server", "items_per_request")) self.items_per_query: int = int(get_config("server", "items_per_request"))
self.timezone: ZoneInfo = ZoneInfo(get_config("datetime", "timezone")) self.timezone: ZoneInfo = ZoneInfo(str(get_config("datetime", "timezone")))
self.time_format: str = str(get_config("datetime", "format")) self.time_format: str = str(get_config("datetime", "format"))
self.item_template: Template = Template(get_config("html", "template"), autoescape=True) self.item_template: Template = Template(str(get_config("html", "template")), autoescape=True)
self.item_filename_template: Template = Template(get_config("html", "filename_template"), autoescape=False) self.item_filename_template: Template = Template(str(get_config("html", "filename_template")), autoescape=False)
self.max_filename_length: int = int(get_config("html", "max_filename_length")) self.max_filename_length: int = int(get_config("html", "max_filename_length"))
self.filename_translation = str.maketrans(get_config("html", "filename_replacement")) self.filename_translation = str.maketrans(get_config("html", "filename_replacement"))