Self-Hosted alternative to GitHub Gists
 
 
 
 
 
 
Go to file
Aravinth Manivannan 06830bfd2c
feat: DB: visibility filtered gist retrieval
SUMMARY
    GistDatabase::get_user_gists retrieved all gists that were created by
    the user. GistDatabase::get_user_public_gists and
    GistDatabase::get_user_public_unlisted_gists produce
    visibility-filtered results

DESCRIPTION
    Gist visibility levels are ordered in the following order:

		---------------------------------
		| Public < Unlisted < Private   |
		---------------------------------

    A user with permissions to access a visibility-level will
    also have access to the levels lower levels to it. Accessibility
    filters use this mechanism to filter gists: a higher
    visibility-level request will also return  gists with lower
    visibility-levels.

    GistDatabase::get_user_public_unlisted_gists:
	Return all gists that belong to a user with
	public(GistVisibility::Public) and
	unlisted(GistVisibility::UnliUnlisted) visibility levels. Gists
	with private(GistVisibility::Private) visibility levels are
	ignored.

    GistDatabase::get_user_public_gists:
	Return all gists that belong to a user with
	public(GistVisibility::Public) only is returned. Private and
	Unlisted resources are ignored.

    GistDatabase::get_user_gists:
	Returns all gists belonging to a user
2022-02-16 17:13:12 +05:30
.github fix: lints and run migrations before generating coverage in CI 2022-02-13 00:07:28 +05:30
config feat: bootstarp gists 2022-02-12 23:48:35 +05:30
database feat: DB: visibility filtered gist retrieval 2022-02-16 17:13:12 +05:30
docs feat: ecosystem overview 2022-02-12 16:31:00 +05:30
src feat: HTTP JSON endpoint to create new gist 2022-02-15 23:48:05 +05:30
.env-sample feat: bootstrap database ops 2022-02-12 16:35:55 +05:30
.gitignore feat: setup tests 2022-02-12 18:25:45 +05:30
Cargo.lock feat: implement serialization and deserialiation for Gist, GIstPrivacy and GistComments in db_core 2022-02-15 23:46:05 +05:30
Cargo.toml feat: helper method Data::new_gist to create new gist and tests 2022-02-14 22:46:17 +05:30
LICENSE.md add license 2022-02-11 17:42:13 +05:30
Makefile feat: add gists_gists, gists_comments and gists_comments & related methods 2022-02-14 20:11:26 +05:30
README.md feat: add gists_gists, gists_comments and gists_comments & related methods 2022-02-14 20:11:26 +05:30
build.rs init 2022-02-11 17:42:35 +05:30
sqlx-data.json feat: add gists_gists, gists_comments and gists_comments & related methods 2022-02-14 20:11:26 +05:30

README.md

Gists

Self-Hosted GitHub Gists

Build dependency status codecov

Features

  • Upload code snippets
  • Syntax Highlighting
  • Comments
  • Versioning through Git
  • Fork gists
  • Gist privacy: public, unlisted, private
  • Git clone via HTTP and SSH
  • Activity Pub implementation for publishing native gists and commenting

Why?

Gists are nice, while there are wonderful forges like Gitea, there isn't a libre pastebin implementation that can rival GitHub Gists.

Usage

  1. All configuration is done through ./config/default.toml(can be moved to /etc/gists/config.toml).