loadavg initial commit

This commit is contained in:
mooleshacat 2024-10-21 23:29:11 -04:00
parent ce8ca89def
commit c621fd04df
No known key found for this signature in database
GPG Key ID: 89DDFF5BD326A1B9
4 changed files with 16 additions and 2 deletions

View File

@ -78,6 +78,7 @@
- add proxy patch - add proxy patch
- sig helper reconnect patch - sig helper reconnect patch
- uptime status patch (mooleshacat) - uptime status patch (mooleshacat)
- loadavg status patch (mooleshacat)
- token monitor patch (mooleshacat) - token monitor patch (mooleshacat)
**User features** **User features**
@ -169,9 +170,9 @@ 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 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 notes ## uptime & loadavg status patch notes
This branch has the uptime patch from 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. This branch has the uptime & loadavg patch from myself (mooleshacat) which if enabled in the config, will show the uptime and/or loadavg on the page. Please note, if everyone can see your uptime or loadavg, so could a theoretical attacker. This may or may not be a good idea, you be the judge.
## Documentation ## Documentation

View File

@ -246,6 +246,14 @@ http_proxy:
## ##
#uptime_enabled: true #uptime_enabled: true
##
## Enable/Disable showing the load avg on the main page.
##
## Accepted values: true, false
## Default: false
##
#loadavg_enabled: true
## ##
## Enable/Disable the "Popular" tab on the main page. ## Enable/Disable the "Popular" tab on the main page.
## ##

View File

@ -103,6 +103,7 @@ class Config
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 uptime_enabled : Bool = false
property loadavg_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

View File

@ -2,6 +2,7 @@
locale = env.get("preferences").as(Preferences).locale locale = env.get("preferences").as(Preferences).locale
dark_mode = env.get("preferences").as(Preferences).dark_mode dark_mode = env.get("preferences").as(Preferences).dark_mode
uptime_enabled = CONFIG.uptime_enabled uptime_enabled = CONFIG.uptime_enabled
loadavg_enabled = CONFIG.loadavg_enabled
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<%= locale %>"> <html lang="<%= locale %>">
@ -38,6 +39,9 @@
<% if uptime_enabled %> <% if uptime_enabled %>
<tr><td style="text-align: center; vertical-align: middle;"><font style="font-size: 10px;color:#c3c3c3;">server <%= Invidious::Uptime.get_uptime %></font></td></tr> <tr><td style="text-align: center; vertical-align: middle;"><font style="font-size: 10px;color:#c3c3c3;">server <%= Invidious::Uptime.get_uptime %></font></td></tr>
<% end %> <% end %>
<% if loadavg_enabled %>
<tr><td style="text-align: center; vertical-align: middle;"><font style="font-size: 10px;color:#c3c3c3;">server <%= Invidious::Loadavg.get_loadavg %></font></td></tr>
<% end %>
</table> </table>
</div> </div>
<div class="pure-u-1 pure-u-md-12-24 searchbar"> <div class="pure-u-1 pure-u-md-12-24 searchbar">