feat: Add setting to disable embed endpoints and UI.#4316
Conversation
Agent-Logs-Url: https://github.com/LycheeOrg/Lychee/sessions/9124130a-5f1e-47bc-9b13-53c399f83543 Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
Agent-Logs-Url: https://github.com/LycheeOrg/Lychee/sessions/9124130a-5f1e-47bc-9b13-53c399f83543 Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
📝 WalkthroughWalkthroughA configuration feature enabling administrators to disable embed functionality globally. Changes include backend controller guards, a new database migration for the config setting, frontend state management integration, and UI components gated by the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ❌ 1❌ Failed checks (1 warning)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
resources/js/composables/contextMenus/leftMenu.ts (1)
124-124: Minor:?? truefallback is dead code.
is_embed_enabledis typed asboolean(non-nullable) inlychee.d.tsand the store initializes it totrue, sois_embed_enabled.valuecan never benull/undefined. The?? truefallback can be dropped for clarity, though it's harmless.♻️ Suggested simplification
- access: (is_embed_enabled.value ?? true) && user.value?.id !== null, + access: is_embed_enabled.value && user.value?.id !== null,
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2e8e758f-7b06-4f50-94bc-c9b16889bb16
📒 Files selected for processing (7)
app/Http/Controllers/Gallery/EmbedController.phpapp/Http/Resources/GalleryConfigs/InitConfig.phpdatabase/migrations/2026_04_22_000001_add_embed_enabled_config.phpresources/js/components/gallery/albumModule/AlbumHero.vueresources/js/composables/contextMenus/leftMenu.tsresources/js/lychee.d.tsresources/js/stores/LycheeState.ts
We got news some people don't want that.
Summary by CodeRabbit