Skip to content

klowdo/linkding-traefik-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linkding-Traefik Sync

License: MIT

Automatically sync your Traefik routes to Linkding bookmarks.

Features

  • Syncs all enabled Traefik HTTP routers to Linkding as bookmarks
  • Automatic tagging of synced bookmarks
  • Skip filter to ignore hosts matching a regex pattern
  • Uses container labels (homepage.name) for bookmark titles when available
  • Dry run mode for testing without making changes
  • Health check endpoint for container orchestration
  • Graceful shutdown handling
  • Configurable sync interval

Quick Start

services:
  linkding-traefik-sync:
    image: ghcr.io/klowdo/linkding-traefik-sync:latest
    environment:
      LINKDING_URL: https://linkding.example.com
      LINKDING_TOKEN: your_api_token
      TRAEFIK_API_URL: http://traefik:8080
      SYNC_INTERVAL: 300
      BOOKMARK_TAGS: traefik,home-lab
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: unless-stopped

Configuration

Variable Required Default Description
LINKDING_URL Yes - URL to your Linkding instance
LINKDING_TOKEN Yes - Linkding API token
TRAEFIK_API_URL Yes - URL to Traefik API (usually port 8080)
SYNC_INTERVAL No 300 Seconds between sync runs
BOOKMARK_TAGS No traefik,home-lab Comma-separated tags applied to bookmarks
SKIP_PATTERN No - Regex pattern for hosts to skip
SYNC_DRY_RUN No false Log actions without making changes
HEALTH_FILE No /tmp/healthy Path to health check file

Getting Your Linkding API Token

  1. Log in to your Linkding instance
  2. Go to Settings > Integrations
  3. Generate a new API token
  4. Copy the token to your configuration

Enabling Traefik API

Add the following to your Traefik configuration:

api:
  dashboard: true
  insecure: true

Or via command line:

command:
  - --api.dashboard=true
  - --api.insecure=true

The API will be available on port 8080 by default.

Example Output

[2024-01-15T10:30:00+00:00] Linkding-Traefik Sync starting...
[2024-01-15T10:30:00+00:00] Traefik API: http://traefik:8080
[2024-01-15T10:30:00+00:00] Linkding URL: https://linkding.example.com
[2024-01-15T10:30:00+00:00] Sync interval: 300s
[2024-01-15T10:30:00+00:00] Bookmark tags: traefik,home-lab
[2024-01-15T10:30:00+00:00] Starting sync...
[2024-01-15T10:30:01+00:00] Added bookmark: https://app.example.com (title: My App)
[2024-01-15T10:30:01+00:00] Added bookmark: https://api.example.com (title: api.example.com)
[2024-01-15T10:30:01+00:00] Sync complete: 2 added, 0 skipped

Docker Socket Access

To use container labels for bookmark titles, mount the Docker socket:

volumes:
  - /var/run/docker.sock:/var/run/docker.sock:ro

The sync will look for these labels in order:

  1. homepage.name - Homepage dashboard integration label
  2. Container name as fallback

License

MIT

About

Automatically sync your Traefik routes to Linkding bookmarks

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors