mirror of
https://github.com/iv-org/invidious.git
synced 2025-05-30 11:54:17 -04:00
Merge pull request #61 from catspeed-cc/dev-uptime-status
Merge: dev-uptime-status into development
This commit is contained in:
commit
ce96413f8e
7 changed files with 45 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
1
|
||||
*~
|
||||
/docs/
|
||||
/dev/
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
- add redis patch
|
||||
- add proxy patch
|
||||
- sig helper reconnect patch
|
||||
- uptime status patch (mooleshacat)
|
||||
- token monitor patch (mooleshacat)
|
||||
|
||||
**User features**
|
||||
|
@ -168,6 +169,11 @@ This branch has the token monitor patch from myself (mooleshacat) which will che
|
|||
This patch is a temporary workaround until inv_sig_helper itself can get the tokens for us. unixfox (invidious dev) raised this idea to techmetx11 (inv_sig_helper dev) and they are working on an implementation that will eventually make this patch useless. This is OK, as it is only a patch and that setup would be better performance wise than my current implementations. You can read about it here https://github.com/iv-org/inv_sig_helper/issues/10
|
||||
|
||||
|
||||
## uptime status patch
|
||||
|
||||
This fork has the uptime patch made by myself (mooleshacat) which if enabled in the config, will show the uptime on the page. Please note, if everyone can see your uptime, so could a theoretical attacker. This may or may not be a good idea, you be the judge.
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
The full documentation can be accessed online at https://docs.invidious.io/
|
||||
|
|
|
@ -238,6 +238,14 @@ http_proxy:
|
|||
# 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.
|
||||
##
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
require "digest/md5"
|
||||
require "file_utils"
|
||||
require "process"
|
||||
|
||||
# Require kemal, kilt, then our own overrides
|
||||
require "kemal"
|
||||
|
|
|
@ -102,6 +102,7 @@ class Config
|
|||
# Subscribe to channels using PubSubHubbub (requires domain, hmac_key)
|
||||
property use_pubsub_feeds : Bool | Int32 = false
|
||||
property popular_enabled : Bool = true
|
||||
property uptime_enabled : Bool = false
|
||||
property captcha_enabled : Bool = true
|
||||
property login_enabled : Bool = true
|
||||
property registration_enabled : Bool = true
|
||||
|
|
23
src/invidious/helpers/uptime.cr
Normal file
23
src/invidious/helpers/uptime.cr
Normal file
|
@ -0,0 +1,23 @@
|
|||
class Invidious::Uptime
|
||||
|
||||
def self.get_uptime
|
||||
|
||||
str_uptime = "error"
|
||||
|
||||
if CONFIG.uptime_enabled
|
||||
|
||||
# get the uptime
|
||||
uptime_cmd = "/usr/bin/uptime"
|
||||
uptime_args = "-p"
|
||||
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
|
||||
|
||||
end
|
||||
|
||||
end
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue