CoastalCommits Pastes is a fork of Drift, a self-hostable Gist and paste service. Built with Next.js 13 and React Server Components. https://pastes.coastalcommits.com
Find a file
2022-03-22 22:05:26 -07:00
.github/ISSUE_TEMPLATE Add issue templates 2022-03-12 15:07:07 -08:00
client client: improve makrdown handling of nested elements 2022-03-22 22:05:26 -07:00
server client: improve makrdown handling of nested elements 2022-03-22 22:05:26 -07:00
CONTRIBUTING.md Create CONTRIBUTING.md 2022-03-12 19:45:25 -08:00
LICENSE Create LICENSE 2022-03-12 15:03:17 -08:00
README.md post generation rework with static paths/props 2022-03-21 17:20:41 -07:00

Drift

Drift is a self-hostable Gist clone. It's also a major work-in-progress, but is (almost, no database yet) completely functional.

You can try a demo at https://drift.maxleiter.com. The demo is built on master but has no database, so files and accounts can be wiped at any time.

If you want to contribute, need support, or want to stay updated, you can join the IRC channel at #drift on irc.libera.chat or reach me on twitter. If you don't have an IRC client yet, you can use a webclient here.

Setup

Development

In both server and client, run yarn (if you need yarn, you can download it here.) You can run yarn dev in either / both folders to start the server and client with file watching / live reloading.

Production

Note: Drift is not yet ready for production usage and should not be used too seriously. I'll make every effort to not lose data, but I won't make any guarantees until the project is further along.

yarn build in both client/ and server/ will produce production code for the client and server respectively. The client and server each also have Dockerfiles which you can use with a docker-compose (an example compose will be provided in the near future).

If you're deploying the front-end to something like Vercel, you'll need to set the root folder to client/.

Environment Variables

You can change these to your liking.

client/.env:

  • API_URL: defaults to localhost:3001, but allows you to host the front-end separately from the backend on a service like Vercel or Netlify
  • WELCOME_CONTENT: a markdown string (with \n newlines) that's rendered on the home page
  • WELCOME_TITLE: the file title for the post on the homepage.
  • SECRET_KEY: a secret key used for validating API requests that is never exposed to the browser

server/.env:

  • PORT: the default port to start the server on (3000 by default)
  • ENV: can be production or debug, toggles logging
  • JWT_SECRET: a secure token for JWT tokens. You can generate one here.
  • MEMORY_DB: if true, a sqlite database will not be created and changes will only exist in memory. Mainly for the demo.
  • REGISTRATION_PASSWORD: if MEMORY_DB is not true, the user will be required to provide this password to sign-up, in addition to their username and account password. If it's not set, no password will be required.
  • SECRET_KEY: the same secret key as the client

Current status

Drift is a major work in progress. Below is a (rough) list of completed and envisioned features. If you want to help address any of them, please let me know regardless of your experience and I'll be happy to assist.

  • creating and sharing private, public, unlisted posts
    • syntax highlighting (detected by file extension)
    • multiple files per post
    • uploading files via drag-and-drop
  • responsive UI
  • user auth
    • SSO via HTTP header (Issue: #11)
  • downloading files (individually and entire posts)
  • password protected posts
  • sqlite database
  • non-node backend
  • administrator account / settings
  • docker-compose (PR: #13)
    • publish docker builds
  • user settings
  • works enough with JavaScript disabled
  • documentation
  • customizable homepage, so the demo can exist as-is but other instances can be built from the same source. Environment variable for the file contents?