Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
880ad85a1e | ||
|
|
e40cc0f48b | ||
|
|
46d667776f | ||
|
|
99de4e57e1 | ||
|
|
00d0df731b | ||
|
|
599d8caa31 |
@@ -1,3 +1,12 @@
|
|||||||
|
### [0.1.1](https://github.com/stonith404/pingvin-share/compare/v0.1.0...v0.1.1) (2022-10-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add `ALLOW_UNAUTHENTICATED_SHARES` to docker compose file ([599d8ca](https://github.com/stonith404/pingvin-share/commit/599d8caa31dc018c14c959d6602ac652eaef5da2))
|
||||||
|
* only log jobs if they actually did something ([e40cc0f](https://github.com/stonith404/pingvin-share/commit/e40cc0f48beec09e18738de1b445cabd9daab09b))
|
||||||
|
* share finishes before all files are uploaded ([99de4e5](https://github.com/stonith404/pingvin-share/commit/99de4e57e18df54596e168a57b94c55d7a834472))
|
||||||
|
|
||||||
## [0.1.0](https://github.com/stonith404/pingvin-share/compare/v0.0.1...v0.1.0) (2022-10-29)
|
## [0.1.0](https://github.com/stonith404/pingvin-share/compare/v0.0.1...v0.1.0) (2022-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ The website is now listening available on `http://localhost:3000`, have fun with
|
|||||||
|
|
||||||
### Upgrade to a new version
|
### Upgrade to a new version
|
||||||
|
|
||||||
Just update the docker container by running `docker compose pull && docker compose up -d`
|
1. Check if your local `docker-compose.yml` and `.env` files are up to date with the files in the repository
|
||||||
|
2. Run `docker compose pull && docker compose up -d` to update your docker container
|
||||||
|
|
||||||
> Note: If you installed Pingvin Share before it used Sqlite, you unfortunately have to set up the project from scratch again, sorry for that.
|
> Note: If you installed Pingvin Share before it used Sqlite, you unfortunately have to set up the project from scratch again, sorry for that.
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Injectable } from "@nestjs/common";
|
import { Injectable } from "@nestjs/common";
|
||||||
import { Cron } from "@nestjs/schedule";
|
import { Cron } from "@nestjs/schedule";
|
||||||
|
import * as moment from "moment";
|
||||||
import { FileService } from "src/file/file.service";
|
import { FileService } from "src/file/file.service";
|
||||||
import { PrismaService } from "src/prisma/prisma.service";
|
import { PrismaService } from "src/prisma/prisma.service";
|
||||||
import * as moment from "moment";
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class JobsService {
|
export class JobsService {
|
||||||
@@ -31,14 +31,19 @@ export class JobsService {
|
|||||||
await this.fileService.deleteAllFiles(expiredShare.id);
|
await this.fileService.deleteAllFiles(expiredShare.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`job: deleted ${expiredShares.length} expired shares`);
|
if (expiredShares.length > 0)
|
||||||
|
console.log(`job: deleted ${expiredShares.length} expired shares`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Cron("0 * * * *")
|
@Cron("0 * * * *")
|
||||||
async deleteExpiredRefreshTokens() {
|
async deleteExpiredRefreshTokens() {
|
||||||
const expiredShares = await this.prisma.refreshToken.deleteMany({
|
const expiredRefreshTokens = await this.prisma.refreshToken.deleteMany({
|
||||||
where: { expiresAt: { lt: new Date() } },
|
where: { expiresAt: { lt: new Date() } },
|
||||||
});
|
});
|
||||||
console.log(`job: deleted ${expiredShares.count} expired refresh tokens`);
|
|
||||||
|
if (expiredRefreshTokens.count > 0)
|
||||||
|
console.log(
|
||||||
|
`job: deleted ${expiredRefreshTokens.count} expired refresh tokens`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ export class PrismaService extends PrismaClient {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
console.log(config.get("DB_URL"));
|
|
||||||
super.$connect().then(() => console.info("Connected to the database"));
|
super.$connect().then(() => console.info("Connected to the database"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ services:
|
|||||||
- APP_URL=${APP_URL}
|
- APP_URL=${APP_URL}
|
||||||
- SHOW_HOME_PAGE=${SHOW_HOME_PAGE}
|
- SHOW_HOME_PAGE=${SHOW_HOME_PAGE}
|
||||||
- ALLOW_REGISTRATION=${ALLOW_REGISTRATION}
|
- ALLOW_REGISTRATION=${ALLOW_REGISTRATION}
|
||||||
|
- ALLOW_UNAUTHENTICATED_SHARES=${ALLOW_UNAUTHENTICATED_SHARES}
|
||||||
- MAX_FILE_SIZE=${MAX_FILE_SIZE}
|
- MAX_FILE_SIZE=${MAX_FILE_SIZE}
|
||||||
- JWT_SECRET=${JWT_SECRET}
|
- JWT_SECRET=${JWT_SECRET}
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -41,13 +41,11 @@ const Upload = () => {
|
|||||||
);
|
);
|
||||||
share = await shareService.create(id, expiration, security);
|
share = await shareService.create(id, expiration, security);
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
const progressCallBack = (bytesProgress: number) => {
|
const progressCallBack = (progress: number) => {
|
||||||
setFiles((files) => {
|
setFiles((files) => {
|
||||||
return files.map((file, callbackIndex) => {
|
return files.map((file, callbackIndex) => {
|
||||||
if (i == callbackIndex) {
|
if (i == callbackIndex) {
|
||||||
file.uploadingProgress = Math.round(
|
file.uploadingProgress = progress;
|
||||||
(100 * bytesProgress) / files[i].size
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
});
|
});
|
||||||
@@ -77,7 +75,6 @@ const Upload = () => {
|
|||||||
(file) => file.uploadingProgress >= 100 || file.uploadingProgress == -1
|
(file) => file.uploadingProgress >= 100 || file.uploadingProgress == -1
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
console.log(files.length);
|
|
||||||
const fileErrorCount = files.filter(
|
const fileErrorCount = files.filter(
|
||||||
(file) => file.uploadingProgress == -1
|
(file) => file.uploadingProgress == -1
|
||||||
).length;
|
).length;
|
||||||
|
|||||||
@@ -75,12 +75,16 @@ const uploadFile = async (
|
|||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
formData.append("file", file);
|
formData.append("file", file);
|
||||||
|
|
||||||
return (
|
const response = await api.post(`shares/${shareId}/files`, formData, {
|
||||||
await api.post(`shares/${shareId}/files`, formData, {
|
onUploadProgress: (progressEvent) => {
|
||||||
onUploadProgress: (progressEvent) =>
|
const uploadingProgress = Math.round(
|
||||||
progressCallBack(progressEvent.loaded),
|
(100 * progressEvent.loaded) / progressEvent.total
|
||||||
})
|
);
|
||||||
).data;
|
if (uploadingProgress < 100) progressCallBack(uploadingProgress);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
progressCallBack(100);
|
||||||
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share",
|
"name": "pingvin-share",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"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",
|
||||||
"version": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s && git add CHANGELOG.md",
|
"version": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s && git add CHANGELOG.md",
|
||||||
"release:patch": "npm version patch -m 'release: %s' && git push && git push --tags",
|
"release:patch": "npm version patch -m 'release: %s' && git push && git push --tags",
|
||||||
"release:minor": "npm version minor -m 'release: %s' && git push && git push --tags"
|
"release:minor": "npm version minor -m 'release: %s' && git push && git push --tags",
|
||||||
|
"deploy:dev": "docker buildx build --push --tag stonith404/pingvin-share:development --platform linux/amd64,linux/arm64 ."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user