Compare commits
15 Commits
v0.16.1
...
link-copy-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36fa76563e | ||
|
|
f96ac5e4ba | ||
|
|
bbbf10d233 | ||
|
|
e9d1a9abb6 | ||
|
|
8fdba0ca7c | ||
|
|
e5718700bc | ||
|
|
e40a0c844c | ||
|
|
e647746c93 | ||
|
|
9be77826e9 | ||
|
|
a9bb05c4da | ||
|
|
e1a9f2a27c | ||
|
|
ba62c13cfa | ||
|
|
3de744d5e9 | ||
|
|
61608cfe2d | ||
|
|
db755ef300 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,24 +1,3 @@
|
|||||||
### [0.16.1](https://github.com/stonith404/pingvin-share/compare/v0.16.0...v0.16.1) (2023-07-10)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* Adding reverse share ability to copy the link ([#191](https://github.com/stonith404/pingvin-share/issues/191)) ([7574eb3](https://github.com/stonith404/pingvin-share/commit/7574eb3191f21aadd64f436e9e7c78d3e3973a07)), closes [#178](https://github.com/stonith404/pingvin-share/issues/178) [#181](https://github.com/stonith404/pingvin-share/issues/181)
|
|
||||||
* Adding reverse shares' shares a clickable link ([#190](https://github.com/stonith404/pingvin-share/issues/190)) ([0276294](https://github.com/stonith404/pingvin-share/commit/0276294f5219a7edcc762bc52391b6720cfd741d))
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* set link default value to random ([#192](https://github.com/stonith404/pingvin-share/issues/192)) ([a1ea7c0](https://github.com/stonith404/pingvin-share/commit/a1ea7c026594a54eafd52f764eecbf06e1bb4d4e)), closes [#178](https://github.com/stonith404/pingvin-share/issues/178) [#181](https://github.com/stonith404/pingvin-share/issues/181)
|
|
||||||
|
|
||||||
## [0.16.0](https://github.com/stonith404/pingvin-share/compare/v0.15.0...v0.16.0) (2023-07-09)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* Adding more informations on My Shares page (table and modal) ([#174](https://github.com/stonith404/pingvin-share/issues/174)) ([1466240](https://github.com/stonith404/pingvin-share/commit/14662404614f15bc25384d924d8cb0458ab06cd8))
|
|
||||||
* Adding the possibility of copying the link by clicking text and icons ([#171](https://github.com/stonith404/pingvin-share/issues/171)) ([348852c](https://github.com/stonith404/pingvin-share/commit/348852cfa4275f5c642669b43697f83c35333044))
|
|
||||||
|
|
||||||
## [0.15.0](https://github.com/stonith404/pingvin-share/compare/v0.14.1...v0.15.0) (2023-05-09)
|
## [0.15.0](https://github.com/stonith404/pingvin-share/compare/v0.14.1...v0.15.0) (2023-05-09)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
backend/package-lock.json
generated
4
backend/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share-backend",
|
"name": "pingvin-share-backend",
|
||||||
"version": "0.16.1",
|
"version": "0.15.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pingvin-share-backend",
|
"name": "pingvin-share-backend",
|
||||||
"version": "0.16.1",
|
"version": "0.15.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nestjs/common": "^9.3.9",
|
"@nestjs/common": "^9.3.9",
|
||||||
"@nestjs/config": "^2.3.1",
|
"@nestjs/config": "^2.3.1",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share-backend",
|
"name": "pingvin-share-backend",
|
||||||
"version": "0.16.1",
|
"version": "0.15.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nest build",
|
"build": "nest build",
|
||||||
"dev": "cross-env NODE_ENV=development nest start --watch",
|
"dev": "cross-env NODE_ENV=development nest start --watch",
|
||||||
"prod": "prisma migrate deploy && prisma db seed && node dist/src/main",
|
"prod": "prisma migrate deploy && prisma db seed && node dist/src/main",
|
||||||
"lint": "eslint 'src/**/*.ts'",
|
"lint": "eslint 'src/**/*.ts'",
|
||||||
"format": "prettier --end-of-line=auto --write 'src/**/*.ts'",
|
"format": "prettier --write 'src/**/*.ts'",
|
||||||
"test:system": "prisma migrate reset -f && nest start & wait-on http://localhost:8080/api/configs && newman run ./test/newman-system-tests.json"
|
"test:system": "prisma migrate reset -f && nest start & wait-on http://localhost:8080/api/configs && newman run ./test/newman-system-tests.json"
|
||||||
},
|
},
|
||||||
"prisma": {
|
"prisma": {
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
export const DATA_DIRECTORY = process.env.DATA_DIRECTORY || "./data";
|
export const DATA_DIRECTORY = process.env.DATA_DIRECTORY || "./data";
|
||||||
export const SHARE_DIRECTORY = `${DATA_DIRECTORY}/uploads/shares`;
|
export const SHARE_DIRECTORY = `${DATA_DIRECTORY}/uploads/shares`
|
||||||
export const DATABASE_URL =
|
export const DATABASE_URL = process.env.DATABASE_URL || "file:../data/pingvin-share.db?connection_limit=1";
|
||||||
process.env.DATABASE_URL ||
|
export const CLAMAV_HOST = process.env.CLAMAV_HOST || (process.env.NODE_ENV == "docker" ? "clamav" : "127.0.0.1");
|
||||||
"file:../data/pingvin-share.db?connection_limit=1";
|
|
||||||
export const CLAMAV_HOST =
|
|
||||||
process.env.CLAMAV_HOST ||
|
|
||||||
(process.env.NODE_ENV == "docker" ? "clamav" : "127.0.0.1");
|
|
||||||
export const CLAMAV_PORT = parseInt(process.env.CLAMAV_PORT) || 3310;
|
export const CLAMAV_PORT = parseInt(process.env.CLAMAV_PORT) || 3310;
|
||||||
@@ -10,9 +10,6 @@ export class ReverseShareDTO {
|
|||||||
@Expose()
|
@Expose()
|
||||||
shareExpiration: Date;
|
shareExpiration: Date;
|
||||||
|
|
||||||
@Expose()
|
|
||||||
token: string;
|
|
||||||
|
|
||||||
from(partial: Partial<ReverseShareDTO>) {
|
from(partial: Partial<ReverseShareDTO>) {
|
||||||
return plainToClass(ReverseShareDTO, partial, {
|
return plainToClass(ReverseShareDTO, partial, {
|
||||||
excludeExtraneousValues: true,
|
excludeExtraneousValues: true,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Expose, plainToClass, Type } from "class-transformer";
|
import { Expose, plainToClass, Type } from "class-transformer";
|
||||||
import { ShareDTO } from "./share.dto";
|
import { ShareDTO } from "./share.dto";
|
||||||
import { FileDTO } from "../../file/dto/file.dto";
|
import {FileDTO} from "../../file/dto/file.dto";
|
||||||
import { OmitType } from "@nestjs/swagger";
|
import {OmitType} from "@nestjs/swagger";
|
||||||
|
|
||||||
export class MyShareDTO extends OmitType(ShareDTO, [
|
export class MyShareDTO extends OmitType(ShareDTO, [
|
||||||
"files",
|
"files",
|
||||||
|
|||||||
4
frontend/package-lock.json
generated
4
frontend/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share-frontend",
|
"name": "pingvin-share-frontend",
|
||||||
"version": "0.16.1",
|
"version": "0.15.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pingvin-share-frontend",
|
"name": "pingvin-share-frontend",
|
||||||
"version": "0.16.1",
|
"version": "0.15.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.10.6",
|
"@emotion/react": "^11.10.6",
|
||||||
"@emotion/server": "^11.10.0",
|
"@emotion/server": "^11.10.0",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share-frontend",
|
"name": "pingvin-share-frontend",
|
||||||
"version": "0.16.1",
|
"version": "0.15.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
"format": "prettier --end-of-line=auto --write \"src/**/*.ts*\""
|
"format": "prettier --write \"src/**/*.ts*\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.10.6",
|
"@emotion/react": "^11.10.6",
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
import { Stack, TextInput } from "@mantine/core";
|
|
||||||
import { ModalsContextProps } from "@mantine/modals/lib/context";
|
|
||||||
|
|
||||||
const showReverseShareLinkModal = (
|
|
||||||
modals: ModalsContextProps,
|
|
||||||
reverseShareToken: string,
|
|
||||||
appUrl: string
|
|
||||||
) => {
|
|
||||||
const link = `${appUrl}/upload/${reverseShareToken}`;
|
|
||||||
return modals.openModal({
|
|
||||||
title: "Reverse share link",
|
|
||||||
children: (
|
|
||||||
<Stack align="stretch">
|
|
||||||
<TextInput variant="filled" value={link} />
|
|
||||||
</Stack>
|
|
||||||
),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export default showReverseShareLinkModal;
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { ActionIcon, TextInput } from "@mantine/core";
|
|
||||||
import { useClipboard } from "@mantine/hooks";
|
|
||||||
import { useRef, useState } from "react";
|
import { useRef, useState } from "react";
|
||||||
import { TbCheck, TbCopy } from "react-icons/tb";
|
|
||||||
import toast from "../../utils/toast.util";
|
import toast from "../../utils/toast.util";
|
||||||
|
import { ActionIcon, TextInput } from "@mantine/core";
|
||||||
|
import { TbCheck, TbCopy } from "react-icons/tb";
|
||||||
|
import { useClipboard } from "@mantine/hooks";
|
||||||
|
|
||||||
function CopyTextField(props: { link: string }) {
|
function CopyTextField(props: { link: string }) {
|
||||||
const clipboard = useClipboard({ timeout: 500 });
|
const clipboard = useClipboard({ timeout: 500 });
|
||||||
@@ -14,7 +14,7 @@ function CopyTextField(props: { link: string }) {
|
|||||||
|
|
||||||
const copyLink = () => {
|
const copyLink = () => {
|
||||||
clipboard.copy(props.link);
|
clipboard.copy(props.link);
|
||||||
toast.success("The link was copied to your clipboard.");
|
toast.success("Your link was copied to the keyboard.");
|
||||||
if (timerRef.current) clearTimeout(timerRef.current);
|
if (timerRef.current) clearTimeout(timerRef.current);
|
||||||
timerRef.current = setTimeout(() => {
|
timerRef.current = setTimeout(() => {
|
||||||
setCheckState(false);
|
setCheckState(false);
|
||||||
|
|||||||
@@ -62,10 +62,6 @@ const CreateUploadModalBody = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const modals = useModals();
|
const modals = useModals();
|
||||||
|
|
||||||
const generatedLink = Buffer.from(Math.random().toString(), "utf8")
|
|
||||||
.toString("base64")
|
|
||||||
.substr(10, 7);
|
|
||||||
|
|
||||||
const [showNotSignedInAlert, setShowNotSignedInAlert] = useState(true);
|
const [showNotSignedInAlert, setShowNotSignedInAlert] = useState(true);
|
||||||
|
|
||||||
const validationSchema = yup.object().shape({
|
const validationSchema = yup.object().shape({
|
||||||
@@ -82,7 +78,7 @@ const CreateUploadModalBody = ({
|
|||||||
});
|
});
|
||||||
const form = useForm({
|
const form = useForm({
|
||||||
initialValues: {
|
initialValues: {
|
||||||
link: generatedLink,
|
link: "",
|
||||||
recipients: [] as string[],
|
recipients: [] as string[],
|
||||||
password: undefined,
|
password: undefined,
|
||||||
maxViews: undefined,
|
maxViews: undefined,
|
||||||
|
|||||||
@@ -17,10 +17,9 @@ import { useModals } from "@mantine/modals";
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { TbInfoCircle, TbLink, TbPlus, TbTrash } from "react-icons/tb";
|
import { TbInfoCircle, TbLink, TbPlus, TbTrash } from "react-icons/tb";
|
||||||
import Meta from "../../components/Meta";
|
|
||||||
import showReverseShareLinkModal from "../../components/account/showReverseShareLinkModal";
|
|
||||||
import showShareLinkModal from "../../components/account/showShareLinkModal";
|
import showShareLinkModal from "../../components/account/showShareLinkModal";
|
||||||
import CenterLoader from "../../components/core/CenterLoader";
|
import CenterLoader from "../../components/core/CenterLoader";
|
||||||
|
import Meta from "../../components/Meta";
|
||||||
import showCreateReverseShareModal from "../../components/share/modals/showCreateReverseShareModal";
|
import showCreateReverseShareModal from "../../components/share/modals/showCreateReverseShareModal";
|
||||||
import useConfig from "../../hooks/config.hook";
|
import useConfig from "../../hooks/config.hook";
|
||||||
import shareService from "../../services/share.service";
|
import shareService from "../../services/share.service";
|
||||||
@@ -123,10 +122,7 @@ const MyShares = () => {
|
|||||||
<Accordion.Panel>
|
<Accordion.Panel>
|
||||||
{reverseShare.shares.map((share) => (
|
{reverseShare.shares.map((share) => (
|
||||||
<Group key={share.id} mb={4}>
|
<Group key={share.id} mb={4}>
|
||||||
<Anchor
|
<Anchor href={`${appUrl}/share/${share.id}`}>
|
||||||
href={`${appUrl}/share/${share.id}`}
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
<Text maw={120} truncate>
|
<Text maw={120} truncate>
|
||||||
{share.id}
|
{share.id}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -172,31 +168,6 @@ const MyShares = () => {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Group position="right">
|
<Group position="right">
|
||||||
<ActionIcon
|
|
||||||
color="victoria"
|
|
||||||
variant="light"
|
|
||||||
size={25}
|
|
||||||
onClick={() => {
|
|
||||||
if (window.isSecureContext) {
|
|
||||||
clipboard.copy(
|
|
||||||
`${config.get("general.appUrl")}/upload/${
|
|
||||||
reverseShare.token
|
|
||||||
}`
|
|
||||||
);
|
|
||||||
toast.success(
|
|
||||||
"The link was copied to your clipboard."
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
showReverseShareLinkModal(
|
|
||||||
modals,
|
|
||||||
reverseShare.token,
|
|
||||||
config.get("general.appUrl")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TbLink />
|
|
||||||
</ActionIcon>
|
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
color="red"
|
color="red"
|
||||||
variant="light"
|
variant="light"
|
||||||
|
|||||||
@@ -16,15 +16,15 @@ import { useModals } from "@mantine/modals";
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { TbInfoCircle, TbLink, TbTrash } from "react-icons/tb";
|
import { TbLink, TbTrash, TbInfoCircle } from "react-icons/tb";
|
||||||
import Meta from "../../components/Meta";
|
|
||||||
import showShareInformationsModal from "../../components/account/showShareInformationsModal";
|
|
||||||
import showShareLinkModal from "../../components/account/showShareLinkModal";
|
import showShareLinkModal from "../../components/account/showShareLinkModal";
|
||||||
import CenterLoader from "../../components/core/CenterLoader";
|
import CenterLoader from "../../components/core/CenterLoader";
|
||||||
|
import Meta from "../../components/Meta";
|
||||||
import useConfig from "../../hooks/config.hook";
|
import useConfig from "../../hooks/config.hook";
|
||||||
import shareService from "../../services/share.service";
|
import shareService from "../../services/share.service";
|
||||||
import { MyShare } from "../../types/share.type";
|
import { MyShare } from "../../types/share.type";
|
||||||
import toast from "../../utils/toast.util";
|
import toast from "../../utils/toast.util";
|
||||||
|
import showShareInformationsModal from "../../components/account/showShareInformationsModal";
|
||||||
|
|
||||||
const MyShares = () => {
|
const MyShares = () => {
|
||||||
const modals = useModals();
|
const modals = useModals();
|
||||||
@@ -122,7 +122,7 @@ const MyShares = () => {
|
|||||||
}`
|
}`
|
||||||
);
|
);
|
||||||
toast.success(
|
toast.success(
|
||||||
"The link was copied to your clipboard."
|
"Your link was copied to the keyboard."
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
showShareLinkModal(
|
showShareLinkModal(
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ export type MyReverseShare = {
|
|||||||
maxShareSize: string;
|
maxShareSize: string;
|
||||||
shareExpiration: Date;
|
shareExpiration: Date;
|
||||||
remainingUses: number;
|
remainingUses: number;
|
||||||
token: string;
|
|
||||||
shares: MyShare[];
|
shares: MyShare[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share",
|
"name": "pingvin-share",
|
||||||
"version": "0.16.1",
|
"version": "0.15.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"format": "cd frontend && npm run format && cd ../backend && npm run format",
|
"format": "cd frontend && npm run format && cd ../backend && npm run format",
|
||||||
"lint": "cd frontend && npm run lint && cd ../backend && npm run lint",
|
"lint": "cd frontend && npm run lint && cd ../backend && npm run lint",
|
||||||
@@ -8,8 +8,5 @@
|
|||||||
"release:patch": "cd backend && npm version patch --commit-hooks false && cd ../frontend && npm version patch --commit-hooks false && cd .. && git add . && npm version patch --force -m 'release: %s' && git push && git push --tags",
|
"release:patch": "cd backend && npm version patch --commit-hooks false && cd ../frontend && npm version patch --commit-hooks false && cd .. && git add . && npm version patch --force -m 'release: %s' && git push && git push --tags",
|
||||||
"release:minor": "cd backend && npm version minor --commit-hooks false && cd ../frontend && npm version minor --commit-hooks false && cd .. && git add . && npm version minor --force -m 'release: %s' && git push && git push --tags",
|
"release:minor": "cd backend && npm version minor --commit-hooks false && cd ../frontend && npm version minor --commit-hooks false && cd .. && git add . && npm version minor --force -m 'release: %s' && git push && git push --tags",
|
||||||
"deploy:dev": "docker buildx build --push --tag stonith404/pingvin-share:development --platform linux/amd64,linux/arm64 ."
|
"deploy:dev": "docker buildx build --push --tag stonith404/pingvin-share:development --platform linux/amd64,linux/arm64 ."
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"conventional-changelog-cli": "^3.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user