Go to file
Tessa Walsh f7ba712646 Add seed file support to Browsertrix backend (#2710)
Fixes #2673 

Changes in this PR:

- Adds a new `file_uploads.py` module and corresponding `/files` API
prefix with methods/endpoints for uploading, GETing, and deleting seed
files (can be extended to other types of files moving forward)
- Seed files are supported via `CrawlConfig.config.seedFileId` on POST
and PATCH endpoints. This seedFileId is replaced by a presigned url when
passed to the crawler by the operator
- Seed files are read when first uploaded to calculate `firstSeed` and
`seedCount` and store them in the database, and this is copied into the
workflow and crawl documents when they are created.
- Logic is added to store `firstSeed` and `seedCount` for other
workflows as well, and a migration added to backfill data, to maintain
consistency and fix some of the pymongo aggregations that previously
assumed all workflows would have at least one `Seed` object in
`CrawlConfig.seeds`
- Seed file and thumbnail storage stats are added to org stats
- Seed file and thumbnail uploads first check that the org's storage
quota has not been exceeded and return a 400 if so
- A cron background job (run weekly each Sunday at midnight by default,
but configurable) is added to look for seed files at least x minutes old
(1440 minutes, or 1 day, by default, but configurable) that are not in
use in any workflows, and to delete them when they are found. The
backend pods will ensure this k8s batch job exists when starting up and
create it if it does not already exist. A database entry for each run of
the job is created in the operator on job completion so that it'll
appear in the `/jobs` API endpoints, but retrying of this type of
regularly scheduled background job is not supported as we don't want to
accidentally create multiple competing scheduled jobs.
- Adds a `min_seed_file_crawler_image` value to the Helm chart that is
checked before creating a crawl from a workflow if set. If a workflow
cannot be run, return the detail of the exception in
`CrawlConfigAddedResponse.errorDetail` so that we can display the reason
in the frontend
- Add SeedFile model from base UserFile (former ImageFIle), ensure all APIs
returning uploaded files return an absolute pre-signed URL (either with external origin or internal service origin)

---------
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
2025-07-22 19:11:02 -07:00
.github l18n: Manually fix translation files (#2759) 2025-07-22 14:19:28 -07:00
.vscode devex: Add Storybook for component development (#2556) 2025-04-21 13:06:31 -07:00
ansible Update ansible pipfile (#2088) 2024-09-20 11:41:21 -07:00
assets refactor: Implement brand colors (#2141) 2024-11-12 08:54:11 -08:00
backend Add seed file support to Browsertrix backend (#2710) 2025-07-22 19:11:02 -07:00
chart Add seed file support to Browsertrix backend (#2710) 2025-07-22 19:11:02 -07:00
configs Remove Code and Configs for Swarm/podman support (#407) 2022-12-08 18:19:58 -08:00
frontend Profiles: Make browser commit API call idempotent (#2728) 2025-07-22 17:59:49 -07:00
scripts Configure browsertrix proxies (#1847) 2024-10-02 18:35:45 -07:00
test fix(build): use /usr/bin/env bash instead of /bin/bash (#1020) 2023-07-28 21:50:04 -07:00
.gitattributes Add linguist-generated attribute to generated files (#2221) 2024-12-07 01:27:50 -05:00
.gitignore Make btrix helper work with microk8s (#768) 2023-04-18 08:50:46 -04:00
.pre-commit-config.yaml Add Repository Index + Chart Rename + Docs Rename (#1708) 2024-04-21 09:42:25 -07:00
btrix Add seed file support to Browsertrix backend (#2710) 2025-07-22 19:11:02 -07:00
LICENSE Add License, Logo and README updates for release (#157) 2022-02-23 12:10:46 -08:00
NOTICE Add Repository Index + Chart Rename + Docs Rename (#1708) 2024-04-21 09:42:25 -07:00
pylintrc misc tweaks: 2021-08-25 18:34:49 -07:00
README.md docs: Organize readme and fix doc links (#2479) 2025-03-11 18:37:20 -07:00
update-version.sh style change: remove spaces from python version docstring 2025-02-17 16:52:49 -08:00
version.txt version: bump to 1.17.4 2025-07-16 10:22:10 -07:00
yarn.lock docs: add public collections gallery howto (#2462) 2025-03-08 15:57:13 -08:00

Browsertrix

 

Browsertrix is a cloud-native, high-fidelity, browser-based crawling service designed to make web archiving easier and more accessible for everyone.

The service provides an API and UI for starting, scheduling, sharing, and managing crawls. This repo includes the orchestration and management tools around crawling, while the actual crawling is performed using browsertrix-crawler containers.

Install Browsertrix to self host, or access hosted Browsertrix from app.browsertrix.com.

See webrecorder.net/browsertrix for a full overview of features.

Documentation

Documentation for using, deploying, and developing Browsertrix is available at docs.browsertrix.com.

See instructions in frontend/docs to run the docs locally.

Installation

Instructions for setting up Browsertrix is available at docs.browsertrix.com/deploy.

The docs cover deploying Browsertrix in different environments using Kubernetes, from a single-node setup to scalable clusters in the cloud.

Support

Ask us your questions about Browsertrix and web archiving in the community help forum.

Dedicated professional support is available with a custom subscription. For details, see hosted Browsertrix plans.

Bugs

For bug reports or feature requests, please open a GitHub issue.

Changelog

See release notes.

Contributing

Developing

Guides for getting started with local development are available at docs.browsertrix.com/develop.

See Code of Conduct.

Translating

Translations are managed through Weblate, a web-based and open source translation tool. View translations in progress and register to contribute at our Weblate project.

Translation status

License

Browsertrix is made available under the AGPLv3 License.

Documentation is made available under the Creative Commons Attribution 4.0 International License.