1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-06-30 06:30:11 +02:00

fixed expiration date

This commit is contained in:
Elias Schneider 2022-04-25 17:58:03 +02:00
parent d6718cc545
commit b26578a409
No known key found for this signature in database
GPG Key ID: D5EC1C72D93244FD
6 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,4 @@
APPWRITE_FUNCTION_API_KEY=
# IMPORTANT If you're running the website inside docker and your Appwrite instance runs on localhost host,
# use host.docker.internal instead of localhost
NEXT_PUBLIC_APPWRITE_HOST=http://host.docker.internal/v1
NEXT_PUBLIC_APPWRITE_HOST=http://localhost:86/v1
# Must be the same as in the _APP_STORAGE_LIMIT in the Appwrite env file
NEXT_PUBLIC_MAX_FILE_SIZE=300000000

View File

@ -2,7 +2,7 @@ import axios from "axios";
const api = () =>
axios.create({
baseURL: process.env["NEXT_PUBLIC_APPWRITE_HOST"],
baseURL: process.env["APPWRITE_HOST"],
headers: {
cookie: `a_session_console=${process.env["APPWRITE_USER_TOKEN"]}`,
},

View File

@ -3,7 +3,7 @@ const aw = () => {
let client = new sdk.Client();
client
.setEndpoint(process.env["NEXT_PUBLIC_APPWRITE_HOST"])
.setEndpoint(process.env["APPWRITE_HOST"])
.setProject("pingvin-share")
.setKey(process.env["APPWRITE_API_KEY"])
.setSelfSigned();

View File

@ -8,7 +8,7 @@
"start": "next start",
"lint": "next lint",
"init:appwrite": "cd .setup && npm install && npx ts-node index.ts",
"deploy": "docker buildx build -t git.elias.li/stonith404/pingvin-share:latest --platform linux/amd64,linux/arm64 --push ."
"deploy": "docker build -t git.elias.li/stonith404/pingvin-share:latest . && docker push git.elias.li/stonith404/pingvin-share:latest"
},
"dependencies": {
"@mantine/core": "^4.1.3",

View File

@ -52,7 +52,7 @@ const Upload = () => {
showCompletedUploadModal(
modals,
`${window.location.origin}/share/${bucketId}`,
new Date(Date.now()).toLocaleString()
new Date(Date.now() + expiration * 60 * 1000).toLocaleString()
);
}
},

View File

@ -4,7 +4,12 @@ import sdk from "node-appwrite";
const client = new sdk.Client();
client
.setEndpoint(process.env["NEXT_PUBLIC_APPWRITE_HOST"] as string)
.setEndpoint(
(process.env["NEXT_PUBLIC_APPWRITE_HOST"] as string).replace(
"localhost",
"host.docker.internal"
)
)
.setProject("pingvin-share")
.setKey(process.env["APPWRITE_FUNCTION_API_KEY"] as string);