Giter VIP home page Giter VIP logo

Comments (13)

dekeonus avatar dekeonus commented on June 28, 2024 1

I desperately need some dinner, but after I'll PR a [zm]-r10.ebuild that has that web-server selection (with KEYWORDS="" it will based on the oubliette-overlay version i.e. prior to the webapp_* changes)

It will also have the dev-libs/libjwt package

from oubliette-overlay.

dekeonus avatar dekeonus commented on June 28, 2024 1

Sorry you were correct. ScriptAlias was in the wrong place. updated to working state (my local install was still including cctv_host.include instead of zoneminder.include)

from oubliette-overlay.

nabbi avatar nabbi commented on June 28, 2024

I started some work on this over at oubliette-overlay-dev 1.36.9999. This should also address your #5 report, the others I haven't gotten around to yet 😉

Let me know your thoughts; I don't feel the migration to webapp is compete yet and not convinced this is the appropriate solution unless we expand the scope to decouple from apache and/or do more things the gentoo vhost way.

from oubliette-overlay.

dekeonus avatar dekeonus commented on June 28, 2024

I've been trying to learn autotools, so as to package dev-libs/libjwt (zoneminder wants 'debian style' so.names and the patch debian uses wasn't usable in a gentoo build system). I've got it building and zoneminder is now picking it up correctly.
I don't think upstream libjwt will be interested in a PR but once I've learned how to use cmake I'll try (my patch is only for autotools build thus far, the cmake build has other issues beyond just patching for debian style so.names).

  • Zoneminder CAN NOT use app-admin/webapp-config as the build requires knowledge of the web server user & group name. webapp-config has no way to re-merge / flag for re-merge the zoneminder package if the web server to be used is changed. On this particular note I'll include the pkg_setup phase as I've got it currently written at the end of this comment.

  • We should be doing things the gentoo vhost way: That is /etc/apache2/vhost/10-zoneminder.conf should have never been installed, right from the very first ebuild in the main gentoo repo. That file should have always been a /etc/apache2/vhost/zoneminder.include (if installed at all). This would have prevented automatically switching the zm-vhost on and would have enabled the user to specify their own load order (that leading 10-)
    As there are now users expecting to be able to etc-update merge that vhost file #3 , going the zoneminder.include route seems to me to be the way forward:

    • Use something similar to the existing legacy file name check
    • If the user has a 'regular file' 10-zoneminder.conf move it to zoneminder.include. Symlink 10-zoneminder.conf to zoneminder.include (the symlink will, in effect, leave the vhost configured as before)
    • If there user has a 'symlink file' 10-zoneminder.conf ewarn the user that it was a legacy installation artefact and that they should migrate to using a [num]-vhost_id.conf that includes the zoneminder.include.
  • Perhaps a pkg_config phase that will interactively prep the zoneminder install

    • Ask user for the zm db_name, db_user, db_pass
    • if USE=apache2 the zm fqdn, the desired logging path (or use main vhost) logging
    • Setup the zoneminder db, and if apache2 setup a [num]-zoneminder.conf that has logging setup and include the zoneminder.include (ServerName and ServerAlias should be in the include file to facilitate being included from both vhost:80 and vhost:443).

so here's that pkg_setup that should hint at how I've been approaching selectable web-server choice.

#=== Trimmed ===

IUSE_WEB_SERVER="apache2 nginx"

REQUIRED_USE="
    || ( ssl gnutls )
    ^^ ( ${IUSE_WEB_SERVER} )
"

#=== Trimmed ===

pkg_setup() {
    if use nginx ; then
        MY_WEB_USER=nginx
        MY_WEB_GROUP=nginx
        MY_WEB_INITD=nginx
    elif use apache2 ; then
        MY_WEB_USER=apache
        MY_WEB_GROUP=apache
        MY_WEB_INITD=apache2
    fi
    # allow the user to override
    [[ -n "${ZM_WEBSRV_USER}" ]] && MY_WEB_USER=${ZM_WEBSRV_USER}
    [[ -n "${ZM_WEBSRV_GROUP}" ]] && MY_WEB_GROUP=${ZM_WEBSRV_GROUP}
    [[ -n "${ZM_WEBSRV_INITD}" ]] && MY_WEB_INITD=${ZM_WEBSRV_INITD}
    # bail if web user:group not set
    if [[ -z "${MY_WEB_USER}" || -z "${MY_WEB_GROUP}" ]]; then
        die "no web server configured"
    fi

    export MY_WEB_USER MY_WEB_GROUP MY_WEB_INITD
}

#=== Trimmed ===

from oubliette-overlay.

nabbi avatar nabbi commented on June 28, 2024

Thanks for these insights. For your reference, there was a tweak to correct the non-1.36.9999 submodule logic. I was a bit fatigued by then, I hope I got it right.

Agreed, let's trash what I pushed into the dev-overlay. You should have access to create branches and merge your own PR over there (if you choose to, as you have collaborator access). These seem like major enough changes which we should sandbox test more

from oubliette-overlay.

nabbi avatar nabbi commented on June 28, 2024

Hey @dekeonus . I just wanted to ping out to see what your thoughts are on the status of your 9999-r10 commits covering this and #5 #8 #9. I reviewed these changes and I appreciate all your improvements.

The following observations were encountered when installing it, yet I honestly haven't spent much time beyond this report.

QA notices:

 * One or more CMake variables were not used by the project:
 *   GNUTLS_LIBRARIES

vhost.d/zoneminder.include was created without end user instructions for guidance, I know we talked about this so I added a symlink: ln -s zoneminder.include 10_zoneminder.conf

This file needs a deeper review, I think we are missing the nph-zms ScriptAlias; there were a few adjustments I incorporated from upstreams file so there could be other tweaks I didn't catch at first glance. This message was logged at service startup:

AH00671: The ScriptAlias directive in /etc/apache2/vhosts.d/10_zoneminder.conf at line 32 will probably never match because it overlaps an earlier Alias. 

Anyway, is this working for your or do I have something unique ? As time permits, I'll continue reviewing and testing this more. Thank you

from oubliette-overlay.

dekeonus avatar dekeonus commented on June 28, 2024
  • One or more CMake variables were not used by the project:
  • GNUTLS_LIBRARIES

Yes I'm unsure how to silence that, it is however expected. The only other way to forcibly disable gnutls / gcrypt library search would be a more drastic modification of the CMakeLists.txt

AH00671: The ScriptAlias directive in /etc/apache2/vhosts.d/10_zoneminder.conf at line 32 will probably never match because it overlaps an earlier Alias.

hmmm, yeah ln -s zoneminder.include 10_zoneminder.conf isn't going to work ... that's stuff I haven't written as yet (other projects and life events got in the way). The symlink to zoneminder.include was for avoiding breaking the existing setup. What was needed was to move the 10_zoneminder.conf to zoneminder.include, and then symlink.
The code I've not yet written would be roughly doing

mv 10_zoneminder.conf zoneminder.include
ln -s zoneminder.include 10_zoneminder.conf
install ._cfg0000_zoneminder.include
if  isSymlink 10_zoneminder.conf ; then
  ewarn user about needing to migrate to using zoneminder_vhost.conf
     #which is in /usr/share/doc/zoneminder-[version]
fi

so that the older vhost.conf was still in play (so that an unattended upgrade doesn't immediately fail).
but etc-update would need to update the zoneminder.include and the user would need to copy the zoneminder_vhost.conf into /etc/apache2/vhosts.d/[user_prefered_vhost_name].conf and adjust it accordingly

I am wanting to write a pkg_config() phase to handle this (for apache2 at least, I don't have nginx test machine atm).

I could look at doing something about migrating settings from 10_zoneminder.conf to a new vhost.conf file However this is bad as the user should always choose [sort_number]_[vhost_conf_name].conf not the package maintainer. So anything I write would only be to prevent breaking already installed systems, new installs should not install a vhost.conf only the vhost.include.

I hope I've been making sense here.

from oubliette-overlay.

dekeonus avatar dekeonus commented on June 28, 2024

as a reference all of this is missing if you've just symlinked the vhost.include that comes with the -r10 ebuild

<IfModule ssl_module>
<VirtualHost *:443>
    SSLEngine on

    # logging configuration, this directory needs to be created
    ErrorLog /var/log/apache2/localhost/ssl_error_log
    <IfModule log_config_module>
        #see /etc/apache2/modules.d/00_mod_log_config.conf for other options
        CustomLog /var/log/apache2/localhost/ssl_access_log common
    </IfModule>

    Include /etc/apache2/vhosts.d/zoneminder.include

</VirtualHost>
</IfModule>

<VirtualHost *:80>
# allows opportunistic ssl upgrades (starttls on port 80 -very few clients use this)
#   SSLEngine optional

    # logging configuration, this directory needs to be created
    ErrorLog /var/log/apache2/localhost/error_log
    <IfModule log_config_module>
        #see /etc/apache2/modules.d/00_mod_log_config.conf for other options
        CustomLog /var/log/apache2/localhost/access_log common
    </IfModule>

    Include /etc/apache2/vhosts.d/zoneminder.include

    <IfModule mpm_peruser_module>
        ServerEnvironment apache apache
    </IfModule>

</VirtualHost>

# vim: ts=4 filetype=apache

so apache doesn't know that the symlinked 10_zoneminder.conf is a named virtual host
and so being that ScriptAlias is likely something conflicting with the default / first named apache vhost

from oubliette-overlay.

nabbi avatar nabbi commented on June 28, 2024

sounds good, yes that all makes sense. And, no rush, I haven't had time myself as of late. I know you had a few things in the works yet and wasn't quite sure how ready this all was. Will keep it in -dev until we both had more time to commit to this. Thank you!

from oubliette-overlay.

dekeonus avatar dekeonus commented on June 28, 2024

I've yet to look at packaging janus-gateway for 1.37+ (reports are that it greatly reduces CPU usage while monitoring). and my primary zoneminder box has an 8 year old 32bit only cpu so it could use all the help I can give it.

EDIT: I will clarify, I do have hardware to replace that ageing stalwart but I just haven't had time to build a new gentoo server on it.

from oubliette-overlay.

dekeonus avatar dekeonus commented on June 28, 2024

oh crap I'm getting old: correction the processor is 18 years old (it can vote and drink in my country)

from oubliette-overlay.

nabbi avatar nabbi commented on June 28, 2024

😃 all good

from oubliette-overlay.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.