-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.toml
More file actions
130 lines (117 loc) · 4.88 KB
/
config.example.toml
File metadata and controls
130 lines (117 loc) · 4.88 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# InkDrip Configuration
# Copy this file to config.toml and adjust as needed.
# All values shown are defaults.
[server]
# Address to bind the HTTP server.
host = "0.0.0.0"
port = 8080
# Public base URL used in feed links and image references.
# Set this to your actual server address when deployed.
base_url = "http://localhost:8080"
# API token for management endpoints. Leave empty to disable auth.
api_token = ""
# Whether feed/OPML/aggregate endpoints are publicly accessible.
# When false and api_token is set, these endpoints require authentication.
# Images and health checks are always public.
public_feeds = true
# Maximum upload size in bytes (default: 52428800 = 50 MiB).
max_upload_bytes = 52428800
[storage]
# Directory for database, uploaded books, and extracted images.
data_dir = "./data"
[defaults]
# Default values used when creating new feeds. These are snapshotted at feed
# creation time — changing them here will NOT affect existing feeds.
# To update an existing feed, use PATCH /api/feeds/:id or `inkdrip edit feed`.
# Default words to release per day for new feeds.
words_per_day = 3000
# Target word count per segment during splitting.
target_segment_words = 1500
# Maximum word count per segment (will try not to exceed).
max_segment_words = 2000
# Minimum word count per segment (avoids tiny trailing segments).
min_segment_words = 500
# Default daily delivery time (HH:MM, 24-hour format).
delivery_time = "08:00"
# Timezone for delivery time calculation.
# Supports: "UTC", "UTC+N", "Asia/Shanghai", "America/New_York", etc.
timezone = "Asia/Shanghai"
# Days of the week to skip releases on.
# Accepts an array of day names (full or abbreviated, case-insensitive).
# Available values: "monday" ("mon"), "tuesday" ("tue"), "wednesday" ("wed"),
# "thursday" ("thu"), "friday" ("fri"), "saturday" ("sat"), "sunday" ("sun")
# Example: skip_days = ["saturday", "sunday"] — skip weekends
skip_days = []
# Budget enforcement mode for scheduling.
# - "strict": Never exceed words_per_day (default). A segment is pushed to the
# next day if adding it would exceed the budget.
# - "flexible": Allow a segment if it brings the daily total closer to words_per_day,
# even if it slightly overshoots. Uses the same "closer-to-target"
# heuristic as the splitter.
budget_mode = "strict"
[parser.txt]
# Regex pattern for chapter separators.
chapter_separator = "^={3,}$"
# Paragraph separator.
paragraph_separator = "\n\n"
[watch]
# Enable automatic file watching and import.
enabled = false
# Directory to watch for new book files.
dir = "./books"
# Automatically create a feed when a new book is detected.
auto_create_feed = true
# How often to scan the directory (seconds).
scan_interval_secs = 300
[transforms]
# Show reading time and word count (e.g., "≈ 5 min · ~1,234 words").
reading_time = true
# Reading speed in words per minute for time estimation.
reading_speed = 300
# Append reading progress indicator (e.g., "[42% · 12/28]") to each segment.
reading_progress = true
# Custom CSS to inject into segment HTML content.
custom_css = ""
# External command hook system for advanced extensibility.
# Hooks run external commands at key pipeline stages, communicating via
# JSON on stdin/stdout. Disabled by default.
[hooks]
enabled = false
# Global timeout for all hook executions (seconds).
timeout_secs = 30
# Runs after book parsing, before splitting into segments.
# Input (stdin): {"hook":"post_book_parse","title":"...","author":"...","chapters":[...]}
# Output (stdout): {"chapters":[...]} or empty to keep original.
# [hooks.post_book_parse]
# enabled = true
# command = "python3 /opt/inkdrip/hooks/post-parse.py"
# Runs during feed serving, after all internal transforms.
# Input (stdin): {"hook":"segment_transform","segment_index":0,"content_html":"...","..."}
# Output (stdout): {"content_html":"..."} or empty to keep original.
# [hooks.segment_transform]
# enabled = true
# command = "python3 /opt/inkdrip/hooks/transform-segment.py"
# Runs when a segment is first released (future, not yet wired).
# [hooks.on_release]
# enabled = true
# command = "node /opt/inkdrip/hooks/notify-release.js"
[feed]
# Default feed format: "atom" or "rss".
format = "atom"
# Maximum number of items returned per feed request.
# Feeds always show the most recently released N segments to ensure
# the feed stays up-to-date even when total segments exceed this limit.
items_limit = 50
# Aggregate feeds combine multiple feeds into a single unified feed.
# Define aggregates here or manage them via the API.
#
# [[aggregates]]
# slug = "daily-reading"
# title = "Daily Reading"
# description = "All my book feeds combined"
# include_all = false # true = include all feeds automatically
# feeds = ["feed-slug-1", "feed-slug-2"]
[history]
# Maximum number of undo entries to keep. Older entries are pruned, and any
# associated soft-deleted resources are permanently removed.
stack_depth = 50