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> |
||
---|---|---|
.github | ||
.vscode | ||
ansible | ||
assets | ||
backend | ||
chart | ||
configs | ||
frontend | ||
scripts | ||
test | ||
.gitattributes | ||
.gitignore | ||
.pre-commit-config.yaml | ||
btrix | ||
LICENSE | ||
NOTICE | ||
pylintrc | ||
README.md | ||
update-version.sh | ||
version.txt | ||
yarn.lock |
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.
License
Browsertrix is made available under the AGPLv3 License.
Documentation is made available under the Creative Commons Attribution 4.0 International License.