Bad default location for REPORTS_ROOT
bdlamprecht opened this issue · comments
Current Behavior
Due to the way your current implementation references configuration files located in /etc/netbox/
instead of /opt/netbox/netbox/netbox/
, when you browse to http://localhost/extras/reports/
, the following is seen:
Yes, I know this can be changed in the netbox.env
by setting a value for REPORTS_ROOT
, however, in my opinion, this "default" is not a good idea. I don't believe anyone is going to use the /etc/reports
location to store custom python scripts specific to NetBox.
I'd like to propose using /etc/netbox/reports/
as an alternative, but I didn't want to go through the hassle of creating a PR if it wasn't going to be merged.
What are your thoughts one way or the other?
Expected Behavior
N/A
Debug Information
N/A
You're right, /etc/reports
is a bad location for the reports. IMO this happened when we moved the 'main' configuration file to /etc/netbox
and BASE_DIR
now expands to /etc
rather than /opt/netbox/netbox
.
I agree that /etc/netbox/reports
would be a good location. But I want to make sure this works out when using a configuration managed by Kubernetes/OpenShift. And I'm not entirely sure it does in a nice way.
IMO the nice way would be to have two separate ConfigMaps, one for reports and one for configuration. And when the one for configuration is mapped to /etc/netbox
, I'm not sure if we can map the one for reports to /etc/netbox/reports
.
So the main configuration might have to be moved to somewhere else, e.g. /etc/netbox/config
, so that config and reports can co-exist.
Or am I over-complicating matters and it's fine to have one ConfigMap for config and reports?
I'd love to hear your opinion on this, and @tobiasge's as well, as he initially suggested to move the configuration to /etc/netbox
.
Hello,
at the moment we're not using reports but I also think /etc/netbox/reports
would be a good location for that. But you're right. You can't map to /etc/netbox/reports
when the configuration is mapped to /etc/netbox
in Openshift.
So the proposal with mapping to /etc/netbox/config
and /etc/netbox/reports
is a good solution.
I won't be able to implement this now because I'm on holiday for the next weeks. If this can wait I will do the implementation.
@flipkill1985 Could you test this in our deployment?
@tobiasge Have you had the chance to look into this? Would one ConfigMap for config and reports be fine or do you think they should better be separated?
Hello,
I'm back now. I think it would be better to have them separated. This makes it possible for the user to also define a persistent volume in Openshift.