Strolt Documentation

website·Indexed 29 days ago

https://strolt.shibanet0.com

Strolt is a tool for effortless backup management. Documentation includes configuration for notification drivers such as Slack and Telegram, CLI commands, and API references for Strolt API (1.0), Strolt Proxy API (1.0), and Strolt Manager API (1.0).

Tokens
4.1K
Snippets
36
Records
43
Agent score
45%

What's inside Strolt

  1. Strolt backup management capabilities

    Strolt is an open-source, dockerized backup management tool that provides the following capabilities:

    • Scheduled Backups: Support for cron-based scheduled operations.
    • Database Backups: Native support for PostgreSQL, MongoDB, MySQL, and MariaDB.
    • Storage Flexibility: Supports any storage type compatible with restic.
    • Notifications: Integration with platforms like Telegram and Slack.
    • Management Interfaces: Control via CLI, API, and a Web UI for agent management.
    • Configuration: Managed via a simple YAML configuration file.
  2. Retrieve Strolt Proxy system information

    Use the /api/v1/info endpoint to get general information about the Strolt Proxy. This endpoint requires Basic Authentication.
    curl -u username:password GET /api/v1/info
  3. Configure a PostgreSQL backup service in Strolt

    This example demonstrates how to configure a Strolt service to back up a PostgreSQL database to a MinIO S3 bucket using the Restic driver. It includes scheduling for backups and pruning, the use of environment variable placeholders for credentials, and notification integration for errors.
    timezone: America/New_York
    
    tags:
      - tag1:value
      - tag2:value
      - tag3:value
    
    services:
      example:
        database:
          tags:
            - taskTag
          schedule:
            backup: "0 0 * * *"
            prune: "0 20 * * *"
          source:
            driver: pg
            config:
              host: "{{.PG_HOST}}"
              database: "{{.PG_DATABASE}}"
              username: "{{.PG_USER}}"
              password: "{{.PG_PASSWORD}}"
          destinations:
            restic-postgres:
              extends: minio_restic
              env:
                RESTIC_PASSWORD: "{{.RESTIC_PASSWORD}}"
                RESTIC_REPOSITORY: "s3:{{.MINIO_S3_URL}}/EXAMPLE2/restic-postgres"
          notifications:
            - telegram
            - errors
    
    secrets:
      RESTIC_PASSWORD: password
      PG_HOST: postgres
      PG_DATABASE: strolt
      PG_USER: strolt_user
      PG_PASSWORD: strolt_password
    
    extends:
      secrets:
        - ./strolt.secrets.yml
      configs:
        - ./strolt.base.yml
  4. Configure task notifications and event triggers

    Notifications are defined in definitions.notifications and assigned to tasks by name. You can filter which events trigger a notification using the events array. Available events include:

    • OPERATION_START, OPERATION_STOP, OPERATION_ERROR
    • SOURCE_START, SOURCE_STOP, SOURCE_ERROR
    • DESTINATION_START, DESTINATION_STOP, DESTINATION_ERROR
    services:
      my-service:
        my-task:
          notifications:
            - tg-errors
    
    definitions:
      notifications:
        tg-errors:
          driver: telegram
          config:
            token: "123456:ABC-DEF"
            chatId: "1234567890"
          events: [OPERATION_ERROR, SOURCE_ERROR, DESTINATION_ERROR]
  5. Manage reusable destination templates

    You can define destination templates in the definitions.destinations section and reference them within a task using the extends keyword. This avoids duplicating driver and config settings across multiple tasks.
    services:
      my-service:
        my-task:
          destinations:
            my-backup-dest:
              extends: destination-template
    
    definitions:
      destinations:
        destination-template:
          driver: restic
          config:
            keep:
              last: 5
  6. Configure task schedules using cron

    Tasks within a service can have a schedule block containing backup and prune keys. Both accept standard cron rules to determine when the operation should run.
    schedule:
      # run every day at 6:00 and 18:00 UTC
      backup: "0 6,18 */1 * *"
      prune: "0 6,18 */1 * *"
  7. Define services and tasks in Strolt

    The services element is REQUIRED. It is a map of services, where each service contains tasks. Each task can define its own tags, schedule, source, destinations, and notifications.
    services:
      service-name:
        task-name:
          tags:
            - tag1:v0.01
          schedule:
            backup: "0 6,18 */1 * *"
            prune: "0 6,18 */1 * *"
          source:
            driver: pg
            config:
              host: 127.0.0.1
              port: 5432
              database: pg_database
              username: pg_username
              password: pg_password
          destinations:
            restic:
              driver: restic
              config: {}
              env: {}
          notifications:
            - telegram
  8. Configure Slack notification driver in Strolt

    To send notifications to Slack, use the slack driver. The configuration requires the teamId, botId, and hookId, which are derived from the Slack Webhook URL format: https://hooks.slack.com/services/{botId}/{teamId}/{hookId}.
    definitions:
      notifications:
        {notification name}:
          driver: slack
          config:
            teamId: Txxxxxxxxxx
            botId: Bxxxxxxxxxx
            hookId: rOtl1yLfUb7r1laqX27X0GBH
  9. Configure notification event triggers in Strolt

    Define which system events trigger a specific notification driver by adding them to the events list under the notification name in the configuration. If no events are explicitly defined, the system defaults to triggering on OPERATION_STOP and OPERATION_ERROR.
    definitions:
      notifications:
        my_notification_name:
          driver: {driver_name}
          config: {}
          events:
            - OPERATION_START
            - OPERATION_STOP
            - OPERATION_ERROR
            - SOURCE_START
            - SOURCE_STOP
            - SOURCE_ERROR
            - DESTINATION_START
            - DESTINATION_STOP
            - DESTINATION_ERROR
  10. Strolt configuration file basics

    Strolt uses a YAML file to define services, timezones, tags, secrets, extensions, and definitions. The application looks for strolt.yaml (preferred) or strolt.yml in the working directory. If both exist, strolt.yaml takes precedence.
  11. Configure global settings in the Strolt file

    The Strolt YAML file supports several top-level elements for global configuration:

    • timezone: Sets the IANA Time Zone (defaults to Local).
    • tags: An array of strings used for global tagging.
    • secrets: A map of key-value pairs for sensitive data.
    • extends: Used to include external YAML files for secrets or configs.
    • definitions: Used to create reusable templates for destinations and notifications.
    timezone: UTC
    disableWatchChanges: false
    tags:
      - tag1:value
      - tag2:value
    secrets:
      SUPER_SECRET: SECRET
    extends:
      secrets:
        - ./secrets.yml
      configs:
        - ./strolt_config.yml