Self-Hosted alternative to GitHub Gists
 
 
 
 
 
 
Go to file
Aravinth Manivannan 18865552e1
feat: Data::write_file and Data::read_file to save and read gists
SUMMARY
    Data::write_file
	Creates a new files and commits them to "master" branch on the
	bare repository allocated for the gist. If multiple files are
	supplied, all files are written and committed in a single
	commit.

	Currently, empty commit message is used but this should probably
	be changed.

	If filename includes spaces it is escaped. Example "foo bar".txt
	is escaped and converted into "foo\ bar".txt.

    Data::read_file
	Reads files already committed to the repository allocated for
	the gist. This method expects filenames provided to be already
	escaped. Failure would result in file not found errors

    Data::get_repository_path
	Receives gist public ID and returns path of the repository
	allocated for the gist. Programmers are expected to use this
	method to work on the repositories instead of manually
	constructing paths.

    crate::utils::escape_spaces
	Escapes spaces in the provided string, "foo bar".txt is
	converted to "foo\ bar".txt
2022-02-15 21:29:55 +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: helper method Data::new_gist to create new gist and tests 2022-02-14 22:46:17 +05:30
docs feat: ecosystem overview 2022-02-12 16:31:00 +05:30
src feat: Data::write_file and Data::read_file to save and read gists 2022-02-15 21:29:55 +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: bootstarp gists 2022-02-12 23:48:35 +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).