New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Munge the config in the global configvals into the configs array #2101

Merged
merged 6 commits into from Jun 28, 2018

Conversation

Projects
None yet
3 participants
@connortechnology
Member

connortechnology commented May 10, 2018

When using the api to get the config, things like PATH_ZMS are no longer returned because they don't exist in the Config table anymore.

This code munges the values from the /etc/zm/conf.d settings into the array before returning it.

@knight-of-ni

This comment has been minimized.

Show comment
Hide comment
@knight-of-ni

knight-of-ni May 11, 2018

Member

So I'll push the following to this PR:

{
  name        => 'ZM_PATH_ZMS',
  default     => '',
  description => 'Web path to zms streaming server',
  help        => q`
    The ZoneMinder streaming server is required to send streamed
    images to your browser. It will be installed into the cgi-bin
    path given at configuration time. This option determines what
    the web path to the server is rather than the local path on
    your machine. Ordinarily the streaming server runs in
    parser-header mode however if you experience problems with
    streaming you can change this to non-parsed-header (nph) mode
    by changing 'zms' to 'nph-zms'. IMPORTANT: The value for this
    variable is no longer read from the database. Instead, this
    variable should be set in a config file under the conf.d
    folder.
    `,
  type        => $types{rel_path},Graz, Austria
  category    => 'hidden',
},

@pliablepixels This should fix the viewByName function.
The only question I have is, is this the only variable we want to put back in? What about the others?
See: bacf65a#diff-66f1fd548f32344e70c3b02e426e0508

Member

knight-of-ni commented May 11, 2018

So I'll push the following to this PR:

{
  name        => 'ZM_PATH_ZMS',
  default     => '',
  description => 'Web path to zms streaming server',
  help        => q`
    The ZoneMinder streaming server is required to send streamed
    images to your browser. It will be installed into the cgi-bin
    path given at configuration time. This option determines what
    the web path to the server is rather than the local path on
    your machine. Ordinarily the streaming server runs in
    parser-header mode however if you experience problems with
    streaming you can change this to non-parsed-header (nph) mode
    by changing 'zms' to 'nph-zms'. IMPORTANT: The value for this
    variable is no longer read from the database. Instead, this
    variable should be set in a config file under the conf.d
    folder.
    `,
  type        => $types{rel_path},Graz, Austria
  category    => 'hidden',
},

@pliablepixels This should fix the viewByName function.
The only question I have is, is this the only variable we want to put back in? What about the others?
See: bacf65a#diff-66f1fd548f32344e70c3b02e426e0508

@connortechnology

This comment has been minimized.

Show comment
Hide comment
@connortechnology

connortechnology May 11, 2018

Member

Having the entries in config table will mean that my munging code will need to change. So no merging till I do that.

I think they should all come back mainly just to get the help text back and for completeness.

Member

connortechnology commented May 11, 2018

Having the entries in config table will mean that my munging code will need to change. So no merging till I do that.

I think they should all come back mainly just to get the help text back and for completeness.

@knight-of-ni

This comment has been minimized.

Show comment
Hide comment
@knight-of-ni

knight-of-ni May 11, 2018

Member

Would it? The munging code just updates the key/value pairs with the entries from the config files, right? Isn't that what we want?

Member

knight-of-ni commented May 11, 2018

Would it? The munging code just updates the key/value pairs with the entries from the config files, right? Isn't that what we want?

@connortechnology

This comment has been minimized.

Show comment
Hide comment
@connortechnology

connortechnology May 11, 2018

Member

Yeah, the api Config just returns an array of db rows. So I just appended to it. Instead we will need to loop through it and find the entry with the right name.

Member

connortechnology commented May 11, 2018

Yeah, the api Config just returns an array of db rows. So I just appended to it. Instead we will need to loop through it and find the entry with the right name.

@knight-of-ni

This comment has been minimized.

Show comment
Hide comment
@knight-of-ni

knight-of-ni May 11, 2018

Member

Oh, I see.

Member

knight-of-ni commented May 11, 2018

Oh, I see.

@pliablepixels

This comment has been minimized.

Show comment
Hide comment
@pliablepixels

pliablepixels May 11, 2018

Contributor

from zmNinja's perspective, I use
/configs/viewByName/ZM_PATH_ZMS.json for the wizard functionality - important for me
/configs/viewByName/ZM_EVENT_IMAGE_DIGITS.json for direct image access, which I really don't need anymore (it was a legacy detail that I've since addressed using view=image as the alternate

Contributor

pliablepixels commented May 11, 2018

from zmNinja's perspective, I use
/configs/viewByName/ZM_PATH_ZMS.json for the wizard functionality - important for me
/configs/viewByName/ZM_EVENT_IMAGE_DIGITS.json for direct image access, which I really don't need anymore (it was a legacy detail that I've since addressed using view=image as the alternate

@knight-of-ni knight-of-ni added this to the 1.32.0 milestone Jun 15, 2018

@connortechnology

This comment has been minimized.

Show comment
Hide comment
@connortechnology

connortechnology Jun 22, 2018

Member

So I've updated this a bit. Please forgive the commit log strangeness... rebase never works well for me. The change is simple, just consider the Files changed.

@pliablepixels is zmNinja expecting an array of config entries or a Name key'd hash of config entries?

Which do we think is better? What I have done here is output the entire db Config table indexed by Name, with file based config values super-imposed or added.

Comments?

Member

connortechnology commented Jun 22, 2018

So I've updated this a bit. Please forgive the commit log strangeness... rebase never works well for me. The change is simple, just consider the Files changed.

@pliablepixels is zmNinja expecting an array of config entries or a Name key'd hash of config entries?

Which do we think is better? What I have done here is output the entire db Config table indexed by Name, with file based config values super-imposed or added.

Comments?

@pliablepixels

This comment has been minimized.

Show comment
Hide comment
@pliablepixels

pliablepixels Jun 22, 2018

Contributor

I directly seek out the variable I need using /viewByName/WHATEVER_VAR.json to save NW bandwidth.

Contributor

pliablepixels commented Jun 22, 2018

I directly seek out the variable I need using /viewByName/WHATEVER_VAR.json to save NW bandwidth.

@connortechnology

This comment has been minimized.

Show comment
Hide comment
@connortechnology

connortechnology Jun 25, 2018

Member

I've added support for viewByName

Member

connortechnology commented Jun 25, 2018

I've added support for viewByName

@knight-of-ni

This comment has been minimized.

Show comment
Hide comment
@knight-of-ni

knight-of-ni Jun 28, 2018

Member

@pliablepixels says it works for him, so merging....

Member

knight-of-ni commented Jun 28, 2018

@pliablepixels says it works for him, so merging....

@knight-of-ni knight-of-ni merged commit 9df65e8 into ZoneMinder:master Jun 28, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment