- use python-on-whale to use docker cli api directly, creating docker stack for each crawl or profile browser - configure storages via storages.yaml secret - add crawl_job, profile_job, splitting into base and k8s/swarm implementations - split manager into base crawlmanager and k8s/swarm implementations - swarm: load initial scale from db to avoid modifying fixed configs, in k8s, load from configmap - swarm: support scheduled jobs via swarm-cronjob service - remove docker dependencies (aiodocker, apscheduler, scheduling) - swarm: when using local minio, expose via /data/ route in nginx via extra include (in k8s, include dir is empty and routing handled via ingress) - k8s: cleanup minio chart: move init containers to minio.yaml - swarm: stateful set implementation to be consistent with k8s scaling: - don't use service replicas, - create a unique service with '-N' appended and allocate unique volume for each replica - allows crawl containers to be restarted w/o losing data - add volume pruning background service, as volumes can be deleted only after service shuts down fully - watch: fully simplify routing, route via replica index instead of ip for both k8s and swarm - rename network btrix-cloud-net -> btrix-net to avoid conflict with compose network |
||
---|---|---|
.. | ||
assets | ||
src | ||
xliff | ||
.dockerignore | ||
.gitignore | ||
Dockerfile | ||
frontend.conf.template | ||
lit-localize.json | ||
locations.conf | ||
nginx.conf | ||
package.json | ||
postcss.config.js | ||
README.md | ||
sample.env.local | ||
tailwind.config.js | ||
tsconfig.json | ||
web-test-runner.config.mjs | ||
webpack.config.js | ||
webpack.dev.js | ||
webpack.prod.js | ||
yarn.lock |
Browsertrix Cloud frontend
Quickstart
Install dependencies:
yarn
Copy environment variables from the sample file:
cp sample.env.local .env.local
Update API_BASE_URL
in .env.local
to point to your dev backend API. For example:
API_BASE_URL=http://dev.example.com/api
Start the dev server:
yarn start
This will open localhost:9870
in a new tab in your default browser.
To develop against a local instance of the backend API,
follow instructions for deploying to a local Docker instance. Update API_BASE_URL
and then restart the dev server.
Scripts
yarn <name> |
|
---|---|
start |
runs app in development server, reloading on file changes |
test |
runs tests in chromium with playwright |
build-dev |
bundles app and outputs it in dist directory |
build |
bundles app, optimized for production, and outputs it to dist |
lint |
find and fix auto-fixable javascript errors |
format |
formats js, html and css files |
localize:extract |
generate XLIFF file to be translated |
localize:build |
output a localized version of strings/templates |
Testing
Tests assertions are written in Chai.
To watch for file changes while running tests:
yarn test --watch
To run tests in multiple browsers:
yarn test --browsers chromium firefox webkit
Localization
Wrap text or templates in the msg
helper to make them localizable:
// import from @lit/localize:
import { msg } from "@lit/localize";
// later, in the render function:
render() {
return html`
<button>
${msg("Click me")}
</button>
`
}
Entire templates can be wrapped as well:
render() {
return msg(html`
<p>Click the button</p>
<button>Click me</button>
`)
}
See: https://lit.dev/docs/localization/overview/#message-types
To add new languages:
- Add BCP 47 language tag to
targetLocales
inlit-localize.json
- Run
yarn localize:extract
to generate new .xlf file in/xliff
- Provide .xlf file to translation team
- Replace .xlf file once translated
- Run
yarn localize:build
bring translation intosrc
See: https://lit.dev/docs/localization/overview/#extracting-messages