chore: docs update

This commit is contained in:
Pitu 2021-06-07 17:40:28 +09:00
parent 987078b9af
commit 44974f937a
5 changed files with 28 additions and 38 deletions

View File

@ -8,33 +8,35 @@
[![Support me](https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-yellow.svg?style=flat-square)](https://www.buymeacoffee.com/kana)
### Attention
If you are upgrading from v3 to v4 (current release) and you want to keep your files and relations please read the [migration guide](docs/migrating.md).
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](docs/migrating.md). 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.
### Attention (2)
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.
`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.
### What is this?
## What is Chibisafe?
Chibisafe is a file uploader service written in node that aims to to be easy to use and easy to set up. It's mainly intended for images and videos, but it accepts anything you throw at it.
- You can run it in public or private mode, making it so only people with user accounts can upload files as well as controlling if user signup is enabled or not.
- Out of the box support for ShareX configuration letting you upload screenshots and screencaptures directly to your chibisafe instance.
- Browser extension to be able to right click any image/video and upload it directly to your chibisafe instance.
- Out of the box support for ShareX configuration letting you upload screenshots and screenrecordings directly to your chibisafe instance.
- Browser extension to be able to right click any image/video from any website and upload it directly to your chibisafe instance.
- Chunk uploads enabled by default to be able to handle big boi files.
- API Key support so you can integrate the service with whatever you desire.
- Albums, tags and Discord-like search function
- User list and control panel
### Docker
To avoid all of this and use docker [read the docs here](docs/docker.md)
If you want to deploy a docker instance instead of manually setting the service up, you can use `docker-composer` with our scripts. [Please refer to the docs here](docs/docker.md)
### Pre-requisites
This guide asumes a lot of things, including that you know your way around linux, nginx and internet in general.
This guide asumes a whole lot of things, including that you know your way around linux, nginx and internet in general.
- Decently updated version of linux
- `node` version 12+
- `build-essential` package installed to build dependencies
- `ffmpeg` package installed if you want video thumbnails
- Decently updated version of linux (we recommend Debian)
- `node` version 12.18.2+ (we recommend using [volta.sh](https://volta.sh/) or [n](https://github.com/tj/n))
- `build-essential` package installed in your system to build dependencies
- `ffmpeg` package installed
- `pm2` globally installed (`npm i -g pm2`) to keep the service alive at all times.
- A database, postgresql preferably. You can also fall back to sqlite3 which ships by default.
- Alternatively you can use tmux, forever, or whatever you are most familiar with
- `nginx` installed and running
> Note: while Chibisafe does work on Windows, setting it up is not covered in this readme. It's up to you to install the neccessary dependencies
### Installing

View File

@ -2,7 +2,7 @@ function isBabelLoader(caller) {
return caller && caller.name === 'babel-loader';
}
module.exports = function(api) {
module.exports = api => {
if (api.env('test') && !api.caller(isBabelLoader)) {
return {
presets: [

View File

@ -1,14 +0,0 @@
[Unit]
Description=chibisafe, easy to use file uploader
After=network.target
[Service]
Type=simple
User=yourusername
WorkingDirectory=/path/to/chibisafe
EnvironmentFile=/path/to/chibisafe/.env
ExecStart=/usr/bin/npm run start
Restart=always
[Install]
WantedBy=multi-user.target

View File

@ -1,23 +1,23 @@
### Using Docker
If you want to avoid all the hassle of installing the dependencies, configuring nginx and etc you can simply use our docker image which makes things way faster.
If you want to avoid all the hassle of installing the dependencies, configuring nginx and so on you can try our docker image which makes things a bit simpler.
First make sure you have docker and docker composer installed, so please follow the install instructions for your OS/Distro:
- https://docs.docker.com/engine/install/debian/
- https://docs.docker.com/compose/install/
After that:
- Copy the config file called `docker-compose.config.example.yml` to `docker-compose.config.yml` with the values you want. Those that are left commented will use the default values.
- Copy either `chibisafe.moe.http.example.conf` or `chibisafe.moe.https.example.conf` to `chibisafe.moe.conf` for either HTTP or HTTPS
- - If using HTTPS make sure to put your certs into the `ssl` folder and name them accordingly:
- Copy the config file called `docker-compose.config.example.yml` and name it `docker-compose.config.yml` with the values you want. Those that are left commented will use the default values.
- Copy either `chibisafe.moe.http.example.conf` or `chibisafe.moe.https.example.conf` and name it `chibisafe.moe.conf` for either HTTP or HTTPS
- - If using HTTPS make sure to put your certificates into the `ssl` folder and name them accordingly:
- - - `chibisafe.moe.crt` for the certificate
- - - `chibisafe.moe.key` for the certificate key
Once you are done run the following commands:
- `cd docker`
- `./chibisafe.sh prod pull`
- `./chibisafe.sh prod build`
- `./chibisafe.sh prod up -d`
- `./chibisafe prod pull`
- `./chibisafe prod build`
- `./chibisafe prod up -d`
Congrats, your chibisafe instance is now running.

View File

@ -1,5 +1,5 @@
### Service config for systemd
The file chibisafe-example.service is to be moved to `/etc/systemd/system/chibisafe.service`
If you want to keep Chibisafe running by using systemd you can copy the example code shown below and create the file `/etc/systemd/system/chibisafe.service` with it.
You will need to edit the parameters:
- `User` to be the username/uid of your chibisafe instance
@ -12,7 +12,8 @@ You will need to edit the parameters:
Example below.
```[Unit]
```
[Unit]
Description=chibisafe, easy to use file uploader
After=network.target
@ -25,4 +26,5 @@ ExecStart=/usr/bin/npm run start
Restart=always
[Install]
WantedBy=multi-user.target```
WantedBy=multi-user.target
```