项目作者: v0l

项目描述 :
Free file hosting website
高级语言: JavaScript
项目地址: git://github.com/v0l/void.cat.git
创建时间: 2016-05-05T15:40:27Z
项目社区:https://github.com/v0l/void.cat

开源协议:

下载


Void.cat

Free, simple file hosting

Features

  • Profiles
  • File bandwidth statistics
  • Administration features
  • File download paywall

Running

Use the docker image to run void.cat:

docker run --rm -it -p 8080:80 git.v0l.io/kieran/void-cat:latest

Then open your browser at http://localhost:8080.

The first registration will be set as admin,
so make sure to create your own account

Deploying

Docker compose is the best option for most as this sets up postgres / redis / clamav.

Run the following commands to get going:

  1. git clone https://git.v0l.io/Kieran/void.cat
  2. cd void.cat/
  3. docker compose up -d

You should now be able to access void.cat on http://localhost.

If you already have something running on port 80 you may have problems, you can modify the docker-compose.yml
file to change the port.

You can modify the site config in ./VoidCat/appsettings.compose.json, this is recommended for anything other
than a simple test

Usage

Simply drag and drop your files into the dropzone,
or paste your screenshots or files into the browser window.

From cli you can upload with curl:

  1. export FILE=memes.jpg
  2. curl -X POST \
  3. -H "V-Content-Type: $(file --mime-type -b $FILE)" \
  4. -H "V-Full-Digest: $(sha256sum -bz $FILE | cut -d' ' -f1)" \
  5. -H "V-Filename: $FILE" \
  6. --data-binary @$FILE \
  7. "https://void.cat/upload?cli=true"

Or you can create an alias function in ~/bash_aliases like so:

  1. vcu() {
  2. echo "Uploading $1"
  3. curl -X POST \
  4. -H "V-Content-Type: $(file --mime-type -b $1)" \
  5. -H "V-Full-Digest: $(sha256sum -bz $1 | cut -d' ' -f1)" \
  6. -H "V-Filename: $1" \
  7. --data-binary @$1 \
  8. "https://void.cat/upload?cli=true"
  9. echo -e ""
  10. }

Uploading from cli will simply become vcu memes.jpg

You can also upload files to your user account by specifying an API key in the curl command:

  1. -H "Authorization: Bearer MY_API_KEY"

This command will return the direct download URL only.
To get the json output simply remove the ?cli=true from the url.

Development

To run postgres in local use:

  1. docker run --rm -it -p 5432:5432 -e POSTGRES_DB=void -e POSTGRES_PASSWORD=postgres postgres -d postgres

To run MinIO in local use:

  1. docker run --rm -it -p 9000:9000 -p 9001:9001 minio/minio -- server /data --console-address ":9001"