Skip to content

Add alpine cloudflared script set - #1360

Closed
bandogora wants to merge 18 commits into
community-scripts:mainfrom
bandogora:alpine-cloudflared
Closed

Add alpine cloudflared script set#1360
bandogora wants to merge 18 commits into
community-scripts:mainfrom
bandogora:alpine-cloudflared

Conversation

@bandogora

Copy link
Copy Markdown
Contributor

Scripts which are clearly AI generated and not further revised by the Author of this PR (in terms of Coding Standards and Script Layout) may be closed without review.

✍️ Description

Adds alpine-cloudflared script set and update frontend json

🔗 Related PR / Issue

Link: #

✅ Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No breaking changes – Existing functionality remains intact.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔍 Code & Security Review (X in brackets)

  • Follows Code_Audit.md & CONTRIBUTING.md guidelines
  • Uses correct script structure (AppName.sh, AppName-install.sh, AppName.json)
  • No hardcoded credentials

📋 Additional Information (optional)


📦 Application Requirements (for new scripts)

Required for 🆕 New script submissions.
Pull requests that do not meet these requirements may be closed without review.

  • The application is at least 6 months old
  • The application is actively maintained
  • The application has 600+ GitHub stars
  • Official release tarballs are published

@bandogora
bandogora requested review from a team as code owners January 29, 2026 16:33
@greptile-apps

greptile-apps Bot commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR adds Alpine Linux support for Cloudflared with interactive token configuration. However, it violates a critical repository rule requiring all ct/*.sh files and JSON install methods to specify Debian as the OS, not Alpine.

Key issues found:

  • Critical: ct/alpine-cloudflared.sh specifies var_os="${var_os:-alpine}" instead of required debian (violates rule 7ddeff42)
  • Critical: frontend/public/json/cloudflared.json specifies "os": "Alpine" instead of required "Debian" (violates rule 7ddeff42)
  • Logic error: Uses || true operator on line 64 to suppress failures, which masks errors (violates rule 1749f54a)
  • Style violations: Both scripts contain numerous non-header comments throughout the code (violates rule 2fcf5e5e)
  • Typo: Comment contains 'Increse' instead of 'Increase' in install/alpine-cloudflared-install.sh:23

The implementation itself appears functional with proper user configuration handling and service setup, but the OS specification violations are blocking issues that must be resolved before merge.

Confidence Score: 1/5

  • This PR has critical policy violations that block merge
  • Multiple violations of mandatory repository rules, including the critical OS specification requirement that affects both the shell script and JSON configuration
  • All three files require attention: ct/alpine-cloudflared.sh for OS specification and code style, install/alpine-cloudflared-install.sh for comments and typo, frontend/public/json/cloudflared.json for OS specification

Important Files Changed

Filename Overview
ct/alpine-cloudflared.sh violates OS requirement (uses alpine instead of debian), contains prohibited comments, uses
install/alpine-cloudflared-install.sh contains typo in comment and multiple non-header comments that violate style guidelines
frontend/public/json/cloudflared.json specifies Alpine OS instead of required Debian OS for alpine install method

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

3 files reviewed, 25 comments

Edit Code Review Agent Settings | Greptile

Comment thread ct/alpine-cloudflared.sh
Comment thread ct/alpine-cloudflared.sh
Comment thread ct/alpine-cloudflared.sh
token_valid() {
local token="$1"

# Sanitize token of unprintable chars

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove non-header comment

Context Used: Rule from dashboard - What: Shell script files in ct/ and /install directories must not contain comments except for file h... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread ct/alpine-cloudflared.sh
# Sanitize token of unprintable chars
token=$(echo "$token" | tr -cd '[:print:]')

# Validate token is present and alphanumeric (should be Base64)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove non-header comment

Context Used: Rule from dashboard - What: Shell script files in ct/ and /install directories must not contain comments except for file h... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread ct/alpine-cloudflared.sh
return 1
fi

# export for use in install script

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove non-header comment

Context Used: Rule from dashboard - What: Shell script files in ct/ and /install directories must not contain comments except for file h... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


# Enable sysctl service so conf is applied on start
$STD rc-update add sysctl
# Increase ping_group_range by one to create space for cloudflared group

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove non-header comment

Context Used: Rule from dashboard - What: Shell script files in ct/ and /install directories must not contain comments except for file h... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

net.ipv4.ping_group_range = 65534 65535
EOF

# Apply 90-cloudflared.conf now

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove non-header comment

Context Used: Rule from dashboard - What: Shell script files in ct/ and /install directories must not contain comments except for file h... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


# Apply 90-cloudflared.conf now
$STD sysctl -p /etc/sysctl.d/90-cloudflared.conf
# Create cloudflared group in ping_group_range

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove non-header comment

Context Used: Rule from dashboard - What: Shell script files in ct/ and /install directories must not contain comments except for file h... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


if [ -z "${TOKEN:-}" ]; then
mkdir -p "$CONFIG_PATH"
# Create empty config file so permissions are correct and users can find it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove non-header comment

Context Used: Rule from dashboard - What: Shell script files in ct/ and /install directories must not contain comments except for file h... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

exit 1
fi

# Start service now if externally managed, otherwise user needs to setup config first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove non-header comment

Context Used: Rule from dashboard - What: Shell script files in ct/ and /install directories must not contain comments except for file h... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@MickLesk

Copy link
Copy Markdown
Member

The whole Script is AI generated? Then use in Docs the AI.md and improve the Script. Many Issues or wrong conversations. All Scripts should have the Same Syntax. Alpine is very smart and should be an easy Script

@community-scripts community-scripts deleted a comment from greptile-apps Bot Jan 30, 2026
Comment thread ct/alpine-cloudflared.sh
@@ -0,0 +1,143 @@
#!/usr/bin/env bash
# shellcheck source=misc/build.func

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
# shellcheck source=misc/build.func

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Without this shellcheck gives a warning. I also think it's nice that it points to the scripts location in the repo.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can disable the lint in the shellcheckrc if everyone thinks it's not useful.

Comment thread ct/alpine-cloudflared.sh
Comment on lines +17 to +18
var_token="${var_token:-}"
var_config_path="${var_config_path:-/usr/local/etc/cloudflared}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
var_token="${var_token:-}"
var_config_path="${var_config_path:-/usr/local/etc/cloudflared}"

Where did you get that from?

@bandogora bandogora Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I created them in case users want to set the var and skip the whiptail menu. I can make it a normal ENV var but figured the user choice would be nice and wanted to stick with the convention for user settable vars.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can also use them to skip the menu for CD/CI if you have a workflow that tests skip installation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just stick to the standards here please.

@bandogora

Copy link
Copy Markdown
Contributor Author

The whole Script is AI generated?

None of this is AI generated. I customized the script to install a production ready container with user friendly setup.

Is it the comments that give you that impression? I think code comments are important for maintainability and understanding.

Many Issues or wrong conversations. All Scripts should have the Same Syntax. Alpine is very smart and should be an easy Script

Could you point out some of your issues with the script?

Most variance comes from allowing the user to use a token (remote managed) or a config file (locally managed). That and setting up a cloudflared user with limited permissions, which is a security best practice.

The cloudflared group should also be in the ping_group_range to allow the ICMP proxy feature (or you get a warning in the output).

If your main issue is the whiptail menu, that is in the docs and I tried to keep it simple and added comments to explain what it's doing.

Comment thread ct/alpine-cloudflared.sh
Comment on lines +128 to +132
if [ -z "$var_token" ]; then
echo -e "${TAB}📝${TAB}${BOLD}${DGN}Tunnel Config: ${BGN}${CONFIG_PATH}/config.yml${CL}"
else
echo -e "${TAB}🪪${TAB}${BOLD}${DGN}Tunnel Token: ${BGN}${TOKEN:0:33}...${CL}"
fi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These lines can be removed but I thought it was helpful information for the user.

@bandogora

bandogora commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

The frontend test are failing because I updated cloudflared.json instead of creating alpine-cloudflared.json. Should I create a alpine-cloudflared.json for the tests?

@MickLesk

Copy link
Copy Markdown
Member

Yes because cloudflare isnt available here

@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

@bandogora This PR has been marked as stale. It will be closed if no new commits are added in 7 days.

@michelroegl-brunner

Copy link
Copy Markdown
Member

You are still missing to address some review comments from Greptile. Also can you please explaine the whole function in the main file. Why is that needed. This dose not stick to our standards.

@github-actions github-actions Bot closed this Mar 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@bandogora Closing stale PR due to inactivity (no commits for 7 days after stale label).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants