[ixpmanager] integrating my own PHP page in IXP manager

Marco d'Itri md at Linux.IT
Mon Jan 20 22:48:52 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://www.inex.ie/pipermail/ixpmanager/attachments/20250120/f125ba06/attachment.sig>


More information about the ixpmanager mailing list