diff --git a/README.md b/README.md index 0850f47..a69e9bd 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,11 @@ ## 📝 Introduction -Laravel Telegram Git Notifier is a package that allows you to create a Telegram bot to receive notifications from GitHub or GitLab events and manage customization through messages and buttons on Telegram. +Laravel Telegram Git Notifier is a package that allows you to create a Telegram bot to receive notifications from GitHub +or GitLab events and manage customization through messages and buttons on Telegram. -- Send notifications of your GitHub/GitLab repositories to Telegram Bots, Groups, Super Groups (Multiple Topics), and Channels. +- Send notifications of your GitHub/GitLab repositories to Telegram Bots, Groups, Super Groups (Multiple Topics), and + Channels. - The bot must be created using the [BotFather](https://core.telegram.org/bots#6-botfather) ## 📋 Requirements @@ -35,11 +37,52 @@ You can install this package via Composer: composer require cslant/laravel-telegram-git-notifier ``` +## 🚀 Usage + +See the [Usage - Telegram git notifier Documentation](https://docs.cslant.com/telegram-git-notifier/usage/first_test) +for a list of usage. + Please check and update some configurations in the documentation. ## 📖 Official Documentation -Please see the [Telegram Git Notifier Documentation](https://docs.cslant.com/telegram-git-notifier/) for more information. +Please see the [Telegram Git Notifier Documentation](https://docs.cslant.com/telegram-git-notifier/) for more +information. + +## ✨ Supported events + +### GitHub Events Available + +- [x] Push +- [x] Issues +- [x] Issue Comment +- [x] Pull Request +- [x] Pull Request Review +- [x] Pull Request Review Comment +- [x] Fork +- [x] Commit Comment +- [x] Deployment +- [x] Deployment Status +- [x] Fork +- [x] Gollum +- [x] Watch + + ... and more events can be seen in the [all GitHub events available](https://docs.cslant.com/telegram-git-notifier/prologue/event-availability/github) + +### GitLab Events Available + +- [x] Push +- [x] Tag Push +- [x] Issue +- [x] Merge Request +- [x] Note +- [x] Pipeline +- [x] Wiki Page +- [x] Build +- [x] Deployment +- [x] Release + + ... and more events can be seen in the [all GitLab events available](https://docs.cslant.com/telegram-git-notifier//prologue/event-availability/gitlab) ## License diff --git a/composer.json b/composer.json index bc35369..f61fe6a 100644 --- a/composer.json +++ b/composer.json @@ -51,13 +51,7 @@ }, "scripts": { "analyse": "vendor/bin/phpstan analyse", - "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", - "post-install-cmd": [ - "bash vendor/cslant/telegram-git-notifier/install.sh" - ], - "post-update-cmd": [ - "bash vendor/cslant/telegram-git-notifier/install.sh" - ] + "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" }, "support": { "issues": "https://github.com/cslant/laravel-telegram-git-notifier/issues" diff --git a/resources/views/tools/custom_event.blade.php b/resources/views/tools/custom_event.blade.php index 52eefe8..f7c7ece 100644 --- a/resources/views/tools/custom_event.blade.php +++ b/resources/views/tools/custom_event.blade.php @@ -5,7 +5,7 @@ $docsUrl = 'https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads'; if ($platform === 'gitlab') { - $docsUrl = 'https://docs.gitlab.com/ee/user/project/integrations/webhooks.html'; + $docsUrl = 'https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html'; } $documentation = __('tg-notifier::tools/custom_event.documentation'); ?> diff --git a/src/Commands/ChangeOwnerConfigJson.php b/src/Commands/ChangeOwnerConfigJson.php index 41a084c..5f82f9a 100644 --- a/src/Commands/ChangeOwnerConfigJson.php +++ b/src/Commands/ChangeOwnerConfigJson.php @@ -12,7 +12,7 @@ class ChangeOwnerConfigJson extends Command * @var string */ protected $signature = 'config-json:change-owner - {user : The user to change owner} + {user? : The user to change owner} {group? : The group to change owner}'; /** @@ -29,12 +29,24 @@ class ChangeOwnerConfigJson extends Command */ public function handle(): void { - $user = $this->argument('user'); + if (PHP_OS_FAMILY !== 'Linux') { + $this->error('This command only works on Linux'); + + return; + } + + $user = $this->argument('user') ?? ''; $group = $this->argument('group') ?? $user; + if (empty($user) || empty($group)) { + $group = $user = exec('ps aux | egrep "(apache|httpd|nginx)" | grep -v "root" | head -n1 | cut -d\ -f1'); + } + $jsonsPath = config('telegram-git-notifier.data_file.storage_folder'); if (is_string($jsonsPath) && file_exists($jsonsPath)) { - exec("chown -R $user:$group $jsonsPath"); + shell_exec("chown -R $user:$group $jsonsPath"); + } else { + $this->error('The path to the jsons folder is not valid'); } } }