BRANDING_GUIDE.md raw

White-Label Branding Guide

ORLY supports full white-label branding, allowing relay operators to customize the UI appearance without rebuilding the application. All branding is loaded at runtime from a configuration directory.

Quick Start

Generate a branding kit:

# Generic/white-label branding (recommended for customization)
./orly init-branding --style generic

# ORLY-branded template
./orly init-branding --style orly

# Custom output directory
./orly init-branding --style generic /path/to/branding

The branding kit is created at ~/.config/ORLY/branding/ by default.

Directory Structure

~/.config/ORLY/branding/
  branding.json          # Main configuration
  assets/
    logo.png             # Header logo (replaces default)
    favicon.png          # Browser favicon
    icon-192.png         # PWA icon 192x192
    icon-512.png         # PWA icon 512x512
  css/
    custom.css           # Full CSS override
    variables.css        # CSS variable overrides only

Configuration (branding.json)

{
  "version": 1,
  "app": {
    "name": "My Relay",
    "shortName": "Relay",
    "title": "My Relay Dashboard",
    "description": "A high-performance Nostr relay"
  },
  "nip11": {
    "name": "My Relay",
    "description": "Custom relay description for NIP-11",
    "icon": "https://example.com/icon.png"
  },
  "manifest": {
    "themeColor": "#4080C0",
    "backgroundColor": "#F0F4F8"
  },
  "assets": {
    "logo": "assets/logo.png",
    "favicon": "assets/favicon.png",
    "icon192": "assets/icon-192.png",
    "icon512": "assets/icon-512.png"
  },
  "css": {
    "customCSS": "css/custom.css",
    "variablesCSS": "css/variables.css"
  }
}

Configuration Sections

SectionDescription
appApplication name and titles displayed in the UI
nip11NIP-11 relay information document fields
manifestPWA manifest colors
assetsPaths to custom images (relative to branding dir)
cssPaths to custom CSS files

Custom Assets

Replace the generated placeholder images with your own:

AssetSizePurpose
logo.png256x256 recommendedHeader logo
favicon.png64x64Browser tab icon
icon-192.png192x192PWA icon (Android)
icon-512.png512x512PWA splash screen

Tip: Use PNG format with transparency for best results.

CSS Customization

Quick Theme Changes (variables.css)

Edit css/variables.css to change colors without touching component styles:

/* Light theme */
html, body {
    --bg-color: #F0F4F8;
    --header-bg: #FFFFFF;
    --primary: #4080C0;
    --text-color: #334155;
    /* ... see generated file for all variables */
}

/* Dark theme */
body.dark-theme {
    --bg-color: #0F172A;
    --header-bg: #1E293B;
    --primary: #60A5FA;
    --text-color: #F8FAFC;
}

Full CSS Override (custom.css)

Edit css/custom.css for complete control over styling:

/* Custom header */
.header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Custom buttons */
button {
    border-radius: 8px;
    font-weight: 500;
}

/* Custom cards */
.card {
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

Available CSS Variables

Background Colors

Text Colors

Theme Colors

Status Colors

Form/Input Colors

Button Colors

Environment Variables

VariableDefaultDescription
ORLY_BRANDING_DIR~/.config/ORLY/brandingBranding directory path
ORLY_BRANDING_ENABLEDtrueEnable/disable custom branding

Applying Changes

Restart the relay to apply branding changes:

# Stop and start the relay
pkill orly
./orly

Changes to CSS and assets require a restart. The relay logs will show:

custom branding loaded from /home/user/.config/ORLY/branding

Branding Endpoints

The relay serves branding assets at these endpoints:

EndpointDescription
/branding/logo.pngCustom logo
/branding/favicon.pngCustom favicon
/branding/icon-192.pngPWA icon 192x192
/branding/icon-512.pngPWA icon 512x512
/branding/custom.cssCombined CSS (variables + custom)
/branding/manifest.jsonCustomized PWA manifest

Disabling Branding

To use the default ORLY branding:

# Option 1: Remove branding directory
rm -rf ~/.config/ORLY/branding

# Option 2: Disable via environment
ORLY_BRANDING_ENABLED=false ./orly

Troubleshooting

Branding not loading

CSS changes not appearing

Logo not showing

Colors look wrong in light/dark mode