[ixpmanager] integrating my own PHP page in IXP manager
Marco d'Itri
md at Linux.IT
Sun Jan 5 10:41:17 GMT 2025
I have successfully integrated p2p graphs from sflow_exporter in
a static content page. (I will release everything once the Javascript
part will have been cleaned up.)
The only wart is that I have also abused the same static content feature
to expose the proxy page which securely gets the data from Prometheus.
The issue here is that I cannot control the headers, e.g. to provide
a proper Content-Type.
The minimal reproducer is:
<?php
$user = Auth::getUser();
if (!$user) exit;
$shortname = $user->customer->shortname;
header('X-Test: foo');
echo "$shortname\n";
?>
I could put this page in public/ instead, but then I do not know what
needs to be loaded to be able to access Auth::getUser().
What is the correct way to integrate this kind of code in IXP manager?
(Hopefully without learning Laravel, because I would first need to learn
PHP developement then... All my PHP code is pure cargo cult programming
fueled by Google searches.)
--
ciao,
Marco
More information about the ixpmanager
mailing list