1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-14 04:17:29 +00:00
cloudtube/utils/constants.js

51 lines
902 B
JavaScript
Raw Normal View History

2020-11-20 05:27:38 +00:00
const mixin = require("mixin-deep")
let constants = {
2020-08-31 13:22:16 +00:00
user_settings: {
instance: {
type: "string",
2020-09-23 11:45:02 +00:00
default: "https://second.cadence.moe"
2020-08-31 13:22:16 +00:00
},
save_history: {
type: "boolean",
default: false
2020-10-26 07:29:05 +00:00
},
local: {
type: "boolean",
default: false
2020-08-31 13:22:16 +00:00
}
},
server_setup: {
local_instance_origin: "http://localhost:3000"
},
2020-08-30 13:54:59 +00:00
caching: {
2020-09-23 11:45:02 +00:00
csrf_time: 4*60*60*1000,
seen_token_subscriptions_eligible: 40*60*60*1000,
subscriptions_refresh_loop_min: 5*60*1000,
2020-08-30 13:54:59 +00:00
},
regex: {
ucid: "[A-Za-z0-9-_]+",
2021-02-03 07:49:21 +00:00
video_id: "[A-Za-z0-9-_]{11,}"
},
symbols: {
refresher: {
ACTIVE: Symbol("ACTIVE"),
WAITING: Symbol("WAITING"),
EMPTY: Symbol("EMPTY")
}
2020-08-30 13:54:59 +00:00
}
}
2020-11-20 05:27:38 +00:00
try {
const overrides = require("../config/config.js")
constants = mixin(constants, overrides)
} catch (e) {
console.log("Note: overrides file `config/config.js` ignored, file not found.")
}
2020-08-30 13:54:59 +00:00
module.exports = constants