Drift logo

Drift

  •  0 ratings
In category: Pastebins

About Drift

Self-hosted Github Gist clone.

  •   620  
  •   0  
  •   0  
  •   0  
Github stats:
  •  Commits: N/A  
  •   N/A  
  •   N/A  
  •  Latest commit: N/A  

Deploy this app to Linode with a free $100 credit!

Languages/Platforms/Technologies:
Lincenses:

More about Drift

Drift

Note: This branch is where all work is being done to refactor to the Next.js 13 app directory and React Server Components.

Drift is a self-hostable Gist clone. It's in beta, but is completely functional.

You can try a demo at https://drift.lol. The demo is built on main 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.


Contents:

Setup

Development

In the root directory, run pnpm i. If you need pnpm, you can download it here. You can run pnpm dev in client for file watching and live reloading.

To work with prisma, you can use pnpm prisma or pnpm exec prisma to interact with the database.

Production

pnpm build will produce production code. pnpm start will start the Next.js server.

Environment Variables

You can change these to your liking.

.env:

  • DRIFT_URL: the URL of the drift instance.
  • DATABASE_URL: the URL to connect to your postgres instance. For example, postgresql://user:password@localhost:5432/drift.
  • WELCOME_CONTENT: a markdown string that's rendered on the home page
  • WELCOME_TITLE: the file title for the post on the homepage.
  • ENABLE_ADMIN: the first account created is an administrator account
  • REGISTRATION_PASSWORD: the password required to register an account. If not set, no password is required.
  • NODE_ENV: defaults to development, can be production

Auth environment variables

Note: Only credential auth currently supports the registration password, so if you want to secure registration, you must use only credential auth.

  • GITHUB_CLIENT_ID: the client ID for GitHub OAuth.
  • GITHUB_CLIENT_SECRET: the client secret for GitHub OAuth.
  • NEXTAUTH_URL: the URL of the drift instance. Not required if hosting on Vercel.
  • CREDENTIAL_AUTH: whether to allow username/password authentication. Defaults to true.

Running with pm2

It's easy to start Drift using pm2. First, add the .env file with your values (see the above section for the required options).

Then, use the following command to start the server:

  • pnpm build && pm2 start pnpm --name drift --interpreter bash -- start

Refer to pm2's docs or pm2 help for more information.

Running with Docker

Current status

Drift is a 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.

  • [x] Next.js 13 app directory
  • [x] creating and sharing private, public, password-protected, and unlisted posts
  • [x] syntax highlighting
  • [x] expiring posts
  • [x] responsive UI
  • [x] user auth
  • [ ] SSO via HTTP header (Issue: #11)
  • [x] SSO via GitHub OAuth
  • [x] downloading files (individually and entire posts)
  • [x] password protected posts
  • [x] postgres database
  • [x] administrator account / settings
  • [x] docker-compose (PRs: #13, #75)
  • [ ] publish docker builds
  • [ ] user settings
  • [ ] works enough with JavaScript disabled
  • [ ] in-depth documentation
  • [x] 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?
  • [ ] fleshed out API
  • [ ] Swappable database backends
  • [ ] More OAuth providers

Comments (0)

Please login to join the discussion on this project.

Drift Reviews (0)

Overall Rating

None

based on 0 ratings

Please login to review this project.

No reviews for this project yet.

↑ back to top

pCloud Lifetime

Popular Projects

FluxBB

in Social Networks and Forums
 33k    0    0    0  

Nextcloud

in File Transfer & Synchronization
 20k    1    1    0  

Libreddit

in Social Networks and Forums
 7k    0    1    0  

Dashboard

in Personal Dashboards
 6k    0    0    0  

Audiobookshelf

in Audio Streaming
 6k    0    1    0  

CasaOS

in Self-hosting Solutions
 5k    0    0    0  

Mediagoblin

in Photo and Video Galleries
 4k    0    0    0  

Most Discussed

Nextcloud

in File Transfer & Synchronization
 20k    1    1    0  

Tube Archivist

in Automation
 3k    0    1    0  

OneDev

in Project Management
 2k    0    0    0  

iodine

in Proxy
 2k    0    0    0  

Alf.io

in Booking and Scheduling
 2k    0    0    0  

sysPass

in Password Managers
 1k    0    0    0  

Misskey

in Social Networks and Forums
 2k    0    0    0  
Linux VPS from $11/yr.
RackNerd VPS for $11.38/mo

Top Rated Projects

Gitea

 1 rating
in Project Management

Bagisto

 1 rating
in E-commerce

LinkAce

 1 rating
in Bookmarks and Link Sharing

Pydio

 1 rating
in File Transfer & Synchronization

Audiobookshelf

 1 rating
in Audio Streaming

Nextcloud

 1 rating
in File Transfer & Synchronization

Seafile

 1 rating
in File Transfer & Synchronization

Categories

You May Also Be Interested In

Stikked logo
Stikked cover

Stikked

Advanced and beautiful pastebin.

rustypaste logo
rustypaste cover

rustypaste

A minimal file upload/pastebin service.

FlashPaper logo
FlashPaper cover

FlashPaper

A one-time encrypted zero-knowledge password/secret sharing…