mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-17 10:58:31 +00:00
added config variable
This commit is contained in:
parent
e2d9e1aaf7
commit
cc4b3bf888
@ -238,6 +238,14 @@ http_proxy:
|
|||||||
# Features
|
# Features
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
|
||||||
|
##
|
||||||
|
## Enable/Disable showing the uptime on the main page.
|
||||||
|
##
|
||||||
|
## Accepted values: true, false
|
||||||
|
## Default: false
|
||||||
|
##
|
||||||
|
#uptime_enabled: true
|
||||||
|
|
||||||
##
|
##
|
||||||
## Enable/Disable the "Popular" tab on the main page.
|
## Enable/Disable the "Popular" tab on the main page.
|
||||||
##
|
##
|
||||||
|
@ -102,6 +102,7 @@ class Config
|
|||||||
# Subscribe to channels using PubSubHubbub (requires domain, hmac_key)
|
# Subscribe to channels using PubSubHubbub (requires domain, hmac_key)
|
||||||
property use_pubsub_feeds : Bool | Int32 = false
|
property use_pubsub_feeds : Bool | Int32 = false
|
||||||
property popular_enabled : Bool = true
|
property popular_enabled : Bool = true
|
||||||
|
property uptime_enabled : Bool = false
|
||||||
property captcha_enabled : Bool = true
|
property captcha_enabled : Bool = true
|
||||||
property login_enabled : Bool = true
|
property login_enabled : Bool = true
|
||||||
property registration_enabled : Bool = true
|
property registration_enabled : Bool = true
|
||||||
|
@ -1,15 +1,20 @@
|
|||||||
class Invidious::Uptime
|
class Invidious::Uptime
|
||||||
|
|
||||||
def self.get_uptime
|
def self.get_uptime
|
||||||
|
|
||||||
str_uptime = "error"
|
str_uptime = "error"
|
||||||
|
|
||||||
# get the uptime
|
if CONFIG.uptime_enabled
|
||||||
uptime_cmd = "/usr/bin/uptime"
|
|
||||||
uptime_args = "-p"
|
# get the uptime
|
||||||
process = Process.new(uptime_cmd, [uptime_args], output: Process::Redirect::Pipe)
|
uptime_cmd = "/usr/bin/uptime"
|
||||||
|
uptime_args = "-p"
|
||||||
str_uptime = process.output.gets_to_end
|
process = Process.new(uptime_cmd, [uptime_args], output: Process::Redirect::Pipe)
|
||||||
|
str_uptime = process.output.gets_to_end
|
||||||
|
|
||||||
|
else
|
||||||
|
str_uptime = ""
|
||||||
|
end
|
||||||
|
|
||||||
return str_uptime
|
return str_uptime
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user