🍓🖼️🍹 A small thing where I can upload a file and get a link back https://files-shared.strawmelonjuice.com/
Find a file
2025-09-12 11:05:21 +02:00
dashboard replace check for bytes with try-catch (chromium support fixed) 2025-09-12 11:03:22 +02:00
data/files Add dev run 2025-08-26 10:42:31 +02:00
scripts user management scripts 2025-08-31 14:35:03 +02:00
.dockerignore docker 2025-08-27 12:07:21 +02:00
.gitignore Time for an eyesight break 2025-08-27 02:50:07 +02:00
bun.lock added tailwind 2025-08-26 23:04:44 +02:00
Dockerfile user management scripts 2025-08-31 14:35:03 +02:00
index.ts small error wipers 2025-08-27 11:44:24 +02:00
mise.toml ask for confirm 2025-09-12 11:05:21 +02:00
package.json fmt 2025-08-26 23:44:14 +02:00
README.md user management scripts 2025-08-31 14:35:03 +02:00
tsconfig.json Time for an eyesight break 2025-08-27 02:50:07 +02:00

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

  1. Clone the repository:
    git clone https://codeberg.org/strawmelonjuice/strawmediajuice.git
    cd strawmediajuice
    
  2. Start the application:
    mise run dev
    
  3. 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! 🚀