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

nginx: update init script to publish services over mdns #23767

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

mhusaam
Copy link
Contributor

@mhusaam mhusaam commented Mar 27, 2024

update init script to announce http related services over mdns

Signed-off-by: Mohd Husaam Mehdi [email protected]

@systemcrash
Copy link
Contributor

please remove the merge commit @mhusaam

@mhusaam
Copy link
Contributor Author

mhusaam commented Apr 18, 2024

Hi @systemcrash, thanks for pointing it out. I have updated the PR, kindly review.

net/nginx/files/nginx.init Show resolved Hide resolved
net/nginx/files/nginx.init Outdated Show resolved Hide resolved
@mhusaam
Copy link
Contributor Author

mhusaam commented Apr 19, 2024

Hi @systemcrash, thanks for your comments. Kindly review. The following has been updated:

  1. mdns option moved to global main section instead of per server. (while revisiting I realised that we cannot add an option in server section.)
  2. changed mdns to default false, so now it has to be explicitly set to true. (because it was mentioned as a comment in my other PR: atftpd: update init script to use procd and publish service #23765 (comment))
  3. Resolved your comments.

Thanks.

port=$(echo "$port" | head -n1 | awk '{print $1;}')


if [ "${enabled}" != "0" ] && [ "${enabled}" != "false" ] && [ -n "${port}" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason you chose "${...}" ? I see it used in a few other places in the file, but keep it to "$..." or ${...}.

Also, indent inside the if block.

Apply tabs consistently to indent inside this function block. Line up this function indent with the function above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @systemcrash,

  • ${} was me being "extra careful" in the in the test operator :)
  • I like to have consistent indentation neither vim nor github show the indentation, and vim does not have great support for indentation in shell scripts (it is good for C), so I missed that. I will try to use VisualStudio editor for this in future.

configure_mdns() {
local mdns="$(uci -q get nginx.global.mdns)"

if [ "${mdns}" = "1" ] || [ "${mdns}" = "true" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice mix of styles here. [ ... ] is basically if. Not important.

It would improve readability to tab indent here inside the if block. Indent equally, using tabs.
So here, maybe outdent the if and fi to match local.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello,

Fixed the indentation.

@systemcrash
Copy link
Contributor

Otherwise, looks good functionality-wise.

@mhusaam mhusaam force-pushed the for_nginx_mdns branch 5 times, most recently from bb06e3a to 3f265ca Compare April 20, 2024 15:42
@mhusaam
Copy link
Contributor Author

mhusaam commented Apr 20, 2024

Hello @systemcrash, thanks for your comments. I have resolved them. Kindly review.

@Ra2-IFV
Copy link
Contributor

Ra2-IFV commented Nov 26, 2024

ping @Ansuel
looks good here

@Ansuel
Copy link
Member

Ansuel commented Nov 26, 2024

@Ra2-IFV thanks for the ping, will fix 1-2 formal thing and I will merge this.

Update nginx init script to announce http related services over mdns.

Signed-off-by: Mohd Husaam Mehdi <[email protected]>
[ bump PKG release, improve commit description ]
Signed-off-by: Christian Marangi <[email protected]>
@Ansuel Ansuel merged commit d7e86e7 into openwrt:master Nov 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants