mirror of
https://github.com/diced/zipline.git
synced 2025-05-10 18:05:54 +02:00
feat: new readme
This commit is contained in:
parent
7bd889ebd9
commit
a6807a681c
4 changed files with 261 additions and 25 deletions
269
README.md
269
README.md
|
@ -1,37 +1,212 @@
|
|||
# Zipline 4
|
||||
<div align="center">
|
||||
<img src="https://raw.githubusercontent.com/diced/zipline/v4/public/zipline_small.png"/>
|
||||
|
||||
> [!WARNING]
|
||||
> This is a work in progress, the database is not final and is subject to change without a migration.
|
||||
The next generation ShareX / File upload server
|
||||
|
||||
Roadmap for v4: https://diced.notion.site/Zipline-v4-Roadmap-058aceb8a35140e7af4c726560aa3db1?pvs=4
|
||||

|
||||

|
||||

|
||||
[](https://discord.gg/EAhCRfGxCF)
|
||||
|
||||
## Running Zipline v4
|
||||

|
||||
|
||||
Running v4 as of the latest commit is as simple as spinning up a docker container with a few of the required environment variables.
|
||||
[v4.zipline.diced.sh](https://v4.zipline.diced.sh) | [v3.zipline.diced.sh](https://v3.zipline.diced.sh)
|
||||
|
||||
It is recommended to follow the guide available at [v4.zipline.diced.sh/docs/get-started/docker](https://v4.zipline.diced.sh/docs/get-started/docker).
|
||||
<!-- TODO: change these links and image branch -->
|
||||
|
||||
There is also a guide on how to run Zipline v4 without docker [here](https://v4.zipline.diced.sh/docs/get-started/source).
|
||||
</div>
|
||||
|
||||
## Features
|
||||
|
||||
- Setup Quickly: [Get Started with Docker](https://zipline.diced.sh/docs/get-started/docker)
|
||||
- Configure
|
||||
- Upload any file
|
||||
- Folders
|
||||
- Tags
|
||||
- URL shortening
|
||||
- Embeds
|
||||
- Discord Webhooks
|
||||
- HTTP Webhooks
|
||||
- OAuth2
|
||||
- 2FA
|
||||
- Passkeys
|
||||
- Password Protection
|
||||
- Image Compression
|
||||
- Video Thumbnails
|
||||
- API
|
||||
- PWA
|
||||
- Partial Uploads
|
||||
- Invites
|
||||
- Quotas
|
||||
- Custom Themes
|
||||
- ... and more!
|
||||
|
||||
# Usage
|
||||
|
||||
Visit [the docs](https://zipline.diced.sh/docs/get-started/docker) for a more in-depth guide on how to get started.
|
||||
|
||||
## Install and Run with Docker
|
||||
|
||||
This is the recommended way to run Zipline:
|
||||
|
||||
```yml
|
||||
services:
|
||||
postgresql:
|
||||
image: postgres:16
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRESQL_USER:-zipline}
|
||||
POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD:?POSTGRESSQL_PASSWORD is required}
|
||||
POSTGRES_DB: ${POSTGRESQL_DB:-zipline}
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ['CMD', 'pg_isready', '-U', 'zipline']
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
zipline:
|
||||
image: ghcr.io/diced/zipline
|
||||
ports:
|
||||
- '3000:3000'
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- DATABASE_URL=postgres://${POSTGRESQL_USER:-zipline}:${POSTGRESQL_PASSWORD}@postgresql:5432/${POSTGRESQL_DB:-zipline}
|
||||
depends_on:
|
||||
- postgresql
|
||||
volumes:
|
||||
- './uploads:/zipline/uploads'
|
||||
- './public:/zipline/public'
|
||||
- './themes:/zipline/themes'
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
```
|
||||
|
||||
### Volumes
|
||||
|
||||
- `./uploads` - The folder where all the user uploads are stored (the default is `./uploads`)
|
||||
- `./public` - The folder where all the public assets are stored (must mount to `/zipline/public`)
|
||||
- `./themes` - The folder where all the custom themes are stored (must mount to `/zipline/themes`)
|
||||
|
||||
### Generating Secrets
|
||||
|
||||
```bash
|
||||
echo "POSTGRESQL_PASSWORD=$(openssl rand -base64 42 | tr -dc A-Za-z0-9 | cut -c -32 | tr -d '\n')" > .env
|
||||
echo "CORE_SECRET=$(openssl rand -base64 42 | tr -dc A-Za-z0-9 | cut -c -32 | tr -d '\n')" >> .env
|
||||
```
|
||||
|
||||
Without the `CORE_SECRET` environment variable, Zipline will not start.
|
||||
|
||||
### Changing where uploads are stored
|
||||
|
||||
By default, Zipline will default to the `./uploads` folder, which is also reflected in the `docker-compose.yml` above. If you want to change this, you can set the `DATASOURCE_LOCAL_DIRECTORY` environment variable to a different path.
|
||||
|
||||
```bash
|
||||
DATASOURCE_LOCAL_DIRECTORY=/path/to/your/local/files
|
||||
# or relative to the working directory
|
||||
DATASOURCE_LOCAL_DIRECTORY=./relative/path/to/files
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Remember to change volume mappings in the docker-compose.yml file if you change this.
|
||||
|
||||
### Changing the port and hostname
|
||||
|
||||
By default, Zipline binds to `0.0.0.0:3000`, which is also reflected in the `docker-compose.yml` above. If you want to change this, you can set the `CORE_PORT` and `CORE_HOSTNAME` environment variables to a different port and hostname.
|
||||
|
||||
```bash
|
||||
CORE_PORT=80
|
||||
CORE_HOSTNAME=localhost
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> If you change the port, you will need to update the `ports` section in the `docker-compose.yml` file.
|
||||
|
||||
### Using S3
|
||||
|
||||
If you want to use S3 instead of the local filesystem, you can set the following environment variables:
|
||||
|
||||
```bash
|
||||
DATASOURCE_TYPE=s3
|
||||
|
||||
DATASOURCE_S3_ACCESS_KEY_ID=access_key_id
|
||||
DATASOURCE_S3_SECRET_ACCESS_KEY=secret
|
||||
DATASOURCE_S3_BUCKET=zipline
|
||||
DATASOURCE_S3_REGION=us-west-2
|
||||
```
|
||||
|
||||
For more information, like other providers, see the [docs](https://zipline.diced.sh/docs/config/datasource#s3-datasource).
|
||||
|
||||
### Starting Zipline
|
||||
|
||||
Simply run the following command to start the server:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
You should be able to access the website at `http://localhost:3000` or the port you specified.
|
||||
|
||||
## Manual Install
|
||||
|
||||
See [docs](https://zipline.diced.sh/docs/get-started/source) for more information.
|
||||
|
||||
# Migrating from v3
|
||||
|
||||
Zipline v4 was a complete rewrite, and as such, there is no upgrade path from v3 to v4. You will need to export your data from v3 and import it into v4. This process is made easier by the fact that v4 has a built-in importer to import data from v3.
|
||||
|
||||
See [migration](https://zipline.diced.sh/docs/migrate) for more information.
|
||||
|
||||
# Contributing
|
||||
|
||||
Here are some simple instructions to get Zipline v4 running and ready to develop on.
|
||||
Contributions of any kind are welcome, whether they are bug reports, pull requests, or feature requests.
|
||||
|
||||
## Prerequisites
|
||||
## Bug Reports
|
||||
|
||||
Create an issue on GitHub and use the template, please include the following (if one of them is not applicable to the issue then it's not needed):
|
||||
|
||||
- The steps to reproduce the bug
|
||||
- Logs of Zipline
|
||||
- The version of Zipline, and whether or not you are using Docker (include the image digest/tag if possible)
|
||||
- Your OS & Browser including server OS
|
||||
- What you were expecting to see
|
||||
- How it can be fixed (if you know)
|
||||
|
||||
## Feature Requests
|
||||
|
||||
Create a discussion on GitHub, and please include the following:
|
||||
|
||||
- Brief explanation of your feature in the title (very brief)
|
||||
- How it would work (be detailed)
|
||||
|
||||
## Pull Requests
|
||||
|
||||
Create a pull request on GitHub. If your PR does not pass the action checks, then please fix the errors. If your PR was submitted before a release, and I have pushed a new release, please make sure to update your PR to reflect any changes, usually this is handled by GitHub.
|
||||
|
||||
### Development
|
||||
|
||||
Here's how to setup Zipline for development
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
- nodejs (lts -> 20.x, 22.x)
|
||||
- pnpm (9.x)
|
||||
- pnpm (10.x)
|
||||
- a postgresql server
|
||||
|
||||
## Setup
|
||||
#### Setup
|
||||
|
||||
You should probably use a `.env` file to manage your environment variables, here is an example .env file with every available environment variable:
|
||||
|
||||
````bash
|
||||
```bash
|
||||
DEBUG=zipline
|
||||
|
||||
# required
|
||||
CORE_SECRET="a secret"
|
||||
CORE_SECRET="a secret that is 32 characters long"
|
||||
|
||||
# required
|
||||
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/zipline?schema=public"
|
||||
|
@ -42,23 +217,23 @@ CORE_HOSTNAME=0.0.0.0
|
|||
|
||||
# one of these is required
|
||||
DATASOURCE_TYPE="local"
|
||||
DATASOURCE_TYPE="s3"
|
||||
# DATASOURCE_TYPE="s3"
|
||||
|
||||
# if DATASOURCE_TYPE=local
|
||||
DATASOURCE_LOCAL_DIRECTORY="/path/to/your/local/files"
|
||||
|
||||
# if DATASOURCE_TYPE=s3
|
||||
DATASOURCE_S3_ACCESS_KEY_ID="your-access-key-id"
|
||||
DATASOURCE_S3_SECRET_ACCESS_KEY="your-secret-access-key"
|
||||
DATASOURCE_S3_REGION="your-region"
|
||||
DATASOURCE_S3_BUCKET="your-bucket"
|
||||
DATASOURCE_S3_ENDPOINT="your-endpoint" # if using a custom endpoint other than aws s3
|
||||
# DATASOURCE_S3_ACCESS_KEY_ID="your-access-key-id"
|
||||
# DATASOURCE_S3_SECRET_ACCESS_KEY="your-secret-access-key"
|
||||
# DATASOURCE_S3_REGION="your-region"
|
||||
# DATASOURCE_S3_BUCKET="your-bucket"
|
||||
# DATASOURCE_S3_ENDPOINT="your-endpoint"
|
||||
# ^ if using a custom endpoint other than aws s3
|
||||
|
||||
# optional but both are required if using ssl
|
||||
SSL_KEY="/path/to/your/ssl/key"
|
||||
SSL_CERT="/path/to/your/ssl/cert"
|
||||
|
||||
````
|
||||
# SSL_KEY="/path/to/your/ssl/key"
|
||||
# SSL_CERT="/path/to/your/ssl/cert"
|
||||
```
|
||||
|
||||
Install dependencies:
|
||||
|
||||
|
@ -83,3 +258,49 @@ And to run the production version of Zipline:
|
|||
```bash
|
||||
pnpm start
|
||||
```
|
||||
|
||||
#### Making changes to the database schema
|
||||
|
||||
Zipline uses [prisma](https://www.prisma.io/) as its ORM, and as such, you will need to use the prisma CLI to facilitate any changes to the database schema.
|
||||
|
||||
Once you have made a change to `prisma.schema`, you can run the script `db:migrate` to generate a migration file. This script doesn't apply the migration, as Zipline handles applying migrations itself on startup.
|
||||
|
||||
```bash
|
||||
pnpm db:migrate
|
||||
```
|
||||
|
||||
If you wish to push changes to the database without generating a migration file, you can run the script `db:prototype`. This is only recommended for testing purposes, and should not be used in production.
|
||||
|
||||
```bash
|
||||
pnpm db:prototype
|
||||
```
|
||||
|
||||
#### Linting and Formatting
|
||||
|
||||
Zipline will fail to build unless the code is properly formatted and linted. To format the code, you can run the following command:
|
||||
|
||||
```bash
|
||||
pnpm validate
|
||||
```
|
||||
|
||||
#### Testing `zipline-ctl`
|
||||
|
||||
To build the ctl, you can run the following command:
|
||||
|
||||
```bash
|
||||
pnpm build:server
|
||||
```
|
||||
|
||||
then run any command you want
|
||||
|
||||
```bash
|
||||
pnpm ctl help
|
||||
```
|
||||
|
||||
# Documentation
|
||||
|
||||
Documentation is located at [zipline.diced.sh](https://zipline.diced.sh) and the source is located at [github.com/diced/zipline-docs](https://github.com/diced/zipline-docs).
|
||||
|
||||
# Security
|
||||
|
||||
Security issues are taken seriously, and should be reported via [GitHub Advisories](https://github.com/diced/zipline/security/advisories). For more information see the [security policy](SECURITY.md).
|
||||
|
|
15
SECURITY.md
Normal file
15
SECURITY.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 4.x.x | :white_check_mark: |
|
||||
| < 3 | :x: |
|
||||
| < 2 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Report a Vulnerability [here](https://github.com/diced/zipline/security/advisories) (click Report a Vulnerability). Please include exact details with how to reproduce the vulnerability, and if possible, a proof of concept that demonstrates the vulnerability.
|
||||
|
||||
<- Go [back](README.md#SECURITY)
|
|
@ -2,7 +2,7 @@
|
|||
"name": "zipline",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"version": "4.0.0-dev+1",
|
||||
"version": "4.0.0",
|
||||
"scripts": {
|
||||
"build": "pnpm run --stream \"/^build:.*/\"",
|
||||
"build:prisma": "prisma generate --no-hints",
|
||||
|
|
BIN
public/zipline_small.png
Normal file
BIN
public/zipline_small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
Loading…
Add table
Add a link
Reference in a new issue