Code Monkey home page Code Monkey logo

kregfile - somewhat like volafile

kregfile is like volafile, except open source and you can host it yourself. In fact, you have to host it yourself, because I won't be doing it for you.

Prerequisites

  • node (14+)
  • yarn
  • A working C++ compiler, to compile node extension modules
  • Previews
    • exiftool
    • ffmpeg
    • imagemagick and graphicsmagick (optional, for PDF previews)
    • firejail (optional, but highly recommended, see 'jail' in the config to disable)

Instructions

  • Start a redis
  • yarn
  • Fiddle with .config.json if you must, use defaults.js as a reference.
  • Then run yarn start for maximum cancer
  • Navigate to 127.0.0.1:8080 and enjoy.

If everything works, you may consider putting things into production, get TLS certificates on so on.

Configuration files

kregfile will load configuration data from all of these files, if they are present, in this order. The last value for any configuration option wins (much like CSS rules).

  1. defaults.js (the defaults of kregfile, do not edit, but use as a reference of available options)
  2. $HOME/.config/kregfile.json
  3. $HOME/.config/kregfile.js
  4. $PWD/.config.js
  5. $PWD/.config.json

.js files will be require()d and the config options will be taken from the keys present in the exported object. .json files wil lbe parsed as JSON, and options taken from the top-level object.

Force-making specific rooms

Just use the redis-cli to set rooms:<alias> to some number (usually the timestamp), e.g. redis-cli set rooms:gentoomen 1.

Making moderators

Use the ./setRole.js script to set the mod role for a user (and make the user refresh the tab).

Code structure

  • common has code commonly shared between the frontend and backend
  • client has most client-side code
  • entries contains the entry points for client side code (for webppack)
  • lib contains most server-side code
  • static contains static assets (and webpack generated bundles)
  • uploads contains the uploaded files (unless specified differently in the config)
  • views contains the ejs templates (not many)

How to devel?

  • Run yarn run pack in a shell. This will start webpack in watch mode and rebundle once the sources change automatically
  • Run nodemon in another shell. This will trigger server restarts automatically when you change things.

The clients (browser tabs) should automatically reconnect and pull any new client code version automatically.

Troubleshooting FAQ

  1. My previews do not work!

    Make sure you have all the prerequites installed. Then it might be firejail that is broken, e.g. it refuses to run in another "sandbox" (which might be the VPS/linux container/docker your kregfile is running in). If that's the case, then consider turning off the "jail" config option and check if it then works for you.

kregfile's Projects

node-blake2 icon node-blake2

All four BLAKE2 variants (blake2b, blake2bp, blake2s, blake2sp) with stream support for Node.js

notepack icon notepack

A fast Node.js implementation of the latest MessagePack spec

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.