ITGOIT - Wiki

Copyparty

nano docker-compose.yml

services:
  copyparty:
    image: copyparty/ac:latest
    container_name: copyparty
    restart: unless-stopped
    user: "1000:1000"
    ports:
      - 3923:3923
    volumes:
      - ./cfg:/cfg:z
      - ./data:/w:z
    environment:
      - XDG_CONFIG_HOME=/cfg
      - PYTHONUNBUFFERED=1
      # mimalloc improves performance on Alpine-based containers. 
      - LD_PRELOAD=/usr/lib/libmimalloc-secure.so.2

    stop_grace_period: 15s
    healthcheck:
      test: ["CMD-SHELL", "wget --spider -q 127.0.0.1:3923/?reset=/._"]
      interval: 1m
      timeout: 2s
      retries: 5
      start_period: 15s
docker compose up -d

Configure Copyparty

cd cfg
nano copyparty.conf
# -*- mode: yaml -*-
# vim: ft=yaml:

[global]
  # --- Core Settings ---
  p: 3923              # Port to listen on (moved here from docker-compose)
  no-crt               # Disable TLS if you are behind a reverse proxy that handles TLS for you
  e2dsa                # Enable file indexing and filesystem scanning on startup
  e2ts                 # Enable multimedia indexing (for music/video tags)
  theme: 2             # Flat dark theme (0-5 are standard, 2 is modern dark)
  ansi                 # Enable colors in stdout logs
  
  # --- Security & Network ---
  no-robots            # Tell search engines not to index your files
  force-js             # Make the site harder for dumb crawlers to scrape
  vc-url: https://api.copyparty.eu/advisories  # Version-checker: warns admin of CVEs
  
  # --- Reverse Proxy ---
  rproxy: 1            # Grab the correct IP from the Traefik/Cloudflare headers
  xff-src: lan         # Trust proxy headers coming from LAN/Docker networks
  xff-hdr: x-forwarded-for  # (Note: MUST have two spaces before comments here)
  
  # --- Performance & Storage Hacks ---
  dedup                # Prevent duplicate uploads (saves disk space by creating symlinks)
  hardlink             # Use hardlinks instead of symlinks when deduplication triggers (saves inodes)
  hist: /cfg/hist      # Store the database and thumbnails in ./cfg instead of ./data
  
[accounts]
  public: guest        # Username: Password
  admin: Copyparty!    # Tip: You can hash these later using `copyparty --ah-cli`


  # --- VOLUMES ---
[/]                    # ROOT VOLUME
  /w                   # We must explicitly map subfolders
  accs:
    A: admin           # Admin gets full control
  flags:
    dothidden          # Cosmetically hides files listed in a `.hidden` text file
    hardlinkonly       # If deduplication triggers, use hardlinks instead of symlinks

[/public]              # PUBLIC VOLUME
  /w/public            # We must explicitly map subfolders
  accs:
    r: *               # Anyone can Read/Download
    w: *               # Anyone can Upload
    rwmd: public       # 'public' account gets read/write/move/delete
    A: admin           # Admin gets full control

[/private]             # PRIVATE VOLUME
  /w/private           # We must explicitly map subfolders
  accs:
    A: admin           # Only Admin gets full control here