MCPSERV.CLUB
Opengist

Opengist

Self-Hosted

Self-hosted Pastebin powered by Git

Active(100)
2.8kstars
0views
Updated 17 days ago

Overview

Discover what makes Opengist powerful

Opengist is a self‑hosted Pastebin service that treats every snippet as a Git repository. The core idea is to expose the same semantics that developers are already familiar with—clone, pull, push, and branch—while providing a lightweight web UI for browsing and sharing code. Each gist lives under its own directory in the backing Git store, allowing fine‑grained history tracking and atomic updates. The application is built in Go, with a single binary that can be run directly or deployed via Docker/Helm. Its API surface mirrors the GitHub Gist REST endpoints, making it a drop‑in replacement for teams that rely on public or private gists in CI pipelines, documentation sites, or internal tooling.

REST API

WebSocket API

Git over HTTP/SSH

Fine‑grained visibility

Overview

Opengist is a self‑hosted Pastebin service that treats every snippet as a Git repository. The core idea is to expose the same semantics that developers are already familiar with—clone, pull, push, and branch—while providing a lightweight web UI for browsing and sharing code. Each gist lives under its own directory in the backing Git store, allowing fine‑grained history tracking and atomic updates. The application is built in Go, with a single binary that can be run directly or deployed via Docker/Helm. Its API surface mirrors the GitHub Gist REST endpoints, making it a drop‑in replacement for teams that rely on public or private gists in CI pipelines, documentation sites, or internal tooling.

Architecture

Opengist is a monolithic Go application that bundles an HTTP server, a lightweight WebSocket layer for real‑time updates, and a Git backend powered by git2go. The server exposes:

  • REST API: CRUD operations on gists, user authentication, and webhooks.
  • WebSocket API: Live preview of markdown rendering and syntax highlighting.
  • Git over HTTP/SSH: Standard Git transport protocols are served by an embedded git-http-backend and a custom SSH daemon, allowing external tools to push and pull directly.

The data model is persisted in a single Git repository located under /opengist/data. Metadata such as ownership, visibility flags, and topic tags are stored in a JSON file per gist (meta.json). This eliminates the need for a separate database and leverages Git’s built‑in integrity guarantees.

Core Capabilities

  • Fine‑grained visibility: Public, unlisted, or private gists with optional OpenID Connect or OAuth2 authentication.
  • Rich content: Markdown rendering, CSV preview, and syntax highlighting powered by chroma.
  • Search & tagging: Full‑text search over snippet contents and support for user‑defined topics.
  • Revision history: Git history is exposed via the API; users can diff and revert changes.
  • Embeddable snippets: Public gists can be embedded in external sites via a simple iframe or raw URL.
  • Webhooks: Trigger on push/pull events, enabling CI/CD integrations or notifications.

Deployment & Infrastructure

Opengist ships with container images for every release, supporting both HTTP and SSH ports. A typical docker-compose.yml mounts a host directory ($HOME/.opengist) to persist data across restarts. The application is stateless apart from the Git repository, making horizontal scaling straightforward—multiple instances can share a networked filesystem or use an NFS mount for the data directory. Helm charts are available for Kubernetes, providing ready‑made Ingress and RBAC configurations.

Integration & Extensibility

The API is fully documented in the docs folder and follows GitHub Gist’s REST conventions, so existing clients can interact without modification. Developers can hook into the lifecycle via webhooks or by extending the Go codebase: custom middleware, new authentication providers, or additional metadata fields can be added with minimal effort due to the open‑source license (MIT). The SSH server is pluggable, allowing integration with corporate SSH key management solutions.

Developer Experience

Configuration is YAML‑based and can be overridden by environment variables (UID, GID, port numbers, etc.). The codebase is organized into clear packages: api, git, auth, and web. Unit tests cover core logic, and the CI pipeline runs on GitHub Actions. The community is active on Discord, where contributors discuss feature requests and security issues. Documentation includes a detailed “Usage” section covering Git operations, OAuth setup, and embedding instructions.

Use Cases

  • Internal knowledge bases: Teams can store reusable code snippets with version control, accessible via a simple web UI.
  • CI/CD pipelines: Scripts can be fetched from gists using git clone or HTTP, ensuring reproducibility.
  • Developer tooling: IDE plugins can push snippets directly to a self‑hosted instance, bypassing external rate limits.
  • Educational platforms: Students can submit code snippets that are automatically versioned and reviewed.

Advantages

  • Performance: A single Go binary with no external database means low memory footprint and fast startup.
  • Flexibility: Git‑based storage gives developers full control over history, branching, and atomic merges.
  • Licensing: MIT license allows commercial use without copyleft obligations.
  • Security: Authentication via OAuth2 or OpenID Connect integrates with existing identity providers; private gists are encrypted at rest by Git’s object storage.
  • Simplicity: Docker images and Helm charts reduce operational overhead, while the REST API aligns with familiar GitHub patterns.

Opengist delivers a developer‑centric pastebin that blends the familiarity of Git with the convenience of an online code sharing platform, making it a compelling choice for teams that value version control, extensibility, and self‑hosting.

Open SourceReady to get started?

Join the community and start self-hosting Opengist today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
other
License
AGPL-3.0
Stars
2.8k
Technical Specs
Pricing
Open Source
Docker
Official
Supported OS
LinuxDocker
Author
thomiceli
thomiceli
Last Updated
17 days ago