Skip to content

fix(logs): handle missing clipboard API in non-HTTPS contexts#8942

Open
devrim-1283 wants to merge 2 commits intocoollabsio:nextfrom
devrim-1283:fix/clipboard-https-secure-context
Open

fix(logs): handle missing clipboard API in non-HTTPS contexts#8942
devrim-1283 wants to merge 2 commits intocoollabsio:nextfrom
devrim-1283:fix/clipboard-https-secure-context

Conversation

@devrim-1283
Copy link
Contributor

Changes

The copy-logs clipboard button was silently failing on HTTP instances. The clipboard API is only available in secure contexts (HTTPS or localhost). Calling writeText on undefined threw a TypeError that Alpine.js swallowed — the button appeared to do nothing with no user feedback.

Both deployment show and shared get-logs blade views had the same issue.

  • Added a clipboard existence check before attempting the write
  • Properly chained then/catch on the writeText Promise so success and failure both surface as toast notifications

Issues

  • Fixes

Category

  • Bug fix
  • Improvement
  • New feature
  • Adding new one click service
  • Fixing or updating existing one click service

Preview

No visual changes — behavior fix. On HTTP the error toast now appears instead of silently failing.

AI Assistance

  • AI was NOT used to create this PR
  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code
  • How extensively: Used to explore codebase and identify root cause. I reviewed and verified all changes.

Testing

  1. Access Coolify over HTTP
  2. Start a deployment, open the deployment log screen
  3. Click the copy logs button
  4. Before: silent fail with TypeError in console
  5. After: error toast shown to the user
  6. Same test on HTTPS: copy succeeds with success toast

Contributor Agreement

Important

  • I have read and understood the contributor guidelines. If I have failed to follow any guideline, I understand that this PR may be closed without review.
  • I have searched existing issues and pull requests (including closed ones) to ensure this isn't a duplicate.
  • I have tested all the changes thoroughly with a local development instance of Coolify and I am confident that they will work as expected when a maintainer tests them.

navigator.clipboard is undefined in insecure contexts (HTTP), causing
a silent TypeError when clicking the copy logs button. Added a secure
context check and proper Promise chaining so failures surface as user-
visible error messages instead of silent crashes.

Affects deployment log view and shared get-logs component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants