moley

command module
v2.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 3 Imported by: 0

README

Moley

Release Go Reference Homebrew License CI

Moley

Share a local app on your own domain in one command.

Moley unlocks the good parts of Cloudflare (Tunnels, DNS, Access) straight from a single config file. Point it at localhost:3000, declare who can see it, get a live URL. You never have to touch the Cloudflare dashboard.

What you can do

One moley.yml, one command, and Cloudflare does the rest. A few real setups:

Share a dev app with a teammate

You're building something on localhost:3000 and want to show it to one person, signed in with their GitHub account, on your own domain.

access:
  policies:
    - name: just-us
      decision: allow
      include:
        - email: {email: "teammate@example.com"}

ingress:
  zone: "example.com"
  mode: subdomain
  apps:
    - target: {hostname: localhost, port: 3000, protocol: http}
      expose: {subdomain: demo}
      access:
        providers: [github, onetimepin]
        session_duration: "168h"
      policies: [just-us]

moley tunnel rundemo.example.com, behind a GitHub login, locked to the email you listed.

Let the whole company in

Swap the policy. Anyone with a company email, signed in through your corporate IdP, gets through.

access:
  policies:
    - name: company-only
      decision: allow
      include:
        - email_domain: {domain: "mycompany.com"}

ingress:
  zone: "example.com"
  mode: subdomain
  apps:
    - target: {hostname: localhost, port: 3000, protocol: http}
      expose: {subdomain: staging}
      access:
        providers: [google-workspace]
      policies: [company-only]
Gate an API for a single service

Expose a local API so only one caller can reach it, using a Cloudflare service token. No browser flow, no IdP.

access:
  policies:
    - name: one-client
      decision: non_identity
      include:
        - service_token: {token_id: "your-service-token-uuid"}

ingress:
  zone: "example.com"
  mode: subdomain
  apps:
    - target: {hostname: localhost, port: 8080, protocol: http}
      expose: {subdomain: api}
      policies: [one-client]

The caller sends CF-Access-Client-Id and CF-Access-Client-Secret headers. Everyone else gets blocked at Cloudflare's edge, before a single packet hits your laptop.

Mix and match

Nothing stops you from combining these in one file. Dashboard behind a GitHub login, webhook behind a service token, public status page behind nothing at all, all running through the same tunnel, all cleaned up when you run moley tunnel stop.

Install

Homebrew:

brew install --cask stupside/tap/moley

Go:

go install github.com/stupside/moley/v2@latest

Or grab a binary from the releases page.

Quick start

moley config set --cloudflare.token="your-api-token"

moley tunnel init

moley tunnel run

Documentation

Full documentation is available at moley.dev.

Contributing

See CONTRIBUTING.md.

License

MIT. See LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal
app/session
Package session orchestrates the full lifecycle of a tunnel session: tunnel infrastructure, DNS routing, and Cloudflare Access protection.
Package session orchestrates the full lifecycle of a tunnel session: tunnel infrastructure, DNS routing, and Cloudflare Access protection.
domain
Package domain provides core domain models for Moley.
Package domain provides core domain models for Moley.
features/access/usecase
Package access provides the Cloudflare Access application lifecycle handler for the reconciler.
Package access provides the Cloudflare Access application lifecycle handler for the reconciler.
features/dns/cloudflare
Package cloudflare provides Cloudflare-specific implementations.
Package cloudflare provides Cloudflare-specific implementations.
features/dns/usecase
Package dns provides the DNS record lifecycle handler for the reconciler.
Package dns provides the DNS record lifecycle handler for the reconciler.
features/tunnel/cloudflare
Package cloudflare provides Cloudflare-specific implementations.
Package cloudflare provides Cloudflare-specific implementations.
platform/logging
Package logging provides structured logging for Moley.
Package logging provides structured logging for Moley.
platform/orchestration
Package orchestration provides DAG-based resource lifecycle management.
Package orchestration provides DAG-based resource lifecycle management.
platform/paths
Package paths provides utilities for managing file system paths in Moley.
Package paths provides utilities for managing file system paths in Moley.
version
Package version provides build-time version information.
Package version provides build-time version information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL