Skip to content

Conversation

@jim3ma
Copy link

@jim3ma jim3ma commented Sep 3, 2025

Add port for authelia url, like:

https://auth.example.com:6443

@coderabbitai
Copy link

coderabbitai bot commented Sep 3, 2025

📝 Walkthrough

Walkthrough

The Helm template for Authelia ingress host generation now conditionally appends a port to the hostname based on the provided values. If a SubDomain exists, it uses SubDomain.Domain[:Port]; otherwise, Domain[:Port]. A newline was added at EOF for the standard ingress block.

Changes

Cohort / File(s) Summary
Ingress host formatting update
charts/authelia/templates/_ingress.tpl
Adjust host construction to append :Port when Port > 0 for both SubDomain.Domain and Domain; cast Port to int and format with %d. Added trailing newline at EOF in standard ingress section.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as Values.yaml
  participant Helm as Helm Templating
  participant Template as _ingress.tpl
  participant Output as Rendered Host

  User->>Helm: Provide Domain, SubDomain, Port
  Helm->>Template: Render with values
  alt SubDomain set
    alt Port > 0
      Template->>Output: host = SubDomain.Domain:Port
    else Port <= 0 or unset
      Template->>Output: host = SubDomain.Domain
    end
  else No SubDomain
    alt Port > 0
      Template->>Output: host = Domain:Port
    else Port <= 0 or unset
      Template->>Output: host = Domain
    end
  end
  note over Template,Output: Port is cast to int and formatted with %d
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 842ec8e and 8b87033.

⛔ Files ignored due to path filters (4)
  • charts/authelia/templates/configMap.yaml is excluded by !**/*.yaml
  • charts/authelia/templates/traefikCRD/ingressRoute.yaml is excluded by !**/*.yaml
  • charts/authelia/values.local.yaml is excluded by !**/*.yaml
  • charts/authelia/values.yaml is excluded by !**/*.yaml
📒 Files selected for processing (1)
  • charts/authelia/templates/_ingress.tpl (2 hunks)
🔇 Additional comments (2)
charts/authelia/templates/_ingress.tpl (2)

217-217: Trailing newline: LGTM

No functional impact; keeps file style consistent.


14-24: Guard .Port casting in authelia.ingress.host with a default

The authelia.ingress.host helper is only used by authelia.ingress.uri and does not feed into any Ingress or TLS host fields in this chart. You can safely apply this diff to avoid errors when .Port is unset:

@@ charts/authelia/templates/_ingress.tpl
-        {{- if gt (int .Port) 0 }}
-            {{- printf "%s.%s:%d" .SubDomain .Domain (int .Port) }}
-        {{- else }}
-            {{- printf "%s.%s" .SubDomain .Domain }}
-        {{- end }}
+        {{- $port := int (default 0 .Port) -}}
+        {{- if gt $port 0 }}
+            {{- printf "%s.%s:%d" .SubDomain .Domain $port }}
+        {{- else }}
+            {{- printf "%s.%s" .SubDomain .Domain }}
+        {{- end }}
@@ charts/authelia/templates/_ingress.tpl
-        {{- if gt (int .Port) 0 }}
-            {{- printf "%s:%d" .Domain (int .Port) }}
-        {{- else }}
-            {{- .Domain }}
-        {{- end }}
+        {{- $port := int (default 0 .Port) -}}
+        {{- if gt $port 0 }}
+            {{- printf "%s:%d" .Domain $port }}
+        {{- else }}
+            {{- .Domain }}
+        {{- end }}
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

1 participant