A self-hosted streamable alternative

Overview

What is Clippy?

Clippy is a self-hosted streamable alternative

Usage

docker-compose (recommended)

version: '3'
services:
  clippy:
    image: samfry13/clippy:latest
    container_name: clippy
    environment:
      PUID: '1000'
      PGID: '1000'
      INIT_DB: 'true'
      NEXTAUTH_SECRET: 'changeme'
      NEXTAUTH_URL: 'https://your.site.here'
      NEXTAUTH_WHITELIST: '[email protected],[email protected]'
      EMAIL_SERVER_HOST: 'smtp.gmail.com'
      EMAIL_SERVER_USER: '[email protected]'
      EMAIL_SERVER_PASSWORD: 'examplepassword'
      EMAIL_SERVER_PORT: '587'
      EMAIL_FROM: '[email protected]'
    volumes:
      - /path/to/data:/data
    ports:
      - 3000:3000
    restart: unless-stopped

Environment Variables

General Variables

Variable Default Required Function
PUID 1000 The user ID to run the app as
PGID 1000 The group ID to run the app as
PORT 3000 The port the app exposes inside the container
NEXT_PUBLIC_MAX_UPLOAD_SIZE 104857600 The max upload file size in bytes
NEXT_PUBLIC_MAX_CHUNK_SIZE 30720 The max upload chunk size in kilobytes. Must be divisible by 256

Database Variables

Variable Default Required Function
DATABASE_URL file:/data/app.db The file location for your .db file or the URL to your database
INIT_DB true This is used to set up schemas in your .db file

Auth Variables

This project uses email authentication through NextAuth.js to set up registered users who can upload videos.

Variable Default Required Function
NEXTAUTH_SECRET - The secret for encrypting user tokens in the db
NEXTAUTH_URL - The url that the api can redirect back to after email authentication. Should just be the origin (i.e. https://www.example.com)
NEXTAUTH_WHITELIST - This image limits access of users to a whitelisted set of emails. This is a comma separated list of emails who are allowed to sign up

Email Variables

Variable Default Required Function
EMAIL_SERVER_HOST - The email server host name (i.e. smtp.gmail.com)
EMAIL_SERVER_USER - The username to login to the email server host
EMAIL_SERVER_PASSWORD - The password to login to the email server host
EMAIL_SERVER_PORT - The port to connect to the email server on
EMAIL_FROM - What email to send the login emails from (i.e. [email protected])

Running Locally

To build and run locally follow these steps:

Clone the repo using git clone https://github.com/samfry13/clippy.git

Install dependencies using npm install

Copy the .env.example into a .env file, and make sure all environment variables are set to specifications above (should error if not set correctly). Make sure to set the DATA_DIR and DATABASE_URL to a location you have control over. Usually in the repo itself.

Create and update .db file using npx prisma db push

Run the development server with npm run dev

Comments
  • Browser console throws various errors.

    Browser console throws various errors.

    When browsing the site various errors pop up in the console like this:

    image

    The errors referenced are:

    • https://reactjs.org/docs/error-decoder.html/?invariant=425
    • https://reactjs.org/docs/error-decoder.html/?invariant=418
    • https://reactjs.org/docs/error-decoder.html/?invariant=423

    Functionality seems unimpaired and everything seems to work. Are these errors important or can they be safely ignored? If they can be ignored can they also be suppressed?

    bug 
    opened by TinFoilFox 4
  • Stuck uploads

    Stuck uploads

    Issue

    Uploads fail if the /DATA_DIR/uploads directory does not exist. The app does not create the uploads folder and fails if it is not created first.

    Solution

    The app should check if the uploads directory exists and create it if it does not.

    bug 
    opened by TinFoilFox 1
  • Verify external databases actually work

    Verify external databases actually work

    The app is set up to handle database connections from a file or an external database. We should probably check if external databases actually work and add documentation in the README.md

    opened by TinFoilFox 1
  • Update docker build

    Update docker build

    This overhauls the environment variables mostly.

    The reason for this, is Next.js is designed in a way that environment variables are set at build time, this can be worked around somewhat when using docker, but the issue is client variables. By default, Next.js replaces the code with the strings themselves. This makes it almost impossible to have dynamic environment variables for the client when running in docker.

    The workaround I'm using dynamically loads new environment variables into a JS script, and then on the frontend, loading that script in on every page.

    It's annoying, but it works.

    Also in this PR:

    • various small fixes and tweaks to code
    opened by samfry13 0
  • Upload button is not anchored

    Upload button is not anchored

    Issue

    When scrolling through videos, the upload button does not remain anchored to the bottom right. It's position is fixed and scrolls up with the videos.

    Screenshot

    Screenshot_20220923-111015_Firefox

    bug 
    opened by TinFoilFox 0
  • feat: replace single upload with chunked uploads

    feat: replace single upload with chunked uploads

    Now uploads no longer use the multipart form data, but instead just send video chunks directly.

    Added an environment variable to set chunk upload size (defaults to 30720 from the upload library I'm using).

    In this PR I also removed the description field on the DB (it wasn't being used), and default titles to an empty string.

    opened by samfry13 0
  • gracefully handle ffmpeg video errors

    gracefully handle ffmpeg video errors

    Should fix #23. This adds a catch on the ffmpeg process to then delete the video and any progress if it errors out.

    With this, however, the client won't know what happened, only that the uploaded video now disappears.

    opened by samfry13 0
  • fix: only allow video uploads

    fix: only allow video uploads

    Should fix #22. Now verifying video file types on the input itself, on the client side before the upload (because users can click "all files" in the dialog if they really want to), and on the server as well, just in case someone decides to hit the API directly.

    opened by samfry13 0
  • Video stuck processing

    Video stuck processing

    If the ffmpeg fails to convert the video the video card is stuck processing and never completes.

    There should be a graceful method for handling if ffmpeg fails for any reason, including cleanup for any generated files and database entries.

    bug 
    opened by TinFoilFox 0
  • Verify file types when uploading

    Verify file types when uploading

    The app does not check what file type you are uploading.

    I was able to upload a .jpg and a .png file to the app. The upload process should probably check the file being uploaded is actually a video.

    bug 
    opened by TinFoilFox 0
  • use react query dehydration

    use react query dehydration

    This uses react query's dehydrate/rehydrate strategy outlined here. For some reason there was a discrepancy between the query client cache on the server vs client, and it was causing the server to render with 1 video instead of 2 after a video had been uploaded. Or 2 videos instead of 1 when a video had been deleted.

    This should really fix #10. For real this time.

    opened by samfry13 0
  • Style login page.

    Style login page.

    Suggestion

    The login and other pages of NextAuth.js are currently in their default style. We should update the pages to be in line with the Material design of the rest of the site.

    enhancement 
    opened by TinFoilFox 0
  • Add discord as alternative login.

    Add discord as alternative login.

    Suggestion

    NextAuth.js supports several providers for Oauth. Of the providers listed I think having the ability to login with Discord would be the most useful.

    Questions to consider

    If this is implemented, should Discord be a mandatory login method or could Discord and e-mail be used interchangeably? If users can use Discord does e-mail authentication become optional?

    enhancement 
    opened by TinFoilFox 0
  • More verbose logging

    More verbose logging

    This could also have an ENV variable that toggles or sets verbosity level

    Things that could be logged for debugging:

    • IP of new connections to the site
    • Email errors if any
    • HTTP errors
    • Queue actions (e.g. if you upload multiple files, how far along the queue are you)
    enhancement 
    opened by TinFoilFox 0
  • Admin/moderation tools

    Admin/moderation tools

    There should probably be some way of moderating the app in the case of bad actors.

    This could include things like:

    • Ability to purge a user account and all of their data
    • Banning a user's email
    • Ban and purge combo
    • Suspending a user, preventing uploads but not deleting videos
    • Deleting a single video
    • Renaming a video
    enhancement 
    opened by TinFoilFox 1
  • Queue for uploads

    Queue for uploads

    It would be helpful to queue uploaded files be processed one at a time instead of all at once. This way you don't slam the server with a ton of encoding jobs when uploading multiple files at once.

    enhancement 
    opened by TinFoilFox 0
Owner
Samuel Fry
Samuel Fry
A self-hosted solution for backing up and viewing backed up mobile photos

Photostore Photostore is a self-hosted, client-server solution for backing up, viewing and downloading photos. How it works The Photostore API (writte

null 38 Oct 25, 2022
A self-hosted, customizable and ad-free Google Search experience

Giggle A self-hosted, customizable and ad-free Google Search experience. What does it do? Giggle lets you run Google searches against allow- and block

Dan Lovelace 213 Dec 15, 2022
Self-hosted environment variable management platform

envplat - environment platform This project is under development. Please contact me for any information or collaboration. Self-hosted environment vari

Environment Platform 4 Apr 25, 2022
A self-hosted file sharing platform.

Pingvin Share Pingvin Share is a self-hosted file sharing platform made for the Appwrite Hackathon. ?? Showcase Demo: https://pingvin-share.dev.eliass

Elias Schneider 354 Jan 7, 2023
CDK constructs for self-hosted GitHub Actions runners

GitHub Self-Hosted Runners CDK Constructs Use this CDK construct to create ephemeral self-hosted GitHub runners on-demand inside your AWS account. Eas

CloudSnorkel 134 Dec 20, 2022
⛺️ Tipi is a homeserver for everyone! One command setup, one click installs for your favorites self-hosted apps. ✨

⛺️ Tipi — A personal homeserver for everyone ⚠️ Tipi is still at an early stage of development and issues are to be expected. Feel free to open an iss

Nicolas Meienberger 4.9k Jan 4, 2023
An ultra-lightweight self-hosted CI solution with a dashboard and containerized runners

An extremely simple containerized CI server. Ecosystem The Candor ecosystem is straightforward, and entirely containerized. Docker runs on the host ma

Paul Huebner 8 Nov 20, 2022
A self-hosted solution for creating/managing forms and applications.

Centox - Self-hosted form website It is a self-hosted solution for creating/managing forms and applications. Users can login using their Discord Accou

Simon Maribo 11 Dec 26, 2022
Self-hosted TOTP authenticator PWA with FIDO2 (WebAuthn)

pasu Self-hosted TOTP authenticator PWA with FIDO2 (WebAuthn) Features 2FA secrets stored in your own server instead of your own device Codes are gene

ソ瑠璃(soruly) 11 Nov 2, 2022
A self-hosted eBooks Library for your family or yourself.

What is BookStairs? BookStairs is an open-source personal EPUB library which was highly inspired by talebook, calibre-web and BookBrowser. It's design

BookStairs 5 Dec 29, 2022
SCAchat - A self-hosted chatting application

SCAchat is a self-hosted chatting application similar to AOL Instant Messenger. The chatting application is privacy-respecting and does not store any messages or user-data. Once a session has ended, all messages are gone.

Chadano 4 Jul 18, 2022
A self-hosted Thumbnail generator/finder which creates thumbnails based on folder names and google search results.

Thumba A self hosted Thumbnail generator/finder which creates thumbnails based on folder names and google search results. Description This project use

Norbert Takács 20 Dec 15, 2022
An open source, self-hosted, and entirely free solution to social media management.

An open source, self-hosted, and entirely free solution to social media management. Status ?? In Development ?? Shoutify is currently early in the dev

TechSquidTV 202 Dec 22, 2022
Self-hosted Slack bot to run your code snippets

slack-code-runner Self-hosted Slack bot to run your code snippets Prerequisites Docker Usage Create a new Slack app and add it to your workspace. You

Myeonghyeon Kim 5 Sep 14, 2022
Self-hosted open source social media marketing

OpenSMM Description OpenSMM(Open Social Media Marketing) is a self-hosted social media marketing platform built to assist small businesses manage thei

Vaughn 22 Dec 23, 2022
An open-source and self-hosted assessment platform for recruitment

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Kaen 2 Oct 4, 2022
A minimal & self-hostable alternative to pastebin intended for code

minBin A minimal & self-hostable alternative to pastebin intended for code Use ⌨️ A public instance is available at https://bin.kio.dev/ Building ?? n

Kio 4 Dec 29, 2022
potsky.eth NTF website hosted on IPFS

potsky NFT Website Introduction This website showcases potsky's digital creations from 90's to now created on Amiga and on Mac OS X. Dev # install dep

Potsky 2 Jan 6, 2022
Automated packaging of Debian-flavored NGINX with PageSpeed modules. Written in Bash and GitHub Workers. APT Repository hosted on Dokku.

NGINX + Google PageSpeed Configuring NGINX to build correctly is a pain. Not because of anything wrong with it, but rather because of how slim the sta

Slava Knyazev 21 Oct 14, 2022