Improve docs

This commit is contained in:
Kieran 2023-12-21 23:21:19 +00:00
parent d41e3951d9
commit 83f51a4668
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
7 changed files with 55 additions and 14 deletions

View File

@ -11,13 +11,31 @@ Free, simple file hosting
Use the docker image to run void.cat:
`docker run --rm -it -p 8080:80 ghcr.io/v0l/void.cat/app:latest`
`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:
```bash
git clone https://git.v0l.io/Kieran/void.cat
cd void.cat/
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,

View File

@ -8,6 +8,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{40BC550E-CAD3-4E85-8BC9-539B53F87126}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
docker-compose.dev.yml = docker-compose.dev.yml
EndProjectSection
EndProject
Global

View File

@ -15,6 +15,7 @@ public class DownloadController : BaseDownloadController
{
}
[HttpHead]
[HttpOptions]
[Route("{id}")]
[EnableCors("*")]

View File

@ -37,6 +37,8 @@ public class CleanupLocalDiskStore : IMigration
private async Task CleanupDisk()
{
var baseDir = Path.Join(_settings.DataDirectory, "files-v2");
if (!Directory.Exists(baseDir)) return;
foreach (var path in Directory.EnumerateFiles(baseDir, "*.*", SearchOption.AllDirectories))
{
if (!Guid.TryParse(Path.GetFileNameWithoutExtension(path), out var id))

View File

@ -4,20 +4,18 @@
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Information"
"Microsoft.EntityFrameworkCore": "Warning"
}
},
"Settings": {
"CorsOrigins": [
"http://localhost:8001",
"http://localhost:3000"
],
"CorsOrigins": [],
"VirusScanner": {
"ClamAV": {
"Endpoint": "tcp://clamav:3310",
"MaxStreamSize": 100000000000
}
},
"SiteUrl": "http://localhost:8001",
"Redis": "redis",
"Postgres": "User ID=postgres;Password=postgres;Database=void;Pooling=true;Host=postgres:5432"
}

16
docker-compose.dev.yml Normal file
View File

@ -0,0 +1,16 @@
services:
redis:
image: "redis:alpine"
ports:
- "6079:6379"
postgres:
image: "postgres:16"
ports:
- "5432:5432"
environment:
- "POSTGRES_DB=void"
- "POSTGRES_HOST_AUTH_METHOD=trust"
clamav:
image: "clamav/clamav"
ports:
- "3320:3310"

View File

@ -1,26 +1,31 @@
version: "3.9"
services:
web:
build: .
restart: unless-stopped
ports:
- "8001:80"
volumes:
- "./VoidCat/appsettings.compose.json:/app/appsettings.json:ro"
- "./data/web:/app/data"
depends_on:
- postgres
- redis
- clamav
redis:
image: "redis:alpine"
ports:
- "6079:6379"
restart: unless-stopped
volumes:
- "./data/redis:/data"
postgres:
image: "postgres:14.1"
ports:
- "5432:5432"
image: "postgres:16"
restart: unless-stopped
volumes:
- "./data/postgres:/var/lib/postgresql/data"
environment:
- "POSTGRES_DB=void"
- "POSTGRES_HOST_AUTH_METHOD=trust"
clamav:
image: "clamav/clamav"
ports:
- "3320:3310"
restart: unless-stopped
volumes:
- "./data/clamav:/var/lib/clamav"