mirror of
https://codeberg.org/vlw/blobber.git
synced 2025-09-13 16:23:41 +02:00
doc: add README
This commit is contained in:
parent
42716ed7da
commit
84e27f66ea
1 changed files with 68 additions and 1 deletions
69
README.md
69
README.md
|
@ -1,2 +1,69 @@
|
||||||
# blobber
|
# Blobber (BETA)
|
||||||
|
|
||||||
|
A very simple object store for uploading and sharing public, unlisted, immutable binaries.
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
|
||||||
|
These examples will use a blob with the following properties:
|
||||||
|
|
||||||
|
id|MIME-type
|
||||||
|
--|--
|
||||||
|
0191fabf-6f31-7850-aa09-599532ddaa24|image/webp
|
||||||
|
|
||||||
|
## Inline
|
||||||
|
|
||||||
|
```
|
||||||
|
HTTP GET Request: https://example.com/0191fabf-6f31-7850-aa09-599532ddaa24
|
||||||
|
|
||||||
|
Accepts: */*
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
HTTP 200 Response: <BINARY_DATA>
|
||||||
|
|
||||||
|
Content-Type: image/webp
|
||||||
|
Content-Disposition: inline
|
||||||
|
```
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
**Prerequisites:** PHP 8.3+ and MariaDB 14+
|
||||||
|
|
||||||
|
1. Clone this repo
|
||||||
|
2. Install dependencies with Composer
|
||||||
|
```sh
|
||||||
|
composer install --optimize-autoloader
|
||||||
|
```
|
||||||
|
3. Make a copy of the enviroment variable file
|
||||||
|
```sh
|
||||||
|
cp -p .env.example.ini .env.ini
|
||||||
|
```
|
||||||
|
4. Import the database structure. Create a new database and import the SQL from `/src/database/blobber.sql`
|
||||||
|
```sh
|
||||||
|
mysql -e "CREATE DATABASE blobber"
|
||||||
|
mysql blobber < ./src/database/blobber.sql
|
||||||
|
```
|
||||||
|
5. Set the following required properties
|
||||||
|
key|description
|
||||||
|
--|--
|
||||||
|
`blob_storage_path`|An absolute path to a directory (with or without tailing slash) where uploaded blobs will be stored
|
||||||
|
`mariadb_*`|MariaDB database credentials
|
||||||
|
6. Configure your web server. **All** requests should be routed to the PHP file at `/public/index.php`. Here is an example configuration for NGINX:
|
||||||
|
```nginx
|
||||||
|
# You might need to alter this block to suit your NGINX configuration
|
||||||
|
# The important thing is that all requests should be routed to /public/index.php
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /var/www/blobber/public;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files /index.php =503;
|
||||||
|
|
||||||
|
include snippets/fastcgi-php.conf;
|
||||||
|
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
Loading…
Add table
Reference in a new issue