Spaces:
Paused
feat: add open-source files, fix critical bugs, rewrite README with Duplicate Space button
Browse files- fix: huggingface_hub version was non-existent (==0.34.4), unpinned to latest
- fix: N8N_SECURE_COOKIE defaulted to true, breaking login behind HF TLS proxy (now false)
- fix: WebSocket upgrade handler now forwards Upgrade/Connection headers correctly
- fix: removed deprecated local_dir_use_symlinks param from n8n-sync.py
- fix: chmod 700 on /home/node/.n8n to satisfy n8n permission check
- feat: N8N_VERSION build ARG for optional n8n version pinning via HF Space Variable
- feat: N8N_BASIC_AUTH_ACTIVE=true by default with warning if password not set
- feat: full README rewrite with Duplicate Space button, secrets table, architecture docs
- chore: add CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, CHANGELOG.md
- chore: add .env.example with all variables documented
- chore: add .gitignore
Files changed (11)
- .env.exampleAdded+95
- .gitignoreAdded+33
- CHANGELOG.mdAdded+29
- CODE_OF_CONDUCT.mdAdded+27
- CONTRIBUTING.mdAdded+48
- Dockerfile+5-2
- README.md+194-32
- SECURITY.mdAdded+29
- health-server.js+19-7
- n8n-sync.py-1
- start.sh+14-1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495# =============================================================================# Hugging8n β Environment Variables Reference# Copy to .env and fill in your values before running locally.# On HuggingFace Spaces, add Secrets and Variables in Settings β Variables and secrets.# =============================================================================
# -----------------------------------------------------------------------------# REQUIRED β Basic Auth (set these as Secrets on HF Spaces)# -----------------------------------------------------------------------------
# Username for n8n basic auth loginN8N_BASIC_AUTH_USER=admin
# Password for n8n basic auth login. REQUIRED to protect your instance.# Generate a strong password: openssl rand -base64 24N8N_BASIC_AUTH_PASSWORD=
# -----------------------------------------------------------------------------# RECOMMENDED β Persistent Backup (set these as Secrets on HF Spaces)# -----------------------------------------------------------------------------
# Your Hugging Face write token (to create/update the backup dataset)# Get one at: https://huggingface.co/settings/tokensHF_TOKEN=
# Your Hugging Face username (owner of the backup dataset)# If not set, inferred from SPACE_AUTHOR_NAME automatically on HF SpacesHF_USERNAME=
# Name of the private dataset repo used for backup (auto-created on first run)BACKUP_DATASET_NAME=hugging8n-backup
# How often to sync the backup, in secondsSYNC_INTERVAL=180
# -----------------------------------------------------------------------------# OPTIONAL β n8n Configuration# -----------------------------------------------------------------------------
# Timezone for n8n schedule triggers (e.g. Asia/Dhaka, Europe/London, US/Eastern)GENERIC_TIMEZONE=UTC
# n8n encryption key β protects stored credentials. Persisted in backup.# Generate with: openssl rand -hex 32# WARNING: if you lose this key and your backup, all credentials are lost.N8N_ENCRYPTION_KEY=
# Override the auto-detected Space hostname (leave blank on HF Spaces)SPACE_HOST_OVERRIDE=
# -----------------------------------------------------------------------------# OPTIONAL β Keep-Alive# -----------------------------------------------------------------------------
# UptimeRobot Main API key for creating an external keep-alive monitor# Get one at: https://uptimerobot.com β My Settings β API Settings β Main API Key# This is NOT needed as a HF Space Secret β it's only used by setup-uptimerobot.shUPTIMEROBOT_API_KEY=
# Custom monitor name (defaults to "Hugging8n <space-host>")UPTIMEROBOT_MONITOR_NAME=
# UptimeRobot ping interval in minutes (default: 5)UPTIMEROBOT_INTERVAL=5
# Comma-separated UptimeRobot alert contact IDs (optional)UPTIMEROBOT_ALERT_CONTACTS=
# -----------------------------------------------------------------------------# ADVANCED β n8n Internals (usually leave as defaults)# -----------------------------------------------------------------------------
# Disable n8n basic auth (not recommended β leaves your instance unprotected)# N8N_BASIC_AUTH_ACTIVE=false
# Internal n8n port (default: 5678)N8N_PORT=5678
# Public proxy port exposed by HF Spaces (default: 7861)PUBLIC_PORT=7861
# Disable n8n telemetry (default: false)N8N_DIAGNOSTICS_ENABLED=false
# Disable n8n personalization prompts (default: false)N8N_PERSONALIZATION_ENABLED=false
# -----------------------------------------------------------------------------# BUILD-TIME VARIABLE (HF Spaces: add as Variable, not Secret)# -----------------------------------------------------------------------------
# Pin a specific n8n version for reproducibility (default: latest)# Example: 1.90.0# On HF Spaces, add this as a Variable (not Secret) so it's passed as a build arg.N8N_VERSION=latest123456789101112131415161718192021222324252627282930313233# Environment.env.env.local.env.*.local
# n8n local data.n8n/
# Python__pycache__/*.py[cod]*.pyo*.pyd.Python*.egg-info/dist/build/.venv/venv/
# Nodenode_modules/npm-debug.log*
# OS.DS_StoreThumbs.db
# Editor.vscode/.idea/*.swp*.swo1234567891011121314151617181920212223242526272829# Changelog
All notable changes to this project will be documented in this file.
## [1.0.0] - 2026-04-22
### π Initial Release
#### Features
- **Self-hosted n8n** β runs the latest n8n on HuggingFace Spaces Docker with zero external database requirements (uses SQLite)- **Persistent backup** β automatically backs up `/home/node/.n8n` (workflows, credentials, SQLite DB, encryption key) to a private HF Dataset via `huggingface_hub`- **Safe SQLite backup** β uses `sqlite3 .backup` for a consistent hot-copy of the live database- **Auto-restore on startup** β restores the full n8n state from the dataset before starting n8n- **Graceful shutdown** β runs a final backup pass on `SIGTERM` / `SIGINT` before exiting- **Health endpoint** β `/health` on port 7861 returns sync status and service info- **Proxy server** β lightweight Node.js reverse proxy forwards HTTP and WebSocket traffic from port 7861 to n8n on port 5678- **UptimeRobot integration** β `setup-uptimerobot.sh` creates an external keep-alive monitor for the `/health` endpoint- **Basic auth** β n8n basic auth enabled by default; set `N8N_BASIC_AUTH_USER` and `N8N_BASIC_AUTH_PASSWORD` to secure your instance- **Timezone support** β set `GENERIC_TIMEZONE` for schedule trigger accuracy- **Optional n8n version pinning** β pass `N8N_VERSION` as a HF Space Variable to pin a specific n8n release
#### Architecture
- `Dockerfile` β builds on `node:22-slim`, installs n8n and Python sync dependencies- `start.sh` β validates config, restores backup, starts sync loop, proxy, and n8n- `n8n-sync.py` β manages backup/restore using `huggingface_hub`- `health-server.js` β lightweight HTTP + WebSocket reverse proxy with `/health` and `/status` endpoints- `setup-uptimerobot.sh` β optional one-shot script to create an UptimeRobot monitor123456789101112131415161718192021222324252627# Code of Conduct
## Our Pledge
We are committed to making participation in this project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
**Positive behavior includes:**- Using welcoming and inclusive language- Being respectful of differing viewpoints- Gracefully accepting constructive criticism- Focusing on what is best for the community
**Unacceptable behavior includes:**- Trolling, insulting, or derogatory comments- Public or private harassment- Publishing others' private information without permission- Other conduct which could reasonably be considered inappropriate
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting the maintainer. All complaints will be reviewed and investigated.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.0.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748# Contributing to Hugging8n
Thanks for your interest in contributing! βΎοΈ
## How to Contribute
### Bug Reports- Open an issue with a clear description- Include your HF Space logs if possible- Mention the n8n version you're using (check Space logs on startup)
### Feature Requests- Open an issue with the `enhancement` label- Describe the use case β why is this needed?
### Pull Requests1. Fork the repo2. Create a feature branch: `git checkout -b feature/my-feature`3. Make your changes4. Test locally with Docker: `docker build -t hugging8n . && docker run -p 7861:7861 --env-file .env hugging8n`5. Commit with a clear message6. Push and open a PR
### Code Style- Shell scripts: use `set -e`, quote variables, comment non-obvious logic- Keep it simple β this project should stay easy to understand- No unnecessary dependencies
### Testing- Test with and without `HF_TOKEN` (backup enabled and disabled)- Test with and without `N8N_BASIC_AUTH_ACTIVE`- Verify the `/health` endpoint responds correctly- Verify n8n loads in the browser via the proxy
## Development Setup
```bashcp .env.example .env# Fill in your valuesdocker build -t hugging8n .docker run -p 7861:7861 --env-file .env hugging8n```
Then open `http://localhost:7861` β you should see the n8n UI.
## Questions?
Open an issue or start a discussion. We're friendly! π€123458 unmodified lines1415161718192021222324FROM node:22-slimENV DEBIAN_FRONTEND=noninteractive \N8N_PORT=5678 \HF_HUB_DISABLE_PROGRESS_BARS=1 \8 unmodified linespython3-pip \sqlite3 \tini \&& pip3 install --no-cache-dir --break-system-packages huggingface_hub==0.34.4 \&& npm install -g n8n@latest \&& rm -rf /var/lib/apt/lists/*RUN mkdir -p /home/node/app /home/node/.n8n && \chown -R node:node /home/nodeWORKDIR /home/node/app12345678 unmodified lines161718192021222324252627FROM node:22-slimARG N8N_VERSION=latestENV DEBIAN_FRONTEND=noninteractive \N8N_PORT=5678 \HF_HUB_DISABLE_PROGRESS_BARS=1 \8 unmodified linespython3-pip \sqlite3 \tini \&& pip3 install --no-cache-dir --break-system-packages huggingface_hub \&& npm install -g n8n@${N8N_VERSION} \&& rm -rf /var/lib/apt/lists/*RUN mkdir -p /home/node/app /home/node/.n8n && \chmod 700 /home/node/.n8n && \chown -R node:node /home/nodeWORKDIR /home/node/app
4 unmodified lines567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556574 unmodified linescolorTo: indigosdk: dockerapp_port: 7861pinned: falselicense: mit---# Hugging8nRun a self-hosted n8n instance on Hugging Face Spaces without external database services.This Space uses:- `n8n` running locally on port `5678`- a small proxy/health server on port `7861` for HF Spaces- periodic backup of `/home/node/.n8n` to a private Hugging Face Dataset## Required secret- `HF_TOKEN`: Hugging Face token with write access to create/update a private dataset backup## Recommended variables- `BACKUP_DATASET_NAME`: backup dataset name. Default: `hugging8n-backup`- `SYNC_INTERVAL`: backup interval in seconds. Default: `180`- `GENERIC_TIMEZONE`: timezone for schedule triggers. Example: `Asia/Dhaka`- `N8N_ENCRYPTION_KEY`: optional explicit encryption key. If omitted, n8n stores it inside `.n8n` and the backup preserves it- `N8N_BASIC_AUTH_ACTIVE`: set to `true` if you want built-in basic auth- `N8N_BASIC_AUTH_USER`: basic auth username- `N8N_BASIC_AUTH_PASSWORD`: basic auth password## Optional variables- `HF_USERNAME`: owner of the backup dataset. By default this is inferred from `SPACE_AUTHOR_NAME`- `SPACE_HOST_OVERRIDE`: set this only if you want to override the detected Space hostname- `N8N_DIAGNOSTICS_ENABLED=false`- `N8N_PERSONALIZATION_ENABLED=false`## How persistence worksOn startup, the Space restores `/home/node/.n8n` from a private dataset repo.While running, it watches for changes and uploads the updated `.n8n` directory back to the dataset. This preserves:- workflows- credentials- users- SQLite database- encryption key## Keep-aliveIf you already solved the sleep problem in your HF setup, use that. If not, `setup-uptimerobot.sh` can create an external monitor for `https://<your-space>.hf.space/health`.4 unmodified lines567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182194 unmodified linescolorTo: indigosdk: dockerapp_port: 7861pinned: truelicense: mit---<!-- Badges -->[](https://github.com/somratpro/Hugging8N)[](https://opensource.org/licenses/MIT)[](https://huggingface.co/spaces/somratpro/Hugging8n)[](https://n8n.io)**Self-hosted n8n workflow automation β free, no server needed.** Hugging8n runs [n8n](https://n8n.io) on HuggingFace Spaces Docker, giving you a full-featured workflow automation platform with 400+ integrations. Your workflows, credentials, and settings are automatically backed up to a private HuggingFace Dataset so nothing is lost on restart.## Table of Contents- [β¨ Features](#-features)- [π Quick Start](#-quick-start)- [π Authentication](#-authentication)- [πΎ Persistent Backup](#-persistent-backup)- [π Staying Alive](#-staying-alive)- [ποΈ Architecture](#-architecture)- [π» Local Development](#-local-development)- [π Troubleshooting](#-troubleshooting)- [π€ Contributing](#-contributing)- [π License](#-license)## β¨ Features- β‘ **Zero Config:** Duplicate this Space, set your credentials, and n8n is running in minutes.- π **400+ Integrations:** Connect any service β HTTP, webhooks, databases, Slack, Gmail, GitHub, and more.- πΎ **Persistent Backup:** Workflows, credentials, and the SQLite database back up automatically to a private HF Dataset. Restored on every startup so nothing is lost.- π **Basic Auth:** n8n is protected by basic auth out of the box β just set your username and password.- π³ **Docker Native:** Runs on the free HF Spaces tier (2 vCPU, 16GB RAM) with SQLite β no external database needed.- β° **External Keep-Alive:** Optional UptimeRobot integration to prevent free Space sleep.- π **Health Endpoint:** `/health` returns service and sync status for monitoring.- π **100% HF-Native:** Runs entirely on HuggingFace's free infrastructure.## π Quick Start### Step 1: Duplicate this Space[](https://huggingface.co/spaces/somratpro/Hugging8n?duplicate=true)Click the button above to duplicate the template into your own account.### Step 2: Add Your SecretsNavigate to your new Space's **Settings**, scroll to the **Variables and secrets** section, and add the following under **Secrets**:#### Required β Authentication| Secret | Description || :--- | :--- || `N8N_BASIC_AUTH_PASSWORD` | Password to log in to your n8n instance. Set this to protect your workflows. |#### Required β Persistent Backup *(Highly Recommended)*| Secret | Description || :--- | :--- || `HF_TOKEN` | HuggingFace token with write access. Get one at [hf.co/settings/tokens](https://huggingface.co/settings/tokens). |> [!TIP]> Without `HF_TOKEN`, n8n will still run, but workflows and credentials will be **lost every time the Space restarts**. It is strongly recommended to set this.#### Optional β Configuration| Variable / Secret | Default | Description || :--- | :--- | :--- || `N8N_BASIC_AUTH_USER` | `admin` | Username for n8n login || `HF_USERNAME` | *(auto-detected)* | Your HF username, for naming the backup dataset || `BACKUP_DATASET_NAME` | `hugging8n-backup` | Name of the private dataset repo for backup || `SYNC_INTERVAL` | `180` | How often to back up, in seconds || `GENERIC_TIMEZONE` | `UTC` | Timezone for schedule triggers (e.g. `Asia/Dhaka`) || `N8N_ENCRYPTION_KEY` | *(auto-generated)* | Encryption key for stored credentials. Set explicitly so it survives Space rebuilds. |#### Build-Time Variable (add as Variable, not Secret)| Variable | Default | Description || :--- | :--- | :--- || `N8N_VERSION` | `latest` | Pin a specific n8n version (e.g. `1.90.0`) for reproducibility |> [!IMPORTANT]> On HuggingFace Spaces, `N8N_VERSION` must be added as a **Variable** (not a Secret) so it is passed as a Docker build arg during image build.### Step 3: Deploy & RunThat's it! The Space will build and start automatically. Watch progress in the **Logs** tab. First build takes a few minutes as n8n installs.### Step 4: Log InOnce the Space is running, open it and log in with:- **Username:** the value of `N8N_BASIC_AUTH_USER` (default: `admin`)- **Password:** the value of `N8N_BASIC_AUTH_PASSWORD`> [!WARNING]> If you did not set `N8N_BASIC_AUTH_PASSWORD`, your n8n instance is **unprotected**. Anyone with the Space URL can access your workflows and credentials. Set this secret immediately.## π AuthenticationHugging8n uses n8n's built-in basic auth to protect your instance. It is enabled by default.| Variable | Default | Description || :--- | :--- | :--- || `N8N_BASIC_AUTH_ACTIVE` | `true` | Set to `false` to disable basic auth (not recommended) || `N8N_BASIC_AUTH_USER` | `admin` | Login username || `N8N_BASIC_AUTH_PASSWORD` | *(none)* | Login password β **must be set** |## πΎ Persistent BackupHugging8n automatically backs up your entire n8n data directory (`/home/node/.n8n`) to a **private** HuggingFace Dataset.**What is backed up:**- All workflows- All credentials (encrypted)- SQLite database (hot-copy via `sqlite3 .backup`)- n8n encryption key- User data**How it works:**1. On startup: restore from dataset (if it exists)2. Every `SYNC_INTERVAL` seconds: detect changes and upload3. On shutdown (`SIGTERM`): run a final backup before exiting| Variable | Default | Description || :--- | :--- | :--- || `HF_TOKEN` | β | HF write token || `HF_USERNAME` | *(auto)* | Dataset owner username || `BACKUP_DATASET_NAME` | `hugging8n-backup` | Dataset repo name || `SYNC_INTERVAL` | `180` | Backup interval in seconds |> [!TIP]> Set `N8N_ENCRYPTION_KEY` explicitly. If n8n auto-generates it and the Space is rebuilt (not just restarted), the key will be different and your backed-up credentials will be unreadable.## π Staying Alive *(Recommended on Free HF Spaces)*Free HF Spaces sleep after periods of inactivity. Set up an external UptimeRobot monitor to keep yours awake.1. Create a free account at [uptimerobot.com](https://uptimerobot.com)2. Get your **Main API Key** from My Settings β API Settings3. Run the helper script:```bashUPTIMEROBOT_API_KEY=your-key ./setup-uptimerobot.sh your-space.hf.space```4. UptimeRobot will ping `/health` every 5 minutes from outside HF, keeping the Space awake.> [!NOTE]> This works for **public** Spaces only. Private Spaces cannot be pinged by external monitors.## ποΈ Architecture```Hugging8n/βββ Dockerfile # Builds on node:22-slim, installs n8n + Python syncβββ start.sh # Startup orchestrator: restore β sync loop β proxy β n8nβββ n8n-sync.py # Backup/restore via huggingface_hubβββ health-server.js # HTTP + WebSocket reverse proxy (port 7861 β 5678)βββ setup-uptimerobot.sh # One-shot UptimeRobot monitor creationβββ .env.example # All environment variable documentationβββ README.md # This file```**Startup sequence:**1. Read environment variables and set n8n config2. Warn if `N8N_BASIC_AUTH_PASSWORD` is not set3. Restore backup from HF Dataset (if `HF_TOKEN` is set)4. Start backup sync loop in background5. Start health/proxy server on port 78616. Start n8n on port 56787. On `SIGTERM` / `SIGINT`: final backup + clean exit## π» Local Development```bashgit clone https://github.com/somratpro/Hugging8N.gitcd Hugging8Ncp .env.example .env# Fill in N8N_BASIC_AUTH_PASSWORD and optionally HF_TOKEN```**With Docker:**```bashdocker build -t hugging8n .docker run -p 7861:7861 --env-file .env hugging8n```Then open `http://localhost:7861`.**Pin an n8n version:**```bashdocker build --build-arg N8N_VERSION=1.90.0 -t hugging8n .```## π Troubleshooting- **Can't log in:** Make sure `N8N_BASIC_AUTH_PASSWORD` is set in Secrets. Default username is `admin`.- **Workflows lost after restart:** Set `HF_TOKEN` and `HF_USERNAME` so the backup dataset is created and restored.- **n8n editor shows "disconnected":** The WebSocket proxy may not have connected yet β wait a few seconds and refresh. Check Space logs for errors.- **Space keeps sleeping:** Use `setup-uptimerobot.sh` to set up an external keep-alive monitor.- **Credentials unreadable after rebuild:** Make sure `N8N_ENCRYPTION_KEY` is set explicitly as a Secret. If it was auto-generated, it changes on rebuild.- **Build fails:** If you pinned `N8N_VERSION`, verify the version exists at [npmjs.com/package/n8n](https://www.npmjs.com/package/n8n?activeTab=versions).- **Backup failing:** Check Space logs for `Sync failed`. Verify `HF_TOKEN` has write access and `HF_USERNAME` is correct.## π€ ContributingContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.## π LicenseMIT β see [LICENSE](LICENSE) for details.*Made with β€οΈ by [@somratpro](https://github.com/somratpro)*
1234567891011121314151617181920212223242526272829# Security Policy
## Reporting a Vulnerability
If you discover a security vulnerability, please report it responsibly:
1. **Do NOT open a public issue**2. Email the maintainer or open a private security advisory on GitHub3. Include steps to reproduce if possible
We'll respond within 48 hours and work on a fix.
## Security Best Practices
When deploying Hugging8n:
- **Enable basic auth** β set `N8N_BASIC_AUTH_USER` and `N8N_BASIC_AUTH_PASSWORD` to protect your n8n instance from unauthorized access- **Use a strong password** β generate with `openssl rand -base64 24`- **Set your Space to Private** β prevents unauthorized access to your n8n instance from the web- **Keep your HF token scoped** β use fine-grained tokens with minimum permissions (read/write to your backup dataset only)- **Set a strong `N8N_ENCRYPTION_KEY`** β protects your stored credentials; if lost, credentials cannot be recovered- **Don't commit `.env` files** β the `.gitignore` already excludes them- **Review n8n credentials** β periodically audit credentials stored in n8n
## Supported Versions
| Version | Supported ||---------|-----------|| 1.0.x | β
|74 unmodified lines75767778798081828384858687888990919293949574 unmodified linesserver.on("upgrade", (req, socket, head) => {const upstream = net.connect(TARGET_PORT, TARGET_HOST, () => {socket.write(`${req.method} ${req.url} HTTP/${req.httpVersion}\r\n` +Object.entries(buildHeaders(req)).map(([key, value]) => `${key}: ${value}`).join("\r\n") +"\r\n\r\n",);if (head && head.length) upstream.write(head);upstream.pipe(socket);socket.pipe(upstream);});upstream.on("error", () => {socket.destroy();});});server.listen(PUBLIC_PORT, "0.0.0.0", () => {74 unmodified lines7576777879808182838485868788899091929394959697989910010110210310410510610774 unmodified linesserver.on("upgrade", (req, socket, head) => {const upstream = net.connect(TARGET_PORT, TARGET_HOST, () => {const headers = {...req.headers,host: `${TARGET_HOST}:${TARGET_PORT}`,"x-forwarded-for": req.socket.remoteAddress || "","x-forwarded-host": req.headers.host || "","x-forwarded-proto": req.headers["x-forwarded-proto"] || "https",upgrade: req.headers.upgrade || "websocket",connection: "Upgrade",};const headerLines = Object.entries(headers).map(([key, value]) => `${key}: ${value}`).join("\r\n");upstream.write(`${req.method} ${req.url} HTTP/${req.httpVersion}\r\n` +headerLines +"\r\n\r\n",);if (head && head.length) upstream.write(head);upstream.pipe(socket);socket.pipe(upstream);});upstream.on("error", () => socket.destroy());socket.on("error", () => upstream.destroy());});server.listen(PUBLIC_PORT, "0.0.0.0", () => {
121 unmodified lines122123124125126127128121 unmodified linesrepo_type="dataset",token=HF_TOKEN,local_dir=tmpdir,local_dir_use_symlinks=False,)tmp_path = Path(tmpdir)121 unmodified lines122123124125126127121 unmodified linesrepo_type="dataset",token=HF_TOKEN,local_dir=tmpdir,)tmp_path = Path(tmpdir)
19 unmodified lines202122232425261 unmodified line28293031323319 unmodified linesexport N8N_PROTOCOL="${N8N_PROTOCOL:-https}"export N8N_PROXY_HOPS="${N8N_PROXY_HOPS:-1}"export N8N_LISTEN_ADDRESS="${N8N_LISTEN_ADDRESS:-0.0.0.0}"export N8N_SECURE_COOKIE="${N8N_SECURE_COOKIE:-true}"export N8N_DIAGNOSTICS_ENABLED="${N8N_DIAGNOSTICS_ENABLED:-false}"export N8N_PERSONALIZATION_ENABLED="${N8N_PERSONALIZATION_ENABLED:-false}"export N8N_USER_FOLDER="$N8N_HOME"1 unmodified lineexport GENERIC_TIMEZONE="${GENERIC_TIMEZONE:-${TZ:-UTC}}"export TZ="${TZ:-$GENERIC_TIMEZONE}"echo ""echo " ββββββββββββββββββββββββββββββββββββββ"echo " β Hugging8n β"19 unmodified lines2021222324252627281 unmodified line303132333435363738394041424344454619 unmodified linesexport N8N_PROTOCOL="${N8N_PROTOCOL:-https}"export N8N_PROXY_HOPS="${N8N_PROXY_HOPS:-1}"export N8N_LISTEN_ADDRESS="${N8N_LISTEN_ADDRESS:-0.0.0.0}"# Must be false: HF Spaces terminates TLS at its edge; n8n sees plain HTTP internally.# Secure cookies require HTTPS end-to-end and will break login on HF Spaces.export N8N_SECURE_COOKIE="${N8N_SECURE_COOKIE:-false}"export N8N_DIAGNOSTICS_ENABLED="${N8N_DIAGNOSTICS_ENABLED:-false}"export N8N_PERSONALIZATION_ENABLED="${N8N_PERSONALIZATION_ENABLED:-false}"export N8N_USER_FOLDER="$N8N_HOME"1 unmodified lineexport GENERIC_TIMEZONE="${GENERIC_TIMEZONE:-${TZ:-UTC}}"export TZ="${TZ:-$GENERIC_TIMEZONE}"# Basic auth β enabled by default to protect your n8n instanceexport N8N_BASIC_AUTH_ACTIVE="${N8N_BASIC_AUTH_ACTIVE:-true}"if [ "${N8N_BASIC_AUTH_ACTIVE}" = "true" ]; thenexport N8N_BASIC_AUTH_USER="${N8N_BASIC_AUTH_USER:-admin}"export N8N_BASIC_AUTH_PASSWORD="${N8N_BASIC_AUTH_PASSWORD:-}"if [ -z "${N8N_BASIC_AUTH_PASSWORD:-}" ]; thenecho "β οΈ WARNING: N8N_BASIC_AUTH_ACTIVE=true but N8N_BASIC_AUTH_PASSWORD is not set."echo " Your n8n instance is NOT protected. Set N8N_BASIC_AUTH_PASSWORD in Secrets."fifiecho ""echo " ββββββββββββββββββββββββββββββββββββββ"echo " β Hugging8n β"