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

@ -1,60 +1,66 @@
{ {
app: { app: {
name: 'ily.li', name: 'ily.li',
contact_email: 'contact@ily.li', contact_email: 'contact@ily.li',
}, },
log_level: "DEV", log_level: "DEV",
db_log_level: "ERROR", db_log_level: "ERROR",
public_url: "http://localhost:4899", public_url: "http://localhost:4899",
public_websocket_url: "ws://localhost:4899", public_websocket_url: "ws://localhost:4899",
port: 4899, port: 4899,
mysql: { mysql: {
connectionLimit: 10, connectionLimit: 10,
host: "localhost", host: "localhost",
user: "root", user: "root",
password: "", password: "",
database: "ilyli", database: "ilyli",
create_database_automatically: false, create_database_automatically: false,
}, },
redis: { redis: {
host: "127.0.0.1", host: "127.0.0.1",
port: 6379, port: 6379,
prefix: 'ilyli', prefix: 'ilyli',
}, },
session: { session: {
cookie: { cookie: {
secure: false, secure: false,
}, },
}, },
mail: { mail: {
host: "127.0.0.1", host: "127.0.0.1",
port: "1025", port: "1025",
secure: false, secure: false,
username: "", username: "",
password: "", password: "",
allow_invalid_tls: true, allow_invalid_tls: true,
from: 'contact@ily.li', from: 'contact@ily.li',
from_name: 'ily.li', from_name: 'ily.li',
}, },
view: { view: {
cache: false, cache: false,
}, },
magic_link: { magic_link: {
validity_period: 20, validity_period: 20,
}, },
newlyGeneratedSlugSize: 3, auth: {
default_file_ttl: 30, // 30 seconds approval_mode: false,
max_upload_size: 16, // MB // 30 days
max_hotlink_size: 1, // MB name_change_wait_period: 2592000000,
approval_mode: false, },
domain: 'localhost', newlyGeneratedSlugSize: 3,
allowed_url_domains: [ // 30 seconds
'localhost:4899', default_file_ttl: 30,
'127.0.0.1:4899', // MB
], max_upload_size: 16,
default_url_domain_for_files: 0, // MB
default_url_domain_for_urls: 1, max_hotlink_size: 1,
domain: 'localhost',
// 1 hour in ms allowed_url_domains: [
delete_old_files_interval: 3600000, 'localhost:4899',
'127.0.0.1:4899',
],
default_url_domain_for_files: 0,
default_url_domain_for_urls: 1,
// 1 hour in ms
delete_old_files_interval: 3600000,
} }

View File

@ -1,32 +1,36 @@
{ {
log_level: "DEBUG", log_level: "DEBUG",
db_log_level: "ERROR", db_log_level: "ERROR",
public_url: 'https://ily.li', public_url: 'https://ily.li',
public_websocket_url: 'wss://ily.li', public_websocket_url: 'wss://ily.li',
session: { session: {
cookie: { cookie: {
secure: true secure: true
}, },
}, },
mail: { mail: {
secure: true, secure: true,
allow_invalid_tls: false allow_invalid_tls: false
}, },
magic_link: { magic_link: {
validity_period: 900, validity_period: 900,
}, },
newlyGeneratedSlugSize: 5, newlyGeneratedSlugSize: 5,
default_file_ttl: 2592000, // 30 days // 30 days
max_upload_size: 8192, // MB default_file_ttl: 2592000,
max_hotlink_size: 128, // MB // MB
approval_mode: true, max_upload_size: 8192,
domain: 'ily.li', // MB
allowed_url_domains: [ max_hotlink_size: 128,
'ily.li', auth: {
], approval_mode: true,
default_url_domain_for_files: 0, },
default_url_domain_for_urls: 0, domain: 'ily.li',
allowed_url_domains: [
// 1 day in ms 'ily.li',
delete_old_files_interval: 86400000 ],
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", "name": "ily.li",
"version": "1.0.0", "version": "1.0.1",
"description": "Self-hosted file pusher", "description": "Self-hosted file pusher",
"repository": "https://eternae.ink/arisu/ily.li", "repository": "https://eternae.ink/arisu/ily.li",
"author": "Alice Gaudon <alice@gaudon.pro>", "author": "Alice Gaudon <alice@gaudon.pro>",

View File

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