somratpro commited on
Commit
b0d5852
Β·
1 Parent(s): 928c07f

docs: revamp README with comprehensive features, setup guides, and project badges

Browse files
Files changed (1) hide show
  1. README.md +123 -47
README.md CHANGED
@@ -1,32 +1,51 @@
1
  ---
2
  title: Hugging8n
3
  emoji: πŸ”—
4
- colorFrom: blue
5
- colorTo: indigo
6
  sdk: docker
7
  app_port: 7861
8
  pinned: true
9
  license: mit
10
  secrets:
11
  - name: HF_TOKEN
12
- description: HuggingFace token with write access (Settings > Tokens). Used for automatic backup.
13
  - name: CLOUDFLARE_PROXY_URL
14
- description: Your Cloudflare Worker URL to bypass platform blocks (Telegram/Discord). Required for most external services.
15
  ---
16
 
17
- # πŸ”— Hugging8n
18
-
19
- **Self-hosted n8n workflow automation β€” free, no server needed.** Hugging8n runs [n8n](https://n8n.io) on HuggingFace Spaces Docker, serving a premium dashboard at `/` and the n8n editor is accessible via the dashboard.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  ## ✨ Features
22
 
23
- - ⚑ **Zero Config:** Duplicate this Space, set `HF_TOKEN`, and you're ready.
24
- - πŸ’Ύ **Persistent Backup:** Workflows and credentials back up automatically to a private HF Dataset.
25
- - πŸ” **Secure by Default:** Uses n8n v2's built-in user management. No more insecure environment variables.
26
- - 🌐 **Premium Dashboard:** Live status monitoring, uptime tracking, and integrated keep-alive tools.
27
- - πŸ› οΈ **Built-in Connectivity Fixes:** Automatic DNS-over-HTTPS (DoH) and Transparent Outbound Proxying to bypass platform networking blocks.
28
- - ⏰ **Built-in Keep-Alive:** Easily setup UptimeRobot directly from the dashboard UI.
29
- - 🐳 **Optimized Infrastructure:** Clean startup logs, minimal resource usage, and production-ready proxy.
30
 
31
  ## πŸš€ Quick Start
32
 
@@ -34,59 +53,116 @@ secrets:
34
 
35
  [![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-xl.svg)](https://huggingface.co/spaces/somratpro/Hugging8n?duplicate=true)
36
 
37
- ### Step 2: Configure Secrets
38
 
39
- Go to **Settings > Secrets** and add:
40
 
41
- - `HF_TOKEN`: Your HuggingFace token with **Write** access.
 
42
 
43
- ### Step 3: Initialize n8n
44
 
45
- 1. Wait for the Space to build.
46
- 2. Visit the Space URL and click **Open n8n Editor**.
47
- 3. Create your owner account (this is your primary login).
 
48
 
49
- ## βš™οΈ Configuration
50
 
51
- You can customize Hugging8n using Environment Variables (Settings > Variables):
 
 
 
52
 
53
- | Variable | Default | Description |
54
- | :--- | :--- | :--- |
55
- | `SYNC_INTERVAL` | `180` | Backup frequency in seconds. |
56
- | `GENERIC_TIMEZONE` | `UTC` | Timezone for n8n. |
57
- | `N8N_LOG_LEVEL` | `error` | Set to `info` for more verbose logs. |
58
- | `CLOUDFLARE_PROXY_URL` | (Required) | Your Cloudflare Worker URL (to bypass Discord/Telegram blocks). |
59
- | `CLOUDFLARE_PROXY_DOMAINS` | (default) | Comma-separated list of domains to proxy. Use `*` to proxy everything. |
60
- | `SPACE_HOST_OVERRIDE` | - | Override the detected host if using a custom domain. |
61
 
62
- ## πŸ” Authentication & Security
63
 
64
- Hugging8n uses n8n's native user management.
 
 
 
65
 
66
- - The first person to access the n8n editor on a fresh install becomes the **Owner**.
67
- - **Important:** If you delete the Space and haven't set up `HF_TOKEN`, your users and workflows will be lost.
68
- - **Permissions:** The startup script uses `umask 0077` to ensure all sensitive data is restricted to the node user.
69
 
70
  ## πŸ’Ύ Persistent Backup
71
 
72
- Hugging8n automatically creates and maintains a private dataset in your Hugging Face account named `hugging8n-backup`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
- - **Sync Status:** You can check the current sync health directly on the Hugging8n Dashboard.
75
- - **Restoration:** On every startup, Hugging8n pulls the latest state from your dataset before launching n8n.
76
 
77
- ## ⚠️ Known Limitations & Workarounds
78
 
79
- **External Connectivity (Telegram/Discord/WhatsApp)**
80
- Hugging Face officially blocks outgoing connections to specific services on Free Tier Spaces. Hugging8n includes a transparent proxy system to bypass this automatically.
81
 
82
- πŸ‘‰ **[Read the Cloudflare Proxy Guide](./CLOUDFLARE_PROXY_GUIDE.md)**
83
- *(Upgrading to a paid Space removes this firewall restriction entirely).*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  ## πŸ—οΈ Architecture
86
 
87
- - `/` : **Premium Dashboard** (Management & Monitoring)
88
- - All other paths (e.g., `/home/workflows`) : Proxied to **n8n Workflow Editor**
89
- - `/health` : **Health Check** (Used by the internal proxy and external monitors)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
  ---
92
  *Made with ❀️ by [@somratpro](https://github.com/somratpro)*
 
1
  ---
2
  title: Hugging8n
3
  emoji: πŸ”—
4
+ colorFrom: red
5
+ colorTo: yellow
6
  sdk: docker
7
  app_port: 7861
8
  pinned: true
9
  license: mit
10
  secrets:
11
  - name: HF_TOKEN
12
+ description: HuggingFace token with write access. Used for automatic workspace backup.
13
  - name: CLOUDFLARE_PROXY_URL
14
+ description: Your Cloudflare Worker URL to bypass platform blocks (Telegram/Discord).
15
  ---
16
 
17
+ <!-- Badges -->
18
+ [![GitHub Stars](https://img.shields.io/github/stars/somratpro/hugging8n?style=flat-square)](https://github.com/somratpro/hugging8n)
19
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
20
+ [![HF Space](https://img.shields.io/badge/πŸ€—%20HuggingFace-Space-blue?style=flat-square)](https://huggingface.co/spaces)
21
+ [![n8n](https://img.shields.io/badge/n8n-Workflow-orange?style=flat-square)](https://n8n.io)
22
+
23
+ **Self-hosted n8n workflow automation β€” free, no server needed.** Hugging8n runs [n8n](https://n8n.io) on HuggingFace Spaces, providing a 24/7 automation engine for your workflows. It includes a premium management dashboard, automatic persistent backup to HF Datasets, and built-in connectivity fixes to bypass platform restrictions. Deploy in minutes on the free HF Spaces tier with full data persistence.
24
+
25
+ ## Table of Contents
26
+
27
+ - [✨ Features](#-features)
28
+ - [πŸš€ Quick Start](#-quick-start)
29
+ - [🌐 Cloudflare Proxy Setup](#-cloudflare-proxy-setup)
30
+ - [πŸ’Ύ Persistent Backup](#-persistent-backup)
31
+ - [πŸ’“ Staying Alive](#-staying-alive)
32
+ - [πŸ” Security & Advanced *(Optional)*](#-security--advanced-optional)
33
+ - [πŸ’» Local Development](#-local-development)
34
+ - [πŸ—οΈ Architecture](#-architecture)
35
+ - [πŸ› Troubleshooting](#-troubleshooting)
36
+ - [πŸ“š Links](#-links)
37
+ - [🀝 Contributing](#-contributing)
38
+ - [πŸ“„ License](#-license)
39
 
40
  ## ✨ Features
41
 
42
+ - ⚑ **Zero Config:** Duplicate this Space, set `HF_TOKEN`, and start automating – no other setup needed.
43
+ - πŸ’Ύ **Persistent Backup:** Workflows, credentials, and settings automatically sync to a private HF Dataset, preserving your data across restarts.
44
+ - πŸ” **Secure by Default:** Uses n8n's native user management and restricted file permissions (`umask 0077`).
45
+ - 🌐 **Built-in Connectivity:** Includes Transparent Outbound Proxying and DNS-over-HTTPS (DoH) to bypass Hugging Face networking blocks for Telegram, Discord, and others.
46
+ - πŸ“Š **Premium Dashboard:** Beautiful Web UI at `/` for real-time monitoring of uptime, sync health, and n8n status.
47
+ - ⏰ **Easy Keep-Alive:** Set up a one-time UptimeRobot monitor directly from the dashboard to keep your free Space awake.
48
+ - 🐳 **Optimized Infrastructure:** Minimal resource usage with clean startup logs and production-ready proxying.
49
 
50
  ## πŸš€ Quick Start
51
 
 
53
 
54
  [![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-xl.svg)](https://huggingface.co/spaces/somratpro/Hugging8n?duplicate=true)
55
 
56
+ ### Step 2: Add Your Secrets
57
 
58
+ Navigate to your new Space's **Settings**, scroll down to **Variables and secrets**, and add:
59
 
60
+ - `HF_TOKEN` – Your HuggingFace token with **Write** access (to enable automatic backup).
61
+ - `CLOUDFLARE_PROXY_URL` – *(Optional but Recommended)* Your Cloudflare Worker URL to bypass platform blocks.
62
 
63
+ ### Step 3: Deploy & Initialize
64
 
65
+ The Space will build and start automatically. Once ready:
66
+ 1. Visit the Space URL.
67
+ 2. Click **Open n8n Editor**.
68
+ 3. Create your **Owner account** (this is your primary login).
69
 
70
+ ### Step 4: Monitor & Manage
71
 
72
+ Use the built-in dashboard at the root URL (`/`) to track:
73
+ - **Uptime:** Real-time uptime monitoring.
74
+ - **Sync Status:** Visual indicators for your workflow backups.
75
+ - **Keep-Alive:** Setup tool for external monitors.
76
 
77
+ ## 🌐 Cloudflare Proxy Setup
 
 
 
 
 
 
 
78
 
79
+ Hugging Face Free Tier blocks outgoing connections to some services (Telegram, Discord, etc.). Hugging8n includes a transparent proxy system to bypass this.
80
 
81
+ 1. Go to [Cloudflare Workers](https://dash.cloudflare.com/?to=/:account/workers-and-pages).
82
+ 2. Create a new Worker and paste the code from [cloudflare-worker.js](./cloudflare-worker.js).
83
+ 3. Deploy and copy the Worker URL.
84
+ 4. Add this URL as the `CLOUDFLARE_PROXY_URL` secret in your Space settings.
85
 
86
+ > [!TIP]
87
+ > Check the [Cloudflare Proxy Guide](./CLOUDFLARE_PROXY_GUIDE.md) for detailed step-by-step instructions.
 
88
 
89
  ## πŸ’Ύ Persistent Backup
90
 
91
+ Hugging8n automatically creates a private dataset named `hugging8n-backup` in your Hugging Face account.
92
+
93
+ - **Restore:** On startup, it pulls the latest state from your dataset.
94
+ - **Sync:** Periodically (every 3 minutes by default), it pushes updates to the dataset.
95
+ - **Status:** View current sync health on the Hugging8n Dashboard.
96
+
97
+ | Variable | Default | Description |
98
+ | :--- | :--- | :--- |
99
+ | `SYNC_INTERVAL` | `180` | Backup frequency in seconds |
100
+
101
+ ## πŸ’“ Staying Alive *(Recommended on Free HF Spaces)*
102
+
103
+ To help keep your Space awake, set up an external UptimeRobot monitor directly from the dashboard UI.
104
+
105
+ 1. Open your Space's dashboard (`/`).
106
+ 2. Find the **Keep Space Awake** section.
107
+ 3. Paste your UptimeRobot **Main API key**.
108
+ 4. Click **Create Monitor**.
109
 
110
+ Hugging8n will automatically create a monitor for your Space's `/health` endpoint.
 
111
 
112
+ ## πŸ” Security & Advanced *(Optional)*
113
 
114
+ Customize your instance with these environment variables:
 
115
 
116
+ | Variable | Default | Description |
117
+ | :--- | :--- | :--- |
118
+ | `GENERIC_TIMEZONE` | `UTC` | Timezone for your n8n instance |
119
+ | `N8N_LOG_LEVEL` | `error` | Set to `info` or `debug` for more details |
120
+ | `CLOUDFLARE_PROXY_DOMAINS` | (default list) | Comma-separated domains to proxy (or `*` for all) |
121
+ | `SPACE_HOST_OVERRIDE` | β€” | Override detected host for custom domains |
122
+
123
+ ## πŸ’» Local Development
124
+
125
+ ```bash
126
+ git clone https://github.com/somratpro/hugging8n.git
127
+ cd hugging8n
128
+ cp .env.example .env
129
+ # Edit .env with your secrets
130
+ ```
131
+
132
+ **With Docker:**
133
+ ```bash
134
+ docker build -t hugging8n .
135
+ docker run -p 7861:7861 --env-file .env hugging8n
136
+ ```
137
 
138
  ## πŸ—οΈ Architecture
139
 
140
+ - **Dashboard (`/`)**: Management, monitoring, and keep-alive tools.
141
+ - **n8n Editor (`/home/workflows`)**: All other paths are proxied to the internal n8n instance.
142
+ - **Health Check (`/health`)**: Used for uptime monitoring and readiness probes.
143
+ - **Sync Engine**: Background process managing HF Dataset persistence.
144
+ - **Transparent Proxy**: Intercepts requests to blocked domains and routes them via Cloudflare.
145
+
146
+ ## πŸ› Troubleshooting
147
+
148
+ - **Telegram/Discord not connecting:** Ensure `CLOUDFLARE_PROXY_URL` is set correctly.
149
+ - **Workflows not saving:** Check if `HF_TOKEN` has **Write** access to your account.
150
+ - **Space keeps sleeping:** Use the dashboard to set up an UptimeRobot monitor.
151
+ - **Authentication errors:** n8n v2 uses its own internal users; ensure you created the owner account on first run.
152
+
153
+ ## πŸ“š Links
154
+
155
+ - [n8n Documentation](https://docs.n8n.io)
156
+ - [Hugging Face Spaces](https://huggingface.co/docs/hub/spaces)
157
+ - [Cloudflare Workers](https://workers.cloudflare.com/)
158
+
159
+ ## 🀝 Contributing
160
+
161
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
162
+
163
+ ## πŸ“„ License
164
+
165
+ MIT β€” see [LICENSE](LICENSE) for details.
166
 
167
  ---
168
  *Made with ❀️ by [@somratpro](https://github.com/somratpro)*