You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using the netbox-docker project for getting started with Netbox and Docker, and it's been great to get started with, but I believe the configuration/ directory right now is wearing too many hats in this repository, and it's causing a problem for me if I want to keep a local copy of this repository to do some work, and to be able to pull in new changes in the future, for example if future Netbox releases change something that requires changes to the docker-compose.
Currently the configuration/ directory seems to do three distinct things:
Hold the configuration/configuration.py file, who's goal is to load configuration provided by the users for environment variables, and should not be changed by the users.
Hold sample configuration files for some areas that cannot currently be configured by environment variables, that should be changed by the users.
Be the place that users need to put additional own configuration files to be included in the image.
This whole multiple-personality phenomenon of the configuration/ directory is reflected by the complicated .gitignore entries referring to the configuration directory:
The problem with the current approach is that it is a bit of a minefield for users, especially those not familiar with git.
One obvious place for users to start modify configuration files would be to edit the configuration/configuration.py file. But this is a bad idea, because the role of this file isn't actually to be a configuration file (contrary to what you'd think given its filename and path) but to actually load configuration from environment variables. And if anyone starts to edit the config in there anyway, they'll end up making their git working tree dirty. (Which is actually fine, because users aren't supposed to edit that file, unless they intend to improve loading of environment variables!)
I propose renaming this file to something like configuration/docker-env.py to make it less likely for someone to start looking in that file specifically, and more clearly signal its intent of being a mechanism to load configuration from the environment, and not configuration itself.
Second, the configuration sample files, such as config/plugins.py or config/logging.py, while well-intentioned, cause more harm than good if they're kept in the configuration/ directory and in version control. Anyone who edits these configuration files will end up with their changes making their tree dirty. In my opinion they do not belong in this repository at all, and instead this should just be handled by the documentation of the main Netbox project. If you do decide to keep them in, they could be renamed to something like whatever.py.sample or whatever_sample.py so that they could be easilly identified as sample files, and a single .gitignore line could match all these sample files. Another option would be to move out these sample configuration files into a seperate directory. Exactly what option is decided doesn't matter too much to me, my own preference is to nuke them entirely, but as long as they don't unduly pollute the namespace of configuration/, I'm fine with it.
The goal of this change is to be able for a user (such as myself) to keep a local copy of this repository unmodified, to keep anything that's specific to my environment outside the scope of that repo.
There's been some initial discussion on this in #1049, but I decided it's probably better to keep this as a discussion specifically focused on the configuration/ folder aspect, and ignoring the other stuff for now.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been using the netbox-docker project for getting started with Netbox and Docker, and it's been great to get started with, but I believe the
configuration/
directory right now is wearing too many hats in this repository, and it's causing a problem for me if I want to keep a local copy of this repository to do some work, and to be able to pull in new changes in the future, for example if future Netbox releases change something that requires changes to the docker-compose.Currently the
configuration/
directory seems to do three distinct things:configuration/configuration.py
file, who's goal is to load configuration provided by the users for environment variables, and should not be changed by the users.This whole multiple-personality phenomenon of the
configuration/
directory is reflected by the complicated.gitignore
entries referring to the configuration directory:The problem with the current approach is that it is a bit of a minefield for users, especially those not familiar with git.
One obvious place for users to start modify configuration files would be to edit the
configuration/configuration.py
file. But this is a bad idea, because the role of this file isn't actually to be a configuration file (contrary to what you'd think given its filename and path) but to actually load configuration from environment variables. And if anyone starts to edit the config in there anyway, they'll end up making their git working tree dirty. (Which is actually fine, because users aren't supposed to edit that file, unless they intend to improve loading of environment variables!)I propose renaming this file to something like
configuration/docker-env.py
to make it less likely for someone to start looking in that file specifically, and more clearly signal its intent of being a mechanism to load configuration from the environment, and not configuration itself.Second, the configuration sample files, such as
config/plugins.py
orconfig/logging.py
, while well-intentioned, cause more harm than good if they're kept in theconfiguration/
directory and in version control. Anyone who edits these configuration files will end up with their changes making their tree dirty. In my opinion they do not belong in this repository at all, and instead this should just be handled by the documentation of the main Netbox project. If you do decide to keep them in, they could be renamed to something likewhatever.py.sample
orwhatever_sample.py
so that they could be easilly identified as sample files, and a single .gitignore line could match all these sample files. Another option would be to move out these sample configuration files into a seperate directory. Exactly what option is decided doesn't matter too much to me, my own preference is to nuke them entirely, but as long as they don't unduly pollute the namespace ofconfiguration/
, I'm fine with it.The goal of this change is to be able for a user (such as myself) to keep a local copy of this repository unmodified, to keep anything that's specific to my environment outside the scope of that repo.
There's been some initial discussion on this in #1049, but I decided it's probably better to keep this as a discussion specifically focused on the
configuration/
folder aspect, and ignoring the other stuff for now.Beta Was this translation helpful? Give feedback.
All reactions