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

[BUG] Streams broken by stream.conf #440

Closed
1 task done
lordratner opened this issue Dec 18, 2023 · 9 comments · Fixed by #459
Closed
1 task done

[BUG] Streams broken by stream.conf #440

lordratner opened this issue Dec 18, 2023 · 9 comments · Fixed by #459
Labels
awaiting-approval Stale exempt

Comments

@lordratner
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I upgraded to a more recent SWAG and my stream directive (added after the http directive in nginx.conf) was broken because it was suddenly a duplicate. Digging into the docker volume, there is now a stream directive in /etc/nginx/conf.d.

This directive has an include for anything added to /etc/nginx/stream.d as a .conf file, but I don't see any way to add this in the config folder, making it impossible to use a stream directive outside of tampering with the docker volume filesystem

Expected Behavior

I should be able to add stream directive blocks somewhere in the /config/nginx directory (stream-confs?) that are then added to the stream directive in /etc/nginx/conf.d/stream.conf

There are a number of ways to do this that I'm sure y'all understand. The simplest would be to add streams.conf to the /config/nginx folder, then add include /config/nginx/streams.conf to /etc/nginx/conf.d/stream.conf. The stream server blocks could all be added to that single .conf file.

Steps To Reproduce

Add a stream directive anywhere in the config folder.

Environment

- OS: debain
- How docker service was installed: following docker guide

CPU architecture

x86-64

Docker creation

version: "3.9"
services:
  swag:
    image: lscr.io/linuxserver/swag
    container_name: swag
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
      - URL=ratner.com
      - SUBDOMAINS=wildcard
      - VALIDATION=dns
      - CERTPROVIDER=zerossl
      - EMAIL=
      - DNSPLUGIN=cloudflare #optional
      - EXTRA_DOMAINS=.com, *..com
      - PROPAGATION=30
      - DOCKER_MODS=linuxserver/mods:swag-auto-reload|linuxserver/mods:swag-dashboard|linuxserver/mods:swag-maxmind
      - MAXMINDDB_LICENSE_KEY=
      - STAGING=false #optional
    volumes:
      - /opt/appdata/swag/config:/config
    ports:
      - 443:443
      - 80:80 #optional
      - 81:81
    restart: unless-stopped

Container logs

swag  | 2023-12-18T21:20:53.890173683Z nginx: [emerg] "stream" directive is duplicate in /config/nginx/nginx.conf:89
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@thespad
Copy link
Member

thespad commented Dec 18, 2023

Just remove include /etc/nginx/conf.d/*.conf; from your /config/nginx/nginx.conf and replace it with your stream.conf include.

@lordratner
Copy link
Author

Just remove include /etc/nginx/conf.d/*.conf; from your /config/nginx/nginx.conf and replace it with your stream.conf include.

Thanks, just saw that. That drops out the log lines in /etc/nginx/conf.d/stream.conf, however. I'm sure that's not a big deal, however it would be cleaner in whatever the next release is to fix that, and I didn't see it documented anywhere.

Thank you for the lightning fast response!
Seth

@thespad
Copy link
Member

thespad commented Dec 18, 2023

It's part of the upstream Alpine nginx package and not a change we've made intentionally.

@lordratner
Copy link
Author

It's part of the upstream Alpine nginx package and not a change we've made intentionally.

Gotcha. Could it be handled the same way nginx.conf is handled? In /etc/nginx/nginx.conf, everything is deleted and only "include /config/nginx/nginx.conf;" is in the file.

Could /etc/nginx/conf.d/stream.conf be changed the same way to only have "include /config/nginx/stream.conf;" in it, then the current contents of /etc/nginx/conf.d/stream.conf can be moved to /config/nginx/stream.conf, and the user can add whatever they need?

Just a thought. I'm honestly still not sure how I figured out the problem at all, as I'm not usually one to poke around in the docker filesystem.

Thanks again.

@aptalca
Copy link
Member

aptalca commented Dec 18, 2023

We don't want anything to do with stream. We delete the stream.conf in the baseimage so the user can add theirs if they like. Sounds like upstream changed the location of it (on mobile, didn't look, only guessing) so we'll have to update it to delete again.
https://github.com/linuxserver/docker-baseimage-alpine-nginx/blob/master/Dockerfile#L40

@lordratner
Copy link
Author

We don't want anything to do with stream. We delete the stream.conf in the baseimage so the user can add theirs if they like. Sounds like upstream changed the location of it (on mobile, didn't look, only guessing) so we'll have to update it to delete again. https://github.com/linuxserver/docker-baseimage-alpine-nginx/blob/master/Dockerfile#L40

That would solve the problem. Thanks!

@thespad
Copy link
Member

thespad commented Dec 21, 2023

We're deleting it on the base but it's being added back by installing https://github.com/linuxserver/docker-swag/blob/master/Dockerfile#L45 in the downstream image.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-approval Stale exempt
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants