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

feat(dev): add networking overrides to website Makefile #18655

Merged
merged 1 commit into from
Sep 25, 2023

Commits on Sep 23, 2023

  1. feat(dev): add networking overrides to website Makefile

    This commit adds two new Makefile overrides for configuring the networking in the website Makefile:
    
    * `SERVER_BIND`: Specify which network address to use in Hugo/HTTP servers for binding.
      The default value is `127.0.0.1` to preserve the current behavior.
    * `SERVER_PORT`: Specify which port to use in Hugo/HTTP servers for listening.
      The default value is `1313` to preserve the current behavior.
    
    Before this change, the Hugo/HTTP bind address and port was hard-coded to `127.0.0.1:1313`.
    This behavior is not always convenient. For example, when running Hugo inside of a Docker container.
    In this scenario, the Hugo/HTTP servers can be accessed form outside of the container as follows:
    
        make serve SERVER_BIND=0.0.0.0
        make run-production-site-locally SERVER_BIND=0.0.0.0
    
    I also added a safety check for `DEPLOY_PRIME_URL` in the `preview-build` Makefile target. Without
    this check, Hugo is incorrectly started with a bare `--baseURL` if that variable is not defined.
    
    Signed-off-by: Hugo Hromic <hhromic@gmail.com>
    hhromic committed Sep 23, 2023
    Configuration menu
    Copy the full SHA
    9df93fa View commit details
    Browse the repository at this point in the history