Skip to content

Commit

Permalink
Release 3.7.0 (#328)
Browse files Browse the repository at this point in the history
* fix: oauthId optional

* fix: remove optional

* hotfix: make oauthid optional (#249)

* hotfix: fallback oauth find (#250)

* fix: add a forgotten ? to schema

* fix: catch null at other places (#252)

* fix: forgor (#253)

* Fix root url & uploader stuff (#254)

* fix: uploader route as root won't be broken

* fix: fix broken url route for when on root

* fix: catch hopefully the most of the edge cases (#251)

* fix: catch hopefully the most of the edge cases

* fix: invite only, fools

* feat: tsup, small fixes

* fix: #264

* fix: urls handle empty strings

* fix: remove esbuild

* fix: do not mutate res #266

* feat: new embed method

* fix: overwrite tmp ss flameshot

* fix: overrides for uploading

* refactor: chart.js -> recharts

* feat: download query on /r/

* fix: better icons on file vie2

* feat: ability to generate url shorten config

* fix: sxcu name

* fix: react hooks error

* feat: ability to insert tabs on Tab keypress

* feat: overhaul image upload

* fix: clean

* fix: group icons vertically

* fix: embeds not showing up

* fix: docker stuff

* feat(3.7.0-rc1): version

* fix: cors for files (#257)

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* refactor: many columns/tables in prisma

* feat: keep original name #247

* fix: ability to gen with original-name

* fix: type error

* fix: no name on dashboard

* feat(v3.7.0-rc2): version

* fix: sharex DestinationType

* fix: ensureDatabaseExists args

* fix: sharex config

* fix: #277 #272

* fix: 🐛 Add Menu component as parent

* refactor: popover -> menu

Co-authored-by: IceToast <>
Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* fix: add a "skip" for fresh db's (#274)

* fix: add a "skip" for fresh db's

* fix: trimming

* fix: elevate logging!

* fix: allow more variables on view

* fix: optimize docker image

* fix:  root url for upload and shorten (#255)

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* fix: /app -> /zipline

* feat(v3.7.0-rc3): folders for files

* fix: use `name` instead of `file` (#281)

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* feat: search+create for folder select (#283)

* feat?: Search for the folder to add.
Also you can create a folder right from the file, rather than being redirected.

* woops wrong import

* fix: return null for no string in parser (#285)

* feat: use ENTRYPOINT in docker (#286)

* :3

* Update Dockerfile

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* Update Dockerfile

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* Update Dockerfile

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* test

---------

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* fix: set password to actual text value

* fix: url encode password query

* fix: entrypoint executable (#289)

* feat: override domain header

* fix: random domains

* feat: better version checking

* feat: public folders

* fix: dates #278

* feat: devcontainers for codespaces, etc.

* experiment with devcontainer.json

* introduce a docker-compose for devcontainer

* Devcontainers!

* version pop

* Port labeling and a complimentary env variable

* see it to believe it

* Update .devcontainer/devcontainer.json

* Update .devcontainer/devcontainer.json

* Update .devcontainer/docker-compose.yml

---------

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* fix: spaces and route fixes (#294)

* fix: spaces and route fixes

* fix: shorten url response

* feat: better version checking

* fix: use special characters should work

If it doesn't, better call saul

* save that extra byte

* fix: returning protocol again in domain

unrelated to this pr but whatever

* fix: above ^

* Rename shorten.tsv to shorten.ts

---------

Co-authored-by: diced <pranaco2@gmail.com>
Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* fix: #296

* fix: show files per user (#299)

* feat: clearing orphaned files (#303)

* fix: default public folder (docker)

* feat: seperate discord webhooks (shorten/upload) (#260)

* fix: title for folders

* fix: clipboard & 2fa improvements

A workaround that shows the content that would have been copied if `navigator.clipboard` is unavailable for whatever reason.

2FA input autofocuses & submits on enter.

* fix: revamp uploaded file modal

* fix: revamp mobile ui

* feat: more functionality within files table

* feat: clear zero byte files script

* feat: logger improvements
- Timestamp is gray
- removed colorette dependency
- introduction of LOGGER_FILTERS

* chore: update deps

* feat(v3.7.0-rc4): version

* fix: show warning when password protect

* fix: fix (#310)

* Muted audio by default!

* Code renderin'

* not but still decently standard files being viewable

* reserved routes

* Update validateConfig.ts

---------

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* feat: file size (#308)

* feat: baseline support for file sizes

* feat: script to add file sizes

* fix: #311

* chore: update to mantine@6

* refactor: remove old File.tsx

* feat: initial move to mantine v6

* feat: use api option

* remove: useless size modifier

* fix: user button

* feat: use pininput for 2fa

* fix: breaking changes in migrating mantine v6

---------

Co-authored-by: TacticalCoderJay <gogojayvin923@gmail.com>

* feat: add size to datatable

* fix: null on non originalName

* fix: allow download query on non raw

* fix: undef file

* fix: spacingg between count_by_user

* feat: new ui for shortened urls

* fix: spacing within appshell/paper

* feat: new login page

* feat: reorganize menu

* feat: keyboard spotlight

* feat: tabler icons

* fix: remove feather import

* fix: update 2fa enabled appropriately & delete files (#315)

* fix: update 2fa enabled appropriately

* fix: a proper delete

---------

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* feat(v3.7.0-rc5): version

* feat: add feature request "contact_link"

* feat: multiple stuffs

* feat: gfycat url #322

* feat: gfycat attribution

* feat(3.7.0-rc6): version

* fix: type cast

* feat: list view for urls, invites, users: #302

* refactor: docker-compose -> docker compose

* fix: open folder in new tab

* fix: save list-view setting to localStorage

* fix: Bug: URLs list view #330

* fix: #332

* fix: #331

* fix: #333

* feat: link to view gallery (icon)

* fix: clean up Anchors

* refactor: new eslint changes

* fix: fine tune devcontainer (#329)

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>

* fix: FileModal scrollbars

* fix: dynamically import katex

* fix: remove rogue console.log

* fix: open folder onRowClick

* fix: filter on usePaginatedFiles

* fix: icon sizes

* fix: paste listener

* feat(actions): auto-assign milestone

* feat(v3.7.0-rc7): version

* fix: #339

* fix: resetting avatars

* feat: new icons / oauth icons changed

* feat: UPLOADER_ASSUME_MIMETYPES (#337)

* fix: any instance of #342

* fix: any instance of #345

* fix: make tables take entire vh

* chore: update deps

* fix: add bigger sizeLimit

* fix: token exposed on view/[id]

---------

Co-authored-by: Jayvin Hernandez <gogojayvin923@gmail.com>
Co-authored-by: IceToast <54889359+IceToast@users.noreply.github.com>
Co-authored-by: IThundxr <harshdhaliwal9767@gmail.com>
Co-authored-by: IThundxr <contact@ithundxr.dev>
  • Loading branch information
5 people committed Mar 27, 2023
1 parent 4e70daa commit f9060f8
Show file tree
Hide file tree
Showing 204 changed files with 11,134 additions and 3,683 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18

RUN usermod -l zipline node \
&& groupmod -n zipline node \
&& usermod -d /home/zipline zipline \
&& echo "zipline ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/zipline \
&& chmod 0440 /etc/sudoers.d/zipline \
&& sudo apt-get update && apt-get install gnupg2 -y

USER zipline
56 changes: 56 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "Zipline Codespace",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/zipline",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "zipline"
},
"ghcr.io/devcontainers/features/docker-in-docker:1": {
"dockerDashComposeVersion": "v2",
"installDockerBuildx": true
}
},
"customizations": {
"vscode": {
"settings": {
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"files.autoSave": "afterDelay",
"terminal.integrated.persistentSessionReviveProcess": "never",
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh",
"env": {
"ZSH_THEME": "devcontainers"
}
}
}
},
"extensions": ["prisma.prisma", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}
},
"remoteUser": "zipline",
"updateRemoteUserUID": true,
"remoteEnv": {
"CORE_DATABASE_URL": "postgres://postgres:postgres@localhost/zip10"
},
"portsAttributes": {
"3000": {
"label": "Zipline",
"onAutoForward": "openBrowser"
},
"5432": {
"label": "Postgres"
}
},
"postCreateCommand": "sudo chown -R zipline:zipline /zipline && yarn install"
}
25 changes: 25 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.8'
services:
app:
build:
context: ./
dockerfile: Dockerfile
volumes:
- ../:/zipline:cached
- uploads:/zipline/uploads
- node_modules:/zipline/node_modules
command: sleep infinity
db:
image: postgres:latest
restart: unless-stopped
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DATABASE=postgres
volumes:
- pg_data:/var/lib/postgresql/data

volumes:
pg_data:
uploads:
node_modules:
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
.yarn
.devcontainer
.github
.next
.vscode
20 changes: 18 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"extends": ["next", "next/core-web-vitals", "plugin:prettier/recommended"],
"root": true,
"extends": [
"next",
"next/core-web-vitals",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["unused-imports", "@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"rules": {
"linebreak-style": ["error", "unix"],
"quotes": [
Expand Down Expand Up @@ -28,6 +36,14 @@
"react/style-prop-object": "warn",
"@next/next/no-img-element": "off",
"jsx-a11y/alt-text": "off",
"react/display-name": "off"
"react/display-name": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
],
"@typescript-eslint/ban-ts-comment": "off"
}
}
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Feature Request
url: https://github.com/diced/zipline/discussions/new?category=ideas&title=Your%20breif%20description%20here&labels=feature
about: Ask for a new feature
- name: Zipline Discord
url: https://discord.gg/EAhCRfGxCF
about: Ask for help with anything related to Zipline!
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/milestone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Issue/PR Milestones'

on:
pull_request:
types: [opened, reopened]
issues:
types: [opened, reopened]

jobs:
set:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const milestone = 2
github.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
milestone
})
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

598 changes: 310 additions & 288 deletions .yarn/releases/yarn-3.2.4.cjs → .yarn/releases/yarn-3.3.1.cjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.2.4.cjs
yarnPath: .yarn/releases/yarn-3.3.1.cjs
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Create an issue on GitHub, please include the following (if one of them is not a

## Feature requests

Create an issue on GitHub, please include the following:
Create an discussion on GitHub, please include the following:

- Breif explanation of the feature in the title (very breif please)
- How it would work (detailed, but optional)
Expand Down
96 changes: 53 additions & 43 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,65 +1,75 @@
FROM ghcr.io/diced/prisma-binaries:4.7.x as prisma
# Use the Prisma binaries image as the first stage
FROM ghcr.io/diced/prisma-binaries:4.10.x as prisma

FROM node:alpine3.16 AS deps
RUN mkdir -p /prisma-engines
WORKDIR /build
# Use Alpine Linux as the second stage
FROM node:18-alpine3.16 as base

COPY .yarn .yarn
COPY package.json yarn.lock .yarnrc.yml ./
# Set the working directory
WORKDIR /zipline

RUN yarn install --immutable
# Copy the necessary files from the project
COPY prisma ./prisma
COPY src ./src
COPY next.config.js ./next.config.js
COPY tsup.config.ts ./tsup.config.ts
COPY tsconfig.json ./tsconfig.json
COPY mimes.json ./mimes.json
COPY public ./public

FROM node:alpine3.16 AS builder
WORKDIR /build
FROM base as builder

COPY .yarn ./.yarn
COPY package*.json ./
COPY yarn*.lock ./
COPY .yarnrc.yml ./

# Copy the prisma binaries from prisma stage
COPY --from=prisma /prisma-engines /prisma-engines
ENV PRISMA_QUERY_ENGINE_BINARY=/prisma-engines/query-engine \
PRISMA_MIGRATION_ENGINE_BINARY=/prisma-engines/migration-engine \
PRISMA_INTROSPECTION_ENGINE_BINARY=/prisma-engines/introspection-engine \
PRISMA_FMT_BINARY=/prisma-engines/prisma-fmt \
PRISMA_CLI_QUERY_ENGINE_TYPE=binary \
PRISMA_CLIENT_ENGINE_TYPE=binary

RUN apk add --no-cache openssl openssl-dev
PRISMA_CLIENT_ENGINE_TYPE=binary \
ZIPLINE_DOCKER_BUILD=true \
NEXT_TELEMETRY_DISABLED=1

COPY --from=deps /build/node_modules ./node_modules
COPY src ./src
COPY prisma ./prisma
COPY .yarn .yarn
COPY package.json yarn.lock .yarnrc.yml esbuild.config.js next.config.js next-env.d.ts zip-env.d.ts tsconfig.json mimes.json ./
# Install production dependencies then temporarily save
RUN yarn workspaces focus --production --all
RUN cp -RL node_modules /tmp/node_modules

ENV ZIPLINE_DOCKER_BUILD 1
ENV NEXT_TELEMETRY_DISABLED 1
# Install the dependencies
RUN yarn install --immutable

# Run the build
RUN yarn build

FROM node:alpine3.16 AS runner
WORKDIR /zipline
# Use Alpine Linux as the final image
FROM base
# Install the necessary packages
RUN apk add --no-cache perl procps tini

COPY --from=prisma /prisma-engines /prisma-engines
COPY --from=builder /prisma-engines /prisma-engines
ENV PRISMA_QUERY_ENGINE_BINARY=/prisma-engines/query-engine \
PRISMA_MIGRATION_ENGINE_BINARY=/prisma-engines/migration-engine \
PRISMA_INTROSPECTION_ENGINE_BINARY=/prisma-engines/introspection-engine \
PRISMA_FMT_BINARY=/prisma-engines/prisma-fmt \
PRISMA_CLI_QUERY_ENGINE_TYPE=binary \
PRISMA_CLIENT_ENGINE_TYPE=binary

RUN apk add --no-cache openssl openssl-dev
RUN apk add --no-cache perl procps

ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1

COPY --from=builder /build/.next ./.next
COPY --from=builder /build/node_modules ./node_modules

COPY --from=builder /build/next.config.js ./next.config.js
COPY --from=builder /build/esbuild.config.js ./esbuild.config.js
COPY --from=builder /build/src ./src
COPY --from=builder /build/dist ./dist
COPY --from=builder /build/prisma ./prisma
COPY --from=builder /build/tsconfig.json ./tsconfig.json
COPY --from=builder /build/package.json ./package.json
COPY --from=builder /build/mimes.json ./mimes.json

CMD ["node", "--enable-source-maps", "dist/server"]
PRISMA_CLIENT_ENGINE_TYPE=binary \
NEXT_TELEMETRY_DISABLED=1

# Copy only the necessary files from the previous stage
COPY --from=builder /zipline/dist ./dist
COPY --from=builder /zipline/.next ./.next
COPY --from=builder /zipline/package.json ./package.json

COPY --from=builder /zipline/node_modules ./node_modules
COPY --from=builder /zipline/node_modules/.prisma/client ./node_modules/.prisma/client
COPY --from=builder /zipline/node_modules/@prisma/client ./node_modules/@prisma/client

# Copy Startup Script
COPY docker-entrypoint.sh /zipline
# Make Startup Script Executable
RUN chmod a+x /zipline/docker-entrypoint.sh
# Set the entrypoint to the startup script
ENTRYPOINT ["tini", "--", "/zipline/docker-entrypoint.sh"]
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A ShareX/file upload server that is easy to use, packed with features, and with
- Password Protected Uploads
- URL shortening
- Text uploading
- URL Formats (uuid, dates, random alphanumeric, original name, zws)
- URL Formats (uuid, dates, random alphanumeric, original name, zws, gfycat -> [animals](https://assets.gfycat.com/animals) [adjectives](https://assets.gfycat.com/adjectives))
- Discord embeds (OG metadata)
- Gallery viewer, and multiple file format support
- Code highlighting
Expand All @@ -35,7 +35,16 @@ A ShareX/file upload server that is easy to use, packed with features, and with
- User invites
- File Chunking (for large files)
- File deletion once it reaches a certain amount of views
- Easy setup instructions on [docs](https://zipl.vercel.app/) (One command install `docker-compose up -d`)
- Easy setup instructions on [docs](https://zipl.vercel.app/) (One command install `docker compose up -d`)

<details>
<summary>View upstream documentation</summary>

The website below provides documentation for more up-to-date features with the upstream branch. The normal documentation is for the latest release and is not updated unless a new release is made.

[https://trunk.zipline.diced.tech/](https://trunk.zipline.diced.tech/)

</details>

<details>
<summary><h2>Screenshots (click)</h2></summary>
Expand All @@ -51,13 +60,13 @@ A ShareX/file upload server that is easy to use, packed with features, and with

## Install & run with Docker

This section requires [Docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/install/).
This section requires [Docker](https://docs.docker.com/get-docker/) and [docker compose](https://docs.docker.com/compose/install/).

```shell
git clone https://github.com/diced/zipline
cd zipline

docker-compose up -d
docker compose up -d
```

### After installing
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: '3'
services:
postgres:
image: postgres:15
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
Expand All @@ -21,7 +20,6 @@ services:
dockerfile: Dockerfile
ports:
- '3000:3000'
restart: unless-stopped
env_file:
- .env.local
volumes:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'
services:
postgres:
image: postgres:15
restart: always
restart: unless-stopped
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
Expand All @@ -19,7 +19,7 @@ services:
image: ghcr.io/diced/zipline
ports:
- '3000:3000'
restart: always
restart: unless-stopped
environment:
- CORE_RETURN_HTTPS=false
- CORE_SECRET=changethis
Expand Down
5 changes: 5 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

node --enable-source-maps dist/index.js

0 comments on commit f9060f8

Please sign in to comment.