5757class Config
5858 include YAML ::Serializable
5959
60- property channel_threads : Int32 = 1 # Number of threads to use for crawling videos from channels (for updating subscriptions)
61- property feed_threads : Int32 = 1 # Number of threads to use for updating feeds
62- property output : String = " STDOUT" # Log file path or STDOUT
63- property log_level : LogLevel = LogLevel ::Info # Default log level, valid YAML values are ints and strings, see src/invidious/helpers/logger.cr
64- property db : DBConfig ? = nil # Database configuration with separate parameters (username, hostname, etc)
65-
60+ # Number of threads to use for crawling videos from channels (for updating subscriptions)
61+ property channel_threads : Int32 = 1
62+ # Time interval between two executions of the job that crawls channel videos (subscriptions update).
63+ @[YAML ::Field (converter: Preferences ::TimeSpanConverter )]
64+ property channel_refresh_interval : Time ::Span = 30 .minutes
65+ # Number of threads to use for updating feeds
66+ property feed_threads : Int32 = 1
67+ # Log file path or STDOUT
68+ property output : String = " STDOUT"
69+ # Default log level, valid YAML values are ints and strings, see src/invidious/helpers/logger.cr
70+ property log_level : LogLevel = LogLevel ::Info
71+ # Database configuration with separate parameters (username, hostname, etc)
72+ property db : DBConfig ? = nil
73+
74+ # Database configuration using 12-Factor "Database URL" syntax
6675 @[YAML ::Field (converter: Preferences ::URIConverter )]
67- property database_url : URI = URI .parse(" " ) # Database configuration using 12-Factor "Database URL" syntax
68- property decrypt_polling : Bool = true # Use polling to keep decryption function up to date
69- property full_refresh : Bool = false # Used for crawling channels: threads should check all videos uploaded by a channel
70- property https_only : Bool ? # Used to tell Invidious it is behind a proxy, so links to resources should be https://
71- property hmac_key : String ? # HMAC signing key for CSRF tokens and verifying pubsub subscriptions
72- property domain : String ? # Domain to be used for links to resources on the site where an absolute URL is required
73- property use_pubsub_feeds : Bool | Int32 = false # Subscribe to channels using PubSubHubbub (requires domain, hmac_key)
76+ property database_url : URI = URI .parse(" " )
77+ # Use polling to keep decryption function up to date
78+ property decrypt_polling : Bool = true
79+ # Used for crawling channels: threads should check all videos uploaded by a channel
80+ property full_refresh : Bool = false
81+ # Used to tell Invidious it is behind a proxy, so links to resources should be https://
82+ property https_only : Bool ?
83+ # HMAC signing key for CSRF tokens and verifying pubsub subscriptions
84+ property hmac_key : String ?
85+ # Domain to be used for links to resources on the site where an absolute URL is required
86+ property domain : String ?
87+ # Subscribe to channels using PubSubHubbub (requires domain, hmac_key)
88+ property use_pubsub_feeds : Bool | Int32 = false
7489 property popular_enabled : Bool = true
7590 property captcha_enabled : Bool = true
7691 property login_enabled : Bool = true
@@ -79,28 +94,42 @@ class Config
7994 property admins : Array (String ) = [] of String
8095 property external_port : Int32 ? = nil
8196 property default_user_preferences : ConfigPreferences = ConfigPreferences .from_yaml(" " )
82- property dmca_content : Array (String ) = [] of String # For compliance with DMCA, disables download widget using list of video IDs
83- property check_tables : Bool = false # Check table integrity, automatically try to add any missing columns, create tables, etc.
84- property cache_annotations : Bool = false # Cache annotations requested from IA, will not cache empty annotations or annotations that only contain cards
85- property banner : String ? = nil # Optional banner to be displayed along top of page for announcements, etc.
86- property hsts : Bool ? = true # Enables 'Strict-Transport-Security'. Ensure that `domain` and all subdomains are served securely
87- property disable_proxy : Bool ? | Array (String )? = false # Disable proxying server-wide: options: 'dash', 'livestreams', 'downloads', 'local'
97+ # For compliance with DMCA, disables download widget using list of video IDs
98+ property dmca_content : Array (String ) = [] of String
99+ # Check table integrity, automatically try to add any missing columns, create tables, etc.
100+ property check_tables : Bool = false
101+ # Cache annotations requested from IA, will not cache empty annotations or annotations that only contain cards
102+ property cache_annotations : Bool = false
103+ # Optional banner to be displayed along top of page for announcements, etc.
104+ property banner : String ? = nil
105+ # Enables 'Strict-Transport-Security'. Ensure that `domain` and all subdomains are served securely
106+ property hsts : Bool ? = true
107+ # Disable proxying server-wide: options: 'dash', 'livestreams', 'downloads', 'local'
108+ property disable_proxy : Bool ? | Array (String )? = false
88109
89110 # URL to the modified source code to be easily AGPL compliant
90111 # Will display in the footer, next to the main source code link
91112 property modified_source_code_url : String ? = nil
92113
114+ # Connect to YouTube over 'ipv6', 'ipv4'. Will sometimes resolve fix issues with rate-limiting (see https://github.com/ytdl-org/youtube-dl/issues/21729)
93115 @[YAML ::Field (converter: Preferences ::FamilyConverter )]
94- property force_resolve : Socket ::Family = Socket ::Family ::UNSPEC # Connect to YouTube over 'ipv6', 'ipv4'. Will sometimes resolve fix issues with rate-limiting (see https://github.com/ytdl-org/youtube-dl/issues/21729)
95- property port : Int32 = 3000 # Port to listen for connections (overridden by command line argument)
96- property host_binding : String = " 0.0.0.0" # Host to bind (overridden by command line argument)
97- property pool_size : Int32 = 100 # Pool size for HTTP requests to youtube.com and ytimg.com (each domain has a separate pool of `pool_size`)
98- property use_quic : Bool = false # Use quic transport for youtube api
99-
116+ property force_resolve : Socket ::Family = Socket ::Family ::UNSPEC
117+ # Port to listen for connections (overridden by command line argument)
118+ property port : Int32 = 3000
119+ # Host to bind (overridden by command line argument)
120+ property host_binding : String = " 0.0.0.0"
121+ # Pool size for HTTP requests to youtube.com and ytimg.com (each domain has a separate pool of `pool_size`)
122+ property pool_size : Int32 = 100
123+ # Use quic transport for youtube api
124+ property use_quic : Bool = false
125+
126+ # Saved cookies in "name1=value1; name2=value2..." format
100127 @[YAML ::Field (converter: Preferences ::StringToCookies )]
101- property cookies : HTTP ::Cookies = HTTP ::Cookies .new # Saved cookies in "name1=value1; name2=value2..." format
102- property captcha_key : String ? = nil # Key for Anti-Captcha
103- property captcha_api_url : String = " https://api.anti-captcha.com" # API URL for Anti-Captcha
128+ property cookies : HTTP ::Cookies = HTTP ::Cookies .new
129+ # Key for Anti-Captcha
130+ property captcha_key : String ? = nil
131+ # API URL for Anti-Captcha
132+ property captcha_api_url : String = " https://api.anti-captcha.com"
104133
105134 def disabled ?(option)
106135 case disabled = CONFIG .disable_proxy
0 commit comments