hook scrtipts for before/after applying configuration changes?

  • Hi,


    Is there a way to hook into when configuration changes are applied through the UI? In particular, I would like to make changes to the automatically-generated nginx config files, and keep those changes across config modifications. So, I'd prefer a hook script which is called after everything is written, but before nginx is restarted.


    thanks

  • While I think you are going down the wrong road (using nginx for other sites?), it depends on the version of OMV. On OMV 4.x, you could add a higher numbered mkconf to run after the other config scripts. On OMV 5.x, you might be able to add saltstack code to do this.

    omv 5.5.5 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.5
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • FWIW, yes, I think it's a bit overkill to run a whole separate nginx in a docker to make other sites available, when there's already a perfectly fine nginx already running and serving OMV itself. I used to use the Services / Sites feature for this in 3.x, which does exactly that, and is perfectly suitable for this purpose. And actually, I wouldn't even need to touch any auto-generated files for this if OMV wouldn't add a listen [::]:443 line to the server block. Which, in this form, based on my experience, causes a conflict in nginx if any other service block has a similar line. So, I need to comment this out, just to be able to add a simple listen 443 line in there.


    Any advice on how I could work this around without actually disabling said line in the generated file?


    Anyhow, where can I find pointers to the "saltstack" thing?

  • yes, I think it's a bit overkill to run a whole separate nginx in a docker to make other sites available, when there's already a perfectly fine nginx already running and serving OMV itself.

    I disagree. Most web sites are served to the internet. Having your OMV web server needlessly available to the internet is bad. nginx is very lightweight and having multiple instances running on the systems mean very little. docker gives a little extra security and if an update to OMV or nginx breaks the nginx config, having sites in docker won't be broken.


    if OMV wouldn't add a listen [::]:443 line to the server block

    It is only supposed to do this IF ipv6 is determined to be enabled.

    https://github.com/openmediava…/files/site-webgui.j2#L48

    https://github.com/openmediava…/files/site-webgui.j2#L60


    Any advice on how I could work this around without actually disabling said line in the generated file?

    Disable ipv6

    where can I find pointers to the "saltstack" thing?

    Here is the code - https://github.com/openmediava…vault/srv/salt/omv/deploy

    omv 5.5.5 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.5
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • I don't find any setting regarding this on the UI.

    Set the value of net.ipv6.conf.lo.disable_ipv6 to 1 in /etc/sysctl.d/99-openmediavault.conf and reboot

    Then omv-salt deploy run nginx

    omv 5.5.5 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.5
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!