Onemind-Services-LLC / netbox-secrets

Enhance your secret management with encrypted storage and flexible, user-friendly features.
Apache License 2.0
93 stars 8 forks source link

[Feature]: Add support for NetBox v3.6 #95

Closed abhi1693 closed 10 months ago

abhi1693 commented 10 months ago

NetBox version

v3.6

Feature type

Add a function

Proposed functionality

Update the plugin as per the NetBox v3.6 release

https://github.com/netbox-community/netbox/pull/13614

Use case

To support on newer version

External dependencies

No response

krakazyabra commented 10 months ago

Hi! Just tested (after closing this issue) brand new Netbox (git pull from master) plugin was installed using official documentation

result:

Building netbox
Sending build context to Docker daemon  87.55kB
Step 1/6 : FROM netboxcommunity/netbox:latest
latest: Pulling from netboxcommunity/netbox
Digest: sha256:0de9e53f26737dd444de00caaa65bf25f976d544df0f292bf325df77806ffabb
Status: Downloaded newer image for netboxcommunity/netbox:latest
 ---> 8440d4949def
Step 2/6 : COPY ./plugin_requirements.txt /opt/netbox/
 ---> 4ec714f3a662
Step 3/6 : RUN /opt/netbox/venv/bin/pip install  --no-warn-script-location -r /opt/netbox/plugin_requirements.txt
 ---> Running in c3092153c125
Collecting netbox-secrets (from -r /opt/netbox/plugin_requirements.txt (line 1))
  Obtaining dependency information for netbox-secrets from https://files.pythonhosted.org/packages/59/fc/e202611754175b39076d0348377868073064f9731c997b9f1885fd7df57e/netbox_secrets-1.8.5-py3-none-any.whl.metadata
  Downloading netbox_secrets-1.8.5-py3-none-any.whl.metadata (474 bytes)
Collecting pycryptodome (from netbox-secrets->-r /opt/netbox/plugin_requirements.txt (line 1))
  Obtaining dependency information for pycryptodome from https://files.pythonhosted.org/packages/40/88/89623388754162ddb82c62814ccbfdbfcc8ed9bd6d5f7412d2479bdca3a7/pycryptodome-3.18.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
  Downloading pycryptodome-3.18.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.4 kB)
Downloading netbox_secrets-1.8.5-py3-none-any.whl (69 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 69.0/69.0 kB 2.4 MB/s eta 0:00:00
Downloading pycryptodome-3.18.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 20.8 MB/s eta 0:00:00
Installing collected packages: pycryptodome, netbox-secrets
Successfully installed netbox-secrets-1.8.5 pycryptodome-3.18.0
Removing intermediate container c3092153c125
 ---> a1bebe3deb69
Step 4/6 : COPY configuration/configuration.py /etc/netbox/config/configuration.py
 ---> 93049c48ca4a
Step 5/6 : COPY configuration/plugins.py /etc/netbox/config/plugins.py
 ---> 8c66a09ee0f6
Step 6/6 : RUN SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
 ---> Running in ab487a752a51
🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 255, in fetch_command
    app_name = commands[subcommand]
               ~~~~~~~~^^^^^^^^^^^^
KeyError: 'collectstatic'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/netbox/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 262, in fetch_command
    settings.INSTALLED_APPS
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/conf/__init__.py", line 102, in __getattr__
    self._setup(name)
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/conf/__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/conf/__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/netbox/netbox/netbox/settings.py", line 779, in <module>
    plugin_config.validate(PLUGINS_CONFIG[plugin_name], VERSION)
  File "/opt/netbox/netbox/extras/plugins/__init__.py", line 133, in validate
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Plugin netbox_secrets requires NetBox maximum version 3.5.99.
The command '/bin/sh -c SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input' returned a non-zero code: 1
ERROR: Service 'netbox' failed to build : Build failed

From what I see it still tries to use old 1.8.5 version

abhi1693 commented 10 months ago

You are still downloading v1.8.5 which is for netbox 3.5. We have not yet released the plugin but is scheduled for today