bởi Mateo Q.

Opengist is a self-hosted Pastebin backed by Git repositories, letting teams create, share, and manage code snippets via a web UI or standard Git commands.
Opengist is a self-hosted pastebin backed by Git repositories, exposing an HTTP and SSH interface for creating, editing, and sharing code snippets. It is written in Go with a TypeScript/Tailwind frontend. The typical buyer is a backend/DevOps engineer embedding a private snippet-sharing service into an existing infrastructure stack.
.github/ - CI/CD workflow definitions (Go build, release, Helm, docs)docker/ - Docker entrypoint script for containerized deploymentdocs/ - VitePress documentation site covering installation, configuration, and usagehelm/ - Kubernetes Helm chart for deploying Opengist to a clusterinternal/ - Core Go application logic (routes, models, Git operations, auth)public/ - Frontend assets: TypeScript entry point, CSS, imagesscripts/ - Build and utility scriptstemplates/ - Go HTML templates rendered server-sideCHANGELOG.md - Version historyLICENSE - AGPL-3.0 license textREADME.md - Project overview and quick-start instructionsconfig.yml - Default application configuration fileopengist.go - Go main entry pointpackage.json - Node.js build dependencies for the frontendnpm install jdenticon
npm install pdfobject
npm install tailwindcss
npm install --save-dev typescript
npm install --save-dev webpack webpack-cli
npm install --save-dev css-loader style-loader file-loader
Native / non-npm build steps required:
- Go 1.23+ must be installed to compile and run the backend (
go buildormake)- Git 2.28+ must be present on the host (Opengist shells out to Git for all repository operations)
- Node.js 16+ is required to bundle the frontend assets before serving
Clone or drop source
Place the entire source/ directory at the root of your project, or alongside your existing service directory. The Go module is self-contained.
Install frontend dependencies
Khởi chạy sandbox cách ly và chạy phía máy chủ — không cần cài đặt cục bộ.
Tetrees AI Review cho phiên bản này
This Go cli / script completed archive review with strong static results. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Quy trình avcp-2026-08-04.1 · SHA-256 1f69d6223f8b83e2…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Đã đánh giá 4 thg 8, 2026
Đưa sản phẩm này thẳng vào AI IDE, trình tạo web hoặc cloud IDE của bạn.
Kết nối Tetrees với AI IDE tương thích để liệt kê sản phẩm bạn sở hữu và nhận ZIP đã xác minh mà không cấp quyền tải lên của người bán.
Chưa có đánh giá.
Sign in to join the discussion
Loading discussion…
cd source
npm install
Build frontend assets
npm run build
# or, if a Makefile target exists:
make assets
Configure the application
Copy and edit source/config.yml:
cp source/config.yml ./config.yml
Key environment variables / config fields:
# config.yml excerpt
opengist-home: ~/.opengist # data directory for repos and DB
db-filename: opengist.db # SQLite filename (relative to opengist-home)
http.host: 0.0.0.0
http.port: 6157
ssh.port: 2222
Build and run the Go binary
cd source
go build -o opengist .
./opengist --config ../config.yml
Wire TypeScript paths (if integrating the frontend into your own TS project)
In tsconfig.json, add a path alias pointing at the public TypeScript sources:
{
"compilerOptions": {
"paths": {
"@opengist/*": ["./source/public/ts/*"]
}
}
}
Environment variables (Docker-compatible overrides):
OG_SECRET_KEY=your-random-secret
OG_DB_FILENAME=opengist.db
OG_HTTP_PORT=6157
OG_SSH_PORT=2222
The public surface exposed from source/public/ts/main.ts is behavioral/DOM-level rather than a module export API. The following symbols are directly used and observable:
import jdenticon from 'jdenticon/standalone';
jdenticon.update(selector: string): void;
Scans the DOM for elements matching selector and renders an identicon SVG based on each element's data-jdenticon-value attribute. Call after DOM mutations that introduce new user avatars.
import PDFObject from 'pdfobject';
PDFObject.embed(url: string, targetElement: Element | null): boolean;
Embeds a PDF from url into targetElement using an <embed> tag. Used for .pdf class elements whose data-src holds the PDF URL. Returns false if the browser does not support inline PDFs.
// Internal function in main.ts — not exported, but reproducible:
function colorhash(): void;
Reads location.hash, finds the matching line element in .table-code, and toggles the selected CSS class on its next sibling. Invoke after hash-change events to highlight specific lines in code views.
In a page where user handles are listed, add data-jdenticon-value to container elements and call update after the DOM is ready.
import jdenticon from 'jdenticon/standalone';
document.addEventListener('DOMContentLoaded', () => {
// Dynamically injected user rows include data-jdenticon-value="username"
const rows = document.querySelectorAll('[data-jdenticon-value]');
console.log(`Rendering ${rows.length} identicons`);
jdenticon.update('[data-jdenticon-value]');
});
Given a <div class="pdf" data-src="/files/report.pdf"></div> rendered by the Go template, embed the PDF immediately at load time.
import PDFObject from 'pdfobject';
document.querySelectorAll<HTMLElement>('.pdf').forEach((el) => {
const src = el.dataset.src ?? '';
if (src) {
const success = PDFObject.embed(src, el);
if (!success) {
el.textContent = 'PDF preview not supported in this browser.';
}
}
});
Opengist expiration forms use datetime-local inputs but the backend expects a Unix epoch via a hidden field. Replicate the pattern for any form that needs timezone-safe timestamp submission.
document.querySelectorAll<HTMLFormElement>('form.expirable').forEach((form) => {
form.onsubmit = () => {
form.querySelectorAll<HTMLInputElement>('input[type=datetime-local]').forEach((input) => {
const hidden = document.createElement('input');
hidden.type = 'hidden';
hidden.name = 'expiredAtUnix';
hidden.value = Math.floor(new Date(input.value).getTime() / 1000).toString();
form.appendChild(hidden);
});
return true;
};
});
.github/ - GitHub Actions pipelines: Go unit tests, Docker image release, Helm chart publish, and docs deploy.docker/ - Shell entrypoint that handles UID/GID remapping before starting the Opengist binary inside a container.docs/ - Full VitePress documentation site; rendered and hosted at opengist.io.helm/ - Production-ready Helm chart with deployment, ingress, HPA templates and a values file.internal/ - All Go backend code: HTTP router, SSH server, Git operations, database models, OAuth handlers, admin panel.public/ - Static assets bundled by webpack/esbuild: TypeScript source (ts/), Tailwind CSS (css/), images (img/).scripts/ - Auxiliary shell/Go scripts for development tasks (asset generation, DB migrations, etc.).templates/ - Go html/template files defining every server-rendered page and partial.CHANGELOG.md - Chronological release notes.LICENSE - AGPL-3.0 full license text.README.md - Quickstart, feature list, and links to documentation.config.yml - Reference configuration with all supported keys and their defaults.opengist.go - Go main package; parses config, wires dependencies, starts HTTP and SSH listeners.package.json - Frontend build toolchain and asset pipeline dependencies.init.defaultBranch to be unrecognized and repository creation to fail silently — upgrade Git to 2.28+.opengist-home directory permissions must be writable by the process user; Docker deployments fail if the volume is owned by root and UID/GID env vars are not set.db-filename — ensure only one instance runs per data directory, or switch to PostgreSQL/MySQL.jdenticon ESM/CJS interop — import from jdenticon/standalone (as done in main.ts) not from the default export to avoid bundler issues with tree-shaking the full package.file:// origins; always serve assets over HTTP even in local development.templates/ use Tailwind classes that are absent from public/ts/, add templates/**/*.html to the content array in tailwind.config.js to prevent classes being stripped in production builds.I have dropped the Opengist source into `./source/` in my project.
USAGE.md is also present at `./USAGE.md`.
The upstream package is `opengist` (Go backend, TypeScript/Tailwind frontend,
self-hosted Git-powered pastebin).
Please help me integrate it step-by-step:
1. Read USAGE.md and source/public/ts/main.ts to understand the frontend entry point.
2. Add the required npm dependencies (jdenticon, pdfobject, tailwindcss) to my package.json.
3. Configure webpack or my existing bundler to process source/public/ts/main.ts and
source/public/css/tailwind.css, outputting to my existing public/ dist directory.
4. Wire the Go binary build into my Makefile or docker-compose so that
`source/opengist.go` is compiled and started alongside my other services.
5. Show me how to pass configuration via environment variables (OG_HTTP_PORT,
OG_SECRET_KEY, OG_DB_FILENAME) in my existing .env file.
6. If I need to embed identicons or PDF previews in my own pages, show me
how to reuse the jdenticon.update and PDFObject.embed calls from main.ts.
Do not invent new APIs. Only use symbols and patterns visible in source/ and USAGE.md.
Opengist is licensed under the AGPL-3.0 license — see source/LICENSE. Any modifications to the source must be released under the same license when the software is used over a network.
Upstream project: https://github.com/thomiceli/opengist Documentation: https://opengist.io/docs
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
Hướng dẫn cài đặt đầy đủ và prompt tích hợp sẽ mở khóa sau khi mua.
Automation, Utilities & Developer Tools
Miễn phí