• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
flymaster

flymaster

deploy

Public
Like
deploy
Home
Code
2
README.md
H
main.ts
Branches
1
Pull requests
Remixes
History
Environment variables
2
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v101
View latest version
README.md

SourceHut Workshop Repository Webhook

This webhook monitors the SourceHut workshop repository at https://git.sr.ht/~fly/workshop by fetching its RSS feed and deploying the latest changes to a lifehub val.

How It Works

  1. RSS Feed: Fetches the repository's RSS feed from https://git.sr.ht/~fly/workshop/log/rss.xml
  2. Latest Commit: Gets the most recent commit from the RSS feed
  3. Tarball Download: Downloads the tarball from SourceHut's archive endpoint
  4. File Extraction: Extracts all non-dot files from the tarball
  5. Lifehub Deployment: Creates/updates the lifehub val with all repository content

Setup

The webhook is automatically configured to monitor:

  • Repository: https://git.sr.ht/~fly/workshop
  • RSS Feed: https://git.sr.ht/~fly/workshop/log/rss.xml

No environment variables are required - the webhook is hardcoded to monitor this specific repository.

Triggering

The webhook is automatically triggered when this val receives an HTTP request.

API Response

Success Response

{ "success": true, "message": "Successfully deployed X files to lifehub val", "files": ["file1.js", "file2.md", ...], "repository": "https://git.sr.ht/~fly/workshop", "commit": "Latest commit message", "commitLink": "https://git.sr.ht/~fly/workshop/commit/abc123" }

Error Response

{ "error": "Failed to process repository", "details": "Detailed error message", "repository": "https://git.sr.ht/~fly/workshop" }

Lifehub Val Features

The generated lifehub val includes:

  • File Access: Get specific files via ?file=filename query parameter
  • File Listing: GET request without parameters returns all files and metadata
  • Repository Metadata: Commit info, timestamps, and repository details
  • Helper Functions:
    • getFile(filename): Get content of a specific file
    • listFiles(): Get array of all file names
    • getMetadata(): Get repository and commit metadata
    • searchFiles(pattern): Search files by regex pattern
    • getFilesByExtension(ext): Get files by extension

Usage Examples

Trigger the webhook

# Trigger webhook to check for latest changes curl https://your-val-url.web.val.run

Access lifehub content

# Get file list and metadata curl https://lifehub-val-url.web.val.run # Get specific file curl https://lifehub-val-url.web.val.run?file=README.md

Use lifehub programmatically

import { getFile, listFiles, getMetadata, searchFiles } from "./lifehub"; // Get a specific file const readme = getFile("README.md"); // List all files const allFiles = listFiles(); // Get repository metadata const meta = getMetadata(); console.log(`Last commit: ${meta.lastCommit}`); // Search for files const jsFiles = searchFiles("\\.js$");

Features

  • SourceHut Integration: Specifically designed for SourceHut repositories
  • RSS Feed Monitoring: Uses SourceHut's RSS feed format
  • Latest Commit Tracking: Always gets the most recent changes
  • Complete Repository: Downloads entire repository content via tarball
  • Non-Dot File Filtering: Automatically excludes hidden files and .git directory
  • Binary File Filtering: Automatically skips binary files
  • Rich Metadata: Includes commit information and timestamps
  • Comprehensive API: Full set of helper functions for accessing content

File Processing

  • Included: All text files that don't start with a dot
  • Excluded:
    • Dot files (.gitignore, .env, etc.)
    • .git directory and contents
    • Binary files (detected by null bytes)
    • Directory entries

Limitations

  • SourceHut Specific: Designed specifically for SourceHut repositories
  • Public Repository: Works with the public SourceHut workshop repository
  • Tarball Format: Relies on SourceHut's .tar.gz tarball format
  • Text Files Only: Binary files are automatically filtered out
  • File Names: Sanitized for Val Town compatibility

Error Handling

The webhook provides detailed error messages for common issues:

  • RSS feed not found or inaccessible
  • No commits found in RSS feed
  • Tarball download failures
  • Extraction errors
  • Network connectivity issues

Environment Variables

No environment variables are required - the webhook is hardcoded to monitor the SourceHut workshop repository.

Security Notes

  • Generated vals are set to "unlisted" privacy by default
  • No authentication required for webhook trigger
  • Repository must be publicly accessible or provide public RSS feeds
  • Binary files are automatically filtered out for security
  • Only non-dot files are included to avoid sensitive configuration files

Performance

  • Efficient: Downloads only the latest commit via tarball
  • Complete: Gets entire repository content in one request
  • Fast: No recursive API calls needed
  • Memory Efficient: Processes files individually during extraction
  • Scalable: Works with repositories of any size (within memory limits)
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.