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: 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. Then open your browser at http://localhost:8080.
**The first registration will be set as admin, **The first registration will be set as admin,
so make sure to create your own account** 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 ### Usage
Simply drag and drop your files into the dropzone, 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}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{40BC550E-CAD3-4E85-8BC9-539B53F87126}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore .gitignore = .gitignore
docker-compose.dev.yml = docker-compose.dev.yml
EndProjectSection EndProjectSection
EndProject EndProject
Global Global

View File

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

View File

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

View File

@ -4,20 +4,18 @@
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",
"Microsoft.AspNetCore": "Warning", "Microsoft.AspNetCore": "Warning",
"Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Information" "Microsoft.EntityFrameworkCore": "Warning"
} }
}, },
"Settings": { "Settings": {
"CorsOrigins": [ "CorsOrigins": [],
"http://localhost:8001",
"http://localhost:3000"
],
"VirusScanner": { "VirusScanner": {
"ClamAV": { "ClamAV": {
"Endpoint": "tcp://clamav:3310", "Endpoint": "tcp://clamav:3310",
"MaxStreamSize": 100000000000 "MaxStreamSize": 100000000000
} }
}, },
"SiteUrl": "http://localhost:8001",
"Redis": "redis", "Redis": "redis",
"Postgres": "User ID=postgres;Password=postgres;Database=void;Pooling=true;Host=postgres:5432" "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: services:
web: web:
build: . build: .
restart: unless-stopped
ports: ports:
- "8001:80" - "8001:80"
volumes: volumes:
- "./VoidCat/appsettings.compose.json:/app/appsettings.json:ro" - "./VoidCat/appsettings.compose.json:/app/appsettings.json:ro"
- "./data/web:/app/data"
depends_on: depends_on:
- postgres - postgres
- redis - redis
- clamav
redis: redis:
image: "redis:alpine" image: "redis:alpine"
ports: restart: unless-stopped
- "6079:6379" volumes:
- "./data/redis:/data"
postgres: postgres:
image: "postgres:14.1" image: "postgres:16"
ports: restart: unless-stopped
- "5432:5432" volumes:
- "./data/postgres:/var/lib/postgresql/data"
environment: environment:
- "POSTGRES_DB=void" - "POSTGRES_DB=void"
- "POSTGRES_HOST_AUTH_METHOD=trust" - "POSTGRES_HOST_AUTH_METHOD=trust"
clamav: clamav:
image: "clamav/clamav" image: "clamav/clamav"
ports: restart: unless-stopped
- "3320:3310" volumes:
- "./data/clamav:/var/lib/clamav"