diff --git a/Dockerfile b/Dockerfile
index 5f513c0..53cb6d4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,11 +10,11 @@ COPY prisma ./prisma
COPY package.json yarn.lock next.config.js next-env.d.ts zip-env.d.ts tsconfig.json ./
-RUN yarn install
-
# create a mock config.toml to spoof next build!
RUN echo -e "[core]\nsecret = '12345678'\ndatabase_url = 'postgres://postgres:postgres@postgres/postgres'\n[uploader]\nroute = '/u'\ndirectory = './uploads'\n[urls]\nroute = '/go'" > config.toml
+RUN yarn install
+
RUN yarn build
FROM node:16-alpine3.11 AS runner
diff --git a/docker-compose.yml b/docker-compose.yml
index 9e63859..8fc442e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -15,23 +15,15 @@ services:
retries: 5
zipline:
- image: ghcr.io/diced/zipline/zipline:trunk
+ build:
+ context: .
+ dockerfile: Dockerfile
ports:
- '3000:3000'
restart: unless-stopped
environment:
- - SECURE=false
- SECRET=changethis
- - HOST=0.0.0.0
- - PORT=3000
- DATABASE_URL=postgresql://postgres:postgres@postgres/postgres/
- - UPLOADER_ROUTE=/u
- - UPLOADER_EMBED_ROUTE=/a
- - UPLOADER_LENGTH=6
- - UPLOADER_DIRECTORY=./uploads
- - UPLOADER_ADMIN_LIMIT=104900000
- - UPLOADER_USER_LIMIT=104900000
- - UPLOADER_DISABLED_EXTS=
volumes:
- '$PWD/uploads:/zipline/uploads'
- '$PWD/public:/zipline/public'
diff --git a/package.json b/package.json
index c95b288..b70e7b3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "zip3",
- "version": "3.3.0",
+ "version": "3.3.1",
"scripts": {
"prepare": "husky install",
"dev": "NODE_ENV=development node server",
@@ -18,7 +18,7 @@
"@mui/icons-material": "^5.0.0",
"@mui/material": "^5.0.2",
"@mui/styles": "^5.0.1",
- "@prisma/client": "^3.7.0",
+ "@prisma/client": "^3.9.2",
"@reduxjs/toolkit": "^1.6.0",
"argon2": "^0.28.2",
"colorette": "^1.2.2",
@@ -27,8 +27,8 @@
"fecha": "^4.2.1",
"formik": "^2.2.9",
"multer": "^1.4.2",
- "next": "^12.0.7",
- "prisma": "^3.7.0",
+ "next": "^12.0.10",
+ "prisma": "^3.9.2",
"react": "17.0.2",
"react-color": "^2.19.3",
"react-dom": "17.0.2",
diff --git a/server/validateConfig.js b/server/validateConfig.js
index 1e041b6..f733039 100644
--- a/server/validateConfig.js
+++ b/server/validateConfig.js
@@ -13,15 +13,16 @@ const validator = yup.object({
stats_interval: yup.number().default(1800),
}).required(),
uploader: yup.object({
- route: yup.string().required(),
+ route: yup.string().default('/u'),
+ embed_route: yup.string().default('/a'),
length: yup.number().default(6),
- directory: yup.string().required(),
+ directory: yup.string().default('./uploads'),
admin_limit: yup.number().default(104900000),
user_limit: yup.number().default(104900000),
disabled_extensions: yup.array().default([]),
}).required(),
urls: yup.object({
- route: yup.string().required(),
+ route: yup.string().default('/go'),
length: yup.number().default(6),
}).required(),
ratelimit: yup.object({
diff --git a/src/components/Theming.tsx b/src/components/Theming.tsx
index 64fe1f7..e6924a0 100644
--- a/src/components/Theming.tsx
+++ b/src/components/Theming.tsx
@@ -11,6 +11,8 @@ import ayu_light from 'lib/themes/ayu_light';
import nord from 'lib/themes/nord';
import polar from 'lib/themes/polar';
import dracula from 'lib/themes/dracula';
+import matcha_dark_azul from 'lib/themes/matcha_dark_azul';
+import qogir_dark from 'lib/themes/qogir_dark';
import { useStoreSelector } from 'lib/redux/store';
import createTheme from 'lib/themes';
@@ -24,6 +26,8 @@ export const themes = {
'nord': nord,
'polar': polar,
'dracula': dracula,
+ 'matcha_dark_azul': matcha_dark_azul,
+ 'qogir_dark': qogir_dark,
};
export const friendlyThemeName = {
@@ -35,6 +39,8 @@ export const friendlyThemeName = {
'nord': 'Nord',
'polar': 'Polar',
'dracula': 'Dracula',
+ 'matcha_dark_azul': 'Matcha Dark Azul',
+ 'qogir_dark': 'Qogir Dark',
};
export default function ZiplineTheming({ Component, pageProps }) {
diff --git a/src/components/pages/Dashboard.tsx b/src/components/pages/Dashboard.tsx
index e3e3d5d..22bd1fe 100644
--- a/src/components/pages/Dashboard.tsx
+++ b/src/components/pages/Dashboard.tsx
@@ -17,9 +17,14 @@ import {
Card as MuiCard,
} from '@mui/material';
import AudioIcon from '@mui/icons-material/Audiotrack';
+import DeleteIcon from '@mui/icons-material/Delete';
+import CopyIcon from '@mui/icons-material/FileCopy';
+import OpenIcon from '@mui/icons-material/OpenInNew';
import Link from 'components/Link';
import Card from 'components/Card';
+import Alert from 'components/Alert';
+import copy from 'copy-to-clipboard';
import useFetch from 'lib/hooks/useFetch';
import { useStoreSelector } from 'lib/redux/store';
@@ -95,6 +100,10 @@ export default function Dashboard() {
const [stats, setStats] = useState(null);
const [rowsPerPage, setRowsPerPage] = useState(10);
+ const [open, setOpen] = useState(false);
+ const [severity, setSeverity] = useState('success');
+ const [message, setMessage] = useState('Saved');
+
const updateImages = async () => {
const imgs = await useFetch('/api/user/files');
const recent = await useFetch('/api/user/recent?filter=media');
@@ -124,6 +133,8 @@ export default function Dashboard() {
return (
<>
+
+
Welcome back {user?.username}
You have {images.length ? images.length : '...'} files
@@ -162,7 +173,7 @@ export default function Dashboard() {
{stats ? stats.count : }
Views
- {stats ? `${stats.views_count} (${isNaN(stats.views_count / stats.count) ? '0' : stats.views_count / stats.count})` : }
+ {stats ? `${stats.views_count} (${isNaN(stats.views_count / stats.count) ? 0 : Math.round(stats.views_count / stats.count)})` : }
@@ -206,8 +217,15 @@ export default function Dashboard() {
);
})}
t.palette.divider }}>
-
-
+
+
+
+
diff --git a/src/components/pages/Manage.tsx b/src/components/pages/Manage.tsx
index e10bd2d..469b912 100644
--- a/src/components/pages/Manage.tsx
+++ b/src/components/pages/Manage.tsx
@@ -67,7 +67,7 @@ function VarsTooltip({ children }) {
{'{image.mimetype}'} - mimetype
{'{image.id}'} - id of the image
{'{user.name}'} - your username
- visit the docs for more variables
+ visit the docs for more variables
>
}>
{children}
@@ -97,7 +97,7 @@ export default function Manage() {
...(withEmbed && {Embed: 'true'}),
...(withZws && {ZWS: 'true'}),
},
- URL: '$json:url$',
+ URL: '$json:files[0]$',
Body: 'MultipartFormData',
FileFormName: 'file',
};
@@ -196,7 +196,7 @@ export default function Manage() {
Manage User
- Want to use variables in embed text? Hover on this or visit the docs for more variables
+ Want to use variables in embed text? Hover on this or visit the docs for more variables