Re-Organised Documentation and Readme (#51)

* Create Installation.md

Signed-off-by: Chelsea <chelsea@foxtrt.com>

* Create Configuration.md

Signed-off-by: Chelsea <chelsea@foxtrt.com>

* Update Installation.md

Signed-off-by: Chelsea <chelsea@foxtrt.com>

* Update Configuration.md

Signed-off-by: Chelsea <chelsea@foxtrt.com>

* Update readme.md

Signed-off-by: Chelsea <chelsea@foxtrt.com>

* Update build.yml

Signed-off-by: Chelsea <chelsea@foxtrt.com>

Signed-off-by: Chelsea <chelsea@foxtrt.com>
This commit is contained in:
Chelsea 2022-09-28 15:30:00 +01:00 committed by GitHub
parent 053484ec10
commit a3eca563fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 126 additions and 99 deletions

View File

@ -7,6 +7,7 @@ on:
- 'LICENSE'
- 'config.example.toml'
- '.gitignore'
- 'docs/**'
pull_request:
branches: [ dev ]
paths-ignore:
@ -14,6 +15,7 @@ on:
- 'LICENSE'
- 'config.example.toml'
- '.gitignore'
- 'docs/**'
workflow_dispatch:
jobs:
build:
@ -41,4 +43,4 @@ jobs:
- name: build
run: yarn build
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}

66
docs/Configuration.md Normal file
View File

@ -0,0 +1,66 @@
<div align="center">
<img src="https://raw.githubusercontent.com/AlphaNecron/Void/dev/public/banner.png" width="240" height="135"/>
</div>
# Configuration
## Reverse proxy (nginx)
```nginx
server {
listen 443 ssl;
server_name your.domain;
ssl_certificate /path/to/cert;
ssl_certificate_key /path/to/key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
client_max_body_size 100M;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
## Config schema
```toml
[core]
secure = false # Whether to use https or not
secret = 'supersecretpassphrase' # The secret used to sign cookie
host = '0.0.0.0' # The host Void should run on
port = 3000 # The port Void should run on
database_url = 'postgres://username:password@localhost:5432/db_name' # PostgreSQL database url
[bot]
enabled = false # Whether to enable the bot or not
prefix = '&' # Bot's prefix
token = '' # Bot's token
admin = [''] # Admin ids
log_channel = '' # The channel where logs are sent, leave blank to disable logging
default_uid = 1 # The default user id used to shorten and upload
hostname = 'example.com' # The hostname shortened urls should use in Twilight
[shortener]
allow_vanity = true # Whether to allow vanity urls or not
length = 6 # Slug length
route = '/go' # Route to serve shortened urls
[uploader]
raw_route = '/r' # Route to serve raw contents
length = 6 # Slug length
directory = './uploads' # The directory where images are stored
max_size = 104857600 # Max upload size (users only), in bytes
blacklisted = ['exe'] # Blacklisted file extensions (users only)
```
## Bot permissions
**These permissions are required for the bot to work properly (27712):**
- Add reactions
- Read messages
- Send messages
- Manage messages
- Embed links

52
docs/Installation.md Normal file
View File

@ -0,0 +1,52 @@
<div align="center">
<img src="https://raw.githubusercontent.com/AlphaNecron/Void/dev/public/banner.png" width="240" height="135"/>
</div>
# Installation
**Default credentials**
- Username: `admin`
- Password: `voiduser`
With Void there are 3 ways to install and deploy:
1. [Manual](#manual)
2. [Docker](#Docker)
3. [Docker compose](#Docker-compose)
## Manual
**Requirements**
- `node` >= 14
- PostgreSQL
- Either `yarn` or `npm`
**Install**
```sh
git clone https://github.com/AlphaNecron/Void.git
cd Void
yarn install # or npm install
cp config.example.toml config.toml
nano config.toml # edit the config file
yarn build # or npm run build
yarn start # or npm start
```
## Docker
```sh
git clone https://github.com/AlphaNecron/Void.git
cd Void
cp config.example.toml config.toml
nano config.toml # edit the config file
docker pull alphanecron/void:v0
docker run -p 3000:3000 -v $PWD/config.toml:/void/config.toml -d alphanecron/void:v0
```
## Docker compose
```sh
git clone https://github.com/AlphaNecron/Void.git
cd Void
cp config.example.toml config.toml
nano config.toml # edit the config file
docker-compose up --build -d
```

103
readme.md
View File

@ -9,92 +9,6 @@
![Last commit](https://img.shields.io/github/last-commit/AlphaNecron/Void/dev?color=%234FD1C5&logo=github&style=for-the-badge)
</div>
### Requirements
- `node` >= 14
- PostgreSQL
- Either `yarn` or `npm`
### Installation / Deployment
```sh
git clone https://github.com/AlphaNecron/Void.git
cd Void
yarn install # or npm install
cp config.example.toml config.toml
nano config.toml # edit the config file
yarn build # or npm run build
yarn start # or npm start
```
### Docker
```sh
git clone https://github.com/AlphaNecron/Void.git
cd Void
cp config.example.toml config.toml
nano config.toml # edit the config file
docker pull alphanecron/void:v0
docker run -p 3000:3000 -v $PWD/config.toml:/void/config.toml -d alphanecron/void:v0
```
### Docker compose
```sh
git clone https://github.com/AlphaNecron/Void.git
cd Void
cp config.example.toml config.toml
nano config.toml # edit the config file
docker-compose up --build -d
```
### Reverse proxy (nginx)
```nginx
server {
listen 443 ssl;
server_name your.domain;
ssl_certificate /path/to/cert;
ssl_certificate_key /path/to/key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
client_max_body_size 100M;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
### Config schema
```toml
[core]
secure = false # Whether to use https or not
secret = 'supersecretpassphrase' # The secret used to sign cookie
host = '0.0.0.0' # The host Void should run on
port = 3000 # The port Void should run on
database_url = 'postgres://username:password@localhost:5432/db_name' # PostgreSQL database url
[bot]
enabled = false # Whether to enable the bot or not
prefix = '&' # Bot's prefix
token = '' # Bot's token
admin = [''] # Admin ids
log_channel = '' # The channel where logs are sent, leave blank to disable logging
default_uid = 1 # The default user id used to shorten and upload
hostname = 'example.com' # The hostname shortened urls should use in Twilight
[shortener]
allow_vanity = true # Whether to allow vanity urls or not
length = 6 # Slug length
route = '/go' # Route to serve shortened urls
[uploader]
raw_route = '/r' # Route to serve raw contents
length = 6 # Slug length
directory = './uploads' # The directory where images are stored
max_size = 104857600 # Max upload size (users only), in bytes
blacklisted = ['exe'] # Blacklisted file extensions (users only)
```
### Features
- Configurable
- Fast and reliable
@ -112,21 +26,13 @@
- Password-protected URL
- Embed customization (with variables)
### Docs
- [How to Install](https://github.com/AlphaNecron/Void/tree/dev/docs/Installation.md)
- [How to Configure](https://github.com/AlphaNecron/Void/tree/dev/docs/Configuration.md)
### Contribution
- All pull requests must be made in `dev` branch, pull requests in `v0` will be closed.
### Default credentials
- Username: `admin`
- Password: `voiduser`
### Bot permissions
#### These permissions are required for the bot to work properly (27712):
- Add reactions
- Read messages
- Send messages
- Manage messages
- Embed links
### Todo
- Discord integration
- Album / Bulk upload
@ -134,3 +40,4 @@
### Credits
- Source code and API from `diced/zipline`
- Logo and favicon from `icons8`
- Documentation from `chelsea-fox`