Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a387d86d6 | ||
|
|
330eef51e4 |
@@ -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)
|
## [0.20.2](https://github.com/stonith404/pingvin-share/compare/v0.20.1...v0.20.2) (2023-11-11)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
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.20.2",
|
"version": "0.20.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pingvin-share-backend",
|
"name": "pingvin-share-backend",
|
||||||
"version": "0.20.2",
|
"version": "0.20.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nestjs/cache-manager": "^2.1.0",
|
"@nestjs/cache-manager": "^2.1.0",
|
||||||
"@nestjs/common": "^10.1.2",
|
"@nestjs/common": "^10.1.2",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share-backend",
|
"name": "pingvin-share-backend",
|
||||||
"version": "0.20.2",
|
"version": "0.20.3",
|
||||||
"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",
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ export class ShareOwnerGuard extends JwtGuard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async canActivate(context: ExecutionContext) {
|
async canActivate(context: ExecutionContext) {
|
||||||
|
|
||||||
const request: Request = context.switchToHttp().getRequest();
|
const request: Request = context.switchToHttp().getRequest();
|
||||||
const shareId = Object.prototype.hasOwnProperty.call(
|
const shareId = Object.prototype.hasOwnProperty.call(
|
||||||
request.params,
|
request.params,
|
||||||
|
|||||||
@@ -54,10 +54,15 @@ export class ShareService {
|
|||||||
} else {
|
} else {
|
||||||
const parsedExpiration = parseRelativeDateToAbsolute(share.expiration);
|
const parsedExpiration = parseRelativeDateToAbsolute(share.expiration);
|
||||||
|
|
||||||
|
const expiresNever = moment(0).toDate() == parsedExpiration;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.config.get("share.maxExpiration") !== 0 &&
|
this.config.get("share.maxExpiration") !== 0 &&
|
||||||
|
(expiresNever ||
|
||||||
parsedExpiration >
|
parsedExpiration >
|
||||||
moment().add(this.config.get("share.maxExpiration"), "hours").toDate()
|
moment()
|
||||||
|
.add(this.config.get("share.maxExpiration"), "hours")
|
||||||
|
.toDate())
|
||||||
) {
|
) {
|
||||||
throw new BadRequestException(
|
throw new BadRequestException(
|
||||||
"Expiration date exceeds maximum expiration date",
|
"Expiration date exceeds maximum expiration date",
|
||||||
|
|||||||
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.20.2",
|
"version": "0.20.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pingvin-share-frontend",
|
"name": "pingvin-share-frontend",
|
||||||
"version": "0.20.2",
|
"version": "0.20.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.11.1",
|
"@emotion/react": "^11.11.1",
|
||||||
"@emotion/server": "^11.11.0",
|
"@emotion/server": "^11.11.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share-frontend",
|
"name": "pingvin-share-frontend",
|
||||||
"version": "0.20.2",
|
"version": "0.20.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const showShareInformationsModal = (
|
|||||||
modals: ModalsContextProps,
|
modals: ModalsContextProps,
|
||||||
share: MyShare,
|
share: MyShare,
|
||||||
appUrl: string,
|
appUrl: string,
|
||||||
maxShareSize: number
|
maxShareSize: number,
|
||||||
) => {
|
) => {
|
||||||
const t = translateOutsideContext();
|
const t = translateOutsideContext();
|
||||||
const link = `${appUrl}/s/${share.id}`;
|
const link = `${appUrl}/s/${share.id}`;
|
||||||
|
|||||||
@@ -125,11 +125,13 @@ const CreateUploadModalBody = ({
|
|||||||
"",
|
"",
|
||||||
) as moment.unitOfTime.DurationConstructor,
|
) as moment.unitOfTime.DurationConstructor,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
options.maxExpirationInHours != 0 &&
|
options.maxExpirationInHours != 0 &&
|
||||||
|
(form.values.never_expires ||
|
||||||
expirationDate.isAfter(
|
expirationDate.isAfter(
|
||||||
moment().add(options.maxExpirationInHours, "hours"),
|
moment().add(options.maxExpirationInHours, "hours"),
|
||||||
)
|
))
|
||||||
) {
|
) {
|
||||||
form.setFieldError(
|
form.setFieldError(
|
||||||
"expiration_num",
|
"expiration_num",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share",
|
"name": "pingvin-share",
|
||||||
"version": "0.20.2",
|
"version": "0.20.3",
|
||||||
"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",
|
||||||
|
|||||||
Reference in New Issue
Block a user