···55This project is a lightweight and user-friendly file-sharing application. It allows users to upload files, manage their
66storage, and share files or artifacts via unique links.
7788-98## v2.0.0 roadmap
1091110Version 2.0.0 will no longer ship with a server written in TypeScript, instead, Rust with the Rocket framework should make it both easier to maintain and stronger for future trials.
12111312### โ **Implemented in Rust:**
1313+1414- Dashboard (`/`) serving static HTML
1515- File serving (`/file/<id>`) with filename validation
1616-- Authentication (`/api/auth`) with session management
1616+- Authentication (`/api/auth`) with session management
1717- Session destruction (`/api/session/destroy`)
1818- Simple file upload (`/api/upload`) with quota checking
1919- Simple redirect from (`/favicon.ico`) to the strawmelonjuice.png file
2020- User info retrieval from (`/api/user/fetch`)
21212222-2322### โ **Missing from Rust:**
24232525-1. **`/api/files` - File Listing**
2424+1. **`/api/files` - File Listing**
2625 - [x] Lists all files for authenticated users
2726 - [x] Admins see all files, regular users see only their own
2827 - [ ] Returns file sizes in MB
···5049 - Should display file info with embed support for media files
515052517. **Admin panel** (multiple api's missing, frontend missing)
5353- - An admin panel showable to users who are admin according to `/api/user/fetch`. Allows management, disabling (not removal), reset (deletes all files in ownership) or creation of other users, and server configuration. File management is still done on the file list, as admins can still see all files and their owners.
5252+ - An admin panel showable to users who are admin according to `/api/user/fetch`. Allows management, disabling (not removal), reset (deletes all files in ownership) or creation of other users, and server configuration. File management is still done on the file list, as admins can still see all files and their owners.
545355548. **Repository files** (`/release/<packagename>/`, `/api/upload-streamed`)
5656- - Users claim a repository and own it, only owners and admins can alter (upload/remove/etc.) claimed repository.
5757- - Allows for 'versions' including two featured versions which are displayed at the top.
5858- - Claiming is done by uploading a file with filename `<repositoryname>/<version>/<filename>` to the server. Repository uploads might be unavailable for the web panel until a next release, but I am also thinking of a CLI, which would be very suitable and might even support doing this from the <https://forge.strawmelonjuice.com> CI.
5959- - Files with the same version and filename within a repository are overwritten.
6060- - Repository file uploads do not close when 100% is transmitted, instead they send a `DONE`, and await the server's response.
5555+ - Users claim a repository and own it, only owners and admins can alter (upload/remove/etc.) claimed repository.
5656+ - Allows for 'versions' including two featured versions which are displayed at the top.
5757+ - Claiming is done by uploading a file with filename `<repositoryname>/<version>/<filename>` to the server. Repository uploads might be unavailable for the web panel until a next release, but I am also thinking of a CLI, which would be very suitable and might even support doing this from the <https://forge.strawmelonjuice.com> CI.
5858+ - Files with the same version and filename within a repository are overwritten.
5959+ - Repository file uploads do not close when 100% is transmitted, instead they send a `DONE`, and await the server's response.
61609. **Deploy** (`/pages/<username>/<repositoryname>`-> might be aliased, `/api/upload-streamed`)
6262- - Builds on earlier statements from repository files.
6363- - Uploading `<repositoryname>/deploy.zip` turns an upload into a deployment. The deploy.zip is then unpacked, it must contain an `./index.html` file, regardless of file content. If not, the upload is rejected.
6464-6161+ - Builds on earlier statements from repository files.
6262+ - Uploading `<repositoryname>/deploy.zip` turns an upload into a deployment. The deploy.zip is then unpacked, it must contain an `./index.html` file, regardless of file content. If not, the upload is rejected.
6363+6564<!--
6665## Features
6766···8685## Getting Started (dev mode, use the docker image for real use cases!)
878688871. Clone the repository:
8989- ```bash
9090- git clone https://git.strawmelonjuice.com/strawmelonjuice/strawmediajuice.git
9191- cd strawmediajuice
9292- ```
8888+8989+ ```bash
9090+ git clone https://git.strawmelonjuice.com/strawmelonjuice/strawmediajuice.git
9191+ cd strawmediajuice
9292+ ```
939394942. Get the dependencies. `mise i` or `nix development` work, but if you'd want to install them in other ways, see the `mise.toml` file for your list of dependencies.
959596963. Start the application:
9797- ```bash
9898- just dev
9999- ```
9797+ ```bash
9898+ just dev
9999+ ```
1001004. Access the dashboard at [http://localhost:3000](http://localhost:3000).
101101-102101103102## Environment Variables
104103105104To configure the application, set the following environment variables:
106105107106| Variable name | Description | If not set |
108108-|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
107107+| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
109108| `PORT` | The port on which the server will run. | default: `3000` |
110109| `INIT_USERNAME` | The username for the initial admin account. | Will prompt on first run. |
111110| `INIT_PASSWORD` | The password for the initial admin account. | will prompt on first run. |
···124123125124```yaml
126125volumes:
127127- - ./data:/app/data
126126+ - ./data:/app/data
128127```
129128130129### Kubernetes Example
131130132131```yaml
133132volumeMounts:
134134- - name: data-volume
135135- mountPath: /app/data
133133+ - name: data-volume
134134+ mountPath: /app/data
136135volumes:
137137- - name: data-volume
138138- persistentVolumeClaim:
139139- claimName: data-pvc
136136+ - name: data-volume
137137+ persistentVolumeClaim:
138138+ claimName: data-pvc
140139```
141140142141## Docker Deployment
···144143The application is available as a Docker image on Docker Hub: `strawmelonjuice/strawmediajuice`.
145144146145### Running with Docker CLI
146146+147147```bash
148148docker run -d \
149149 -p 3000:3000 \
···159159```yaml
160160version: "3.8"
161161services:
162162- strawmediajuice:
163163- image: strawmelonjuice/strawmediajuice:latest
164164- ports:
165165- - "3000:3000"
166166- environment:
167167- - PORT=3000
168168- - INIT_USERNAME=admin
169169- - INIT_PASSWORD=securepassword
170170- volumes:
171171- - ./data:/app/data
162162+ strawmediajuice:
163163+ image: strawmelonjuice/strawmediajuice:latest
164164+ ports:
165165+ - "3000:3000"
166166+ environment:
167167+ - PORT=3000
168168+ - INIT_USERNAME=admin
169169+ - INIT_PASSWORD=securepassword
170170+ volumes:
171171+ - ./data:/app/data
172172```
173173174174### Kubernetes Deployment
···179179apiVersion: apps/v1
180180kind: Deployment
181181metadata:
182182- name: strawmediajuice
182182+ name: strawmediajuice
183183spec:
184184- replicas: 1
185185- selector:
186186- matchLabels:
187187- app: strawmediajuice
188188- template:
189189- metadata:
190190- labels:
191191- app: strawmediajuice
192192- spec:
193193- containers:
194194- - name: strawmediajuice
195195- image: strawmelonjuice/strawmediajuice:latest
196196- ports:
197197- - containerPort: 3000
198198- env:
199199- - name: PORT
200200- value: "3000"
201201- - name: INIT_USERNAME
202202- value: "admin"
203203- - name: INIT_PASSWORD
204204- value: "securepassword"
205205- volumeMounts:
206206- - name: data-volume
207207- mountPath: /app/data
208208- volumes:
209209- - name: data-volume
210210- persistentVolumeClaim:
211211- claimName: data-pvc
184184+ replicas: 1
185185+ selector:
186186+ matchLabels:
187187+ app: strawmediajuice
188188+ template:
189189+ metadata:
190190+ labels:
191191+ app: strawmediajuice
192192+ spec:
193193+ containers:
194194+ - name: strawmediajuice
195195+ image: strawmelonjuice/strawmediajuice:latest
196196+ ports:
197197+ - containerPort: 3000
198198+ env:
199199+ - name: PORT
200200+ value: "3000"
201201+ - name: INIT_USERNAME
202202+ value: "admin"
203203+ - name: INIT_PASSWORD
204204+ value: "securepassword"
205205+ volumeMounts:
206206+ - name: data-volume
207207+ mountPath: /app/data
208208+ volumes:
209209+ - name: data-volume
210210+ persistentVolumeClaim:
211211+ claimName: data-pvc
212212---
213213apiVersion: v1
214214kind: Service
215215metadata:
216216- name: strawmediajuice
216216+ name: strawmediajuice
217217spec:
218218- selector:
219219- app: strawmediajuice
220220- ports:
221221- - protocol: TCP
222222- port: 80
223223- targetPort: 3000
224224- type: LoadBalancer
218218+ selector:
219219+ app: strawmediajuice
220220+ ports:
221221+ - protocol: TCP
222222+ port: 80
223223+ targetPort: 3000
224224+ type: LoadBalancer
225225```
226226227227## API Endpoints