Blazing fast file uploader and awesome bunker written in node! ๐
Chibisafe is a file uploader service written in node that aims to to be easy to use and easy to set up. It's easy to use, easy to deploy, free and open source. It accepts files, photos, documents, anything you imagine and gives you back a shareable link for you to send to others.
It supports both public and private mode. Public mode let's anyone sign up and start uploading files to the service, whereas private mode only users with an invite link can do so. During upload, if the file is big it's automatically split into chunks to minimize the chance of network failures enabling you to retry each chunk up to 5 times. Users can also create an API key to use with 3rd party applications to interact directly with their account.
The service also comes with a control panel where you can edit almost every configuration of the instance directly from the UI without having to touch environment or configuration files manually. Control the name, the ratelimit, max file size, accepted extensions, meta descriptions, etc directly from an intuitive panel.
If you fork/deploy your own instance it would mean a lot if you were to keep either the GitHub logo to our repo or a link to it ๐
What's new in v5This release marks a new era for Chibisafe! ๐ Completely rewritten in TypeScript and fixing most pain-points from the past, this new stable version is faster, easier to setup, easier to use and overall better.
docker-compose up
from the root to have the project up and running in a flashexpress
we're now using Fastify which is fasterknex
to Prisma
Routes are TypeScript files located in src/routes
and they need to export 2 things to be treated as such:
export const options = { url: '/admin/user/:uuid', method: 'get', middlewares: ['auth', 'admin'] }; export const run = async (req: Request, res: Response) => {
options.url
and options.method
are required while middlewares
is an option array of middlewares to execute before the router executes the exported run()
method.
You can refer to this commited file for an example
/logs
foldernpm
to yarn
for monorepo capabilitiesnpm run studio
will now open Prisma Studio in the browser to let you edit the database in real time.env
file with all the information needed to be able to build both frontend and backend, now these values will be set by default enabling the user to change them through the settings panel on the chibisafe website. The only environment variable supported now is PORT
to change it from the default which is 8000
, but it's not needed to build the service.index.html
page upon starting, in the future when the user changes those values from the settings panel the file should be reloaded to reflect the new changes without restarting the service.Whichever method you choose to install chibisafe keep in mind that the installation process creates an account named admin
with the same password. Once you log in the first time make sure to change it!
To deploy chibisafe with docker you have a few options.
If you want the latest features you can clone the repository and then run docker-compose up
.
If you want to use the latest stable image published by us you can make a docker-compose.yml
file with the following contents and then run docker-compose up
:
version: "3.7" services: chibisafe: image: chibisafe/chibisafe:latest container_name: chibisafe volumes: - ./database:/home/node/chibisafe/database:rw - ./uploads:/home/node/chibisafe/uploads:rw - ./logs:/home/node/chibisafe/logs:rw ports: - 24424:8000 restart: always
Or if you prefer to use docker directly, you could do something like this replacing the path values (if necessary) with your own:
docker run -d \ --name=chibisafe \ -v ./database:/home/node/chibisafe/database:rw \ -v ./uploads:/home/node/chibisafe/uploads:rw \ -v ./logs:/home/node/chibisafe/logs:rw \ -p 24424:8000 \ --restart unless-stopped \ chibisafe/chibisafe:latest
Now chibisafe will be available in port 24424.
For more in-depth configurations Please refer to the docs here
Manually Pre-requisitesThis small guide assumes a lot of things including but not limited to you knowing your way around linux.
node
version 18 (we recommend using volta.sh)ffmpeg
package installednginx
installed and running (if you want to run chibisafe behind a domain)InstallingNote: while Chibisafe works on Windows out-of-the-box by accesing the IP directly, we don't cover how to set up nginx/caddy/apache2 reverse proxy to have a domain name.
cd
into ityarn install
yarn migrate
yarn build
yarn start
If you are upgrading from v3.x
to v4.0.0
(lolisafe to chibisafe) and you want to keep your files and relations please read the migration guide. Keep in mind the migration is a best-effort script and it's recommended to start from scratch. That being said the migration does work but it's up to you to make a backup beforehand in case something goes wrong.
v4.0.1
changed the hashing algorithm for a better, faster one. So if you are currently running v4.0.0 and decide to update to v4.0.1+ it's in your best interest to rehash all the files your instance is serving. To do this go to the chibisafe root folder and run node src/api/utils/rehashDatabase.js
. Depending on how many files you have it can take a few minutes or hours, there's a progress bar that will give you an idea.
If you're upgrading from v4.x
to v5
you can run yarn install && yarn migrate-v4-to-v5
to start the migration process. Depending how many files you have in your old instance it can take up to 30 minutes so be patient. It'll ask you for the absolute path to your v4 sqlite database and then it'll proceed to migrate your data. Once the process is done there is one more thing to do, which is to move the old ./uploads
folder from chibisafe v4 to the root of your v5 folder.
ScreenshotsNote: if your uploads folder is in another location like a different/network drive and you are using symlinks, make sure to update the symlink to point it to the uploads folder in root of the new chibisafe
Author
Chibisafe ยฉ Pitu, Released under the MIT License.
Authored and maintained by Pitu.
chibisafe.moe ยท GitHub @Pitu
Twice a month we will interview people behind open source businesses. We will talk about how they are building a business on top of open source projects.
We'll never share your email with anyone else.