Miniflux.conf配置参数
Miniflux can use a configuration file and environment variables.
The configuration file is loaded first if specified. Environment
variables takes precedence over the options defined in the configuration
file.
[[Configuration
Options]{.ul}](https://miniflux.app/docs/configuration.html#options)
[[Configuration
File]{.ul}](https://miniflux.app/docs/configuration.html#config-file)
[[Database Connection
Parameters]{.ul}](https://miniflux.app/docs/configuration.html#dsn)
Configuration Options
Toggle debug mode (increase log level).
Disabled by default.
Set the value to 1 to scrape video duration from YouTube website and
use it as a reading time.
Disabled by default.
Show date and time in log messages.
Disabled by default.
Number of background workers to refresh feeds.
Default is 5 workers.
Refresh interval in minutes for feeds.
Default is 60 minutes.
The maximum number of parsing errors that the program will try before
stopping polling a feed. Once the limit is reached, the user must
refresh the feed manually. Set to 0 for unlimited.
Default is 3.
Number of feeds to send to the queue for each interval.
Default is 10 feeds.
Scheduler used for polling feeds. Possible values
are round_robin or entry_frequency.
The maximum number of feeds polled for a given period is subject
to POLLING_FREQUENCY and BATCH_SIZE.
When entry_frequency is selected, the refresh interval for a given
feed is equal to the average updating interval of the last week of the
feed. The actual number of feeds polled will not exceed the maximum
number of feeds that could be polled for a given period.
Default is round_robin.
SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL
Maximum interval in minutes for the entry frequency scheduler.
Default is 24 hours.
SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL
Minimum interval in minutes for the entry frequency scheduler.
Default is 5 minutes.
Postgresql connection parameters.
See [lib/pq]{.ul} for
more details.
Default is user=postgres password=postgres dbname=miniflux2
sslmode=disable
Maximum number of database connections.
Default is 20
Minimum number of database connections.
Default is 1
Address to listen on. Use absolute path for a Unix socket.
Default is 127.0.0.1:8080.
Override LISTEN_ADDR to 0.0.0.0:$PORT (Automatic configuration
for PaaS).
Default is empty.
Base URL to generate HTML links and base path for cookies.
Default is http://localhost/.
Cleanup job frequency to remove old sessions and archive entries.
Default is 24 hours.
Number of days after marking unread items as removed. Use -1 to
disable this feature.
Default is 180 days.
Number of days after which marking read items as removed. Use -1 to
disable this feature.
Default is 60 days.
Number of days after removing old user sessions from the database.
Default is 30 days.
Forces cookies to use secure flag. Send HSTS HTTP header. Enabled
automatically if the HTTP header X-Forwarded-Proto is set to https.
Default is empty.
Disable HTTP Strict Transport Security header if $HTTPS is set.
Default is empty.
Disable HTTP service.
Default is empty.
Disable scheduler service.
Default is empty.
Path to SSL certificate.
Default is empty.
Path to SSL private key.
Default is empty.
Use [Let’s Encrypt]{.ul} to get
automatically a certificate for the domain specified in $CERT_DOMAIN.
Default is empty.
Set to 1 to enable metrics collection. It exposes a /metrics endpoint
that can be used with [Prometheus Monitoring
software]{.ul}.
Disabled by default.
Refresh interval to collect database metrics.
Default is 60 seconds.
List of networks allowed to access the /metrics endpoint
(comma-separated values).
Default is 127.0.0.1/8.
OAuth2 provider. Possible values are google or oidc for a generic
OpenID Connect provider.
Default is empty.
OAuth2 client ID.
Default is empty.
Path to a client ID exposed as a file, it should
contain $OAUTH2_CLIENT_ID value.
Default is empty.
OAuth2 client secret.
Default is empty.
Path to a secret key exposed as a file, it should
contain $OAUTH2_CLIENT_SECRET value.
Default is empty.
OAuth2 redirect URL. This URL must be registered with the provider and
is something like https://miniflux.example.org/oauth2/oidc/callback
Default is empty.
OAUTH2_OIDC_DISCOVERY_ENDPOINT
OpenID Connect discovery endpoint.
Default is empty.
Set to 1 to authorize OAuth2 user creation.
Default is empty.
Set to 1 to run database migrations during application startup.
Default is empty.
Set to 1 to create an admin user from environment variables.
Default is empty.
Admin user login, it’s used only if CREATE_ADMIN is enabled.
Default is empty.
Path to a secret key exposed as a file, it should
contain $ADMIN_USERNAME value.
Default is empty.
Admin user password, it’s used only if CREATE_ADMIN is enabled.
Default is empty.
Path to a secret key exposed as a file, it should
contain $ADMIN_PASSWORD value.
Default is empty.
Pocket consumer API key for all users.
Default is empty.
Path to a secret key exposed as a file, it should
contain $POCKET_CONSUMER_KEY value.
Default is empty.
Avoids mixed content warnings for external images: http-only, all,
or none.
Default is http-only.
Time limit in seconds before the HTTP client cancel the request.
Default is 20 seconds.
Maximum body size for HTTP requests in Mebibyte (MiB).
Default is 15 MiB.
Proxy URL for the HTTP client. For example: http://127.0.0.1:8888.
This proxy is used only when the feed has the option “Fetch via
proxy” enabled.
If you prefer to have a proxy for all outgoing requests, use the
environment variables HTTP_PROXY or HTTPS_PROXY, look at the
official [Golang
documentation]{.ul} for
more details.
Default is empty.
The default User-Agent header to use for the HTTP client. Can be
overridden in per-feed settings. When empty, Miniflux uses a default
User-Agent that includes the Miniflux version.
Default is empty.
Proxy authentication HTTP header.
Default is empty.
Enable user creation based on proxy authentication information.
Default is empty.
Set to 1 to enable maintenance mode. Maintenance mode disables the web
ui and show a text message to the users.
Default is empty.
Define a custom maintenance message.
Default is empty.
Set the value to 1 to enable server-timing headers.
Default is empty.
Configuration File
The configuration file is optional. It’s a text file that follow these
rules:
Miniflux expects each line to be in KEY=VALUE format.
Lines beginning with # are processed as comments and ignored.
Blank lines are ignored.
There is no variable interpolation.
Keys are the same as the environment variables described above.
Example:
DEBUG=on
WORKER_POOL_SIZE=20
Environment variables override the values defined in the config file.
To specify a configuration file, use the command line
argument -config-file or -c.
You can also dump interpreted values with the flag -config-dump for
debugging.
Systemd uses the file /etc/miniflux.conf to populate environment
variables.
Database Connection Parameters
Miniflux uses the Golang
library [pq]{.ul} to communicate with
PostgreSQL. The list of connection parameters are available on [this
page]{.ul}.
The default value for DATABASE_URL is user=postgres password=postgres
dbname=miniflux2 sslmode=disable.
You could also use the URL
format postgres://postgres:postgres@localhost/miniflux2?sslmode=disable.
Password that contains special characters like ^ might be rejected
since Miniflux 2.0.3. [Golang v1.10 is now validating the
password]{.ul} and
will return this error: net/url: invalid userinfo. To avoid this
issue, do not use the URL format for DATABASE_URL or make sure the
password is URL encoded.
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!