If you re-org the logic this way, it seems to work as expected. 

Try to auth first, if you fail auth then fall back to the allow_unauth_graphs. 

include($config['html_dir'] . "/includes/authenticate.inc.php");
$auth = $_SESSION['authenticated'];

if (!$auth && isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs']) {
    $auth = TRUE; // hardcode auth for all with config function
    print_debug('Authentication bypassed by $config[\'allow_unauth_graphs\'].');
} elseif (!$auth && isset($config['allow_unauth_graphs_cidr']) && count($config['allow_unauth_graphs_cidr'])) {
    //if (match_network($_SERVER['REMOTE_ADDR'], $config['allow_unauth_graphs_cidr']))
    if (match_network(get_remote_addr($config['web_session_ip_by_header']), $config['allow_unauth_graphs_cidr'])) {
        $auth = TRUE; // hardcode authenticated for matched subnet
        print_debug("Authentication by matched CIDR.");
    }
}

if (!isset($_SESSION['userlevel']) && $auth) {
    $_SESSION['userlevel'] = 7; // Set global read for session when $auth hardcoded


From: Milton Ngan via observium <observium@lists.observium.org>
Sent: Friday, February 16, 2024 9:03:04 AM
To: Observium
Cc: Adam Armstrong; Milton Ngan
Subject: [Observium] Re: dark ui image legend legibility
 

The problem is related to allowing unauthenticated graph access. This stops the session getting set up properly if you are logged in. 


If I comment this out, it works. 


$config['allow_unauth_graphs']      = TRUE;
$config['allow_unauth_graphs_cidr'] = array("172.16.0.0/12", "10.0.0.0/8", "192.168.0.0/16");


From: Adam Armstrong via observium <observium@lists.observium.org>
Sent: Wednesday, February 14, 2024 9:53:47 AM
To: observium@lists.observium.org
Cc: Adam Armstrong
Subject: [Observium] Re: dark ui image legend legibility
 
we tried.

Wolf Noble via observium wrote on 2024-02-14 17:46:


I'm sure they'd appreciate help unbreaking them then, rather than just being blamed as the problem :P 

fwiw, the TKL image doesn't use nginx; but apache, so that's not likely the ultimate culprit


[= The contents of this message have been Written, Read, Processed, Misspelled, Erased, Sorted, Rewritten, Sniffed, Compressed, Overcompensated, Lost, Found, Altered, Inspected, Certified, and, most importantly delivered ENTIRELY with recycled electrons =]

On Feb 14, 2024, at 11:39, Adam Armstrong via observium <observium@lists.observium.org> wrote:

 These are probably both caused by some broken session handling in that case, I'd expect.

I don't use nginx or fpm, though turnkey is quite infamous at this point for producing needlessly broken Observium images. :D

adam.

Milton Ngan via observium wrote on 2024-02-14 15:42:
i am running this with NGINX and fpm-php since this makes observium easier to run in docker served from a single NGINX instance on the host together with other containerized apps i am running



Sent from my iPad

On Feb 14, 2024, at 7:37 AM, Wolf Noble <loiosh@wolfspaw.com> wrote:

 I’m running this on the turnkeylinux lxc for observium; so will report back once they update their base image for the observium variant from 17->18 which should be “soon”

[= The contents of this message have been written, read, processed, erased, sorted, sniffed, compressed, rewritten, misspelled, overcompensated, lost, found, and most importantly delivered entirely with recycled electrons =]

On Feb 14, 2024, at 09:21, Milton Ngan via observium <observium@lists.observium.org> wrote:

 Adam, which linux distribution and version are you using to develop on? I am building a docker container to run this in so I can try to replicate your execution environment. The docker image uses a clean SVN checkout so i shouldn’t have any crud from previous checkouts. 

It could be something is stomping on the cli options after they have been displayed in the UI. The rendered image looks like what you would get in Light mode. I get the same result using Dark and Dark Blue mode. I might put in a wrapper around rrdtool to log what options are actually being passed in 


Sent from my iPad

On Feb 14, 2024, at 6:03 AM, Adam Armstrong via observium <observium@lists.observium.org> wrote:

 Well that's two of you.

I can't replicate this though, so I have no idea why it's happening.

If you both list everything relevant about your installs (versions, dark/light variant, etc), something might be obvious.

adam.


Wolf Noble wrote on 2024-02-14 05:59:
OMG YAY! i’m not crazy!
….. well… perhaps that’s a bit too far. :)
but at least i’m not the only person experiencing this rather odd behavior.



[= The contents of this message have been written, read, processed, erased, sorted, sniffed, compressed, rewritten, misspelled, overcompensated, lost, found, and most importantly delivered entirely with recycled electrons =]

On Feb 13, 2024, at 23:17, Milton Ngan <milton@valvesoftware.com> wrote:



I am seeing a similar issue. I played around with changing the colors and no matter what I set, I always get the same transparent graph with black text regardless of what color options are set. However, when I run the command on the CLI I get an image that looks like what I would expect.  


Our set up is running on Ubuntu 20.04 with rrdtool 1.7.2, and


From CLI

<yVz9aBNpnEKLcZwJ-cli.png>


>From Observium
<Zr0HKe5ctuMq0Wiq-web.png>


CLI Command:


/usr/bin/rrdtool graph --daemon observium-host /tmp/yVz9aBNpnEKLcZwJ.png -Y --alt-autoscale --rigid -c BACK#00000000 -c SHADEA#00000000 -c SHADEB#00000000 -c FONT#CCCCCC -c CANVAS#00000000 -c GRID#ffffff00 -c MGRID#ffffff10 -c FRAME#CCCCCC -c AXIS#BBBBBB -c ARROW#BBBBBB -R normal --font LEGEND:8:'DroidSansMono,DejaVuSansMono' --font AXIS:7:'DroidSansMono,DejaVuSansMono' --font-render-mode normal --dynamic-labels -E COMMENT:'Bits/s Last Avg Max 95th \n' DEF:outoctets=switch/port-558.rrd:OUTOCTETS:AVERAGE DEF:inoctets=switch/port-558.rrd:INOCTETS:AVERAGE DEF:outoctets_max=switch/port-558.rrd:OUTOCTETS:MAX DEF:inoctets_max=switch/port-558.rrd:INOCTETS:MAX CDEF:alloctets=outoctets,inoctets,+ CDEF:wrongin=alloctets,UN,INF,UNKN,IF CDEF:wrongout=wrongin,-1,* CDEF:octets=inoctets,outoctets,+ CDEF:doutoctets=outoctets,-1,* CDEF:outbits=outoctets,8,* CDEF:outbits_max=outoctets_max,8,* CDEF:doutoctets_max=outoctets_max,-1,* CDEF:doutbits=doutoctets,8,* CDEF:doutbits_max=doutoctets_max,8,* CDEF:inbits=inoctets,8,* CDEF:inbits_max=inoctets_max,8,* VDEF:totin=inoctets,TOTAL VDEF:totout=outoctets,TOTAL VDEF:tot=octets,TOTAL VDEF:95thin=inbits,95,PERCENT VDEF:95thout=outbits,95,PERCENT CDEF:pout_tmp=doutbits,-1,* VDEF:dpout_tmp=pout_tmp,95,PERCENT CDEF:dpout_tmp2=doutbits,doutbits,-,dpout_tmp,-1,*,+ VDEF:d95thout=dpout_tmp2,FIRST AREA:inbits#84BB5C LINE1.25:inbits#357F44:'In ' GPRINT:inbits:LAST:%6.2lf%s GPRINT:inbits:AVERAGE:%6.2lf%s GPRINT:inbits_max:MAX:%6.2lf%s GPRINT:95thin:%6.2lf%s COMMENT:\n AREA:doutbits#7394CB LINE1.25:doutbits#284C7F:'Out' GPRINT:outbits:LAST:%6.2lf%s GPRINT:outbits:AVERAGE:%6.2lf%s GPRINT:outbits_max:MAX:%6.2lf%s GPRINT:95thout:%6.2lf%s COMMENT:\n HRULE:95thin#aa0000 HRULE:d95thout#aa0000 GPRINT:tot:'Total %6.2lf%s' GPRINT:totin:'(In %6.2lf%s' GPRINT:totout:'Out %6.2lf%s)\l' AREA:wrongin#FF000020 AREA:wrongout#FF000020 --start 1707797737 --end 1707884137 --width 1158 --height 300


From: Adam Armstrong via observium <observium@lists.observium.org>
Sent: Thursday, January 11, 2024 11:46:21 AM
To: Observium; Wolf Noble via observium
Cc: Wolf Noble; Adam Armstrong
Subject: [Observium] Re: dark ui image legend legibility
 
I have no idea then.

Theme "mode" is set in index.php:

    if (!isset($_SESSION['mode']) || $_SESSION['mode'] != $config['themes'][$_SESSION['theme']]['type']) {
        $_SESSION['mode'] = $config['themes'][$_SESSION['theme']]['type'];
    }

I can't see a lot of scope for that not to work, especially since no one else has really reported it.

adam.


Wolf Noble via observium wrote on 2024-01-11 01:13:
heya Adam!



observium@whatsup:~$ svn up
Updating '.':
At revision 13253.
observium@whatsup:~$ svn status
?       .bash_history
?       .gnupg
?       .selected_editor
?       .subversion
?       .viminfo
?       devicedata.sh
?       graphs
?       hist
?       obs_agent.tar.gz
?       observium_agent_xinetd
M       scripts/observium_agent_xinetd
?       snmpwalk_aruba_ap.txt
?       wplGenClientTarball.sh
?       wplOpCache.php
?       wplUpdateObservium.sh
?       wpl_version
observium@whatsup:~$

Nothing particularly surprising here.... 

any suggestions?



Wolf Noble
Hoof & Paw
loiosh@wolfspaw.com

-=[ This message has been composed and transmitted with 100% recycled electrons ]=-

On Jan 9, 2024, at 15:03, Adam Armstrong via observium <observium@lists.observium.org> wrote:

These graphs should all have white text.

Do you have any local modifications?

What does "svn status" show?

adam.

Wolf Noble via observium wrote on 2024-01-04 21:05:
Hi Adam,

I'm referring to the datapoint name/value text in graphs, in case the descriptor 'legend' is being overloaded here and means something different to you, than to me ;)

see attached imagery for examples ;) 

is there something else I should check here? [yes, I know py2 is icky. working with tkl to get an updated observium appliance into their pipeline, as this one's somewhat old....



hope yer doing awesomely.
W


Wolf Noble
Hoof & Paw
loiosh@wolfspaw.com

-=[ This message has been composed and transmitted with 100% recycled electrons ]=-

On Jan 4, 2024, at 12:18, Adam Armstrong via observium <observium@lists.observium.org> wrote:

All my graphs have white legends.

Adam

Sent from my iPhone

On 4 Jan 2024, at 18:05, Wolf Noble via observium <observium@lists.observium.org> wrote:


Howdy, all!


is there some voodoo necessary to coerce observium to generate graphs with textual legends that aren't black when dark mode is active? it's kinda hard to view black text on dark blue backgrounds :)

I don't see an obvious knob for this, but it's entirely possible I'm just missing the "legend text color" or "make graph text legible in dark mode" or "learn to read" button somewhere :)

[= The contents of this message have been written, read, processed, erased, sorted, sniffed, compressed, rewritten, misspelled, overcompensated, lost, found, and most importantly delivered entirely with recycled electrons =]
_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org
_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org



_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org

_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org



_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org

<yVz9aBNpnEKLcZwJ-cli.png>
<Zr0HKe5ctuMq0Wiq-web.png>

_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org
_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org


_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org

_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org


_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org