Spaces:
Running
Running
first
Browse files- Dockerfile +1 -1
- app.js +2 -2
- ntah.js +0 -0
- tmp/files.json +1 -0
Dockerfile
CHANGED
|
@@ -14,7 +14,7 @@ RUN apt update && apt install -y ffmpeg && rm -rf /var/lib/apt/lists/*
|
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
# Buat folder "files" & atur permission dengan benar
|
| 17 |
-
RUN mkdir -p /app/files && chmod 777 /app/files
|
| 18 |
|
| 19 |
# Expose port API
|
| 20 |
EXPOSE 7860
|
|
|
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
# Buat folder "files" & atur permission dengan benar
|
| 17 |
+
RUN mkdir -p /app/files && chmod 666 /app/tmp && chmod 777 /app/files
|
| 18 |
|
| 19 |
# Expose port API
|
| 20 |
EXPOSE 7860
|
app.js
CHANGED
|
@@ -9,7 +9,7 @@ const { execSync } = require("child_process");
|
|
| 9 |
|
| 10 |
const FILE_DIR = path.join(__dirname, "files");
|
| 11 |
const EXPIRATION_TIME = 24 * 60 * 60 * 1000; // 24 jam dalam milidetik
|
| 12 |
-
const META_FILE = path.join(__dirname, "files.json");
|
| 13 |
|
| 14 |
// Load metadata file (kalau ada)
|
| 15 |
let fileData = {};
|
|
@@ -63,7 +63,7 @@ app.post("/upload", upload.single("file"), (req, res) => {
|
|
| 63 |
|
| 64 |
res.json({
|
| 65 |
success: true,
|
| 66 |
-
file_url:
|
| 67 |
expires_in: formatRemainingTime(expiresAt) // Format sesuai sisa waktu
|
| 68 |
});
|
| 69 |
});
|
|
|
|
| 9 |
|
| 10 |
const FILE_DIR = path.join(__dirname, "files");
|
| 11 |
const EXPIRATION_TIME = 24 * 60 * 60 * 1000; // 24 jam dalam milidetik
|
| 12 |
+
const META_FILE = path.join(__dirname, "/tmp", "files.json");
|
| 13 |
|
| 14 |
// Load metadata file (kalau ada)
|
| 15 |
let fileData = {};
|
|
|
|
| 63 |
|
| 64 |
res.json({
|
| 65 |
success: true,
|
| 66 |
+
file_url: `${req.protocol}://${req.get("host")}/files/${filePath}`,
|
| 67 |
expires_in: formatRemainingTime(expiresAt) // Format sesuai sisa waktu
|
| 68 |
});
|
| 69 |
});
|
ntah.js
DELETED
|
File without changes
|
tmp/files.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{}
|