Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The config file page (
docs/getting-started/configfile.md) had fallen outof date with the configuration Answer actually uses. This PR rewrites it to
match the current code, and documents every setting the config file
supports.
What was wrong
SQLite (
sqlite3, at/data/sqlite3/answer.db)./tmp/cache/cache.db. It is/data/cache/cache.db.debugdata.database.max_open_conn,max_idle_conn,conn_max_life_timeservice_config.clean_up_uploads,clean_orphan_uploads_period_hours,purge_deleted_files_period_daysui.api_base_url(
SITE_ADDR,SWAGGER_HOST,SWAGGER_ADDRESS_PORT) weren't mentioned.lives for a binary install.
What this PR does
configs/config.yaml.Optional settings that are not set by default (
debugand the threedatabase connection pool settings) are included but commented out, so
the example can be copied as-is.
server,data,i18n,swaggerui,service_config,ui), with a table giving each setting'sdefault and what it does.
runtime, with an example.
/data/conf/config.yaml) and forthe binary (the
confdirectory under the-Cdata directory), andthat Answer must be restarted after changes.
Coverage and sources
The page covers every setting in the config structure Answer reads
(
AllConfigininternal/base/conf/conf.goand the types it uses),plus the
uikeys read by the frontend build.Each description is based on the code that uses the setting, not on its
name. A few behaviors worth reviewers' attention, all taken from the code:
max_open_connis forced to1for SQLite (internal/base/data/data.go).The pool settings only take effect when greater than
0.clean_up_uploads: falsedisables both cleanup jobs(
internal/base/cron/cron.go).clean_orphan_uploads_period_hoursthey are moved to adeletedfolderinside
upload_path. Everypurge_deleted_files_period_days, that wholefolder is emptied (
PurgeDeletedFilesinfile_record_service.go). Sopurge_deleted_files_period_daysis a schedule, not a retention period.swaggerui.protocol,host, andaddressonly affect links shown inthe API documentation, not where Answer listens
(
internal/router/swagger_router.go).ui.api_base_urladds a prefix to all API routes on the server(
internal/base/server/http.go).ui.public_url,api_url, andbase_urlare written into the frontendat build time (
ui/scripts/env.js), so changing them requires a rebuild.api_urlis used as the base URL for the frontend's API requests(
ui/src/utils/request.ts).Only
docs/getting-started/configfile.mdis changed.