| dashboard | ||
| data/files | ||
| scripts | ||
| .dockerignore | ||
| .gitignore | ||
| bun.lock | ||
| Dockerfile | ||
| index.ts | ||
| mise.toml | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Strawmediajuice 🍓🖼️🍹
Welcome to Strawmediajuice!
This project is a lightweight and user-friendly file-sharing application. It allows users to upload files, manage their storage, and share files via unique links.
Features
- File Upload: Upload files securely and receive a unique link for sharing.
- Authentication: Uploads are only possible by authenticated users. (no free signups)
- File Management: List, download, and delete files.
- Admin Controls: Manage user quotas and monitor storage usage.
- Dashboard: A simple web interface for managing files.
Getting Started
- Clone the repository:
git clone https://codeberg.org/strawmelonjuice/strawmediajuice.git cd strawmediajuice - Start the application:
mise run dev - Access the dashboard at http://localhost:3000.
Environment Variables
To configure the application, set the following environment variables:
PORT: The port on which the server will run (default:3000).INIT_USERNAME: The username for the initial admin account. (if not set, will prompt on first run.)INIT_PASSWORD: The password for the initial admin account. (if not set, will prompt on first run.)
You can later create users by going into /app/ on the docker image and running bun ./scripts/user_add.ts, then answering the prompted information.
Data Persistence
To ensure that uploaded files and database data are not lost, make sure to mount the data directory as a volume when deploying the application. This is especially important for Docker and Kubernetes deployments.
Docker Example
volumes:
- ./data:/app/data
Kubernetes Example
volumeMounts:
- name: data-volume
mountPath: /app/data
volumes:
- name: data-volume
persistentVolumeClaim:
claimName: data-pvc
Docker Deployment
The application is available as a Docker image on Docker Hub: strawmelonjuice/strawmediajuice.
Example docker-compose.yml
version: '3.8'
services:
strawmediajuice:
image: strawmelonjuice/strawmediajuice:latest
ports:
- "3000:3000"
environment:
- PORT=3000
- INIT_USERNAME=admin
- INIT_PASSWORD=securepassword
volumes:
- ./data:/app/data
Kubernetes Deployment
You can also deploy the application using Kubernetes. Here's an example manifest:
apiVersion: apps/v1
kind: Deployment
metadata:
name: strawmediajuice
spec:
replicas: 1
selector:
matchLabels:
app: strawmediajuice
template:
metadata:
labels:
app: strawmediajuice
spec:
containers:
- name: strawmediajuice
image: strawmelonjuice/strawmediajuice:latest
ports:
- containerPort: 3000
env:
- name: PORT
value: "3000"
- name: INIT_USERNAME
value: "admin"
- name: INIT_PASSWORD
value: "securepassword"
volumeMounts:
- name: data-volume
mountPath: /app/data
volumes:
- name: data-volume
persistentVolumeClaim:
claimName: data-pvc
---
apiVersion: v1
kind: Service
metadata:
name: strawmediajuice
spec:
selector:
app: strawmediajuice
ports:
- protocol: TCP
port: 80
targetPort: 3000
type: LoadBalancer
API Endpoints
POST /api/upload: Upload a file.POST /api/auth: Authenticate a user.POST /api/files: List files for a user.POST /api/files/delete: Delete a file.
Contributing
Feel free to open issues or submit pull requests to improve the project. Contributions are always welcome!
Happy sharing! 🚀