Compare commits

...

2 Commits

Author SHA1 Message Date
Elias Schneider
7a387d86d6 release: 0.20.3 2023-11-17 15:27:31 +01:00
Elias Schneider
330eef51e4 fix: max expiration gets ignored if expiration is set to "never" 2023-11-17 15:27:22 +01:00
10 changed files with 27 additions and 14 deletions

View File

@@ -1,3 +1,10 @@
## [0.20.3](https://github.com/stonith404/pingvin-share/compare/v0.20.2...v0.20.3) (2023-11-17)
### Bug Fixes
* max expiration gets ignored if expiration is set to "never" ([330eef5](https://github.com/stonith404/pingvin-share/commit/330eef51e4f3f3fb29833bc9337e705553340aaa))
## [0.20.2](https://github.com/stonith404/pingvin-share/compare/v0.20.1...v0.20.2) (2023-11-11)

View File

@@ -1,12 +1,12 @@
{
"name": "pingvin-share-backend",
"version": "0.20.2",
"version": "0.20.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "pingvin-share-backend",
"version": "0.20.2",
"version": "0.20.3",
"dependencies": {
"@nestjs/cache-manager": "^2.1.0",
"@nestjs/common": "^10.1.2",

View File

@@ -1,6 +1,6 @@
{
"name": "pingvin-share-backend",
"version": "0.20.2",
"version": "0.20.3",
"scripts": {
"build": "nest build",
"dev": "cross-env NODE_ENV=development nest start --watch",

View File

@@ -19,7 +19,6 @@ export class ShareOwnerGuard extends JwtGuard {
}
async canActivate(context: ExecutionContext) {
const request: Request = context.switchToHttp().getRequest();
const shareId = Object.prototype.hasOwnProperty.call(
request.params,

View File

@@ -54,10 +54,15 @@ export class ShareService {
} else {
const parsedExpiration = parseRelativeDateToAbsolute(share.expiration);
const expiresNever = moment(0).toDate() == parsedExpiration;
if (
this.config.get("share.maxExpiration") !== 0 &&
parsedExpiration >
moment().add(this.config.get("share.maxExpiration"), "hours").toDate()
(expiresNever ||
parsedExpiration >
moment()
.add(this.config.get("share.maxExpiration"), "hours")
.toDate())
) {
throw new BadRequestException(
"Expiration date exceeds maximum expiration date",

View File

@@ -1,12 +1,12 @@
{
"name": "pingvin-share-frontend",
"version": "0.20.2",
"version": "0.20.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "pingvin-share-frontend",
"version": "0.20.2",
"version": "0.20.3",
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/server": "^11.11.0",

View File

@@ -1,6 +1,6 @@
{
"name": "pingvin-share-frontend",
"version": "0.20.2",
"version": "0.20.3",
"scripts": {
"dev": "next dev",
"build": "next build",

View File

@@ -12,7 +12,7 @@ const showShareInformationsModal = (
modals: ModalsContextProps,
share: MyShare,
appUrl: string,
maxShareSize: number
maxShareSize: number,
) => {
const t = translateOutsideContext();
const link = `${appUrl}/s/${share.id}`;

View File

@@ -125,11 +125,13 @@ const CreateUploadModalBody = ({
"",
) as moment.unitOfTime.DurationConstructor,
);
if (
options.maxExpirationInHours != 0 &&
expirationDate.isAfter(
moment().add(options.maxExpirationInHours, "hours"),
)
(form.values.never_expires ||
expirationDate.isAfter(
moment().add(options.maxExpirationInHours, "hours"),
))
) {
form.setFieldError(
"expiration_num",

View File

@@ -1,6 +1,6 @@
{
"name": "pingvin-share",
"version": "0.20.2",
"version": "0.20.3",
"scripts": {
"format": "cd frontend && npm run format && cd ../backend && npm run format",
"lint": "cd frontend && npm run lint && cd ../backend && npm run lint",