Add auto-backup settings

This commit is contained in:
Syer10
2025-10-14 19:30:54 -04:00
parent e5abfdad21
commit b922510cca
3 changed files with 87 additions and 66 deletions

View File

@@ -150,6 +150,13 @@ jobs:
-e BACKUP_TIME=13:37 \ -e BACKUP_TIME=13:37 \
-e BACKUP_INTERVAL=2 \ -e BACKUP_INTERVAL=2 \
-e BACKUP_TTL=31 \ -e BACKUP_TTL=31 \
-e AUTO_BACKUP_INCLUDE_MANGA=true \
-e AUTO_BACKUP_INCLUDE_CATEGORIES=false \
-e AUTO_BACKUP_INCLUDE_CHAPTERS=false \
-e AUTO_BACKUP_INCLUDE_TRACKING=false \
-e AUTO_BACKUP_INCLUDE_HISTORY=false \
-e AUTO_BACKUP_INCLUDE_CLIENT_DATA=false \
-e AUTO_BACKUP_INCLUDE_SERVER_SETTINGS=false \
-e FLARESOLVERR_ENABLED=true \ -e FLARESOLVERR_ENABLED=true \
-e FLARESOLVERR_URL=http://flaresolverr:8191 \ -e FLARESOLVERR_URL=http://flaresolverr:8191 \
-e FLARESOLVERR_TIMEOUT=30 \ -e FLARESOLVERR_TIMEOUT=30 \

139
README.md
View File

@@ -35,72 +35,79 @@ Use the template [docker-compose.yml](./docker-compose.yml) in this repo for cre
There are a number of environment variables available to configure Suwayomi: There are a number of environment variables available to configure Suwayomi:
| Variable | Server Default | Description | | Variable | Server Default | Description |
|:--------------------------------------:|:--------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| |:---------------------------------------:|:--------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| **TZ** | `Etc/UTC` | What time zone the container thinks it is. | | **TZ** | `Etc/UTC` | What time zone the container thinks it is. |
| **BIND_IP** | `0.0.0.0` | The interface to listen on, inside the container. You almost never want to change this. | | **BIND_IP** | `0.0.0.0` | The interface to listen on, inside the container. You almost never want to change this. |
| **BIND_PORT** | `4567` | Which port Suwayomi will listen on | | **BIND_PORT** | `4567` | Which port Suwayomi will listen on |
| **SOCKS_PROXY_ENABLED** | `false` | Whether Suwayomi will connect through a SOCKS5 proxy | | **SOCKS_PROXY_ENABLED** | `false` | Whether Suwayomi will connect through a SOCKS5 proxy |
| **SOCKS_PROXY_VERSION** | `5` | The version of the SOCKS proxy | | **SOCKS_PROXY_VERSION** | `5` | The version of the SOCKS proxy |
| **SOCKS_PROXY_HOST** | ` ` | The TCP host of the SOCKS proxy | | **SOCKS_PROXY_HOST** | ` ` | The TCP host of the SOCKS proxy |
| **SOCKS_PROXY_PORT** | ` ` | The port of the SOCKS proxy | | **SOCKS_PROXY_PORT** | ` ` | The port of the SOCKS proxy |
| **SOCKS_PROXY_USERNAME** | ` ` | The username to log in to the SOCKS proxy | | **SOCKS_PROXY_USERNAME** | ` ` | The username to log in to the SOCKS proxy |
| **SOCKS_PROXY_PASSWORD** | ` ` | The password to log in to the SOCKS proxy | | **SOCKS_PROXY_PASSWORD** | ` ` | The password to log in to the SOCKS proxy |
| **DOWNLOAD_AS_CBZ** | `false` | Whether Suwayomi should save the manga to disk in CBZ format | | **DOWNLOAD_AS_CBZ** | `false` | Whether Suwayomi should save the manga to disk in CBZ format |
| **AUTH_MODE** | `none` | Whether Suwayomi requires a login to get in. `none` or `basic_auth` or `simple_login` or `ui_login` | | **AUTH_MODE** | `none` | Whether Suwayomi requires a login to get in. `none` or `basic_auth` or `simple_login` or `ui_login` |
| **AUTH_USERNAME** | ` ` | The username to log in to Suwayomi | | **AUTH_USERNAME** | ` ` | The username to log in to Suwayomi |
| **AUTH_PASSWORD** | ` ` | The password to log in to Suwayomi | | **AUTH_PASSWORD** | ` ` | The password to log in to Suwayomi |
| **JWT_AUDIENCE** | `suwayomi-server-api` | The JWT Audience of the ui_login token | | **JWT_AUDIENCE** | `suwayomi-server-api` | The JWT Audience of the ui_login token |
| **JWT_TOKEN_EXPIRY** | `5m` | The JWT access token expiry timeout, in ISO-8601 Duration format | | **JWT_TOKEN_EXPIRY** | `5m` | The JWT access token expiry timeout, in ISO-8601 Duration format |
| **JWT_REFRESH_EXPIRY** | `60d` | The JWT refresh token expiry timeout, in ISO-8601 Duration format | | **JWT_REFRESH_EXPIRY** | `60d` | The JWT refresh token expiry timeout, in ISO-8601 Duration format |
| **DEBUG** | `false` | If extra logging is enabled. Useful for development and troubleshooting. | | **DEBUG** | `false` | If extra logging is enabled. Useful for development and troubleshooting. |
| **MAX_LOG_FILES** | `31` | The max number of days to keep files before they get deleted | | **MAX_LOG_FILES** | `31` | The max number of days to keep files before they get deleted |
| **MAX_LOG_FILE_SIZE** | `10mb` | The max size of a log file - Possible values: 1 (bytes), 1KB (kilobytes), 1MB (megabytes), 1GB (gigabytes) | | **MAX_LOG_FILE_SIZE** | `10mb` | The max size of a log file - Possible values: 1 (bytes), 1KB (kilobytes), 1MB (megabytes), 1GB (gigabytes) |
| **MAX_LOG_FOLDER_SIZE** | `100mb` | The max size of all saved log files - Possible values: 1 (bytes), 1KB (kilobytes), 1MB (megabytes), 1GB (gigabytes) | | **MAX_LOG_FOLDER_SIZE** | `100mb` | The max size of all saved log files - Possible values: 1 (bytes), 1KB (kilobytes), 1MB (megabytes), 1GB (gigabytes) |
| **WEB_UI_ENABLED** | `true` | If the server should serve a webUI | | **WEB_UI_ENABLED** | `true` | If the server should serve a webUI |
| **WEB_UI_FLAVOR** | `WebUI` | `WebUI` or `Custom` | | **WEB_UI_FLAVOR** | `WebUI` | `WebUI` or `Custom` |
| **WEB_UI_CHANNEL** | `stable` | "bundled" (the version bundled with the server release), "stable" or "preview" - the webUI version that should be used | | **WEB_UI_CHANNEL** | `stable` | "bundled" (the version bundled with the server release), "stable" or "preview" - the webUI version that should be used |
| **WEB_UI_UPDATE_INTERVAL** | `23` | Time in hours - 0 to disable auto update - range: 1 <= n < 24 - how often the server should check for webUI updates | | **WEB_UI_UPDATE_INTERVAL** | `23` | Time in hours - 0 to disable auto update - range: 1 <= n < 24 - how often the server should check for webUI updates |
| **AUTO_DOWNLOAD_CHAPTERS** | `false` | If new chapters that have been retrieved should get automatically downloaded | | **AUTO_DOWNLOAD_CHAPTERS** | `false` | If new chapters that have been retrieved should get automatically downloaded |
| **AUTO_DOWNLOAD_EXCLUDE_UNREAD** | `true` | Ignore automatic chapter downloads of entries with unread chapters | | **AUTO_DOWNLOAD_EXCLUDE_UNREAD** | `true` | Ignore automatic chapter downloads of entries with unread chapters |
| **AUTO_DOWNLOAD_NEW_CHAPTERS_LIMIT** | `0` | 0 to disable - how many unread downloaded chapters should be available - if the limit is reached, new chapters won't be downloaded automatically | | **AUTO_DOWNLOAD_NEW_CHAPTERS_LIMIT** | `0` | 0 to disable - how many unread downloaded chapters should be available - if the limit is reached, new chapters won't be downloaded automatically |
| **AUTO_DOWNLOAD_IGNORE_REUPLOADS** | `false` | Decides if re-uploads should be ignored during auto download of new chapters chapters | | **AUTO_DOWNLOAD_IGNORE_REUPLOADS** | `false` | Decides if re-uploads should be ignored during auto download of new chapters chapters |
| **DOWNLOAD_CONVERSIONS** | `{}` | Image download conversions, the format is `{ "image/filetype" = { target = "image/filetype" }, "image/filetype" = { target = "image/filetype", compressionLevel=0.6 } }`. You can also use `default` instead of `image/filetype` to add a default conversion handler. | | **DOWNLOAD_CONVERSIONS** | `{}` | Image download conversions, the format is `{ "image/filetype" = { target = "image/filetype" }, "image/filetype" = { target = "image/filetype", compressionLevel=0.6 } }`. You can also use `default` instead of `image/filetype` to add a default conversion handler. |
| **EXTENSION_REPOS** | `[]` | Any additional extension repos to use, the format is `["https://github.com/MY_ACCOUNT/MY_REPO/tree/repo", "https://github.com/MY_ACCOUNT_2/MY_REPO_2/"]` | | **EXTENSION_REPOS** | `[]` | Any additional extension repos to use, the format is `["https://github.com/MY_ACCOUNT/MY_REPO/tree/repo", "https://github.com/MY_ACCOUNT_2/MY_REPO_2/"]` |
| **MAX_SOURCES_IN_PARALLEL** | `6` | Range: 1 <= n <= 20 - Sets how many sources can do requests (updates, downloads) in parallel. Updates/Downloads are grouped by source and all mangas of a source are updated/downloaded synchronously | | **MAX_SOURCES_IN_PARALLEL** | `6` | Range: 1 <= n <= 20 - Sets how many sources can do requests (updates, downloads) in parallel. Updates/Downloads are grouped by source and all mangas of a source are updated/downloaded synchronously |
| **UPDATE_EXCLUDE_UNREAD** | `true` | If unread manga should be excluded from updates | | **UPDATE_EXCLUDE_UNREAD** | `true` | If unread manga should be excluded from updates |
| **UPDATE_EXCLUDE_STARTED** | `true` | If manga that haven't been started should be excluded from updates | | **UPDATE_EXCLUDE_STARTED** | `true` | If manga that haven't been started should be excluded from updates |
| **UPDATE_EXCLUDE_COMPLETED** | `true` | If completed manga should be excluded from updates | | **UPDATE_EXCLUDE_COMPLETED** | `true` | If completed manga should be excluded from updates |
| **UPDATE_INTERVAL** | `12` | Time in hours - 0 to disable it - (doesn't have to be full hours e.g. 12.5) - range: 6 <= n < ∞ - Interval in which the global update will be automatically triggered | | **UPDATE_INTERVAL** | `12` | Time in hours - 0 to disable it - (doesn't have to be full hours e.g. 12.5) - range: 6 <= n < ∞ - Interval in which the global update will be automatically triggered |
| **UPDATE_MANGA_INFO** | `false` | If manga info should be updated along with the chapters | | **UPDATE_MANGA_INFO** | `false` | If manga info should be updated along with the chapters |
| **BACKUP_TIME** | `00:00` | Range: hour: 0-23, minute: 0-59 - Time of day at which the automated backup should be triggered | | **BACKUP_TIME** | `00:00` | Range: hour: 0-23, minute: 0-59 - Time of day at which the automated backup should be triggered |
| **BACKUP_INTERVAL** | `1` | Time in days - 0 to disable it - range: 1 <= n < ∞ - Interval in which the server will automatically create a backup | | **BACKUP_INTERVAL** | `1` | Time in days - 0 to disable it - range: 1 <= n < ∞ - Interval in which the server will automatically create a backup |
| **BACKUP_TTL** | `14` | Time in days - 0 to disable it - range: 1 <= n < ∞ - How long backup files will be kept before they will get deleted | | **BACKUP_TTL** | `14` | Time in days - 0 to disable it - range: 1 <= n < ∞ - How long backup files will be kept before they will get deleted |
| **FLARESOLVERR_ENABLED** | `false` | Whether FlareSolverr is enabled and available to use | | **AUTO_BACKUP_INCLUDE_MANGA** | `true` | If the auto-backup should include manga |
| **FLARESOLVERR_URL** | `http://localhost:8191` | The URL of the FlareSolverr instance | | **AUTO_BACKUP_INCLUDE_CATEGORIES** | `true` | If the auto-backup should include categories |
| **FLARESOLVERR_TIMEOUT** | `60` | Time in seconds for FlareSolverr to timeout if the challenge is not solved | | **AUTO_BACKUP_INCLUDE_CHAPTERS** | `true` | If the auto-backup should include chapters |
| **FLARESOLVERR_SESSION_NAME** | `suwayomi` | The name of the session that Suwayomi will use with FlareSolverr | | **AUTO_BACKUP_INCLUDE_TRACKING** | `true` | If the auto-backup should include tracking |
| **FLARESOLVERR_SESSION_TTL** | `15` | The time to live for the FlareSolverr session | | **AUTO_BACKUP_INCLUDE_HISTORY** | `true` | If the auto-backup should include history |
| **FLARESOLVERR_RESPONSE_AS_FALLBACK** | `false` | Use the response from FlareSolverr if Suwayomi does not succeed | | **AUTO_BACKUP_INCLUDE_CLIENT_DATA** | `true` | If the auto-backup should include client data |
| **OPDS_USE_BINARY_FILE_SIZES** | `false` | If the file sizes should be displayed in binary (KiB, MiB, GiB) or decimal (KB, MB, GB) | | **AUTO_BACKUP_INCLUDE_SERVER_SETTINGS** | `true` | If the auto-backup should include server settings |
| **OPDS_ITEMS_PER_PAGE** | `50` | How many items to show on a page - 10 <= n < 5000 | | **FLARESOLVERR_ENABLED** | `false` | Whether FlareSolverr is enabled and available to use |
| **OPDS_ENABLE_PAGE_READ_PROGRESS** | `true` | Track and update your reading progress by page for each chapter during page streaming | | **FLARESOLVERR_URL** | `http://localhost:8191` | The URL of the FlareSolverr instance |
| **OPDS_MARK_AS_READ_ON_DOWNLOAD** | `false` | Automatically mark chapters as read when you download them | | **FLARESOLVERR_TIMEOUT** | `60` | Time in seconds for FlareSolverr to timeout if the challenge is not solved |
| **OPDS_SHOW_ONLY_UNREAD_CHAPTERS** | `false` | Filter manga feed to display only chapters you haven't read | | **FLARESOLVERR_SESSION_NAME** | `suwayomi` | The name of the session that Suwayomi will use with FlareSolverr |
| **OPDS_SHOW_ONLY_DOWNLOADED_CHAPTERS** | `false` | Filter manga feed to display only chapters you have downloaded | | **FLARESOLVERR_SESSION_TTL** | `15` | The time to live for the FlareSolverr session |
| **OPDS_CHAPTER_SORT_ORDER** | `DESC` | `DESC` or `ASC` | | **FLARESOLVERR_RESPONSE_AS_FALLBACK** | `false` | Use the response from FlareSolverr if Suwayomi does not succeed |
| **KOREADER_SYNC_SERVER_URL** | `http://localhost:17200` | The URL of the KOReader Sync server | | **OPDS_USE_BINARY_FILE_SIZES** | `false` | If the file sizes should be displayed in binary (KiB, MiB, GiB) or decimal (KB, MB, GB) |
| **KOREADER_SYNC_USERNAME** | ` ` | KOReader Sync UserName | | **OPDS_ITEMS_PER_PAGE** | `50` | How many items to show on a page - 10 <= n < 5000 |
| **KOREADER_SYNC_USERKEY** | ` ` | KOReader Sync UserKey | | **OPDS_ENABLE_PAGE_READ_PROGRESS** | `true` | Track and update your reading progress by page for each chapter during page streaming |
| **KOREADER_SYNC_DEVICE_ID** | ` ` | The Device-ID for KOReader | | **OPDS_MARK_AS_READ_ON_DOWNLOAD** | `false` | Automatically mark chapters as read when you download them |
| **KOREADER_SYNC_CHECKSUM_METHOD** | `binary` | `binary` or `filename` | | **OPDS_SHOW_ONLY_UNREAD_CHAPTERS** | `false` | Filter manga feed to display only chapters you haven't read |
| **KOREADER_SYNC_PERCENTAGE_TOLERANCE** | `0.00000000000001` | Absolute tolerance for progress comparison from 1 (widest) to 1e-15 (strict) | | **OPDS_SHOW_ONLY_DOWNLOADED_CHAPTERS** | `false` | Filter manga feed to display only chapters you have downloaded |
| **KOREADER_SYNC_STRATEGY_FORWARD** | `prompt` | `prompt`, `keep_local`, `keep_remote`, `disabled` | | **OPDS_CHAPTER_SORT_ORDER** | `DESC` | `DESC` or `ASC` |
| **KOREADER_SYNC_STRATEGY_BACKWARD** | `disabled` | `prompt`, `keep_local`, `keep_remote`, `disabled` | | **KOREADER_SYNC_SERVER_URL** | `http://localhost:17200` | The URL of the KOReader Sync server |
| **DATABASE_TYPE** | `H2` | `H2` or `POSTGRESQL` | | **KOREADER_SYNC_USERNAME** | ` ` | KOReader Sync UserName |
| **DATABASE_URL** | `postgresql://localhost:5432/suwayomi` | The URL of the database, only used for non-h2 database | | **KOREADER_SYNC_USERKEY** | ` ` | KOReader Sync UserKey |
| **DATABASE_USERNAME** | ` ` | Database username, only used for non-h2 database | | **KOREADER_SYNC_DEVICE_ID** | ` ` | The Device-ID for KOReader |
| **DATABASE_PASSWORD** | ` ` | Database password, only used for non-h2 database | | **KOREADER_SYNC_CHECKSUM_METHOD** | `binary` | `binary` or `filename` |
| **KOREADER_SYNC_PERCENTAGE_TOLERANCE** | `0.00000000000001` | Absolute tolerance for progress comparison from 1 (widest) to 1e-15 (strict) |
| **KOREADER_SYNC_STRATEGY_FORWARD** | `prompt` | `prompt`, `keep_local`, `keep_remote`, `disabled` |
| **KOREADER_SYNC_STRATEGY_BACKWARD** | `disabled` | `prompt`, `keep_local`, `keep_remote`, `disabled` |
| **DATABASE_TYPE** | `H2` | `H2` or `POSTGRESQL` |
| **DATABASE_URL** | `postgresql://localhost:5432/suwayomi` | The URL of the database, only used for non-h2 database |
| **DATABASE_USERNAME** | ` ` | Database username, only used for non-h2 database |
| **DATABASE_PASSWORD** | ` ` | Database password, only used for non-h2 database |
> [!CAUTION] > [!CAUTION]

View File

@@ -90,6 +90,13 @@ sed -i -r "s/server.maxLogFolderSize = \"(.*?)\"( #)?/server.maxLogFolderSize =
sed -i -r "s/server.backupTime = \"(.*?)\"( #)?/server.backupTime = \"${BACKUP_TIME:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf sed -i -r "s/server.backupTime = \"(.*?)\"( #)?/server.backupTime = \"${BACKUP_TIME:-\1}\" #/" /home/suwayomi/.local/share/Tachidesk/server.conf
sed -i -r "s/server.backupInterval = ([0-9]+|[a-zA-Z]+)( #)?/server.backupInterval = ${BACKUP_INTERVAL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf sed -i -r "s/server.backupInterval = ([0-9]+|[a-zA-Z]+)( #)?/server.backupInterval = ${BACKUP_INTERVAL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
sed -i -r "s/server.backupTTL = ([0-9]+|[a-zA-Z]+)( #)?/server.backupTTL = ${BACKUP_TTL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf sed -i -r "s/server.backupTTL = ([0-9]+|[a-zA-Z]+)( #)?/server.backupTTL = ${BACKUP_TTL:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
sed -i -r "s/server.autoBackupIncludeManga = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeManga = ${AUTO_BACKUP_INCLUDE_MANGA:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
sed -i -r "s/server.autoBackupIncludeCategories = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeCategories = ${AUTO_BACKUP_INCLUDE_CATEGORIES:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
sed -i -r "s/server.autoBackupIncludeChapters = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeChapters = ${AUTO_BACKUP_INCLUDE_CHAPTERS:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
sed -i -r "s/server.autoBackupIncludeTracking = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeTracking = ${AUTO_BACKUP_INCLUDE_TRACKING:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
sed -i -r "s/server.autoBackupIncludeHistory = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeHistory = ${AUTO_BACKUP_INCLUDE_HISTORY:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
sed -i -r "s/server.autoBackupIncludeClientData = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeClientData = ${AUTO_BACKUP_INCLUDE_CLIENT_DATA:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
sed -i -r "s/server.autoBackupIncludeServerSettings = ([0-9]+|[a-zA-Z]+)( #)?/server.autoBackupIncludeServerSettings = ${AUTO_BACKUP_INCLUDE_SERVER_SETTINGS:-\1} #/" /home/suwayomi/.local/share/Tachidesk/server.conf
# cloudflare bypass # cloudflare bypass