### Installing and Starting MkDocs Development Server (uvx) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Installs Material for MkDocs and mkdocs-redirects, then immediately starts the documentation development server using uvx. This command streamlines the setup and serves process into one step. ```sh uvx --with mkdocs-material --with mkdocs-redirects mkdocs serve ``` -------------------------------- ### Starting MkDocs Development Server (pipx) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Starts a local development server for the documentation using MkDocs when installed via pipx. This command enables viewing and testing documentation changes locally. ```sh mkdocs serve ``` -------------------------------- ### Running DigitalOcean Browsertrix Setup Playbook (zsh) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/digitalocean.md This snippet executes the `do_setup.yml` Ansible playbook to install Browsertrix on DigitalOcean. It requires specifying the project name, superuser email, and domain as extra variables. ```zsh ansible-playbook do_setup.yml -e project_name="your-project" -e superuser_email="you@yourdomain.com" -e domain="yourdomain.com" ``` -------------------------------- ### Cloning Browsertrix Repository (zsh) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/digitalocean.md This snippet clones the Browsertrix repository from GitHub and navigates into the newly created directory, which is the first step in setting up the project locally. ```zsh git clone https://github.com/webrecorder/browsertrix.git cd browsertrix ``` -------------------------------- ### Installing Browsertrix Directly from GitHub Release with MicroK8S Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md Performs a direct installation of Browsertrix from a GitHub release using Helm within a MicroK8S setup. This command is an alternative to using the Helm repository for MicroK8S users. ```sh microk8s helm3 upgrade --install btrix \ https://github.com/webrecorder/browsertrix/releases/download/VERSION/browsertrix-VERSION.tgz ``` -------------------------------- ### Copying Helm Local Configuration File (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This command copies the example local Helm configuration file to a new file named `local.yaml` within the `chart` directory. This ensures that local development changes are not accidentally committed to the version control system, providing a dedicated file for local overrides. ```sh cp ./chart/examples/local-config.yaml ./chart/local.yaml ``` -------------------------------- ### Installing Material for MkDocs (pip) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Installs the Material for MkDocs theme and its dependencies using pip, the Python package installer. This command is a prerequisite for running the documentation server locally. ```sh pip install mkdocs-material ``` -------------------------------- ### Verifying Yarn 1 Installation (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md This command verifies the installed Yarn version. A version starting with `1` (e.g., `1.22.22`) confirms Yarn 1 Classic is installed. If Yarn is not installed or is version 2.0+, further installation or configuration steps are required. ```sh yarn --version ``` -------------------------------- ### Upgrading Browsertrix Deployment on DigitalOcean (zsh) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/digitalocean.md This snippet runs the `do_setup.yml` Ansible playbook with the `helm_upgrade` tag to upgrade an existing Browsertrix deployment. It requires the same project-specific extra variables as the initial setup. ```zsh ansible-playbook do_setup.yml -e project_name="your-project" -e superuser_email="you@yourdomain.com" -e domain="yourdomain.com" -t helm_upgrade ``` -------------------------------- ### Running ECK Installation Script Source: https://github.com/webrecorder/browsertrix/blob/main/chart/admin/logging/README.md Executes the setup script for the Elastic Cloud on Kubernetes (ECK) operator. This script creates the necessary Kubernetes namespace and installs the Custom Resource Definitions (CRDs) required for deploying Elasticsearch and Kibana. ```Shell ./chart/admin/logging/scripts/eck_install.sh ``` -------------------------------- ### Starting MkDocs Development Server (pip) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Starts a local development server for the documentation using MkDocs. This allows real-time viewing and testing of documentation changes, typically accessible at localhost:8000. ```sh mkdocs serve ``` -------------------------------- ### Installing Logging Services with Helm (Logging Only) Source: https://github.com/webrecorder/browsertrix/blob/main/chart/admin/logging/README.md Installs or upgrades only the logging services using a dedicated Helm chart. It applies configurations from `chart/admin/logging/values.yaml` to deploy the `btrix-admin-log` release, suitable for a standalone logging setup. ```Shell helm upgrade --install -f ./chart/admin/logging/values.yaml btrix-admin-log ./chart/admin/logging ``` -------------------------------- ### Installing Nginx Ingress Controller for k3s Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/remote.md This Helm command installs the `nginx-ingress` controller into the `ingress-nginx` namespace. It fetches the chart from the official Kubernetes Ingress Nginx repository, ensuring proper routing and creating the namespace if it doesn't exist. ```zsh helm upgrade --install ingress-nginx ingress-nginx \ --repo https://kubernetes.github.io/ingress-nginx \ --namespace ingress-nginx --create-namespace ``` -------------------------------- ### Upgrading MicroK8S Helm Deployment with Local Config (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This command is specific to MicroK8S environments and performs a Helm upgrade or install operation for the `btrix` release. It uses the `microk8s helm3` wrapper to apply the default `values.yaml` and custom `local.yaml` configurations, ensuring local development settings are deployed. ```sh microk8s helm3 upgrade --install -f ./chart/values.yaml -f ./chart/local.yaml btrix ./chart/ ``` -------------------------------- ### Installing Browsertrix Ansible Dependencies (zsh) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/digitalocean.md This snippet changes the directory to the `ansible` folder, installs `pipenv`, installs project dependencies using `pipenv install`, and then activates the pipenv shell for the project. ```zsh cd ansible pip install pipenv pipenv install pipenv shell ``` -------------------------------- ### Installing Logging Services with Helm (Full) Source: https://github.com/webrecorder/browsertrix/blob/main/chart/admin/logging/README.md Installs or upgrades the full Browsertrix Helm chart, enabling logging services. It uses `chart/values.yaml` for main configurations and `chart/examples/local-logging.yaml` for local testing overrides, deploying the `btrix` release. ```Shell helm upgrade --install -f ./chart/values.yaml -f ./chart/examples/local-logging.yaml btrix ./chart ``` -------------------------------- ### Running K3S Installation Playbook Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/k3s.md This command executes the Ansible playbook to install K3S and Browsertrix. It uses the specified inventory file to define target hosts and variables, initiating the automated deployment process. ```Zsh ansible-playbook -i inventory/my-deployment/hosts.ini install_k3s.yml ``` -------------------------------- ### Building Frontend Image with Minikube (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This command uses Minikube's built-in image builder to create the `webrecorder/browsertrix-frontend:latest` Docker image. The image is built from the `frontend` directory, making it available within the Minikube environment for local testing. ```shell minikube image build -t webrecorder/browsertrix-frontend:latest ./frontend ``` -------------------------------- ### Installing Material for MkDocs (pipx) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Installs the Material for MkDocs theme and its dependencies in an isolated environment using pipx. This method helps prevent dependency conflicts with other Python projects. ```sh pipx install mkdocs-material --include-deps ``` -------------------------------- ### Building Backend Image with Minikube (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This command uses Minikube's built-in image builder to create the `webrecorder/browsertrix-backend:latest` Docker image. The image is built from the `backend` directory, making it available within the Minikube environment for local testing. ```shell minikube image build -t webrecorder/browsertrix-backend:latest ./backend ``` -------------------------------- ### Markdown Collapsible Example Admonition with Title Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Presents the Markdown syntax for a collapsible 'Example' admonition with a required title, used for specific circumstances or additional feature information. ```markdown ???+ Example \"Example: Must have a title describing the content\"\n Used to deliver additional information about a feature that could be useful in a _specific circumstance_ or that might not otherwise be considered — should be collapsed by default. ``` -------------------------------- ### Deploying Browsertrix with Helm on MicroK8S Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/remote.md This command deploys or upgrades the Browsertrix application using Helm on a MicroK8s cluster. It applies configurations from `values.yaml` and `my-config.yaml` to install the `btrix` chart, allowing for customized settings. ```shell helm upgrade --install -f ./chart/values.yaml -f ./chart/my-config.yaml \ btrix ./chart/ ``` -------------------------------- ### Installing Browsertrix with Ansible Playbook (Zsh) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/microk8s.md This command executes the `install_microk8s.yml` Ansible playbook to install Browsertrix. It requires specifying the target host's IP address, the domain name for Letsencrypt certificates, and the SSH user for the VPS, automating the entire setup process. ```zsh ansible-playbook -i inventory/hosts install_microk8s.yml -e host_ip="1.2.3.4" -e domain_name="yourdomain.com" -e your_user="your_vps_admin_user" ``` -------------------------------- ### Installing UI Dependencies with Yarn (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md This command installs all required Node.js and UI dependencies for the Browsertrix frontend project, as specified in the `package.json` file. It must be run from the `frontend` directory. ```sh yarn install ``` -------------------------------- ### Deploying Browsertrix with Helm on k3s Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/remote.md This command deploys or upgrades the Browsertrix application using Helm on a k3s cluster. It applies configurations from `values.yaml` and `my-config.yaml` to install the `btrix` chart, similar to the MicroK8s deployment. ```shell helm upgrade --install -f ./chart/values.yaml -f ./chart/my-config.yaml \ btrix ./chart/ ``` -------------------------------- ### Installing Cert-Manager with Helm for k3s Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/remote.md These commands add the Jetstack Helm repository, update it, and then install `cert-manager` into the `cert-manager` namespace. It ensures Custom Resource Definitions (CRDs) are installed and specifies version `v1.12.0` for managing TLS certificates. ```zsh helm repo add jetstack https://charts.jetstack.io helm repo update helm repo update jetstack helm upgrade --install \ cert-manager jetstack/cert-manager \ --namespace cert-manager \ --create-namespace \ --version v1.12.0 \ --set installCRDs=true ``` -------------------------------- ### Upgrading Helm Deployment with Local Config (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This command performs a Helm upgrade or install operation for the `btrix` release, applying both the default `values.yaml` and the custom `local.yaml` configuration files. This ensures that all local development overrides, including image paths and pull policies, are applied to the Kubernetes cluster. ```sh helm upgrade --install -f ./chart/values.yaml \ -f ./chart/local.yaml btrix ./chart/ ``` -------------------------------- ### Markdown Code Block Syntax Highlighting Example Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Demonstrates the correct syntax for creating a fenced code block in Markdown, specifying the language for syntax highlighting. ```markdown ```markdown\nexample markdown code block text\n``` ``` -------------------------------- ### Installing Browsertrix Directly from GitHub Release using Helm Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md Installs Browsertrix using Helm by directly downloading the chart from a specific GitHub release. This method is an alternative to adding the Helm repository, though the repository option is generally recommended for easier upgrades. ```sh helm upgrade --install btrix \ https://github.com/webrecorder/browsertrix/releases/download/VERSION/browsertrix-VERSION.tgz ``` -------------------------------- ### Installing MicroK8s on Linux Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command installs MicroK8s on Ubuntu and other Linux distributions using `snap`, setting up a lightweight, single-node Kubernetes cluster. MicroK8s is recommended for local deployment and production on Linux. ```sh sudo snap install microk8s --classic ``` -------------------------------- ### Installing Project Dependencies with Yarn - Shell Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/tests/README.md This command installs all required project dependencies as specified in the `package.json` file using Yarn. It ensures that all necessary libraries and packages are available for the application to run correctly. ```Shell yarn install ``` -------------------------------- ### Importing Frontend Image into K3S Containerd (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This command imports the `frontend.tar` image archive into the K3S `containerd` runtime. The `--base-name` flag ensures the image is correctly tagged as `webrecorder/browsertrix-frontend:latest` within K3S, making it available for deployment. ```shell k3s ctr images import --base-name webrecorder/browsertrix-frontend:latest ./frontend.tar ``` -------------------------------- ### Importing Backend Image into K3S Containerd (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This command imports the `backend.tar` image archive into the K3S `containerd` runtime. The `--base-name` flag ensures the image is correctly tagged as `webrecorder/browsertrix-backend:latest` within K3S, making it available for deployment. ```shell k3s ctr images import --base-name webrecorder/browsertrix-backend:latest ./backend.tar ``` -------------------------------- ### Serializing Frontend Image for K3S (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This command uses Docker to save the `webrecorder/browsertrix-frontend:latest` image to a tar archive named `frontend.tar`. This step is necessary for importing the image into K3S's `containerd` runtime, as K3S does not directly use Docker images. ```shell docker save webrecorder/browsertrix-frontend:latest > ./frontend.tar ``` -------------------------------- ### Installing Helm on Windows for Minikube Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command installs Helm on Windows using Chocolatey, a package manager, as a prerequisite for deploying Browsertrix within a Minikube Kubernetes environment. Helm is essential for managing Kubernetes applications. ```powershell choco install kubernetes-helm ``` -------------------------------- ### Serializing Backend Image for K3S (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This command uses Docker to save the `webrecorder/browsertrix-backend:latest` image to a tar archive named `backend.tar`. This step is necessary for importing the image into K3S's `containerd` runtime, as K3S does not directly use Docker images. ```shell docker save webrecorder/browsertrix-backend:latest > ./backend.tar ``` -------------------------------- ### Installing or Upgrading Browsertrix Helm Chart Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command installs the latest version of the Browsertrix application using its Helm chart. If Browsertrix is already installed, it performs an upgrade, ensuring the deployment is up-to-date. ```sh helm upgrade --install btrix browsertrix/browsertrix ``` -------------------------------- ### Verifying SSH Connection for Ansible Setup Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/k3s.md This command verifies SSH connectivity to the target server, which is a prerequisite for running the Ansible playbook. It ensures that the specified user can log in to the domain with SSH. ```Shell ssh your-user@your-domain ``` -------------------------------- ### Starting Frontend Application with Yarn - Shell Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/tests/README.md This command starts the frontend application, typically launching a development server. It makes the application accessible in a web browser, usually at `http://localhost:5173`, allowing for local interaction and testing. ```Shell yarn start ``` -------------------------------- ### Cloning Browsertrix Repository Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/k3s.md This command sequence clones the Browsertrix repository from GitHub and then changes the current directory to the newly cloned repository, preparing for further setup steps. ```Zsh git clone https://github.com/webrecorder/browsertrix.git cd browsertrix ``` -------------------------------- ### Installing Helm on Windows for K3S Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command installs Helm on Windows using Chocolatey, a package manager, as a prerequisite for deploying Browsertrix within a K3s Kubernetes environment. Helm is essential for managing Kubernetes applications. ```powershell choco install kubernetes-helm ``` -------------------------------- ### Starting Frontend Development Server (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md This command starts the frontend development server, which runs the application and automatically reloads the browser on file changes. It typically opens `localhost:9870` in the default browser, enabling rapid UI development. ```sh yarn start ``` -------------------------------- ### Installing Helm on Windows for Docker Desktop Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command installs Helm on Windows using Chocolatey, a package manager, as a prerequisite for deploying Browsertrix within a Docker Desktop Kubernetes environment. Helm is essential for managing Kubernetes applications. ```powershell choco install kubernetes-helm ``` -------------------------------- ### Installing Browsertrix from Helm Repository with MicroK8S Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md Installs or upgrades the Browsertrix cluster from the configured Helm repository within a MicroK8S environment. This command leverages the `microk8s helm3` utility for Helm operations. ```sh microk8s helm3 upgrade --install btrix browsertrix/browsertrix ``` -------------------------------- ### Enabling Yarn 1 with Corepack (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md These commands are used when your Yarn version is 2.0 or greater to enable Yarn 1 (Classic) within the Browsertrix frontend project directory. `corepack enable` activates Corepack, and `corepack install` installs the project's specified Yarn version. ```sh cd frontend corepack enable corepack install ``` -------------------------------- ### Configuring MicroK8S Local Image Paths (YAML) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This YAML configuration specifies the image paths for the backend and frontend services when using a MicroK8S local registry. Images are prefixed with `localhost:32000/` to point to the MicroK8S internal registry, ensuring that the correct local images are used. ```yaml backend_image: "localhost:32000/webrecorder/browsertrix-backend:latest" frontend_image: "localhost:32000/webrecorder/browsertrix-frontend:latest" ``` -------------------------------- ### Installing Helm on macOS for Minikube Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command installs Helm on macOS using Homebrew, a package manager, as a prerequisite for deploying Browsertrix within a Minikube Kubernetes environment. Helm is essential for managing Kubernetes applications. ```sh brew install helm ``` -------------------------------- ### Installing Browsertrix with Custom Configuration using Helm Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md Installs or upgrades Browsertrix using Helm, applying custom settings defined in a local YAML configuration file. This allows overriding default parameters like superadmin credentials or local service port during deployment. ```shell helm upgrade --install btrix https://github.com/webrecorder/browsertrix/releases/download/VERSION/browsertrix-VERSION.tgz \ -f ./chart/examples/local-config.yaml ``` -------------------------------- ### Navigating to Frontend Directory - Shell Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/tests/README.md This command changes the current working directory to the `frontend` subdirectory within the cloned repository. This is a prerequisite for installing frontend-specific dependencies and running the application. ```Shell cd frontend ``` -------------------------------- ### Deploying Browsertrix Proxies Subchart from GitHub Release (Helm) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/proxies.md This command installs or upgrades the Browsertrix proxies subchart directly from a specified GitHub release URL. It allows administrators to deploy the latest proxy configurations without needing a local copy of the Browsertrix repository, by replacing `RELEASE` and `VERSION` with the appropriate values. ```Shell helm upgrade --install proxies https://github.com/webrecorder/browsertrix/releases/download/RELEASE/btrix-proxies-VERSION.tgz ``` -------------------------------- ### Installing Helm on macOS for K3S Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command installs Helm on macOS using Homebrew, a package manager, as a prerequisite for deploying Browsertrix within a K3s Kubernetes environment. Helm is essential for managing Kubernetes applications. ```sh brew install helm ``` -------------------------------- ### Checking Node.js Version (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md This command checks the installed version of Node.js. A version number like `v20.17.0` indicates a successful installation. If a command line error is displayed instead, Node.js needs to be installed before proceeding. ```sh node --version ``` -------------------------------- ### Cloning Browsertrix Ansible Repository (Zsh) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/microk8s.md This command sequence clones the Browsertrix repository from GitHub and navigates into the `ansible` directory. This is the initial step required to access the Ansible playbooks for installation and management. ```zsh git clone https://github.com/webrecorder/browsertrix.git cd browsertrix/ansible ``` -------------------------------- ### Uninstalling Browsertrix Deployment from DigitalOcean (zsh) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/digitalocean.md This snippet executes the `do_teardown.yml` Ansible playbook to remove the Browsertrix deployment from DigitalOcean. It requires the project name, superuser email, and domain as extra variables for proper teardown. ```zsh ansible-playbook playbooks/do_teardown.yml -e project_name="your-project" -e superuser_email="you@yourdomain.com" -e domain="yourdomain.com" ``` -------------------------------- ### Installing Helm on macOS for Docker Desktop Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command installs Helm on macOS using Homebrew, a package manager, as a prerequisite for deploying Browsertrix within a Docker Desktop Kubernetes environment. Helm is essential for managing Kubernetes applications. ```sh brew install helm ``` -------------------------------- ### Installing or Upgrading Specific Browsertrix Helm Chart Version Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command installs or upgrades the Browsertrix application using its Helm chart, allowing you to specify a particular version. This is useful for deploying a stable or tested release, corresponding to available GitHub release tags. ```sh helm upgrade --install btrix browsertrix/browsertrix --version VERSION ``` -------------------------------- ### Running Standard Storybook (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/src/stories/Intro.mdx Executes the default `storybook` script using Yarn. This command starts the Storybook development server but does not automatically regenerate the `custom-elements.json` file, potentially leading to outdated attribute documentation. ```Shell yarn storybook ``` -------------------------------- ### Adding Browsertrix Helm Repository Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command adds the official Browsertrix Helm chart repository to your Helm configuration. Once added, you can discover and install Browsertrix charts directly using Helm. ```sh helm repo add browsertrix https://docs.browsertrix.com/helm-repo/ ``` -------------------------------- ### Updating Metacontroller and its Helm Dependency Source: https://github.com/webrecorder/browsertrix/blob/main/chart/README.md This Bash script automates the process of installing Metacontroller from its Git repository, packaging its Helm chart, and then updating the project's overall Helm dependencies. It ensures that the Metacontroller component is correctly set up and its dependencies are resolved. ```Bash #!/bin/bash # intall metacontroller git clone --depth=1 https://github.com/metacontroller/metacontroller.git cd metacontroller helm package deploy/helm/metacontroller --destination deploy/helm cd .. # update dependency helm dependency update ``` -------------------------------- ### Copying Ansible Inventory Directory Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/k3s.md This command creates a copy of the sample K3S inventory directory, allowing users to customize their deployment settings without modifying the original sample files. It's an optional step for managing multiple deployments. ```Zsh cp -r ansible/inventory/sample-k3s ansible/inventory/my-deployment ``` -------------------------------- ### Configuring MicroK8S Image Pull Policy (YAML) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md For MicroK8S environments, the image pull policies should be set to `IfNotPresent` instead of `Never`. This allows MicroK8S to pull images from its local registry if they are not already present, accommodating its specific registry behavior. ```yaml backend_pull_policy: 'IfNotPresent' frontend_pull_policy: 'IfNotPresent' ``` -------------------------------- ### Describing a Kubernetes Pod for Debugging Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md Provides detailed information about a specific Kubernetes pod, including events, status, and resource usage. This command is crucial for diagnosing why a pod might not be starting or functioning correctly. ```sh kubectl describe ``` -------------------------------- ### Configuring Superuser Credentials in Helm (YAML) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This YAML snippet demonstrates how to configure superuser credentials within the Helm chart's `local.yaml` file. It allows setting a specific email and an optional password for the superuser administrator, overriding the default auto-generated credentials. ```yaml superuser: # set this to enable a superuser admin email: my_super_user_email@example.com # optional: if not set, automatically generated # change or remove this password: MySecretPassword! ``` -------------------------------- ### Navigating to Frontend Directory (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md This command changes the current working directory to the `frontend` subdirectory. All subsequent development commands in this guide should be executed from this directory. ```sh cd frontend ``` -------------------------------- ### Redeploying Browsertrix with Local Proxy Configuration (Helm) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/proxies.md This command upgrades or installs the Browsertrix Helm chart, incorporating proxy configurations from both the main `values.yaml` and a local override file, `local.yaml`. It ensures that any `btrix-proxies` settings are applied during the deployment process. ```Shell helm upgrade --install -f ./chart/values.yaml -f ./chart/local.yaml btrix ./chart/ ``` -------------------------------- ### Adding Browsertrix Helm Repository with MicroK8S Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md Adds the Browsertrix Helm repository to a MicroK8S environment, allowing for installation and management of Browsertrix charts via the repository. This command uses `microk8s helm3` instead of standard `helm`. ```sh microk8s helm3 repo add browsertrix https://docs.browsertrix.com/helm-repo/ ``` -------------------------------- ### Referencing Python Dependencies from requirements.txt Source: https://github.com/webrecorder/browsertrix/blob/main/backend/test-requirements.txt This snippet demonstrates the common practice of referencing a `requirements.txt` file to install project dependencies using pip. The `-r` flag tells pip to install packages listed in the specified file. ```Python -r requirements.txt ``` -------------------------------- ### Enabling Logging Addon in Helm Values Source: https://github.com/webrecorder/browsertrix/blob/main/chart/admin/logging/README.md Configures the `chart/values.yaml` file to enable the `logging` service as an addon for the `admin` component. Setting `logging: true` activates the necessary Helm dependencies for the logging stack during Browsertrix-cloud installation. ```YAML addons: admin: logging: true ``` -------------------------------- ### Waiting for MicroK8s Cluster Readiness Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command monitors the status of the MicroK8s cluster and waits until all installed addons and components are fully ready. It ensures the Kubernetes environment is stable and operational before proceeding with application deployment. ```sh microk8s status --wait-ready ``` -------------------------------- ### Configuring External S3-Compatible Storage Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/remote.md This YAML configuration disables local MinIO and defines an external S3-compatible storage solution for Browsertrix. It requires specifying the `access_key`, `secret_key`, and `endpoint_url` to connect to the external storage service. ```yaml minio_local: false storages: - name: "default" access_key: secret_key: endpoint_url: "https://s3..amazonaws.com/bucket/path/" ``` -------------------------------- ### Running Storybook with Watch Mode (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/src/stories/Intro.mdx Executes the `storybook:watch` script using Yarn. This command starts Storybook and automatically regenerates the `custom-elements.json` file, which is crucial for keeping component attribute documentation up-to-date. ```Shell yarn storybook:watch ``` -------------------------------- ### Updating Browsertrix Cluster via Helm Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md Updates the Browsertrix cluster to a new version by re-running the Helm installation command with the desired version. This process pulls the latest images and preserves the existing database and archives. ```shell helm upgrade --install btrix https://github.com/webrecorder/browsertrix/releases/download/NEWVERSION/browsertrix-NEWVERSION.tgz ``` -------------------------------- ### Custom Link Selector HTML Example Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/user-guide/workflow-setup.md This HTML snippet demonstrates a common scenario where custom link selectors are useful. It shows ``` -------------------------------- ### Configuring Local Image Usage in Helm (YAML) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/local-dev-setup.md This YAML configuration snippet, intended for `./chart/local.yaml`, sets the `backend_image` and `frontend_image` to `latest` and their `pull_policy` to `Never`. This ensures that Kubernetes uses locally built Docker images instead of attempting to pull them from a remote registry, which is crucial for local development and testing. ```yaml backend_image: docker.io/webrecorder/browsertrix-backend:latest frontend_image: docker.io/webrecorder/browsertrix-frontend:latest backend_pull_policy: 'Never' frontend_pull_policy: 'Never' ``` -------------------------------- ### Upgrading Browsertrix Helm Deployment Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/k3s.md This command runs the Ansible playbook specifically for upgrading the Browsertrix Helm deployment. The '-t helm_upgrade' tag ensures that only the upgrade tasks related to Helm are executed, facilitating a targeted update. ```Zsh ansible-playbook -i inventory/hosts install_k3s.yml -t helm_upgrade ``` -------------------------------- ### Displaying Waiting Status Icon in HTML Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/ui/design-status-icons.md This HTML snippet displays a 'Waiting' status icon, used when a process is queued but has not started. It uses the `status-waiting` class and a Bootstrap hourglass split icon. ```HTML :bootstrap-hourglass-split: Waiting ``` -------------------------------- ### Configuring Browsertrix Autoscaling Thresholds (YAML) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/customization.md This YAML configuration defines the CPU and memory utilization thresholds for Browsertrix horizontal autoscaling. When these thresholds are met, new pods are started to handle increased load, ensuring optimal performance and resource allocation. ```yaml backend_avg_cpu_threshold: 80 backend_avg_memory_threshold: 95 frontend_avg_cpu_threshold: 80 frontend_avg_memory_threshold: 95 ``` -------------------------------- ### Importing Browsertrix Organization Database Information with cURL Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/admin/org-import-export.md This `curl` command imports an organization's database information from a JSON export file into a new Browsertrix cluster via the API. The `--data-binary` flag streams the JSON file, and the `Content-Type` is set to `application/octet-stream`. This endpoint is available only to superusers. ```sh curl -X POST -H "Content-Type: application/octet-stream" -H "Authorization: Bearer " --data-binary "@org-export.json" https://app.browsertrix.com/api/orgs/import/json ``` -------------------------------- ### Example YAML for Browsertrix Proxy Subchart Configuration Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/proxies.md This YAML snippet defines two proxy configurations for use with the Browsertrix proxies subchart. It illustrates how to specify different proxy types (SSH and SOCKS5), including their IDs, labels, descriptions, country codes, URLs, and authentication details like SSH keys or SOCKS5 credentials. ```YAML proxies: - id: proxy-id-1 shared: true label: My Proxy description: Proxy hosted in for Browsertrix country_code: US url: ssh://proxy-user@ssh-proxy-host ssh_host_public_key: ssh_private_key: - id: proxy-id-2 shared: false label: My SOCKS5 proxy country_code: DE url: socks5://username:password@proxy-host ``` -------------------------------- ### Upgrading Browsertrix Helm Deployment with Ansible (Zsh) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/ansible/microk8s.md This command runs the `install_microk8s.yml` Ansible playbook specifically for upgrading the Helm deployment of Browsertrix. The `-t helm_upgrade` tag ensures that only the relevant upgrade tasks are executed, facilitating a smooth update while preserving existing configurations. ```zsh ansible-playbook -i inventory/hosts install_microk8s.yml -e host_ip="1.2.3.4" -e domain_name="yourdomain.com" -t helm_upgrade ``` -------------------------------- ### Defining a Browsertrix Component with BtrixElement in TypeScript Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/ui/components.md This TypeScript example shows how to define a custom Browsertrix web component by extending `BtrixElement`. It illustrates accessing global application state (e.g., `this.appState.userInfo.name`) and composing other custom components like `` and `` within the component's `render` method, demonstrating a common pattern for complex UI elements. ```TypeScript // my-custom-component.ts @customElement("btrix-my-custom-component") class MyCustomComponent extends BtrixElement { render() { return html` Hello, are you ${this.appState.userInfo.name}? Yes `; } } ``` -------------------------------- ### Custom User Agent String for Browsertrix Crawler Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/user-guide/workflow-setup.md This snippet provides an example of a custom user agent string recommended for use with the Browsertrix crawler. It helps in identifying crawling activity to website owners for allowlisting purposes and can potentially bypass browser-specific restrictions. The string includes browser and OS information, an organization name, and an optional URL for further explanation. ```Text Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.3 orgname.browsertrix (+https://example.com/crawling-explination-page) ``` -------------------------------- ### Configuring External MongoDB Connection Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/remote.md This YAML configuration disables the use of a local MongoDB instance and specifies an external MongoDB instance using a connection string. The `db_url` must adhere to the MongoDB Connection String Format, including necessary authentication details. ```yaml mongo_local: false mongo_auth: db_url: mongodb+srv://... ``` -------------------------------- ### Enabling Browsertrix Horizontal Autoscaling (YAML) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/customization.md This YAML snippet enables horizontal autoscaling for Browsertrix backend and frontend pods by setting the maximum number of replicas. This feature requires the Kubernetes metrics-server add-on to be installed and allows the application to scale based on resource utilization. ```yaml backend_max_replicas: 2 frontend_max_replicas: 2 ``` -------------------------------- ### Exporting Browsertrix Organization Database Information with cURL Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/admin/org-import-export.md This `curl` command retrieves a portable JSON representation of an organization's database information from the Browsertrix API. The `Authorization` header requires a JWT token, and the output is saved to `org-export.json`. This endpoint is restricted to superusers. ```sh curl -H "Content-type: application/json" -H "Authorization: Bearer " https://app.browsertrix.com/api/orgs//export/json -o org-export.json ``` -------------------------------- ### Exporting Browsertrix Organization Files with AWS S3 CLI Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/admin/org-import-export.md This command recursively copies all files associated with a Browsertrix organization from an S3 bucket to a local directory. It's crucial to retain the directory structure for re-importing. The `--endpoint` flag specifies the S3-compatible service endpoint. ```sh aws s3 cp s3://current-bucket/ /path/to/local/directory/ --recursive --endpoint=https://ams3.digitaloceanspaces.com ``` -------------------------------- ### Importing Browsertrix Organization JSON with Version Ignore (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/admin/org-import-export.md This `curl` command demonstrates how to import an organization's JSON data into Browsertrix, bypassing the database version check. It sends a POST request with the JSON payload and an authorization token to the import API endpoint, using the `ignoreVersion=true` query parameter to allow imports from different database versions. The `@org-export.json` specifies the file containing the JSON data to be imported. ```sh curl -X POST -H "Content-type: application/json" -H "Authorization: Bearer " --data-binary "@org-export.json" https://app.browsertrix.com/api/orgs/import/json?ignoreVersion=true ``` -------------------------------- ### Importing Browsertrix Organization Database with Storage Name Update Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/admin/org-import-export.md This `curl` command imports an organization's database information, similar to the basic import, but includes the `storageName` query parameter. This parameter is used to update storage references during import if the primary storage name in the new cluster differs from the original cluster's configuration. ```sh curl -X POST -H "Content-type: application/json" -H "Authorization: Bearer " --data-binary "@org-export.json" https://app.browsertrix.com/api/orgs/import/json?storageName=newname ``` -------------------------------- ### Importing Browsertrix Organization Files with AWS S3 CLI Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/admin/org-import-export.md This command recursively copies an organization's files from a local directory to a new S3 bucket. It's essential to maintain the original organization ID directory and logical structure within the bucket for successful import into a new Browsertrix cluster. ```sh aws s3 cp /path/to/local/directory/ s3://new-bucket/ --recursive ``` -------------------------------- ### Markdown Expanded Tip Admonition with Title Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Shows the Markdown syntax for an expanded 'Tip' admonition with a custom title, used for highlighting universally useful points. ```markdown !!! Tip \"Tip: May have a title stating the tip or best practice\"\n Used to highlight a point that is useful for everyone to understand about the documented subject — should be expanded and kept brief. ``` -------------------------------- ### Markdown Collapsible Info Admonition with Title Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Illustrates the Markdown syntax for a collapsible 'Info' admonition with a required title, used for context-based content like OS or environment dependencies. ```markdown ???+ Info \"Info: Must have a title describing the context under which this information is useful\"\n Used to deliver context-based content such as things that are dependant on operating system or environment — should be collapsed by default. ``` -------------------------------- ### Enabling Essential MicroK8s Addons Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md This command enables critical addons for MicroK8s, including `dns`, `hostpath-storage`, `registry`, and `helm3`. These addons provide necessary services and tools for deploying and managing applications like Browsertrix within the MicroK8s cluster. ```sh microk8s enable dns hostpath-storage registry helm3 ``` -------------------------------- ### Copying Sample Environment File - Shell Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/tests/README.md This command copies the `sample.env.local` file to `.env`, creating the necessary environment configuration for the application. The `.env` file typically contains sensitive or environment-specific variables required for the application's operation. ```Shell cp sample.env.local .env ``` -------------------------------- ### Denoting Paid Features in Markdown Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Shows the Markdown syntax for marking a feature as 'Paid Feature' using a green badge, indicating it's available only on hosted plans. ```markdown `Paid Feature`{ .badge-green } ``` -------------------------------- ### Building App for Development (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md This command bundles the application for development purposes, outputting the compiled files into the `dist` directory. This build is not optimized for production. ```sh yarn build-dev ``` -------------------------------- ### Building App for Production (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md This command bundles the application, optimizing it for production deployment. The optimized output files are placed in the `dist` directory. ```sh yarn build ``` -------------------------------- ### Cloning Browsertrix Cloud Repository - Shell Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/tests/README.md This command clones the `browsertrix-cloud` repository from GitHub to the local machine. It is the initial step to obtain the project's source code, enabling local development and testing. ```Shell git clone git@github.com:webrecorder/browsertrix-cloud.git ``` -------------------------------- ### Deploying Browsertrix Proxies Subchart with Local Configuration (Helm) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/proxies.md This Helm command deploys or updates the dedicated Browsertrix proxies subchart, applying configurations defined in `proxies.yaml`. This method allows for independent updates to proxy settings without requiring a full redeployment of the main Browsertrix application. ```Shell helm upgrade --install -f ./chart/proxies.yaml proxies ./chart/proxies/ ``` -------------------------------- ### Markdown Collapsible Note Admonition Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Demonstrates the Markdown syntax for a collapsible 'Note' admonition, used for additional context or tips that can be expanded by the user. ```markdown ???+ Note\n The default call-out, used to highlight something if there isn't a more relevant one — should generally be expanded by default but can be collapsible by the user if the note is long. ``` -------------------------------- ### Markdown Expanded Warning Admonition with Title Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Shows the Markdown syntax for an expanded 'Warning' admonition with a required title, used for delivering important information that should always be visible. ```markdown !!! Warning \"Warning: Must have a title stating the warning\"\n Used to deliver important information — should always be expanded. ``` -------------------------------- ### Markdown Collapsible Question Admonition with Title Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Demonstrates the Markdown syntax for a collapsible 'Question' admonition with a required title, used for answering frequently asked questions. ```markdown ???+ Question \"Question: Must have a title phrased in the form of a question\"\n Used to answer frequently asked questions about the documented subject — should be collapsed by default. ``` -------------------------------- ### Cloning Browsertrix Source Code - Shell Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/index.md This command clones the Browsertrix project repository from GitHub to your local machine. It is the initial step for setting up a local development environment, providing access to the entire source code. ```sh git clone https://github.com/webrecorder/browsertrix.git ``` -------------------------------- ### Initializing Plausible Analytics Global Object in JavaScript Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/overrides/partials/integrations/analytics/custom.html This snippet initializes the `window.plausible` global object. If `window.plausible` is not already defined, it assigns a function that pushes arguments into a queue (`window.plausible.q`). This pattern is commonly used for asynchronous loading of analytics scripts, allowing commands to be queued before the full script is loaded and executed. ```JavaScript window.plausible = window.plausible || function () { (window.plausible.q = window.plausible.q || []).push(arguments) } ``` -------------------------------- ### Running Storybook Development Server (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/ui/storybook.md This command initiates the Storybook development server, which automatically opens in your default browser. It enables real-time UI development by refreshing the page automatically whenever changes are made to Browsertrix components or their stories. ```Shell yarn storybook:watch ``` -------------------------------- ### Customizing Browsertrix Email Templates with Helm (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/customization.md This Helm command demonstrates how to customize Browsertrix email templates by specifying an alternate HTML template file for the 'invite' email. The `--set-file` parameter is used to point to the custom template, allowing administrators to brand or modify email content. ```shell helm upgrade --install btrix ... --set-file email.templates.invite=./invite.html ``` -------------------------------- ### Markdown Expanded Danger Admonition with Title Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Illustrates the Markdown syntax for an expanded 'Danger' admonition with a required title, used for critical information about unrecoverable actions. ```markdown !!! Danger \"Danger: Must have a title stating the warning\"\n Used to deliver information about serious unrecoverable actions such as deleting large amounts of data or resetting things — should always be expanded. ``` -------------------------------- ### Formatting Code Files (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md This command formats JavaScript, HTML, and CSS files according to predefined style rules, ensuring consistent code formatting across the project. ```sh yarn format ``` -------------------------------- ### Project Dependency List - Python Source: https://github.com/webrecorder/browsertrix/blob/main/backend/requirements.txt This snippet defines the Python packages and their versions required for the project. It includes libraries for web serving (gunicorn, uvicorn, fastapi), database interaction (motor), authentication (passlib, PyJWT), data validation (pydantic), file operations (aiofiles), Kubernetes integration, cloud storage (aiobotocore), caching (redis), templating (jinja2), and more. Specific versions are pinned for stability, and some packages are sourced directly from GitHub. ```Python gunicorn uvicorn[standard] fastapi==0.103.2 motor passlib PyJWT==2.8.0 pydantic==2.8.2 email-validator loguru aiofiles kubernetes-asyncio==29.0.0 kubernetes aiobotocore requests redis>=5.0.0 pyyaml jinja2 humanize python-multipart pathvalidate https://github.com/ikreymer/stream-zip/archive/refs/heads/crc32-optional.zip backoff>=2.2.1 python-slugify>=8.0.1 types_aiobotocore_s3 types-redis types-python-slugify types-pyYAML remotezip json-stream aiostream iso639-lang>=2.6.0 ``` -------------------------------- ### Python In-line Code Block Syntax Highlighting Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/docs.md Illustrates how to add syntax highlighting to an in-line code block in Markdown using the #!language prefix, specifically for a Python function range(). ```markdown `#!python range()` ``` -------------------------------- ### Configuring Browsertrix Storage Replicas (YAML) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/customization.md This YAML configuration defines primary and replica storage locations for Browsertrix. It includes a default primary S3 storage and two replica S3 storages, one on the same local Minio service and another on an external S3 provider, ensuring data redundancy and backup capabilities. ```yaml storages: - name: "default" type: "s3" access_key: "ADMIN" secret_key: "PASSW0RD" bucket_name: btrix-data access_endpoint_url: /data/ endpoint_url: "http://local-minio.default:9000/" is_default_primary: true - name: "replica-0" type: "s3" access_key: "ADMIN" secret_key: "PASSW0RD" bucket_name: "replica-0" endpoint_url: "http://local-minio.default:9000/" is_default_replica: true - name: "replica-1" type: "s3" access_key: "accesskey" secret_key: "secret" bucket_name: "replica-1" endpoint_url: "https://s3provider.example.com/bucket/path/" access_endpoint_url: "https://my-custom-domain.example.com/path/" ``` -------------------------------- ### Configuring External S3 Storage in Browsertrix (YAML) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/customization.md This YAML configuration demonstrates how to integrate an external S3-compatible storage provider with Browsertrix. It requires specifying the storage name, type, access credentials, endpoint URL, and optionally a custom access endpoint URL for direct WACZ file access. The `is_default_primary` flag designates it as the primary storage. ```YAML storages: - name: default type: "s3" access_key: "accesskey" secret_key: "secret" endpoint_url: "https://s3provider.example.com/bucket/path/" access_endpoint_url: "https://my-custom-domain.example.com/path/" #optional is_default_primary: true ``` -------------------------------- ### Building Localized Strings/Templates (Shell) Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/develop/frontend-dev.md This command processes translated XLIFF files and outputs localized versions of strings and templates, integrating them into the application for different language versions. ```sh yarn localize:build ``` -------------------------------- ### Listing Python Development Dependencies Source: https://github.com/webrecorder/browsertrix/blob/main/backend/dev-requirements.txt This snippet specifies the Python packages used for code quality and static analysis. 'black' is a code formatter, 'pylint' is a linter, and 'mypy' is a static type checker, pinned to version 1.10.1. ```Python black pylint mypy==1.10.1 ``` -------------------------------- ### Waiting for Kubernetes Pods to be Ready Source: https://github.com/webrecorder/browsertrix/blob/main/frontend/docs/docs/deploy/local.md Waits for all Kubernetes pods in the current namespace to reach a 'ready' condition, with a timeout of 300 seconds. This command is useful for ensuring the cluster components are fully initialized after deployment. ```shell kubectl wait --for=condition=ready pod --all --timeout=300s ```