Merge branch 'develop'

This commit is contained in:
Alice Gaudon 2021-03-30 17:03:28 +02:00
commit 004e797f72
4 changed files with 99 additions and 91 deletions

View File

@ -42,11 +42,18 @@
magic_link: {
validity_period: 20,
},
newlyGeneratedSlugSize: 3,
default_file_ttl: 30, // 30 seconds
max_upload_size: 16, // MB
max_hotlink_size: 1, // MB
auth: {
approval_mode: false,
// 30 days
name_change_wait_period: 2592000000,
},
newlyGeneratedSlugSize: 3,
// 30 seconds
default_file_ttl: 30,
// MB
max_upload_size: 16,
// MB
max_hotlink_size: 1,
domain: 'localhost',
allowed_url_domains: [
'localhost:4899',
@ -54,7 +61,6 @@
],
default_url_domain_for_files: 0,
default_url_domain_for_urls: 1,
// 1 hour in ms
delete_old_files_interval: 3600000,
}

View File

@ -16,17 +16,21 @@
validity_period: 900,
},
newlyGeneratedSlugSize: 5,
default_file_ttl: 2592000, // 30 days
max_upload_size: 8192, // MB
max_hotlink_size: 128, // MB
// 30 days
default_file_ttl: 2592000,
// MB
max_upload_size: 8192,
// MB
max_hotlink_size: 128,
auth: {
approval_mode: true,
},
domain: 'ily.li',
allowed_url_domains: [
'ily.li',
],
default_url_domain_for_files: 0,
default_url_domain_for_urls: 0,
// 1 day in ms
delete_old_files_interval: 86400000
}

View File

@ -1,6 +1,6 @@
{
"name": "ily.li",
"version": "1.0.0",
"version": "1.0.1",
"description": "Self-hosted file pusher",
"repository": "https://eternae.ink/arisu/ily.li",
"author": "Alice Gaudon <alice@gaudon.pro>",

View File

@ -1,6 +1,5 @@
import Migration from "swaf/db/Migration";
import FileModel from "../models/FileModel";
import {logger} from "swaf/Logger";
export default class ReplaceTtlWithExpiresAtFilesTable extends Migration {
public async install(): Promise<void> {
@ -9,7 +8,6 @@ export default class ReplaceTtlWithExpiresAtFilesTable extends Migration {
const files = await FileModel.select().get();
for (const file of files) {
logger.debug(file);
if (file.created_at && typeof file.ttl === 'number' && file.ttl > 0) {
file.expires_at = new Date(file.created_at.getTime() + file.ttl * 1000);
}