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

    • Offizieller Beitrag

    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 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    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?

    • Offizieller Beitrag

    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 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    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 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!