https://github.com/MaxLeiter/Drift Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} MaxLeiter / Drift Public * Notifications * Fork 20 * Star 515 Drift is a self-hostable Gist alternative and paste service drift.maxleiter.com MIT License 515 stars 20 forks Star Notifications * Code * Issues 20 * Pull requests 3 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 4 branches 0 tags Code Latest commit @MaxLeiter MaxLeiter remove sqlite file from git ... 009aefd Mar 29, 2022 remove sqlite file from git 009aefd Git stats * 194 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/ISSUE_TEMPLATE Add issue templates Mar 12, 2022 client client: redirect to /new when authenticated Mar 29, 2022 server client/server: lint Mar 29, 2022 CONTRIBUTING.md Create CONTRIBUTING.md Mar 13, 2022 LICENSE Create LICENSE Mar 12, 2022 README.md README: remove production usage disclaimer Mar 29, 2022 docker-compose.yml client/server: search cleanup, admin work Mar 29, 2022 View code Drift Setup Development Production Environment Variables Running with pm2 Current status README.md [logo] Drift Drift is a self-hostable Gist clone. It's also a major work-in-progress, but is 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 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 * 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) * NODE_ENV: defaults to development, can be production * 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 * 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 * DRIFT_HOME: defaults to ~/.drift, the directory for storing the database and eventually images Running with pm2 It's easy to start Drift using pm2. First, add .env files to client/ and server/ with the values you want (see the above section for possible values). Then, use the following commands to start the client and server: * cd server && yarn build && pm2 start yarn --name drift-server --interpreter bash -- start * cd .. * cd client && yarn build && pm2 start yarn --name drift-client --interpreter bash -- start You now use pm2 ls to see their statuses. Refer to pm2's docs or pm2 help for more information. 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 * [ ] 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? About Drift is a self-hostable Gist alternative and paste service drift.maxleiter.com Topics react nodejs gist typescript nextjs pastebin self-hosted pastebin-service Resources Readme License MIT License Stars 515 stars Watchers 5 watching Forks 20 forks Releases No releases published Contributors 7 * @MaxLeiter * @maxall41 * @icepaq * @sampaioxsamuel * @emilyst * @reeseovine * @kjaonline Languages * TypeScript 84.6% * CSS 13.2% * Dockerfile 1.7% * JavaScript 0.5% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.