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)
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@ The website is now listening available on `http://localhost:3000`, have fun with
|
||||
|
||||
### 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.
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { Cron } from "@nestjs/schedule";
|
||||
import * as moment from "moment";
|
||||
import { FileService } from "src/file/file.service";
|
||||
import { PrismaService } from "src/prisma/prisma.service";
|
||||
import * as moment from "moment";
|
||||
|
||||
@Injectable()
|
||||
export class JobsService {
|
||||
@@ -31,14 +31,19 @@ export class JobsService {
|
||||
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 * * * *")
|
||||
async deleteExpiredRefreshTokens() {
|
||||
const expiredShares = await this.prisma.refreshToken.deleteMany({
|
||||
const expiredRefreshTokens = await this.prisma.refreshToken.deleteMany({
|
||||
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"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ services:
|
||||
- APP_URL=${APP_URL}
|
||||
- SHOW_HOME_PAGE=${SHOW_HOME_PAGE}
|
||||
- ALLOW_REGISTRATION=${ALLOW_REGISTRATION}
|
||||
- ALLOW_UNAUTHENTICATED_SHARES=${ALLOW_UNAUTHENTICATED_SHARES}
|
||||
- MAX_FILE_SIZE=${MAX_FILE_SIZE}
|
||||
- JWT_SECRET=${JWT_SECRET}
|
||||
volumes:
|
||||
|
||||
@@ -41,13 +41,11 @@ const Upload = () => {
|
||||
);
|
||||
share = await shareService.create(id, expiration, security);
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const progressCallBack = (bytesProgress: number) => {
|
||||
const progressCallBack = (progress: number) => {
|
||||
setFiles((files) => {
|
||||
return files.map((file, callbackIndex) => {
|
||||
if (i == callbackIndex) {
|
||||
file.uploadingProgress = Math.round(
|
||||
(100 * bytesProgress) / files[i].size
|
||||
);
|
||||
file.uploadingProgress = progress;
|
||||
}
|
||||
return file;
|
||||
});
|
||||
@@ -77,7 +75,6 @@ const Upload = () => {
|
||||
(file) => file.uploadingProgress >= 100 || file.uploadingProgress == -1
|
||||
)
|
||||
) {
|
||||
console.log(files.length);
|
||||
const fileErrorCount = files.filter(
|
||||
(file) => file.uploadingProgress == -1
|
||||
).length;
|
||||
|
||||
@@ -75,12 +75,16 @@ const uploadFile = async (
|
||||
let formData = new FormData();
|
||||
formData.append("file", file);
|
||||
|
||||
return (
|
||||
await api.post(`shares/${shareId}/files`, formData, {
|
||||
onUploadProgress: (progressEvent) =>
|
||||
progressCallBack(progressEvent.loaded),
|
||||
})
|
||||
).data;
|
||||
const response = await api.post(`shares/${shareId}/files`, formData, {
|
||||
onUploadProgress: (progressEvent) => {
|
||||
const uploadingProgress = Math.round(
|
||||
(100 * progressEvent.loaded) / progressEvent.total
|
||||
);
|
||||
if (uploadingProgress < 100) progressCallBack(uploadingProgress);
|
||||
},
|
||||
});
|
||||
progressCallBack(100);
|
||||
return response;
|
||||
};
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "pingvin-share",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"scripts": {
|
||||
"format": "cd frontend && npm run format && cd ../backend && npm run format",
|
||||
"lint": "cd frontend && npm run lint && cd ../backend && npm run lint",
|
||||
"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: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