File size: 5,546 Bytes
be8c7bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67a5cb1
 
 
5ee080c
 
 
 
67a5cb1
 
 
 
 
 
be8c7bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6b586fa
 
 
 
 
be8c7bb
 
 
 
 
c6ffa66
83babc8
be8c7bb
 
 
 
 
 
 
6e26197
be8c7bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4b5ca71
 
 
6b586fa
be8c7bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# ============================================================================
# HuggingClip - Paperclip on Hugging Face Spaces
# Configuration Reference
# ============================================================================

# ============================================================================
# Hugging Face Integration (REQUIRED for backup persistence)
# ============================================================================

# Your Hugging Face API token (needed for backup/restore)
# Get it from: https://huggingface.co/settings/tokens
HF_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Your Hugging Face username (optional, auto-detected from token if not set)
# HF_USERNAME=your-username

# ============================================================================
# Paperclip Core Configuration
# ============================================================================

# PostgreSQL connection string
# Format: postgres://user:password@host:port/database
DATABASE_URL=postgres://postgres:paperclip@localhost:5432/paperclip

# Paperclip API port
PORT=3100

# Serve the Paperclip UI (true/false)
SERVE_UI=true

# Node.js environment (development/production)
NODE_ENV=production

# Server bind address
HOST=0.0.0.0

# Paperclip home directory for config/data storage
PAPERCLIP_HOME=/paperclip

# Deployment mode (local/authenticated)
# Use 'authenticated' for production with Better Auth
PAPERCLIP_DEPLOYMENT_MODE=authenticated

# ============================================================================
# Paperclip Agent Providers (varies by setup)
# ============================================================================

# Claude Code β€” choose one mode or neither:
#
# Subscription mode (Claude Pro/Max β€” no per-token cost):
#   Generate a long-lived token (valid 1 year) at:
#   claude.ai β†’ Settings β†’ Claude Code β†’ "Create token"
#   Then set: export CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
# CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-xxxxxxxxxxxxxxxxxxxx
#
# API key mode (pay-per-use):
# ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
#
# Neither set β†’ Claude Code uses stored OAuth credentials from ~/.claude/
#               (requires first-time login inside the container)

# For other LLM providers (OpenAI, etc.)
# LLM_API_KEY=your-api-key

# Allow Claude Code to use all models (default: restricted)
OPENCODE_ALLOW_ALL_MODELS=true

# ============================================================================
# Cloudflare Proxy (Optional - for bypassing HF Spaces network blocks)
# ============================================================================

# Cloudflare API token for setting up outbound proxy
# Get it from: https://dash.cloudflare.com/profile/api-tokens
# CLOUDFLARE_WORKERS_TOKEN=xxx

# Extra domains to proxy, merged with built-in defaults (Telegram, Discord, WhatsApp,
# Facebook, Google). Comma-separated. Set to "*" to proxy ALL external traffic.
# Leave unset to proxy only the built-in default domains.
# CLOUDFLARE_PROXY_DOMAINS=api.sendgrid.com,slack.com

# ============================================================================
# Database Backup Configuration
# ============================================================================

# Sync interval in seconds (how often to backup to HF Dataset)
# Default: 86400 (24h). Override via Space secret to sync more frequently.
SYNC_INTERVAL=3600

# Maximum file size for individual backups (in bytes)
# Default: 52428800 (50MB)
SYNC_MAX_FILE_BYTES=52428800

# Name of the HF Dataset to store backups
# Will be created as: {HF_USERNAME}/{BACKUP_DATASET_NAME}
BACKUP_DATASET_NAME=huggingclip-backup

# ============================================================================
# Authentication & Security
# ============================================================================

# Better Auth secret for user authentication
# Generate a random secret: openssl rand -base64 32
BETTER_AUTH_SECRET=your-random-secret-here-minimum-32-characters

# Optional: Discord webhook for admin notifications
# DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...

# ============================================================================
# Monitoring & Uptime
# ============================================================================

# Cloudflare proxy & keep-alive: add your Cloudflare API token.
# A Worker is created automatically at boot for both outbound proxying and keep-alive.
# CLOUDFLARE_WORKERS_TOKEN=your_cloudflare_token_here

# Optional: Webhook URL for restart/failure alerts
# WEBHOOK_URL=https://uptime-robot-webhook-url

# ============================================================================
# Telemetry & Privacy
# ============================================================================

# Disable Paperclip telemetry (1 = disabled)
PAPERCLIP_TELEMETRY_DISABLED=1

# Respect Do Not Track header
DO_NOT_TRACK=1

# ============================================================================
# Development-Only Variables (for local testing)
# ============================================================================

# Debug logging (set to anything to enable)
# DEBUG=1

# ============================================================================
# HuggingFace Spaces Specific
# ============================================================================

# These are automatically set by HF Spaces:
# SPACE_ID: your-space-id
# SPACE_PERSISTENT_DIRECTORY: /tmp (ephemeral, 50GB)
# SPACE_AUTHOR_NAME: your-hf-username
# SPACE_RUNTIME: docker