mirror of
https://github.com/skidoodle/safebin.git
synced 2026-04-28 11:17:42 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
d7ba7f63c6
|
|||
|
fc129b7e9f
|
|||
|
2d1b2aac48
|
|||
|
39ea3ba48d
|
@@ -28,7 +28,6 @@ archives:
|
|||||||
files:
|
files:
|
||||||
- web/**/*
|
- web/**/*
|
||||||
- README.md
|
- README.md
|
||||||
- CHANGELOG.md
|
|
||||||
|
|
||||||
dockers:
|
dockers:
|
||||||
- image_templates:
|
- image_templates:
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
## [3.0.0](https://github.com/skidoodle/safebin/compare/v2.0.0...v3.0.0) (2026-01-16)
|
|
||||||
|
|
||||||
|
|
||||||
### ⚠ BREAKING CHANGES
|
|
||||||
|
|
||||||
* Docker volume paths and environment variables have been updated. The internal storage path in the container has changed from `/home/appuser/storage` to `/app/storage`. Existing deployments must update their volume mappings and environment variable names to maintain persistence.
|
|
||||||
|
|
||||||
### Code Refactoring
|
|
||||||
|
|
||||||
* relocate core logic to internal package and modernize project structure ([43be383](https://github.com/skidoodle/safebin/commit/43be383fdbfb0263036284b8beb0ce3c646db87c))
|
|
||||||
|
|
||||||
## [2.0.0](https://github.com/skidoodle/safebin/compare/v1.1.0...v2.0.0) (2026-01-16)
|
|
||||||
|
|
||||||
|
|
||||||
### ⚠ BREAKING CHANGES
|
|
||||||
|
|
||||||
* The encryption scheme and URL structure have been completely redesigned. Links generated with previous versions of safebin are no longer compatible and cannot be decrypted by this version.
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* overhaul encryption to zero-knowledge at rest and modernize UI ([599347e](https://github.com/skidoodle/safebin/commit/599347e867444288fa58f8e358269121c5d32e36))
|
|
||||||
|
|
||||||
## [1.1.0](https://github.com/skidoodle/safebin/compare/v1.0.1...v1.1.0) (2026-01-14)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* implement chunked uploads and environment-based configuration ([1ccc80a](https://github.com/skidoodle/safebin/commit/1ccc80ad4e5b949a8f1d1f3a8b3b4e8c4d2e1353))
|
|
||||||
|
|
||||||
## [1.0.1](https://github.com/skidoodle/safebin/compare/v1.0.0...v1.0.1) (2026-01-14)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* better dockerfile ([c1ecbe5](https://github.com/skidoodle/safebin/commit/c1ecbe567a24eb4e755f19fee68422025f3b15b2))
|
|
||||||
|
|
||||||
## 1.0.0 (2026-01-13)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* add automated release and docker workflow ([e40e6d0](https://github.com/skidoodle/safebin/commit/e40e6d01afd0067bba5d0cf4a9b1ff3d7122259f))
|
|
||||||
@@ -21,6 +21,7 @@ LABEL org.opencontainers.image.licenses="GPL-2.0-only"
|
|||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
media-types \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN useradd -m -u 10001 -s /bin/bash appuser
|
RUN useradd -m -u 10001 -s /bin/bash appuser
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ FROM debian:trixie-slim
|
|||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
media-types \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN useradd -m -u 10001 -s /bin/bash appuser
|
RUN useradd -m -u 10001 -s /bin/bash appuser
|
||||||
|
|||||||
@@ -4,74 +4,47 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Server-Side Encryption**: Files are encrypted using AES-256-GCM before touching the disk.
|
- **End-to-End Encryption**: Files are encrypted using AES-128-GCM before being written to disk.
|
||||||
- **Log-Safe Keys**: The decryption key is stored in the URL fragment (`#`). Since fragments are never sent to the server, the key never appears in your HTTP access logs.
|
- **Key-Derived URLs**: The decryption key is part of the URL. The server uses this key to locate and decrypt the file on the fly.
|
||||||
- **Integrity**: Uses GCM (Galois/Counter Mode) to ensure files cannot be tampered with while stored.
|
- **Integrity**: Uses GCM (Galois/Counter Mode) to ensure files cannot be tampered with while stored.
|
||||||
- **Deterministic**: Identical files result in the same ID, allowing for storage deduplication.
|
- **Storage Deduplication**: Identical files result in the same ID, saving disk space.
|
||||||
|
- **Chunked Uploads**: Supports large file uploads via the web interface using 8MB chunks.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
You can interact with the service via the web interface or through the command line.
|
### Web Interface
|
||||||
|
Simply drag and drop files into the browser. The interface handles chunking and provides a shareable link once the upload is finalized.
|
||||||
|
|
||||||
### Uploading a file
|
### Command Line (CLI)
|
||||||
|
You can upload files directly using `curl`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -F 'file=@archive.zip' https://bin.example.com
|
curl -F 'file=@photo.jpg' https://bin.example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
The server will return a URL containing the file ID and the decryption key:
|
The server will return a direct link:
|
||||||
`https://bin.example.com/vS6_1_8pS-Y_8-8_...`
|
`https://bin.example.com/0iEZGtW-ikVdu...jpg`
|
||||||
|
|
||||||
### Downloading a file
|
|
||||||
|
|
||||||
Simply open the link in a browser or use `curl`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl https://bin.example.com/vS6_1_8pS-Y_8-8_... > archive.zip
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
`safebin` is configured via command-line flags:
|
`safebin` can be configured via environment variables or command-line flags:
|
||||||
|
|
||||||
| Flag | Description | Default |
|
| Flag | Environment Variable | Description | Default |
|
||||||
| :--- | :--- | :--- |
|
| :--- | :--- | :--- | :--- |
|
||||||
| `-h` | Bind address for the server. | `0.0.0.0` |
|
| `-h` | `SAFEBIN_HOST` | Bind address for the server. | `0.0.0.0` |
|
||||||
| `-p` | Port to listen on. | `8080` |
|
| `-p` | `SAFEBIN_PORT` | Port to listen on. | `8080` |
|
||||||
| `-s` | Directory where encrypted files are stored. | `./storage` |
|
| `-s` | `SAFEBIN_STORAGE` | Directory for encrypted storage. | `./storage` |
|
||||||
| `-m` | Maximum file size in mb. | `512` |
|
| `-m` | `SAFEBIN_MAX_MB` | Maximum file size in MB. | `512` |
|
||||||
|
|
||||||
## Running Locally
|
## Deployment
|
||||||
|
|
||||||
### With Docker
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/skidoodle/safebin
|
|
||||||
cd safebin
|
|
||||||
docker compose -f compose.dev.yaml up --build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Without Docker
|
|
||||||
|
|
||||||
Requires Go 1.25 or higher.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/skidoodle/safebin
|
|
||||||
cd safebin
|
|
||||||
go build -o safebin .
|
|
||||||
./safebin -p 8080 -s ./data
|
|
||||||
```
|
|
||||||
|
|
||||||
## Deploying
|
|
||||||
|
|
||||||
### Docker Compose
|
### Docker Compose
|
||||||
|
The easiest way to deploy is using the provided `compose.yaml`:
|
||||||
The easiest way to deploy is using the provided `compose.yaml`.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
safebin:
|
safebin:
|
||||||
image: ghcr.io/skidoodle/safebin:main
|
image: ghcr.io/skidoodle/safebin:latest
|
||||||
container_name: safebin
|
container_name: safebin
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
@@ -88,10 +61,22 @@ volumes:
|
|||||||
data:
|
data:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Manual Build
|
||||||
|
Requires Go 1.25 or higher.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go build -o safebin .
|
||||||
|
./safebin -p 8080 -s ./data
|
||||||
|
```
|
||||||
|
|
||||||
## Retention Policy
|
## Retention Policy
|
||||||
|
|
||||||
The server runs a cleanup task every hour. Retention is calculated using a cubic scaling formula to balance disk usage:
|
The server runs a background cleanup task every hour. Retention is calculated using a cubic scaling formula to prioritize small files:
|
||||||
- **Small files (< 1MB)**: Up to 365 days.
|
|
||||||
- **Large files (512MB)**: 24 hours.
|
|
||||||
|
|
||||||
This ensures that the server doesn't run out of disk space due to large binary blobs while allowing small text files or images to persist for longer periods.
|
- **Small files (e.g., < 1MB)**: Kept for up to **365 days**.
|
||||||
|
- **Large files (at Max MB)**: Kept for **24 hours**.
|
||||||
|
- **Temporary Uploads**: Unfinished chunked uploads are purged after **4 hours**.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the **GNU General Public License v2.0**.
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
safebin:
|
safebin:
|
||||||
image: ghcr.io/skidoodle/safebin:main
|
image: ghcr.io/skidoodle/safebin:latest
|
||||||
container_name: safebin
|
container_name: safebin
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user