Skip to content
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

renewed attempt at dockerization #92

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

renewed attempt at dockerization #92

wants to merge 6 commits into from

Conversation

dylanwh
Copy link
Member

@dylanwh dylanwh commented Sep 10, 2022

TODO:

  • lots of stuff

To test, you can:

  • run Makefile.PL
  • docker build . -t bugzilla
  • docker run --rm -e BZ_db_host=DATABASE -e BZ_urlbase=http://localhost:3000/ -e BZ_db_pass=bugs -ti bugzilla checksetup
  • docker run --rm -e BZ_db_host=DATABASE -e BZ_urlbase=http://localhost:3000/ -e BZ_db_pass=bugs -ti bugzilla daemon -- this one should result in a running server.

@justdave justdave marked this pull request as draft September 10, 2022 20:36
api_field_types and api_field_names rely on values from the
Bugzilla->fields definition. This in turn requires checking the schema
of the bugs table at run time. That means trying to access these when a
database is not configured, or before schema migrations have happened is
an error.

This changes those variables to hold functions (sub refs) that are
comptued when called. The help performance not degrade, we make use of
the Bugzilla::request_cache to only re-compute this once per request.
@melezhik
Copy link

@dylanwh i am curious why need to “ run Makefile.PL” ? Usually all compilation happens insider docker build, right ?

@melezhik
Copy link

What is a necessity of “BZ_urlbase”, if this is a bugzilla api URL , usually there is docker port mapping mechanism that would allow map docker tcp ports to the host ones, so would it not be enough just specify a port and then map it during docker run ?

@dylanwh
Copy link
Member Author

dylanwh commented Jan 8, 2023

@dylanwh i am curious why need to “ run Makefile.PL” ? Usually all compilation happens insider docker build, right ?

Side effect of two constraints:

  1. Extensions can change dependencies
  2. I want an efficient docker build that takes advantage of layer caching

So doing this requires generating the dockerfile. I intend on commiting the "default" configuration dockerfile to the repository, so nobody that it works normally for most people

@dylanwh
Copy link
Member Author

dylanwh commented Jan 8, 2023

What is a necessity of “BZ_urlbase”, if this is a bugzilla api URL , usually there is docker port mapping mechanism that would allow map docker tcp ports to the host ones, so would it not be enough just specify a port and then map it during docker run ?

Two reasons really.

Bugzilla has numerous protections from being improperly proxied to, and it uses the urlbase understand what requests are valid and which ones to reject. Some of this is implemented in the so-called Hostage middleware, and other parts exist in other parts of the code.

The second reason is that it needs to know how to fully qualify urls in emails and other places outside of a web request context.

I'd like to make this part of the onboarding/setup easier though.

Copy link
Member

@justdave justdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably needs a rebase, tests are failing, too. Think we're almost there though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants