Closed omri-ice closed 1 year ago
I was just looking at this as well -- I want to enable LDAP (AD) auth, but the django-auth-ldap
module isn't installed. The official https://github.com/netbox-community/netbox-docker lets you add -ldap
to the image tag to get one with LDAP enabled.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am also trying to get SAML to work using netbox-plugin-auth-saml2, and while I have gotten some things to work, I can't get it to fully provision users information due to this error.
Insufficient write permission to the media root
Having a way to bootstrap plugins would be awesome so that we don't have to hack at the container everytime a new version comes out.
hello.. i found a work-around using some of the custom-init features baked into teh linuxserver.io base image.
since i just mount a /config
volume to the container.. i created the file below, and also updated my configuration.py and it worked
root@myserver:/etc/netbox# cat config/custom-cont-init.d/00-install_netbox_plugins
pip3 install --no-cache-dir netbox-topology-views
there was a bit of an order of operations error (looked for plugin before pip) at startup in the container logs, but ultimately it all worked.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@lanefu yes, that works, but you have to start the container two times (the first one to install the plugin, the second one to include it into NetBox and create the needed tables). It might be better is the custom-cont-init.d
scripts were run before the start of Netbox.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Since Netbox 3.3, the custom-cont-init.d method doesn't seem to work any more.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
So, I wanted to help the community a bit if I can. I was going to write a fix for this and push it up stream to see if linuxserver would incorporate it. Unfortunately, their support for this project seems abysmal, and I will be moving back to the official images soon.
But the community shouldn't have to suffer because of poor support as I will openly admit that linux servers docker image is significantly easier to get running. So heres a WORKAROUND for the plugin issue..
PLUGINS_CONFIG = {
}
4. make a file called `plugin_requirements.txt` and `plugins.txt`
plugin_requirements.txt
```file
netbox-topology-views
netbox-ipcalculator
plugins.txt
netbox_topology_views
netbox_ipcalculator
plugin_requirements.txt
and any netbox plugins to 'plugins.txt' ADD <your folder> /custom-config
RUN chmod u+x /custom-config/custom-netbox-entrypoint.sh
ENTRYPOINT [ "/init" ]
#!/bin/bash
set -euo pipefail
# File locations
python_file="/config/configuration.py"
plugin_requirements="/custom-config/plugin_requirements.txt"
plugin_list="/custom-config/plugins.txt"
# Size check
threshold_size_kb=11 # Specify the threshold size in bytes
threshold_size=$((threshold_size_kb * 1024)) # Convert threshold size to bytes
# Wait for file to exist and to be written to
counter=0
while true
do
if [ -e "$python_file" ] && [ $(stat -c %s $python_file) -ge $threshold_size ];
then
break
fi
sleep $counter
((counter++))
done
# Install pip plugins
pip install -r $plugin_requirements
echo "$plugin_requirements" >> "/opt/netbox/local_requirements.txt"
# Create a variable out of the text file
declare -a plugin_list
mapfile -t plugin_list < $plugin_list
plugin_string=$(printf "'%s'," "${plugin_list[@]}")
plugin_string=${plugin_string%?}
# Create the plugin string
plugin_string=$(printf "'%s'," ${plugin_list// /})
plugin_string=${plugin_string%,}
# Enable Plugins and comment logging so it can be added later
sed -i -e "s/PLUGINS *= *\[.*\]/PLUGINS = [$plugin_string]/" \
-e "/^LOGGING = {}/s/^/# /" \
"$python_file"
printf "\n\n## Custom Config ##\n" >> $python_file
cd /custom-config/custom
for FILE in *.conf ;
do
echo "Adding Custom Config $FILE...";
cat "$FILE" | tee -a "$python_file";
printf "\n" >> $python_file
done
cd /
was going to write a fix for this and push it up stream to see if linuxserver would incorporate it. Unfortunately, their support for this project seems abysmal, and I will be moving back to the official images soon.
Do you have a PR to reference?
was going to write a fix for this and push it up stream to see if linuxserver would incorporate it. Unfortunately, their support for this project seems abysmal, and I will be moving back to the official images soon.
Do you have a PR to reference?
I just edited my original comment, should have enough information now on how to get this to work. Again, I'll be moving back to the original community edition, so I dont want to have to support this long term. Otherwise I would just write a fix to resolve this at the source.
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is locked due to inactivity
Desired Behavior
Specify a list of netbox plugins to install (via ENV variable or mounting a requirements.txt file to a given directory) that on boot will install the listed packages to be used in the instance.
This option should support either pulling from pypi or installing local whl files that are mounted to the container.
Current Behavior
This function is not possible currently at runtime
Alternatives Considered
To achieve a similar result the docker image has to be built manually with the additional packages install on build.