Skip to content

feat(build): download icons during package build#41

Merged
mairas merged 2 commits intomainfrom
feat/download-icons-during-build
Dec 14, 2025
Merged

feat(build): download icons during package build#41
mairas merged 2 commits intomainfrom
feat/download-icons-during-build

Conversation

@mairas
Copy link
Contributor

@mairas mairas commented Dec 13, 2025

Summary

Add icon download step to build-source.sh that downloads missing icons from CDN URLs stored in each app's metadata.yaml before building packages.

How it works

  1. Before building app packages, the script iterates through all apps
  2. For apps without an existing icon file, it extracts the icon: URL from metadata.yaml
  3. Downloads the icon from the upstream CasaOS CDN
  4. The icon is then included in the generated .deb package

Why this approach

  • No repo bloat: Icons are downloaded at build time, not stored in the repo
  • Always fresh: Icons come from the authoritative upstream source
  • Reliable: All 144 apps have icon URLs in their metadata (set during conversion)
  • Graceful fallback: Apps that fail to download icons still build successfully

Test plan

  • CI builds successfully
  • Icon download step runs and reports results
  • Generated packages include icons
  • Icons display correctly in Homarr dashboard

Closes #39

🤖 Generated with Claude Code

Add icon download step to build-source.sh that downloads missing
icons from CDN URLs stored in each app's metadata.yaml before
building packages.

This ensures all CasaOS container packages include icons for
offline Homarr dashboard display, without requiring icons to be
stored in the repository.

The metadata.yaml files already contain icon URLs from the original
CasaOS app manifests, making this approach reliable for all 144 apps.

Closes #39

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

Build failed for casaos

Please check the workflow logs for details.

Use `: $((var++))` instead of `((var++))` to prevent
script failure when incrementing from 0 with set -e.

In bash, ((0)) returns exit code 1, causing the script
to terminate on the first counter increment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mairas
Copy link
Contributor Author

mairas commented Dec 14, 2025

Code Review

Summary

This PR adds automatic icon downloading from CasaOS CDN URLs during package build. The approach is sound - downloading at build time avoids repo bloat while ensuring icons are available.

Issues Found

  1. Build failure (fixed in dc366c0): The original code used ((counter++)) which returns exit code 1 when counter is 0, causing set -e to terminate. The fix correctly changed this to : $((counter++)).

  2. Potential grep failure: Line 130 could still fail with set -e if grep finds no matches:

    icon_url=$(grep -E '^icon:\s*https?://' "$metadata_file" 2>/dev/null | sed 's/^icon:\s*//' | tr -d ' ')

    If any metadata file lacks a matching icon URL pattern, grep returns exit code 1. Consider adding || true:

    icon_url=$(grep -E '^icon:\s*https?://' "$metadata_file" 2>/dev/null | sed 's/^icon:\s*//' | tr -d ' ' || true)
  3. Metadata format warnings (separate issue): The warnings about deprecated package_name field are from the CasaOS converter generating outdated metadata, not this PR. Will track separately.

What's Good

  • Clean approach: icons downloaded at build time, not stored in repo
  • Graceful fallback: apps without icons still build
  • Good reporting of download statistics

Recommendation

If the current build passes, the PR is ready to merge. If it fails due to the grep issue mentioned above, the fix is straightforward.

@github-actions
Copy link

Build successful for casaos

📦 Built 145 packages

Packages are available as workflow artifacts for inspection.

@mairas mairas merged commit 456e588 into main Dec 14, 2025
2 checks passed
@mairas mairas deleted the feat/download-icons-during-build branch December 14, 2025 09:31
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.

feat: download icons during CasaOS app conversion

1 participant