mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-04 23:10:13 +01:00
fixed expiration date
This commit is contained in:
parent
d6718cc545
commit
b26578a409
@ -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
|
@ -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"]}`,
|
||||
},
|
||||
|
@ -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();
|
||||
|
@ -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",
|
||||
|
@ -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()
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user