Default darkmode (non persistent browser)

ExoNos

New Member
May 6, 2024
8
1
3
Hi,

I dont run browser persistance so having the defaults run as i want them is important to me, I got sick of manually toggling dark mode every time so i did this:

  1. Open console
  2. sudo cp /usr/share/pve-manager/index.html.tpl /usr/share/pve-manager/index.html.tpl.bkup
  3. sudo nano /usr/share/pve-manager/index.html.tpl
  4. Remove every thing after:
<link rel="stylesheet" type="text/css" href="/pve2/css/ext6-pve.css?ver=[% version %]" />
<link rel="stylesheet" type="text/css" href="/pwt/css/ext6-pmx.css?ver=[% wtversion %]" />
But before this:​
[% IF langfile %]
<script type='text/javascript' src='/pve2/locale/pve-lang-[% lang %].js?ver=[% version %]'></script>

4. Then insert this:

[%- IF theme != 'crisp' %]
[%- IF theme == 'auto' %]
<link rel="stylesheet" type="text/css" href="/pwt/themes/theme-proxmox-dark.css?ver=[% wtversion %]" />
[%- ELSE %]
<link rel="stylesheet" type="text/css" href="/pwt/themes/theme-[% theme %].css?ver=[% wtversion %]" />
[%- END -%]
[%- END -%]

It works and allows you to also select light mode if needed...

Note: im not a developer all i care is that it works, is there probably more elegant better ways, i assume so, Im posting this here because i embarrassingly wasted half a day bashing around trying to figure this out so if i can save some one else the trouble cool.


 
  • Like
Reactions: chrcoluk
I dont run browser persistance so having the defaults run as i want them is important to me, I got sick of manually toggling dark mode every time so i did this:
Your solution will probably reset if the respective file or package gets updated. The easier way to do this, is to set your browser (and/or maybe OS) to always prefer dark mode. The UI should respect that by default, so you don't need to modify Proxmox VE at all.

Firefox has this setting under “General > Language & Appearance > Website appearance”.
Chrome has a similar setting under “Appearance > Mode”.

Depending on what browser you are using, you can set these options and still have ephemeral sessions (meaning that cookies and caches are cleaned after you close the browser).
 
  • Like
Reactions: gfngfn256
Hi,
Thanks.
Im not sure why it doesnt pick up my browsers preferences, prehaps its the no scripts plugin, or the Arkenfox user.js antifingerprinting stuff but yeah I guess I`ll just have to keep reapplying haha.
 
prehaps its the no scripts plugin, or the Arkenfox user.js antifingerprinting stuff but yeah I guess I`ll just have to keep reapplying haha.
LibreWolf also blocks websites from this information for that reason. Maybe install a separate browser that you only use for Proxmox web GUI (by setting the proxy to 127.0.0.1, except for the Proxmox host, to block all other traffic)? Or maybe do your regular browsing (with anti-fingerprint and no-script etc.) in a VM for extra protection?
 
Depending on your setup, you could also just try to disable those protections for your Proxmox VE host. Unless you can't trust the person running the instance (in which case, why can you edit files /usr/share?) there should not be much of a privacy concern there. We don't do any telemetry (though, I think Ceph does for crash reports and such, but browser-based protections don't opt you out from them either so) or similar, and you can audit the code if you don't trust us, so yeah.
 
LibreWolf also blocks websites from this information for that reason. Maybe install a separate browser that you only use for Proxmox web GUI (by setting the proxy to 127.0.0.1, except for the Proxmox host, to block all other traffic)? Or maybe do your regular browsing (with anti-fingerprint and no-script etc.) in a VM for extra protection?
That makes sense, i hadnt actually considered just changing browsers :) I`d like to set up a chromium x11 forwarding docker container, and shift to a predominately console based main client running xorg and xinit, only to view the browser remotely using ssh x11 forwarding... im not sure whether it will be a good user experience or not but id like to give it a go.
Depending on your setup, you could also just try to disable those protections for your Proxmox VE host. Unless you can't trust the person running the instance (in which case, why can you edit files /usr/share?) there should not be much of a privacy concern there. We don't do any telemetry (though, I think Ceph does for crash reports and such, but browser-based protections don't opt you out from them either so) or similar, and you can audit the code if you don't trust us, so yeah.
Absolutely, another simple and direct approach i hadnt considered haha, and nope certainly no privacy concern there, i prefer having granular control over what runs in the browser hence the noscripts.
 
Last edited: