From 477aca289a491e6a94237fb52fdcc0301ed539c8 Mon Sep 17 00:00:00 2001 From: diced Date: Sun, 16 Feb 2025 17:25:11 -0800 Subject: [PATCH] feat: v4 changes --- .github/workflows/build.yml | 4 +- .github/workflows/docker-release.yml | 87 ++++++++++++++++++++++++++++ .github/workflows/docker.yml | 22 ++++--- README.md | 4 +- src/components/ThemeProvider.tsx | 10 +--- src/lib/theme/builtins/dark_blue.ts | 35 +++++++++++ src/pages/setup.tsx | 54 +++++++++-------- 7 files changed, 171 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/docker-release.yml create mode 100644 src/lib/theme/builtins/dark_blue.ts diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68a5e206..0849021a 100755 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: 'Build' on: push: - branches: [v4] + branches: [v4, trunk] pull_request: - branches: [v4] + branches: [v4, trunk] workflow_dispatch: jobs: diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 00000000..1f885499 --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -0,0 +1,87 @@ +name: 'Push Release Docker Images' + +on: + push: + tags: + - 'v4.*.*' + workflow_dispatch: + +jobs: + push: + strategy: + matrix: + arch: [amd64, arm64] + + name: push release + runs-on: ubuntu-24.04${{ matrix.arch == 'arm64' && '-arm' || '' }} + steps: + - uses: actions/checkout@v4 + + - name: Get version + id: version + run: | + echo "zipline_version=$(jq .version package.json -r)" >> $GITHUB_OUTPUT + + - name: Get commit sha + id: sha + run: | + echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/build-push-action@v6 + with: + push: true + platforms: linux/${{ matrix.arch }} + cache-from: type=gha + cache-to: type=gha,mode=max + provenance: false + tags: | + ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-${{ matrix.arch }} + ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-${{ steps.sha.outputs.short_sha }}-${{ matrix.arch }} + + amend-builds: + runs-on: ubuntu-24.04 + needs: push + steps: + - uses: actions/checkout@v4 + + - name: Get version + id: version + run: | + echo "zipline_version=$(jq .version package.json -r)" >> $GITHUB_OUTPUT + + - name: Get commit sha + id: sha + run: | + echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: pull images + run: | + docker pull --platform=linux/amd64 ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-amd64 + docker pull --platform=linux/arm64 ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-arm64 + + - name: create manifests + run: | + docker manifest create ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }} \ + --amend ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-amd64 \ + --amend ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-arm64 && \ + docker manifest create ghcr.io/diced/zipline:latest \ + --amend ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-amd64 \ + --amend ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-arm64 + + - name: push manifests + run: | + docker manifest push ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }} && \ + docker manifest push ghcr.io/diced/zipline:latest diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 15a6c789..bfe1c34c 100755 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: 'Push Docker Images' on: push: - branches: [v4] + branches: [v4, trunk] workflow_dispatch: jobs: @@ -36,10 +36,10 @@ jobs: cache-to: type=gha,mode=max provenance: false tags: | - ghcr.io/diced/zipline:v4-${{ matrix.arch }} - ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-${{ matrix.arch }} + ghcr.io/diced/zipline:trunk-${{ matrix.arch }} + ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-${{ matrix.arch }} - ammend-builds: + amend-builds: runs-on: ubuntu-24.04 needs: push steps: @@ -57,19 +57,23 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: pull images run: | - docker pull --platform=linux/amd64 ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-amd64 - docker pull --platform=linux/arm64 ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-arm64 + docker pull --platform=linux/amd64 ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-amd64 + docker pull --platform=linux/arm64 ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-arm64 - name: create manifests run: | - docker manifest create ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }} \ + docker manifest create ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }} \ --amend ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-amd64 \ --amend ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-arm64 && \ + docker manifest create ghcr.io/diced/zipline:trunk \ + --amend ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-amd64 \ + --amend ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-arm64 docker manifest create ghcr.io/diced/zipline:v4 \ --amend ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-amd64 \ --amend ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }}-arm64 - name: push manifests run: | - docker manifest push ghcr.io/diced/zipline:v4-${{ steps.sha.outputs.short_sha }} && \ - docker manifest push ghcr.io/diced/zipline:v4 + docker manifest push ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }} && \ + docker manifest push ghcr.io/diced/zipline:trunk && \ + docker manifest push ghcr.io/diced/zipline:v4 && \ diff --git a/README.md b/README.md index 90b81ba2..a7b6d1cc 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- + The next generation ShareX / File upload server @@ -10,7 +10,7 @@ The next generation ShareX / File upload server ![Build](https://img.shields.io/github/actions/workflow/status/diced/zipline/build.yml?logo=github&style=flat&branch=trunk) -[v4.zipline.diced.sh](https://v4.zipline.diced.sh) | [v3.zipline.diced.sh](https://v3.zipline.diced.sh) +[zipline.diced.sh](https://zipline.diced.sh) | [old v3.zipline.diced.sh](https://v3.zipline.diced.sh) diff --git a/src/components/ThemeProvider.tsx b/src/components/ThemeProvider.tsx index a995ed95..0bbc3bc3 100755 --- a/src/components/ThemeProvider.tsx +++ b/src/components/ThemeProvider.tsx @@ -2,6 +2,7 @@ import { Config } from '@/lib/config/validate'; import { useSettingsStore } from '@/lib/store/settings'; import { useUserStore } from '@/lib/store/user'; import { ZiplineTheme, findTheme, themeComponents } from '@/lib/theme'; +import dark_blue from '@/lib/theme/builtins/dark_blue'; import { MantineProvider, createTheme } from '@mantine/core'; import { useColorScheme } from '@mantine/hooks'; import { createContext, useContext } from 'react'; @@ -48,14 +49,7 @@ export default function Theming({ } if (!theme) { - theme = - findTheme('builtin:dark_blue') ?? - ({ - id: 'builtin:dark_gray', - name: 'Dark Gray', - colorScheme: 'dark', - primaryColor: 'gray', - } as unknown as ZiplineTheme); // back up theme if all else fails lol + theme = findTheme('builtin:dark_blue') ?? (dark_blue as unknown as ZiplineTheme); // back up theme if all else fails lol } return ( diff --git a/src/lib/theme/builtins/dark_blue.ts b/src/lib/theme/builtins/dark_blue.ts new file mode 100644 index 00000000..de0b4393 --- /dev/null +++ b/src/lib/theme/builtins/dark_blue.ts @@ -0,0 +1,35 @@ +const dark_blue = { + name: 'Dark Blue', + id: 'builtin:dark_blue', + colorScheme: 'dark', + colors: { + blue: [ + '#FFFFFF', + '#7C7DC2', + '#7778C0', + '#6C6FBC', + '#575DB5', + '#4D54B2', + '#424BAE', + '#3742AA', + '#323EA8', + '#2C39A6', + ], + dark: [ + '#FFFFFF', + '#293747', + '#6C7A8D', + '#2d3e5a', + '#222c47', + '#171F35', + '#181c28', + '#0c101c', + '#060824', + '#00001E', + ], + }, + primaryColor: 'blue', + mainBackgroundColor: 'color-mix(in srgb, var(--mantine-color-dark-9), black 45%)', +}; + +export default dark_blue; diff --git a/src/pages/setup.tsx b/src/pages/setup.tsx index 5df7397d..b38de2c5 100755 --- a/src/pages/setup.tsx +++ b/src/pages/setup.tsx @@ -25,10 +25,21 @@ import { useRouter } from 'next/router'; import { useState } from 'react'; import { mutate } from 'swr'; +function LinkToDoc({ href, title, children }: { href: string; title: string; children: React.ReactNode }) { + return ( + + + {title} + {' '} + {children} + + ); +} + export default function Setup() { const router = useRouter(); - const [active, setActive] = useState(1); + const [active, setActive] = useState(0); const nextStep = () => setActive((current) => (current < 3 ? current + 1 : current)); const prevStep = () => setActive((current) => (current > 0 ? current - 1 : current)); @@ -107,39 +118,34 @@ export default function Setup() { Documentation - Here are a couple of useful documentation links to get you started with Zipline. + Here are a couple of useful documentation links to get you started with Zipline: - {/* TODO: change these to actual links.. */} - - [name]: desc - + + + Configuring Zipline to your needs + - - [name]: desc - - - [name]: desc - - - [name]: desc - - - [name]: desc - + + Upgrading from a previous version of Zipline + + Configuration - Zipline's configuration is managed by environment variables. Zipline makes this easy by - providing support for using a .env file. When using Docker Compose all - the environment variables are found in the docker-compose.yml file. + Most of Zipline's configuration is now managed through the dashboard. Once you login as + a super-admin, you can click on your username in the top right corner and select + "Server Settings" to configure your instance. The only exception to this is a few + sensitive environment variables that must be set in order for Zipline to run. To change + this, depending on the setup, you can either edit the .env or{' '} + docker-compose.yml file. To see all of the available environment variables, please refer to the documentation{' '} - + here. @@ -199,8 +205,8 @@ export default function Setup() { Setup complete! - Clicking "continue" below will create your super-admin account and log you in. You - will be redirected to the dashboard shortly after that. + Clicking "Finish" below will create your super-admin account and log you in. You will + be redirected to the dashboard shortly after that.