commie 2.0 is a pastebin with line commenting support.

Overview

commie2

commie 2.0 is a pastebin script with line commenting support. This was originally forked from splitbrain/commie and further improved and expanded upon.

Features

  • Pastes are stored as files on the filesystem, encrypted at rest. (no need to configure a database, or plugins, etc.)
  • Every line is commentable with the ability for multiple comments from multiple users.
  • Comments support Github Markdown!
  • Names and emails are cookied for better UX, but easily changable.
  • When you make a comment, the user that made the paste can (optionally) receive an email, with syntax highlighted context of the comment and any other contextual comments. (see screenshots)
  • If the paste is markdown, it will auto generate a preview in html (see screenshots)
  • Way simple interface and codebase. When I forked it, it took maybe 5 minutes to figure out what was going on.
  • Upgraded to modern archtecture to keep only public things in the public directory.
  • Compatible with PHP >=7.4
  • Built with:
    • htmx for simple SPA functionality.
    • hyperscript - adds simple javascript functionality that is very easy to read.
    • latte - for templating engine that honestly is really nice. Better than Twig IMO.
    • scrivo/highlight.php - port of highlight.js with support for many languages.
    • fatfree framework - simple full stack framework to get stuff done pretty quick.

Install

To install, simply clone this repo and configure your webserver to point to the public/ directory. If you use apache webserver, there is a .htaccess file that is already configured in the public/ dir. For more info on other sites such as nginx, go here. You will also need composer and to run composer install. Then move to the configuration section.

Configuration

This is very easy to configure. There is a .config_sample.php file with instructions on how to enable emailing, encryption, and other settings. Copy or rename this file to .config.php and you're on your way!

API

The API is simple to use and make new pastes to. You authenticate by sending an Authorization: Bearer apikey header in the request. If you need another header, you can also use the X-Authorization: Bearer apikey header.

New Paste

POST /api/paste/create

Request Parameters (all required)
---------
content=yourpaste
name=Your+name
[email protected]
language=php (optional, the autodetect is pretty good)

Response
-----------
{"uid":"youruid"}

New Comment

POST /api/paste/@paste_uid/comment/@line_number/create

Parameters (all required)
---------
comment=yourcomment
user=Your+name
[email protected]

Response
-----------
{
	"uid":"youruid",
	"line":5,
	"comment":"yourcomment",
	"user_name":"Your name",
	"user_email":"[email protected]",
	"time":1661023034, // from php time() command
	"color":"abc123" // color based on name of user
}

Screenshots

Home Page

Home Page

Making a comment

Making a comment

Viewing comment

Viewing comment

Comment via Email

Comment via Email

Markdown Paste Example

Markdown Paste Example

Contributing

Throw in an issue and if necessary make a pull request. It's a pretty simple codebase!

Security

Gasp! There's a security issue! If you find one, let me know. There probably are some improvements that can be made. Pull requests are cool too.

Tips

  • If you are going to enable email, it would probably be best to put some controls in place to the paste board (such as only certain users can access the URL, HTTP Basic Auth, etc)

Troubleshooting

Got questions? Here's some common ones...

My pastes won't save!

Make sure that your data/ directory is writable by the webserver user (www-user, apache, nobody, nginx, etc). Something like chmod g+w data/ should do the trick. If it you need to also change the owner, do so with chown apache:apache data/ or whatever user you need.

Ok I did that, but they still won't save!

Do you have SELinux enabled? You can check with sestatus as root and see. If you do have it enabled, you need to make sure that the data/ dir has the correct context permissions which would likely be something like semanage fcontext -a -t httpd_sys_rw_content_t "/path/to/commit/data(/.*)?" and then run restorecon -Rv /path/to/commie/

License

MIT License

You might also like...
🎮 A simple command line tool for installing and interacting with your leaf apps
🎮 A simple command line tool for installing and interacting with your leaf apps

Leaf CLI 2 A simple command line tool for creating and interacting with your leaf projects. You can do stuff like installing packages, interacting wit

Rugby schedules on the command-line

Rugby Schedule Rugby Schedule is a command-line tool that keeps you up to date with rugby tournament schedules. Install Requires PHP 8.0 or later Via

Command line of the website.
Command line of the website.

Deutsch English Svenska Command 0.8.42 Command line of the website. How to use the command line Open a terminal window. Go to your installation folder

A collection of command-line utilities to aid in debugging browser engines.

Browser debug utilities This project contains several scripts that make the process of debugging browser engines much easier (some special cases excep

PHP library providing retry functionality with multiple backoff strategies and jitter support

PHP Backoff Easily wrap your code with retry functionality. This library provides: 4 backoff strategies (plus the ability to use your own) Optional ji

Task for GrumPHP that adds CSS linting support with stylelint. An easy way to enforce convention and avoid errors in your styles

grumphp-stylelint-task Installation Stylelint is a static analysis tool for styles. A mighty, modern linter that helps you avoid errors and enforce co

PHPStan extension to support #[Readonly] constructor properties

icanhazstring/phpstan-readonly-property Support #[Readonly] promoted constructor properties for PHPStan. This library is used to have a full transitio

A GETTR.com client library written in PHP with Laravel support.
A GETTR.com client library written in PHP with Laravel support.

Gettr API Clinet PHP A GETTR.com client library written in PHP with Laravel support. This library uses unofficial publicly accessible API endpoints of

A non-intrusive support form that can be displayed on any page
A non-intrusive support form that can be displayed on any page

A non-intrusive support bubble that can be displayed on any page Using this package you can quickly add a chat bubble that opens a support form on any

Releases(v2.1.1)
Owner
n0nag0n
Always looking for the next idea to build in PHP
n0nag0n
A collection of command line scripts for Magento 2 code generation, and a PHP module system for organizing command line scripts.

What is Pestle? Pestle is A PHP Framework for creating and organizing command line programs An experiment in implementing python style module imports

Alan Storm 526 Dec 5, 2022
Michael Pratt 307 Dec 23, 2022
The Assure Alliance support website. This website is based on Questions2Answers and is a forum for support using Biblical Tools

The Assure Alliance support website. This website is based on Questions2Answers and is a forum for support using Biblical Tools

United Bible Societies Institute for Computer Assisted Publishing 3 Jul 29, 2022
The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.

netz98 magerun CLI tools for Magento 2 The n98 magerun cli tools provides some handy tools to work with Magento from command line. Build Status Latest

netz98 758 Dec 28, 2022
Biblioteca para busca (on-line) de estados e os seus respectivos municípios via API disponibilizada pelo IBGE.

LocalidadeX Biblioteca para busca (on-line) e listagem de estados e seus respectivos municípios, efetua a consulta via API do IBGE, disponibilizando o

Estênio Mariano 3 Feb 12, 2022
m4b-tool is a command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b

m4b-tool m4b-tool is a is a wrapper for ffmpeg and mp4v2 to merge, split or and manipulate audiobook files with chapters. Although m4b-tool is designe

Andreas 798 Jan 8, 2023
Tango is a command-line tool for analyzing access logs 💃

Tango Tool to get insights from the server access logs Tango is a dependency-free command-line tool for analyzing access logs ?? Currently, work on th

Roman Glushko 94 Nov 22, 2022
Disclaimer: The documentation of this plugin is English at the moment, but I might go for Latin later down the line, just for the fun of it.

Quiritibus Plugin This repository is storing the custom plugin developed for the Quiritibus Latin Magazine website, currently being developed at: http

Alkor András 1 Jan 19, 2022
Demo of symfony/console features to build rich command line utilities

Symfony Console Demo This project is a demonstration of symfony/console features. To run the project with Docker. With bash: docker build -t myconsole

Jérôme Tamarelle 3 Jun 16, 2022
TrovCMS command line installer.

Trov CMS Installer TrovCMS is a start kit for websites, built on Filament and Laravel. This install allows you to quickly spin up new sites to hit the

TrovCMS 12 Dec 26, 2022