francisca Documentation

repository·develop·Indexed 19 days ago

https://github.com/uwudev/francisca

Documentation for francisca v0.9.1, a high-performance, general-purpose indexer written in Rust for systems supporting the Nostr protocol, specifically NIP-35 torrent events. Includes guides on configuration via config.json and environment variables, Tor support for anonymized connections, Docker deployment, and a detailed workflow for testing Pull Request preview images.

Tokens
23.7K
Snippets
88
Records
125
Agent score
61%

What's inside francisca

  1. What is Francisca?

    develop

    Francisca is a high-performance, general-purpose indexer written in Rust for systems supporting the Nostr (NIP-35) protocol.

    It acts as a bridge between any Nostr relay and media management applications (such as Prowlarr, Jackett, Sonarr, and Radarr).

    Key Features

    • Nostr Protocol: Direct connection to any Nostr relay using NIP-35.
    • Universal Compatibility: Works with Prowlarr, Jackett, and all *arr applications.
    • Metadata Enrichment: Automatic integration with TMDB and IMDB.
    • Multi-architecture Docker: Supports AMD64, ARM64, and ARMv7.
    • Privacy: Optional Tor routing support.
  2. Security considerations for preview images

    develop

    ⚠️ Warning: Preview images are for testing only. Do not use them in production.

    Key Security Facts

    • No Signatures: Unlike release images, preview images are NOT signed with Cosign. This reduces build complexity but means they lack production-grade verification.
    • Trust: Do not trust preview images from unknown contributors. Always review the code in the Pull Request before executing the container.
    • Secrets: The build process uses DOCKERHUB_USERNAME, DOCKERHUB_TOKEN, and GITHUB_TOKEN internally, but these are not exposed to the image itself.
  3. How the PR Preview workflow works

    develop

    The PR Preview workflow allows contributors and reviewers to test Pull Requests (PRs) using Docker images without manual compilation. It is an opt-in system based on GitHub labels.

    Workflow Lifecycle

    1. Activation: Adding the preview label to a PR triggers a GitHub Action that compiles and publishes a Docker image.
    2. Updates: Pushing new commits to the PR branch automatically updates the existing preview image.
    3. Deactivation: Removing the preview label stops the compilation process (existing images remain available).

    Why use labels?

    • Resource Efficiency: Previews are only built when explicitly requested.
    • Contributor Choice: Authors decide if a preview is necessary for their changes.
    • Reviewer Convenience: Reviewers can request a preview for complex changes.
    • Cost Control: Avoids unnecessary builds for every single commit.
    # No code snippet required for this concept
  4. Security and Trust for Preview Images

    develop

    ⚠️ Warning: Preview images should only be used for testing.

    Key Security Facts

    • No Signing: Unlike release images, preview images are NOT signed with Cosign.
    • Production Use: Never use preview images in a production environment.
    • Trust: Do not trust preview images from unknown contributors; always review the PR code before running the container.
    • Scope: Previews are intended for testing complex features, UI/UX changes, and performance improvements, not for stable deployments.
  5. Quickstart: Install Francisca with Docker Compose

    develop

    To get Francisca running in approximately 30 seconds, create a configuration directory and use Docker Compose to pull and start the service. No account or credentials are required for basic operation, as it connects directly to Nostr relays via the NIP-35 protocol.

    Steps

    1. Create a dedicated configuration directory.
    2. Download the official compose.yml.
    3. Start the container in detached mode.
    # Créer le dossier de configuration
    mkdir -p ~/francisca && cd ~/francisca
    
    # Télécharger et démarrer avec Docker Compose
    curl -o compose.yml https://raw.githubusercontent.com/UwUDev/francisca/master/docker/compose.yml
    docker compose up -d
  6. Set up local development for Francisca documentation

    develop

    To develop the Francisca documentation locally, you must have Bun installed. Follow these steps to install dependencies and start the development server.

    Note on Internationalization (i18n): In development mode, Docusaurus only loads one locale at a time.

    • For French (default): bun start accessible at http://localhost:3000/
    • For English: bun start -- --locale en accessible at http://localhost:3001/en/
    cd website
    bun install
    bun start
  7. Configure Francisca using config.json

    develop

    The primary configuration method is via a config.json file. This file must be placed at the project root for manual installations or mounted as a volume in Docker.

    Note: The application will fail to start if no Nostr relays are provided in the relays array.

    {
        "relays": ["wss://u2p.anhkagi.net"],
        "bind_ip": "0.0.0.0",
        "bind_port": 8715,
        "log_level": "info",
        "tmdb_token": null,
        "use_tor": false,
        "tor_proxy": "127.0.0.1:9050"
    }
  8. Test a Pull Request preview image

    develop

    To test a specific Pull Request, you must first ensure the PR has been labeled with preview. Once the build is complete (typically 5-10 minutes for updates), you can pull and run the corresponding Docker image. The image tags follow the pattern uwucode/francisca:pr-<PR_NUMBER>.

    # 1. Pull the image for PR #456
    docker pull uwucode/francisca:pr-456
    
    # 2. Run with a custom configuration volume
    docker run -p 8080:8080 \
      -v $(pwd)/test-config:/config \
      uwucode/francisca:pr-456
    
    # 3. Test the endpoint
    curl http://localhost:8080/api/endpoint
  9. Install Francisca using Docker

    develop

    Francisca is available as an official multi-architecture Docker image. You can deploy it using either docker run for a quick start or docker compose for managed deployment.

    Prerequisites

    Quick Start with Docker Run

    docker run -d \
      --name francisca \
      -p 8715:8715 \
      uwucode/francisca:latest

    Quick Start with Docker Compose

    Create a compose.yml file:

    services:
      francisca:
        image: uwucode/francisca:latest
        container_name: francisca
        restart: unless-stopped
        ports:
          - "8715:8715"
        environment:
          LOG_LEVEL: "info"
        healthcheck:
          test: ["CMD-SHELL", "curl --fail http://localhost:$${BIND_PORT:-8715}/health || exit 1"]
          interval: 1m30s
          timeout: 20s
          retries: 3
          start_period: 10s

    Then start the service:

    docker compose up -d
  10. Activate TMDB and IMDB support

    develop

    To enable TMDB and IMDB metadata support in Francisca, you must provide a TMDB API token (specifically a JWT). You can do this by either setting the TMDB_TOKEN environment variable or by adding the key to your config.json file. Note that IMDB support is provided automatically through the TMDB integration when metadata is available.

    {
      "TMDB_TOKEN": "YOUR_TMDB_JWT_TOKEN"
    }
  11. Activate and manage PR previews

    develop

    For PR Authors

    To enable a preview for your Pull Request:

    1. Open your PR on GitHub.
    2. In the right sidebar, click on Labels.
    3. Add the preview label.
    4. Wait approximately 10-15 minutes for the build to complete.
    5. Check the PR comments for the specific docker pull commands provided by the bot.

    To update the preview, simply push new commits to your branch. To stop the builds, remove the preview label.

    For Reviewers

    If you need to test a PR before approving:

    1. Request the author to add the preview label, or add it yourself if you have permissions.
    2. Wait for the build to finish.
    3. Use the Docker commands found in the automated bot comment on the PR.