bibliogram/src/lib/constants.js

83 lines
3.1 KiB
JavaScript
Raw Normal View History

2020-01-28 03:14:21 +00:00
/*
Welcome to the constants file!
Copy a key and provide a new value in /config.js to override the value here.
Please read the comments above every section!
*/
2020-01-12 12:50:21 +00:00
2020-01-28 03:14:21 +00:00
let constants = {
// Things that server owners _should_ change!
2020-02-18 00:39:20 +00:00
website_origin: "http://localhost:10407", // Protocol and domain that this instance is hosted on. Do NOT include a trailing slash.
2020-02-05 10:11:00 +00:00
has_privacy_policy: false, // You MUST read /src/site/pug/privacy.pug.template before changing this!
2020-01-28 03:14:21 +00:00
// Things that server owners _could_ change if they want to.
2020-02-02 13:24:14 +00:00
tor: {
enabled: false, // If false, everything else in this block has no effect.
password: null, // If `null`, Bibliogram will run its own Tor process instead.
for: {
user_html: false, // User HTML page seems to have less forgiving rates, and Tor always fails, so it's disabled by default.
timeline_graphql: true,
post_graphql: true,
reel_graphql: true
}
},
2020-03-03 12:32:09 +00:00
// After setting your privacy policy, I suggest you read src/site/html/.well-known/dnt-policy.txt. If you comply with it,
// change this to `true` to serve it, which will make extensions like Privacy Badger automatically whitelist the domain.
does_not_track: false,
2020-02-02 13:24:14 +00:00
allow_user_from_reel: "preferForRSS", // one of: "never", "fallback", "prefer", "onlyPreferSaved", "preferForRSS"
2020-02-02 13:24:14 +00:00
settings: {
rss_enabled: true,
2020-02-22 10:44:17 +00:00
display_feed_validation_buttons: false,
enable_updater_page: false
},
2020-01-28 03:14:21 +00:00
caching: {
image_cache_control: `public, max-age=${7*24*60*60}`,
2020-01-28 11:38:05 +00:00
resource_cache_time: 30*60*1000,
2020-02-01 04:44:40 +00:00
instance_list_cache_time: 3*60*1000,
2020-02-22 10:44:17 +00:00
updater_cache_time: 2*60*1000,
2020-02-01 04:44:40 +00:00
db_user_id: true,
db_post_n3: true
2020-01-28 03:14:21 +00:00
},
// Instagram uses this stuff. This shouldn't be changed, except to fix a bug that hasn't yet been fixed upstream.
2020-01-12 12:50:21 +00:00
external: {
2020-02-02 13:24:14 +00:00
reel_query_hash: "c9100bf9110dd6361671f113dd02e7d6",
2020-01-12 12:50:21 +00:00
timeline_query_hash: "e769aa130647d2354c40ea6a439bfc08",
2020-02-02 11:43:56 +00:00
timeline_query_hash_2: "42323d64886122307be10013ad2dcc44", // https://github.com/rarcega/instagram-scraper/blob/dc022081dbefc81500c5f70cce5c70cfd2816e3c/instagram_scraper/constants.py#L30
2020-01-18 15:38:14 +00:00
shortcode_query_hash: "2b0673e0dc4580674a88d426fe00ea90",
2020-01-14 14:38:33 +00:00
timeline_fetch_first: 12,
2020-02-21 12:32:57 +00:00
username_regex: "[\\w.]*[\\w]",
shortcode_regex: "[\\w-]+",
2020-02-04 06:15:16 +00:00
hashtag_regex: "[^ \\n`~!@#\\$%^&*()\\-=+[\\]{};:\"',<.>/?\\\\]+"
2020-01-12 12:50:21 +00:00
},
2020-01-28 11:38:05 +00:00
resources: {
instances_wiki_raw: "https://raw.githubusercontent.com/wiki/cloudrac3r/bibliogram/Instances.md"
},
2020-01-28 03:14:21 +00:00
// My code uses this stuff. Server owners have no reason to change it.
2020-01-12 12:50:21 +00:00
symbols: {
NO_MORE_PAGES: Symbol("NO_MORE_PAGES"),
TYPE_IMAGE: Symbol("TYPE_IMAGE"),
TYPE_VIDEO: Symbol("TYPE_VIDEO"),
TYPE_GALLERY: Symbol("TYPE_GALLERY"),
TYPE_GALLERY_IMAGE: Symbol("TYPE_GALLERY_IMAGE"),
2020-01-27 06:03:28 +00:00
TYPE_GALLERY_VIDEO: Symbol("TYPE_GALLERY_VIDEO"),
NOT_FOUND: Symbol("NOT_FOUND"),
2020-01-30 03:05:43 +00:00
NO_SHARED_DATA: Symbol("NO_SHARED_DATA"),
2020-02-02 11:43:56 +00:00
INSTAGRAM_DEMANDS_LOGIN: Symbol("INSTAGRAM_DEMANDS_LOGIN"),
RATE_LIMITED: Symbol("RATE_LIMITED"),
ENDPOINT_OVERRIDDEN: Symbol("ENDPOINT_OVERRIDDEN")
2020-02-01 04:44:40 +00:00
},
database_version: 2
2020-01-12 12:50:21 +00:00
}
2020-01-28 03:14:21 +00:00
// Override values from config and export the result
const md = require("mixin-deep")
const config = require("../../config")
constants = md(constants, config)
module.exports = constants