Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
feat: use environment variable for Horizon access control
Paulo Castellano8289e11128d1
diff --git a/app/Providers/HorizonServiceProvider.php b/app/Providers/HorizonServiceProvider.phpindex 59599dc98..c7d739b7c 100644--- a/app/Providers/HorizonServiceProvider.php+++ b/app/Providers/HorizonServiceProvider.php@@ -14,10 +14,6 @@ class HorizonServiceProvider extends HorizonApplicationServiceProviderpublic function boot(): void{parent::boot();-- // Horizon::routeSmsNotificationsTo('15556667777');- // Horizon::routeMailNotificationsTo('[email protected]');- // Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');}/**@@ -28,9 +24,11 @@ class HorizonServiceProvider extends HorizonApplicationServiceProviderprotected function gate(): void{Gate::define('viewHorizon', function ($user = null) {- return in_array(optional($user)->email, [- //- ]);+ $allowedEmails = array_filter(+ array_map('trim', explode(',', config('horizon.allowed_emails', '')))+ );++ return in_array(optional($user)->email, $allowedEmails);});}}diff --git a/config/horizon.php b/config/horizon.phpindex 1153f9dc4..2e456be5f 100644--- a/config/horizon.php+++ b/config/horizon.php@@ -30,6 +30,18 @@ return ['domain' => env('HORIZON_DOMAIN'),+ /*+ |--------------------------------------------------------------------------+ | Horizon Allowed Emails+ |--------------------------------------------------------------------------+ |+ | This is a comma-separated list of email addresses that are allowed to+ | access Horizon in non-local environments. Leave empty to deny all.+ |+ */++ 'allowed_emails' => env('HORIZON_ALLOWED_EMAILS', ''),+/*|--------------------------------------------------------------------------| Horizon Path