fullpwerr commited on
Commit
87e670d
·
1 Parent(s): 04e7338
Files changed (4) hide show
  1. Dockerfile +1 -1
  2. app.js +2 -2
  3. ntah.js +0 -0
  4. 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: `http://yourdomain.com/files/${filePath}`,
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
+ {}