diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/config.example.yml | 948 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-17cf077.sh | 7 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-1c8075c.sh | 11 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-1eca969.sh | 37 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-30e6d29.sh | 7 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-3646395.sh | 9 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-3bcb98e.sh | 5 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-52cb239.sh | 5 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-6e51189.sh | 7 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-701b5ea.sh | 5 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-88b7097.sh | 5 | ||||
| -rwxr-xr-x | config/migrate-scripts/migrate-db-8e884fe.sh | 9 | ||||
| -rw-r--r-- | config/sql/annotations.sql | 4 | ||||
| -rw-r--r-- | config/sql/channel_videos.sql | 6 | ||||
| -rw-r--r-- | config/sql/channels.sql | 6 | ||||
| -rw-r--r-- | config/sql/nonces.sql | 6 | ||||
| -rw-r--r-- | config/sql/playlist_videos.sql | 4 | ||||
| -rw-r--r-- | config/sql/playlists.sql | 4 | ||||
| -rw-r--r-- | config/sql/session_ids.sql | 6 | ||||
| -rw-r--r-- | config/sql/users.sql | 6 | ||||
| -rw-r--r-- | config/sql/videos.sql | 6 |
21 files changed, 1036 insertions, 67 deletions
diff --git a/config/config.example.yml b/config/config.example.yml index e8330705..a3a2eeb7 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -1,13 +1,949 @@ -channel_threads: 1 -feed_threads: 1 +######################################### +# +# Database and other external servers +# +######################################### + +## +## Database configuration with separate parameters. +## This setting is MANDATORY, unless 'database_url' is used. +## db: user: kemal password: kemal host: localhost port: 5432 dbname: invidious -# alternatively, the database URL can be provided directly - if both are set then the latter takes precedence -# database_url: postgres://kemal:kemal@localhost:5432/invidious -full_refresh: false -https_only: false + +## +## Database configuration using a single URI. This is an +## alternative to the 'db' parameter above. If both forms +## are used, then only database_url is used. +## This setting is MANDATORY, unless 'db' is used. +## +## Note: The 'database_url' setting allows the use of UNIX +## sockets. To do so, remove the IP address (or FQDN) and port +## and append the 'host' parameter. E.g: +## postgres://kemal:kemal@/invidious?host=/var/run/postgresql +## +## Accepted values: a postgres:// URI +## Default: postgres://kemal:kemal@localhost:5432/invidious +## +#database_url: postgres://kemal:kemal@localhost:5432/invidious + +## +## Enable automatic table integrity check. This will create +## the required tables and columns if anything is missing. +## +## Accepted values: true, false +## Default: false +## +#check_tables: false + + +## +## Path to an external signature resolver, used to emulate +## the Youtube client's Javascript. If no such server is +## available, some videos will not be playable. +## +## When this setting is commented out, no external +## resolver will be used. +## +## Accepted values: a path to a UNIX socket or "<IP>:<Port>" +## Default: <none> +## +#signature_server: + + +######################################### +# +# Server config +# +######################################### + +# ----------------------------- +# Network (inbound) +# ----------------------------- + +## +## Port to listen on for incoming connections. +## +## Note: Ports lower than 1024 requires either root privileges +## (not recommended) or the "CAP_NET_BIND_SERVICE" capability +## (See https://stackoverflow.com/a/414258 and `man capabilities`) +## +## Accepted values: 1-65535 +## Default: 3000 +## +#port: 3000 + +## +## When the invidious instance is behind a proxy, and the proxy +## listens on a different port than the instance does, this lets +## invidious know about it. This is used to craft absolute URLs +## to the instance (e.g in the API). +## +## Note: This setting is MANDATORY if invidious is behind a +## reverse proxy. +## +## Accepted values: 1-65535 +## Default: <none> +## +#external_port: + +## +## Interface address to listen on for incoming connections. +## +## Accepted values: a valid IPv4 or IPv6 address. +## default: 0.0.0.0 (listen on all interfaces) +## +#host_binding: 0.0.0.0 + +## +## Domain name under which this instance is hosted. This is +## used to craft absolute URLs to the instance (e.g in the API). +## The domain MUST be defined if your instance is accessed from +## a domain name (like 'example.com'). +## +## Accepted values: a fully qualified domain name (FQDN) +## Default: <none> +## domain: + +## +## Tell Invidious that it is behind a proxy that provides only +## HTTPS, so all links must use the https:// scheme. This +## setting MUST be set to true if invidious is behind a +## reverse proxy serving HTTPs. +## +## Accepted values: true, false +## Default: false +## +https_only: false + +## +## Enable/Disable 'Strict-Transport-Security'. Make sure that +## the domain specified under 'domain' is served securely. +## +## Accepted values: true, false +## Default: true +## +#hsts: true + + +# ----------------------------- +# Network (outbound) +# ----------------------------- + +## +## Disable proxying server-wide. Can be disable as a whole, or +## only for a single function. +## +## Accepted values: true, false, dash, livestreams, downloads, local +## Default: false +## +#disable_proxy: false + +## +## Size of the HTTP pool used to connect to youtube. Each +## domain ('youtube.com', 'ytimg.com', ...) has its own pool. +## +## Accepted values: a positive integer +## Default: 100 +## +#pool_size: 100 + + +## +## Additional cookies to be sent when requesting the youtube API. +## +## Accepted values: a string in the format "name1=value1; name2=value2..." +## Default: <none> +## +#cookies: + +## +## Force connection to youtube over a specific IP family. +## +## Note: This may sometimes resolve issues involving rate-limiting. +## See https://github.com/ytdl-org/youtube-dl/issues/21729. +## +## Accepted values: ipv4, ipv6 +## Default: <none> +## +#force_resolve: + +## +## Configuration for using a HTTP proxy +## +## If unset, then no HTTP proxy will be used. +## +http_proxy: + user: + password: + host: + port: + + +## +## Use Innertube's transcripts API instead of timedtext for closed captions +## +## Useful for larger instances as InnerTube is **not ratelimited**. See https://github.com/iv-org/invidious/issues/2567 +## +## Subtitle experience may differ slightly on Invidious. +## +## Accepted values: true, false +## Default: false +## +# use_innertube_for_captions: false + +## +## Send Google session informations. This is useful when Invidious is blocked +## by the message "This helps protect our community." +## See https://github.com/iv-org/invidious/issues/4734. +## +## Warning: These strings gives much more identifiable information to Google! +## +## Accepted values: String +## Default: <none> +## +# po_token: "" +# visitor_data: "" + +# ----------------------------- +# Logging +# ----------------------------- + +## +## Path to log file. Can be absolute or relative to the invidious +## binary. This is overridden if "-o OUTPUT" or "--output=OUTPUT" +## are passed on the command line. +## +## Accepted values: a filesystem path or 'STDOUT' +## Default: STDOUT +## +#output: STDOUT + +## +## Logging Verbosity. This is overridden if "-l LEVEL" or +## "--log-level=LEVEL" are passed on the command line. +## +## Accepted values: All, Trace, Debug, Info, Warn, Error, Fatal, Off +## Default: Info +## +#log_level: Info + +## +## Enables colors in logs. Useful for debugging purposes +## This is overridden if "-k" or "--colorize" +## are passed on the command line. +## Colors are also disabled if the environment variable +## NO_COLOR is present and has any value +## +## Accepted values: true, false +## Default: true +## +#colorize_logs: false + +# ----------------------------- +# Features +# ----------------------------- + +## +## Enable/Disable the "Popular" tab on the main page. +## +## Accepted values: true, false +## Default: true +## +#popular_enabled: true + +## +## Enable/Disable statstics (available at /api/v1/stats). +## The following data is available: +## - Software name ("invidious") and version+branch (same data as +## displayed in the footer, e.g: "2021.05.13-75e5b49" / "master") +## - The value of the 'registration_enabled' config (true/false) +## - Number of currently registered users +## - Number of registered users who connected in the last month +## - Number of registered users who connected in the last 6 months +## - Timestamp of the last server restart +## - Timestamp of the last "Channel Refresh" job execution +## +## Warning: This setting MUST be set to true if you plan to run +## a public instance. It is used by api.invidious.io to refresh +## your instance's status. +## +## Accepted values: true, false +## Default: false +## +#statistics_enabled: false + + +# ----------------------------- +# Users and accounts +# ----------------------------- + +## +## Allow/Forbid Invidious (local) account creation. Invidious +## accounts allow users to subscribe to channels and to create +## playlists without a Google account. +## +## Accepted values: true, false +## Default: true +## +#registration_enabled: true + +## +## Allow/Forbid users to log-in. +## +## Accepted values: true, false +## Default: true +## +#login_enabled: true + +## +## Enable/Disable the captcha challenge on the login page. +## +## Note: this is a basic captcha challenge that doesn't +## depend on any third parties. +## +## Accepted values: true, false +## Default: true +## +#captcha_enabled: true + +## +## List of usernames that will be granted administrator rights. +## A user with administrator rights will be able to change the +## server configuration options listed below in /preferences, +## in addition to the usual user preferences. +## +## Server-wide settings: +## - popular_enabled +## - captcha_enabled +## - login_enabled +## - registration_enabled +## - statistics_enabled +## Default user preferences: +## - default_home +## - feed_menu +## +## Accepted values: an array of strings +## Default: [""] +## +#admins: [""] + +## +## Enable/Disable the user notifications for all users +## +## Note: On large instances, it is recommended to set this option to 'false' +## in order to reduce the amount of data written to the database, and hence +## improve the overall performance of the instance. +## +## Accepted values: true, false +## Default: true +## +#enable_user_notifications: true + +# ----------------------------- +# Background jobs +# ----------------------------- + +## +## Number of threads to use when crawling channel videos (during +## subscriptions update). +## +## Notes: This setting is overridden if either "-c THREADS" or +## "--channel-threads=THREADS" is passed on the command line. +## +## Accepted values: a positive integer +## Default: 1 +## +channel_threads: 1 + +## +## Time interval between two executions of the job that crawls +## channel videos (subscriptions update). +## +## Accepted values: a valid time interval (like 1h30m or 90m) +## Default: 30m +## +#channel_refresh_interval: 30m + +## +## Forcefully dump and re-download the entire list of uploaded +## videos when crawling channel (during subscriptions update). +## +## Accepted values: true, false +## Default: false +## +full_refresh: false + +## +## Number of threads to use when updating RSS feeds. +## +## Notes: This setting is overridden if either "-f THREADS" or +## "--feed-threads=THREADS" is passed on the command line. +## +## Accepted values: a positive integer +## Default: 1 +## +feed_threads: 1 + + +jobs: + + ## Options for the database cleaning job + clear_expired_items: + + ## Enable/Disable job + ## + ## Accepted values: true, false + ## Default: true + ## + enable: true + + ## Options for the channels updater job + refresh_channels: + + ## Enable/Disable job + ## + ## Accepted values: true, false + ## Default: true + ## + enable: true + + ## Options for the RSS feeds updater job + refresh_feeds: + + ## Enable/Disable job + ## + ## Accepted values: true, false + ## Default: true + ## + enable: true + + +# ----------------------------- +# Miscellaneous +# ----------------------------- + +## +## custom banner displayed at the top of every page. This can +## used for instance announcements, e.g. +## +## Accepted values: any string. HTML is accepted. +## Default: <none> +## +#banner: + +## +## Subscribe to channels using PubSubHub (Google PubSubHubbub service). +## PubSubHub allows Invidious to be instantly notified when a new video +## is published on any subscribed channels. When PubSubHub is not used, +## Invidious will check for new videos every minute. +## +## Note: This setting is recommended for public instances. +## +## Note 2: +## - Requires a public instance (it uses /feed/webhook/v1) +## - Requires 'domain' and 'hmac_key' to be set. +## - Setting this parameter to any number greater than zero will +## enable channel subscriptions via PubSubHub, but will limit the +## amount of concurrent subscriptions. +## +## Accepted values: true, false, a positive integer +## Default: false +## +#use_pubsub_feeds: false + +## +## HMAC signing key used for CSRF tokens, cookies and pubsub +## subscriptions verification. +## +## Note: This parameter is mandatory and should be a random string. +## Such random string can be generated on linux with the following +## command: `pwgen 20 1` +## +## Accepted values: a string +## Default: <none> +## +hmac_key: "CHANGE_ME!!" + +## +## List of video IDs where the "download" widget must be +## disabled, in order to comply with DMCA requests. +## +## Accepted values: an array of string +## Default: <none> +## +#dmca_content: + +## +## Cache video annotations in the database. +## +## Warning: empty annotations or annotations that only contain +## cards won't be cached. +## +## Accepted values: true, false +## Default: false +## +#cache_annotations: false + +## +## Source code URL. If your instance is running a modified source +## code, you MUST publish it somewhere and set this option. +## +## Accepted values: a string +## Default: <none> +## +#modified_source_code_url: "" + +## +## Maximum custom playlist length limit. +## +## Accepted values: Integer +## Default: 500 +## +#playlist_length_limit: 500 + +######################################### +# +# Default user preferences +# +######################################### + +## +## NOTE: All the settings below define the default user +## preferences. They will apply to ALL users connecting +## without a preferences cookie (so either on the first +## connection to the instance or after clearing the +## browser's cookies). +## + +default_user_preferences: + + # ----------------------------- + # Internationalization + # ----------------------------- + + ## + ## Default user interface language (locale). + ## + ## Note: When hosting a public instance, overriding the + ## default (english) is not recommended, as it may + ## people using other languages. + ## + ## Accepted values: + ## ar (Arabic) + ## da (Danish) + ## de (German) + ## en-US (english, US) + ## el (Greek) + ## eo (Esperanto) + ## es (Spanish) + ## fa (Persian) + ## fi (Finnish) + ## fr (French) + ## he (Hebrew) + ## hr (Hungarian) + ## id (Indonesian) + ## is (Icelandic) + ## it (Italian) + ## ja (Japanese) + ## nb-NO (Norwegian, Bokmål) + ## nl (Dutch) + ## pl (Polish) + ## pt-BR (Portuguese, Brazil) + ## pt-PT (Portuguese, Portugal) + ## ro (Romanian) + ## ru (Russian) + ## sv (Swedish) + ## tr (Turkish) + ## uk (Ukrainian) + ## zh-CN (Chinese, China) (a.k.a "Simplified Chinese") + ## zh-TW (Chinese, Taiwan) (a.k.a "Traditional Chinese") + ## + ## Default: en-US + ## + #locale: en-US + + ## + ## Default geographical location for content. + ## + ## Accepted values: + ## AE, AR, AT, AU, AZ, BA, BD, BE, BG, BH, BO, BR, BY, CA, CH, CL, CO, CR, + ## CY, CZ, DE, DK, DO, DZ, EC, EE, EG, ES, FI, FR, GB, GE, GH, GR, GT, HK, + ## HN, HR, HU, ID, IE, IL, IN, IQ, IS, IT, JM, JO, JP, KE, KR, KW, KZ, LB, + ## LI, LK, LT, LU, LV, LY, MA, ME, MK, MT, MX, MY, NG, NI, NL, NO, NP, NZ, + ## OM, PA, PE, PG, PH, PK, PL, PR, PT, PY, QA, RO, RS, RU, SA, SE, SG, SI, + ## SK, SN, SV, TH, TN, TR, TW, TZ, UA, UG, US, UY, VE, VN, YE, ZA, ZW + ## + ## Default: US + ## + #region: US + + ## + ## Top 3 preferred languages for video captions. + ## + ## Note: overriding the default (no preferred + ## caption language) is not recommended, in order + ## to not penalize people using other languages. + ## + ## Accepted values: a three-entries array. + ## Each entry can be one of: + ## "English", "English (auto-generated)", + ## "Afrikaans", "Albanian", "Amharic", "Arabic", + ## "Armenian", "Azerbaijani", "Bangla", "Basque", + ## "Belarusian", "Bosnian", "Bulgarian", "Burmese", + ## "Catalan", "Cebuano", "Chinese (Simplified)", + ## "Chinese (Traditional)", "Corsican", "Croatian", + ## "Czech", "Danish", "Dutch", "Esperanto", "Estonian", + ## "Filipino", "Finnish", "French", "Galician", "Georgian", + ## "German", "Greek", "Gujarati", "Haitian Creole", "Hausa", + ## "Hawaiian", "Hebrew", "Hindi", "Hmong", "Hungarian", + ## "Icelandic", "Igbo", "Indonesian", "Irish", "Italian", + ## "Japanese", "Javanese", "Kannada", "Kazakh", "Khmer", + ## "Korean", "Kurdish", "Kyrgyz", "Lao", "Latin", "Latvian", + ## "Lithuanian", "Luxembourgish", "Macedonian", + ## "Malagasy", "Malay", "Malayalam", "Maltese", "Maori", + ## "Marathi", "Mongolian", "Nepali", "Norwegian Bokmål", + ## "Nyanja", "Pashto", "Persian", "Polish", "Portuguese", + ## "Punjabi", "Romanian", "Russian", "Samoan", + ## "Scottish Gaelic", "Serbian", "Shona", "Sindhi", + ## "Sinhala", "Slovak", "Slovenian", "Somali", + ## "Southern Sotho", "Spanish", "Spanish (Latin America)", + ## "Sundanese", "Swahili", "Swedish", "Tajik", "Tamil", + ## "Telugu", "Thai", "Turkish", "Ukrainian", "Urdu", + ## "Uzbek", "Vietnamese", "Welsh", "Western Frisian", + ## "Xhosa", "Yiddish", "Yoruba", "Zulu" + ## + ## Default: ["", "", ""] + ## + #captions: ["", "", ""] + + + # ----------------------------- + # Interface + # ----------------------------- + + ## + ## Enable/Disable dark mode. + ## + ## Accepted values: "dark", "light", "auto" + ## Default: "auto" + ## + #dark_mode: "auto" + + ## + ## Enable/Disable thin mode (no video thumbnails). + ## + ## Accepted values: true, false + ## Default: false + ## + #thin_mode: false + + ## + ## List of feeds available on the home page. + ## + ## Note: "Subscriptions" and "Playlists" are only visible + ## when the user is logged in. + ## + ## Accepted values: A list of strings + ## Each entry can be one of: "Popular", "Trending", + ## "Subscriptions", "Playlists" + ## + ## Default: ["Popular", "Trending", "Subscriptions", "Playlists"] (show all feeds) + ## + #feed_menu: ["Popular", "Trending", "Subscriptions", "Playlists"] + + ## + ## Default feed to display on the home page. + ## + ## Note: setting this option to "Popular" has no + ## effect when 'popular_enabled' is set to false. + ## + ## Accepted values: Popular, Trending, Subscriptions, Playlists, <none> + ## Default: Popular + ## + #default_home: Popular + + ## + ## Default number of results to display per page. + ## + ## Note: this affects invidious-generated pages only, such + ## as watch history and subscription feeds. Playlists, search + ## results and channel videos depend on the data returned by + ## the Youtube API. + ## + ## Accepted values: any positive integer + ## Default: 40 + ## + #max_results: 40 + + ## + ## Show/hide annotations. + ## + ## Accepted values: true, false + ## Default: false + ## + #annotations: false + + ## + ## Show/hide annotation. + ## + ## Accepted values: true, false + ## Default: false + ## + #annotations_subscribed: false + + ## + ## Type of comments to display below video. + ## + ## Accepted values: a two-entries array. + ## Each entry can be one of: "youtube", "reddit", "" + ## + ## Default: ["youtube", ""] + ## + #comments: ["youtube", ""] + + ## + ## Default player style. + ## + ## Accepted values: invidious, youtube + ## Default: invidious + ## + #player_style: invidious + + ## + ## Show/Hide the "related videos" sidebar when + ## watching a video. + ## + ## Accepted values: true, false + ## Default: true + ## + #related_videos: true + + + # ----------------------------- + # Video player behavior + # ----------------------------- + + ## + ## This option controls the value of the HTML5 <video> element's + ## "preload" attribute. + ## + ## If set to 'false', no video data will be loaded until the user + ## explicitly starts the video by clicking the "Play" button. + ## If set to 'true', the web browser will buffer some video data + ## while the page is loading. + ## + ## See: https://www.w3schools.com/tags/att_video_preload.asp + ## + ## Accepted values: true, false + ## Default: true + ## + #preload: true + + ## + ## Automatically play videos on page load. + ## + ## Accepted values: true, false + ## Default: false + ## + #autoplay: false + + ## + ## Automatically load the "next" video (either next in + ## playlist or proposed) when the current video ends. + ## + ## Accepted values: true, false + ## Default: false + ## + #continue: false + + ## + ## Autoplay next video by default. + ## + ## Note: Only effective if 'continue' is set to true. + ## + ## Accepted values: true, false + ## Default: true + ## + #continue_autoplay: true + + ## + ## Play videos in Audio-only mode by default. + ## + ## Accepted values: true, false + ## Default: false + ## + #listen: false + + ## + ## Loop videos automatically. + ## + ## Accepted values: true, false + ## Default: false + ## + #video_loop: false + + + # ----------------------------- + # Video playback settings + # ----------------------------- + + ## + ## Default video quality. + ## + ## Accepted values: dash, hd720, medium, small + ## Default: hd720 + ## + #quality: hd720 + + ## + ## Default dash video quality. + ## + ## Note: this setting only takes effet if the + ## 'quality' parameter is set to "dash". + ## + ## Accepted values: + ## auto, best, 4320p, 2160p, 1440p, 1080p, + ## 720p, 480p, 360p, 240p, 144p, worst + ## Default: auto + ## + #quality_dash: auto + + ## + ## Default video playback speed. + ## + ## Accepted values: 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0 + ## Default: 1.0 + ## + #speed: 1.0 + + ## + ## Default volume. + ## + ## Accepted values: 0-100 + ## Default: 100 + ## + #volume: 100 + + ## + ## Allow 360° videos to be played. + ## + ## Note: This feature requires a WebGL-enabled browser. + ## + ## Accepted values: true, false + ## Default: true + ## + #vr_mode: true + + ## + ## Save the playback position + ## Allow to continue watching at the previous position when + ## watching the same video. + ## + ## Accepted values: true, false + ## Default: false + ## + #save_player_pos: false + + # ----------------------------- + # Subscription feed + # ----------------------------- + + ## + ## In the "Subscription" feed, only show the latest video + ## of each channel the user is subscribed to. + ## + ## Note: when combined with 'unseen_only', the latest unseen + ## video of each channel will be displayed instead of the + ## latest by date. + ## + ## Accepted values: true, false + ## Default: false + ## + #latest_only: false + + ## + ## Enable/Disable user subscriptions desktop notifications. + ## + ## Accepted values: true, false + ## Default: false + ## + #notifications_only: false + + ## + ## In the "Subscription" feed, Only show the videos that the + ## user haven't watched yet (i.e which are not in their watch + ## history). + ## + ## Accepted values: true, false + ## Default: false + ## + #unseen_only: false + + ## + ## Default sorting parameter for subscription feeds. + ## + ## Accepted values: + ## 'alphabetically' + ## 'alphabetically - reverse' + ## 'channel name' + ## 'channel name - reverse' + ## 'published' + ## 'published - reverse' + ## + ## Default: published + ## + #sort: published + + + # ----------------------------- + # Miscellaneous + # ----------------------------- + + ## + ## Proxy videos through instance by default. + ## + ## Warning: As most users won't change this setting in their + ## preferences, defaulting to true will significantly + ## increase the instance's network usage, so make sure that + ## your server's connection can handle it. + ## + ## Accepted values: true, false + ## Default: false + ## + #local: false + + ## + ## Show the connected user's nick at the top right. + ## + ## Accepted values: true, false + ## Default: true + ## + #show_nick: true + + ## + ## Automatically redirect to a random instance when the user uses + ## any "switch invidious instance" link (For videos, it's the plane + ## icon, next to "watch on youtube" and "listen"). When set to false, + ## the user is sent to https://redirect.invidious.io instead, where + ## they can manually select an instance. + ## + ## Accepted values: true, false + ## Default: false + ## + #automatic_instance_redirect: false + + ## + ## Show the entire video description by default (when set to 'false', + ## only the first few lines of the description are shown and a + ## "show more" button allows to expand it). + ## + ## Accepted values: true, false + ## Default: false + ## + #extend_desc: false diff --git a/config/migrate-scripts/migrate-db-17cf077.sh b/config/migrate-scripts/migrate-db-17cf077.sh index 5e5bb214..1597311d 100755 --- a/config/migrate-scripts/migrate-db-17cf077.sh +++ b/config/migrate-scripts/migrate-db-17cf077.sh @@ -1,4 +1,7 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE channels ADD COLUMN subscribed bool;" -psql invidious kemal -c "UPDATE channels SET subscribed = false;" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channels ADD COLUMN subscribed bool;" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channels SET subscribed = false;" diff --git a/config/migrate-scripts/migrate-db-1c8075c.sh b/config/migrate-scripts/migrate-db-1c8075c.sh index 63954397..b6f7b89c 100755 --- a/config/migrate-scripts/migrate-db-1c8075c.sh +++ b/config/migrate-scripts/migrate-db-1c8075c.sh @@ -1,7 +1,10 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE channel_videos DROP COLUMN live_now CASCADE" -psql invidious kemal -c "ALTER TABLE channel_videos DROP COLUMN premiere_timestamp CASCADE" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious -psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN live_now bool" -psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos DROP COLUMN live_now CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos DROP COLUMN premiere_timestamp CASCADE" + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN live_now bool" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz" diff --git a/config/migrate-scripts/migrate-db-1eca969.sh b/config/migrate-scripts/migrate-db-1eca969.sh index f840d924..770a76d3 100755 --- a/config/migrate-scripts/migrate-db-1eca969.sh +++ b/config/migrate-scripts/migrate-db-1eca969.sh @@ -1,19 +1,22 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN title CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN views CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN likes CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN dislikes CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN wilson_score CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN published CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN description CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN language CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN author CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN ucid CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN allowed_regions CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN is_family_friendly CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN genre CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN genre_url CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN license CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN sub_count_text CASCADE" -psql invidious kemal -c "ALTER TABLE videos DROP COLUMN author_thumbnail CASCADE" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN title CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN views CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN likes CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN dislikes CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN wilson_score CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN published CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN description CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN language CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN author CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN ucid CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN allowed_regions CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN is_family_friendly CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN genre CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN genre_url CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN license CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN sub_count_text CASCADE" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN author_thumbnail CASCADE" diff --git a/config/migrate-scripts/migrate-db-30e6d29.sh b/config/migrate-scripts/migrate-db-30e6d29.sh index 3a377461..9d0b2d30 100755 --- a/config/migrate-scripts/migrate-db-30e6d29.sh +++ b/config/migrate-scripts/migrate-db-30e6d29.sh @@ -1,4 +1,7 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE channels ADD COLUMN deleted bool;" -psql invidious kemal -c "UPDATE channels SET deleted = false;" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channels ADD COLUMN deleted bool;" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channels SET deleted = false;" diff --git a/config/migrate-scripts/migrate-db-3646395.sh b/config/migrate-scripts/migrate-db-3646395.sh index 830b85f2..b6efe239 100755 --- a/config/migrate-scripts/migrate-db-3646395.sh +++ b/config/migrate-scripts/migrate-db-3646395.sh @@ -1,5 +1,8 @@ #!/bin/sh -psql invidious kemal < config/sql/session_ids.sql -psql invidious kemal -c "INSERT INTO session_ids (SELECT unnest(id), email, CURRENT_TIMESTAMP FROM users) ON CONFLICT (id) DO NOTHING" -psql invidious kemal -c "ALTER TABLE users DROP COLUMN id" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" < config/sql/session_ids.sql +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "INSERT INTO session_ids (SELECT unnest(id), email, CURRENT_TIMESTAMP FROM users) ON CONFLICT (id) DO NOTHING" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE users DROP COLUMN id" diff --git a/config/migrate-scripts/migrate-db-3bcb98e.sh b/config/migrate-scripts/migrate-db-3bcb98e.sh index cb9fa6ab..444f65ed 100755 --- a/config/migrate-scripts/migrate-db-3bcb98e.sh +++ b/config/migrate-scripts/migrate-db-3bcb98e.sh @@ -1,3 +1,6 @@ #!/bin/sh -psql invidious kemal < config/sql/annotations.sql +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" < config/sql/annotations.sql diff --git a/config/migrate-scripts/migrate-db-52cb239.sh b/config/migrate-scripts/migrate-db-52cb239.sh index db8efeab..da977d97 100755 --- a/config/migrate-scripts/migrate-db-52cb239.sh +++ b/config/migrate-scripts/migrate-db-52cb239.sh @@ -1,3 +1,6 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN views bigint;" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN views bigint;" diff --git a/config/migrate-scripts/migrate-db-6e51189.sh b/config/migrate-scripts/migrate-db-6e51189.sh index ce728118..9132d3d7 100755 --- a/config/migrate-scripts/migrate-db-6e51189.sh +++ b/config/migrate-scripts/migrate-db-6e51189.sh @@ -1,4 +1,7 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN live_now bool;" -psql invidious kemal -c "UPDATE channel_videos SET live_now = false;" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN live_now bool;" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channel_videos SET live_now = false;" diff --git a/config/migrate-scripts/migrate-db-701b5ea.sh b/config/migrate-scripts/migrate-db-701b5ea.sh index 429531a2..46d60c00 100755 --- a/config/migrate-scripts/migrate-db-701b5ea.sh +++ b/config/migrate-scripts/migrate-db-701b5ea.sh @@ -1,3 +1,6 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE users ADD COLUMN feed_needs_update boolean" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE users ADD COLUMN feed_needs_update boolean" diff --git a/config/migrate-scripts/migrate-db-88b7097.sh b/config/migrate-scripts/migrate-db-88b7097.sh index 6bde8399..146ee92d 100755 --- a/config/migrate-scripts/migrate-db-88b7097.sh +++ b/config/migrate-scripts/migrate-db-88b7097.sh @@ -1,3 +1,6 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz;" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz;" diff --git a/config/migrate-scripts/migrate-db-8e884fe.sh b/config/migrate-scripts/migrate-db-8e884fe.sh index 1c8dafd1..0d5de828 100755 --- a/config/migrate-scripts/migrate-db-8e884fe.sh +++ b/config/migrate-scripts/migrate-db-8e884fe.sh @@ -1,5 +1,8 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE channels DROP COLUMN subscribed" -psql invidious kemal -c "ALTER TABLE channels ADD COLUMN subscribed timestamptz" -psql invidious kemal -c "UPDATE channels SET subscribed = '2019-01-01 00:00:00+00'" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channels DROP COLUMN subscribed" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channels ADD COLUMN subscribed timestamptz" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channels SET subscribed = '2019-01-01 00:00:00+00'" diff --git a/config/sql/annotations.sql b/config/sql/annotations.sql index 4ea077e7..3705829d 100644 --- a/config/sql/annotations.sql +++ b/config/sql/annotations.sql @@ -2,11 +2,11 @@ -- DROP TABLE public.annotations; -CREATE TABLE public.annotations +CREATE TABLE IF NOT EXISTS public.annotations ( id text NOT NULL, annotations xml, CONSTRAINT annotations_id_key UNIQUE (id) ); -GRANT ALL ON TABLE public.annotations TO kemal; +GRANT ALL ON TABLE public.annotations TO current_user; diff --git a/config/sql/channel_videos.sql b/config/sql/channel_videos.sql index cec57cd4..cd4e0ffd 100644 --- a/config/sql/channel_videos.sql +++ b/config/sql/channel_videos.sql @@ -2,7 +2,7 @@ -- DROP TABLE public.channel_videos; -CREATE TABLE public.channel_videos +CREATE TABLE IF NOT EXISTS public.channel_videos ( id text NOT NULL, title text, @@ -17,13 +17,13 @@ CREATE TABLE public.channel_videos CONSTRAINT channel_videos_id_key UNIQUE (id) ); -GRANT ALL ON TABLE public.channel_videos TO kemal; +GRANT ALL ON TABLE public.channel_videos TO current_user; -- Index: public.channel_videos_ucid_idx -- DROP INDEX public.channel_videos_ucid_idx; -CREATE INDEX channel_videos_ucid_idx +CREATE INDEX IF NOT EXISTS channel_videos_ucid_idx ON public.channel_videos USING btree (ucid COLLATE pg_catalog."default"); diff --git a/config/sql/channels.sql b/config/sql/channels.sql index b5a29b8f..55772da6 100644 --- a/config/sql/channels.sql +++ b/config/sql/channels.sql @@ -2,7 +2,7 @@ -- DROP TABLE public.channels; -CREATE TABLE public.channels +CREATE TABLE IF NOT EXISTS public.channels ( id text NOT NULL, author text, @@ -12,13 +12,13 @@ CREATE TABLE public.channels CONSTRAINT channels_id_key UNIQUE (id) ); -GRANT ALL ON TABLE public.channels TO kemal; +GRANT ALL ON TABLE public.channels TO current_user; -- Index: public.channels_id_idx -- DROP INDEX public.channels_id_idx; -CREATE INDEX channels_id_idx +CREATE INDEX IF NOT EXISTS channels_id_idx ON public.channels USING btree (id COLLATE pg_catalog."default"); diff --git a/config/sql/nonces.sql b/config/sql/nonces.sql index 7b8ce9f2..644ac32a 100644 --- a/config/sql/nonces.sql +++ b/config/sql/nonces.sql @@ -2,20 +2,20 @@ -- DROP TABLE public.nonces; -CREATE TABLE public.nonces +CREATE TABLE IF NOT EXISTS public.nonces ( nonce text, expire timestamp with time zone, CONSTRAINT nonces_id_key UNIQUE (nonce) ); -GRANT ALL ON TABLE public.nonces TO kemal; +GRANT ALL ON TABLE public.nonces TO current_user; -- Index: public.nonces_nonce_idx -- DROP INDEX public.nonces_nonce_idx; -CREATE INDEX nonces_nonce_idx +CREATE INDEX IF NOT EXISTS nonces_nonce_idx ON public.nonces USING btree (nonce COLLATE pg_catalog."default"); diff --git a/config/sql/playlist_videos.sql b/config/sql/playlist_videos.sql index b2b8d5c4..4b48b46a 100644 --- a/config/sql/playlist_videos.sql +++ b/config/sql/playlist_videos.sql @@ -2,7 +2,7 @@ -- DROP TABLE public.playlist_videos; -CREATE TABLE playlist_videos +CREATE TABLE IF NOT EXISTS public.playlist_videos ( title text, id text, @@ -16,4 +16,4 @@ CREATE TABLE playlist_videos PRIMARY KEY (index,plid) ); -GRANT ALL ON TABLE public.playlist_videos TO kemal; +GRANT ALL ON TABLE public.playlist_videos TO current_user; diff --git a/config/sql/playlists.sql b/config/sql/playlists.sql index 468496cb..83efce48 100644 --- a/config/sql/playlists.sql +++ b/config/sql/playlists.sql @@ -13,7 +13,7 @@ CREATE TYPE public.privacy AS ENUM -- DROP TABLE public.playlists; -CREATE TABLE public.playlists +CREATE TABLE IF NOT EXISTS public.playlists ( title text, id text primary key, @@ -26,4 +26,4 @@ CREATE TABLE public.playlists index int8[] ); -GRANT ALL ON public.playlists TO kemal; +GRANT ALL ON public.playlists TO current_user; diff --git a/config/sql/session_ids.sql b/config/sql/session_ids.sql index afbabb67..c493769a 100644 --- a/config/sql/session_ids.sql +++ b/config/sql/session_ids.sql @@ -2,7 +2,7 @@ -- DROP TABLE public.session_ids; -CREATE TABLE public.session_ids +CREATE TABLE IF NOT EXISTS public.session_ids ( id text NOT NULL, email text, @@ -10,13 +10,13 @@ CREATE TABLE public.session_ids CONSTRAINT session_ids_pkey PRIMARY KEY (id) ); -GRANT ALL ON TABLE public.session_ids TO kemal; +GRANT ALL ON TABLE public.session_ids TO current_user; -- Index: public.session_ids_id_idx -- DROP INDEX public.session_ids_id_idx; -CREATE INDEX session_ids_id_idx +CREATE INDEX IF NOT EXISTS session_ids_id_idx ON public.session_ids USING btree (id COLLATE pg_catalog."default"); diff --git a/config/sql/users.sql b/config/sql/users.sql index 0f2cdba2..ad002ec2 100644 --- a/config/sql/users.sql +++ b/config/sql/users.sql @@ -2,7 +2,7 @@ -- DROP TABLE public.users; -CREATE TABLE public.users +CREATE TABLE IF NOT EXISTS public.users ( updated timestamp with time zone, notifications text[], @@ -16,13 +16,13 @@ CREATE TABLE public.users CONSTRAINT users_email_key UNIQUE (email) ); -GRANT ALL ON TABLE public.users TO kemal; +GRANT ALL ON TABLE public.users TO current_user; -- Index: public.email_unique_idx -- DROP INDEX public.email_unique_idx; -CREATE UNIQUE INDEX email_unique_idx +CREATE UNIQUE INDEX IF NOT EXISTS email_unique_idx ON public.users USING btree (lower(email) COLLATE pg_catalog."default"); diff --git a/config/sql/videos.sql b/config/sql/videos.sql index 8def2f83..55da3967 100644 --- a/config/sql/videos.sql +++ b/config/sql/videos.sql @@ -2,7 +2,7 @@ -- DROP TABLE public.videos; -CREATE TABLE public.videos +CREATE UNLOGGED TABLE IF NOT EXISTS public.videos ( id text NOT NULL, info text, @@ -10,13 +10,13 @@ CREATE TABLE public.videos CONSTRAINT videos_pkey PRIMARY KEY (id) ); -GRANT ALL ON TABLE public.videos TO kemal; +GRANT ALL ON TABLE public.videos TO current_user; -- Index: public.id_idx -- DROP INDEX public.id_idx; -CREATE UNIQUE INDEX id_idx +CREATE UNIQUE INDEX IF NOT EXISTS id_idx ON public.videos USING btree (id COLLATE pg_catalog."default"); |
