Line endings fix
This commit is contained in:
parent
5116dd2137
commit
544abd1ebd
25 changed files with 7378 additions and 7372 deletions
8
app.js
8
app.js
|
@ -47,6 +47,11 @@ app.use("/", authRouter);
|
||||||
app.use("/uploads", express.static("uploads"));
|
app.use("/uploads", express.static("uploads"));
|
||||||
|
|
||||||
function prune () {
|
function prune () {
|
||||||
|
db.all("SELECT * FROM media", (err, rows) => {
|
||||||
|
console.log("Uploaded files: " + rows.length);
|
||||||
|
console.log(rows)
|
||||||
|
});
|
||||||
|
|
||||||
console.log("Vacuuming database...");
|
console.log("Vacuuming database...");
|
||||||
db.run("VACUUM");
|
db.run("VACUUM");
|
||||||
|
|
||||||
|
@ -70,13 +75,12 @@ function prune () {
|
||||||
if (err) return console.error(err);
|
if (err) return console.error(err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
console.log(`Deleted ${row.path}`);
|
console.log(`Deleted ${row.path}`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(prune, 1000 * 60 * 30); //prune every 30 minutes
|
setInterval(prune, 1000 * 60); //prune every minute
|
||||||
|
|
||||||
module.exports = app;
|
module.exports = app;
|
||||||
|
|
0
docker-entrypoint.sh
Executable file → Normal file
0
docker-entrypoint.sh
Executable file → Normal file
|
@ -101,7 +101,6 @@ function handleUpload(req, res, next) {
|
||||||
for (let file in req.files) {
|
for (let file in req.files) {
|
||||||
let currentdate = Date.now();
|
let currentdate = Date.now();
|
||||||
let expireDate = new Date(currentdate + (req.body.expire * 24 * 60 * 60 * 1000));
|
let expireDate = new Date(currentdate + (req.body.expire * 24 * 60 * 60 * 1000));
|
||||||
console.log(expireDate);
|
|
||||||
db.run("INSERT INTO media (path, expire) VALUES (?, ?)", [req.files[file].filename, expireDate], function (err) {
|
db.run("INSERT INTO media (path, expire) VALUES (?, ?)", [req.files[file].filename, expireDate], function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
|
@ -39,6 +39,9 @@ return string.slice((string.lastIndexOf(".") - 2 >>> 0) + 2);
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<p class="dragregion">Select file expiration date: <select name="expire" id="expire">
|
<p class="dragregion">Select file expiration date: <select name="expire" id="expire">
|
||||||
|
<option value="0.00347">5 minutes</option>
|
||||||
|
<option value="0.0417">1 hour</option>
|
||||||
|
<option value="0.25">6 hours</option>
|
||||||
<option value="1">1 day</option>
|
<option value="1">1 day</option>
|
||||||
<option value="7">7 days</option>
|
<option value="7">7 days</option>
|
||||||
<option value="14">14 days</option>
|
<option value="14">14 days</option>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue