Page MenuHomeDevCentral

Allow to use _default.conf for PaaS Docker nginx vhost
ClosedPublic

Authored by dereckson on Apr 2 2023, 13:11.
Tags
None
Referenced Files
F3606992: D2968.id7569.diff
Mon, Sep 30, 06:25
Unknown Object (File)
Sat, Sep 28, 16:02
Unknown Object (File)
Sat, Sep 28, 02:13
Unknown Object (File)
Fri, Sep 27, 23:24
Unknown Object (File)
Fri, Sep 27, 21:37
Unknown Object (File)
Wed, Sep 18, 19:52
Unknown Object (File)
Sun, Sep 15, 12:09
Unknown Object (File)
Sun, Sep 15, 12:09
Subscribers
None

Details

Summary

Current behavior
A _default.conf standard vhost is provided, but not directly useful
as it needs to be included to a specific <service>.conf file.

New behavior
This change detects if <service>.conf exists, and if not, fallback
to _default.conf, so services not needing a specific nginx configuration
can directly use the default one without any need to create a nginx file.

Test Plan
  • Deploy hound, check it's no-op
  • Deploy Penpot (D2597)

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Passed
Unit
No Test Coverage
Branch
docker-nginx-default
Build Status
Buildable 4685
Build 4965: arc lint + arc unit

Event Timeline

dereckson created this revision.

Works like a charm for Hound:

Complector
$ salt docker-002 state.sls_id /etc/nginx/vhosts/hound/hound.conf roles/paas-docker/nginx/config test=True
docker-002:
----------
          ID: /etc/nginx/vhosts/hound/hound.conf
    Function: file.managed
      Result: None
     Comment: The file /etc/nginx/vhosts/hound/hound.conf is set to be changed
              Note: No changes made, actual changes may
              be different due to other states.
     Started: 13:24:14.878532
    Duration: 60.22 ms
     Changes:
              ----------
              diff:
                  ---
                  +++
                  @@ -34,6 +34,7 @@

                       location / {
                           proxy_pass http://localhost:44080;
                  +
                           include includes/proxy_params;
                           proxy_redirect off;
                       }

Summary for docker-002
------------
Succeeded: 1 (unchanged=1, changed=1)
Failed:    0
------------
Total states run:     1
Total run time:  60.220 ms

It's well only there the default file is used:

Complector
$ salt docker-002 state.show_sls roles/paas-docker/nginx/config --out=yaml | grep -C 4 _default.conf
  /etc/nginx/vhosts/hound/hound.conf:
    __env__: base
    __sls__: roles/paas-docker/nginx/config
    file:
    - source: salt://roles/paas-docker/nginx/files/vhosts/_default.conf
    - mode: 644
    - makedirs: true
    - template: jinja
    - context:
This revision is now accepted and ready to land.Apr 2 2023, 13:25