(Grav GitSync) Automatic Commit from smokephil

This commit is contained in:
smokephil 2025-11-11 19:27:29 +01:00 committed by GitSync
parent d73d0ba519
commit 96a01e3ab4
260 changed files with 25905 additions and 16011 deletions

View file

@ -1,3 +1,12 @@
# v3.0.0
## 10/19/2025
1. [](#improved)
* Grav 1.8 support
* Use `{$var}` instead of `${var}` causing deprecation notices
* Prevent accepting webhooks when they are disabled in config [#216](https://github.com/trilbymedia/grav-plugin-git-sync/issues/216)
* Updated FAQ link to discussion
# v2.3.2
## 06/03/2021

View file

@ -81,10 +81,10 @@ Example: private_key: `/home/www-data/.ssh/id_rsa`
> **IMPORTANT**: SSH keys with passphrase are **NOT** supported. To remove a passphrase, run the `ssh-keygen -p` command and when asked for the new passphrase leave blank and return.
# Known Issues and Resolutions
**Q:** `error: The requested URL returned error: 403 Forbidden while accessing...` [#39](https://github.com/trilbymedia/grav-plugin-git-sync/issues/39)
**Q:** `error: The requested URL returned error: 403 Forbidden while accessing...` (reference, [#39](https://github.com/trilbymedia/grav-plugin-git-sync/issues/39))
**A:** This might be caused by your computer having stored in the registry a user/password that might conflict with the one you are intending to use.
[Follow the instructions for resolving the issue...](https://github.com/trilbymedia/grav-plugin-git-sync/issues/39#issuecomment-538867548)
[Follow the instructions for resolving the issue...](https://github.com/trilbymedia/grav-plugin-git-sync/discussions/202#discussioncomment-869460)
# Sponsored by
This plugin could not have been realized without the sponsorship of [Hibbitts Design](http://www.hibbittsdesign.org/blog/) and the development of [Trilby Media](http://trilby.media).
This plugin could not have been realized without the sponsorship of [HibbittsDesign.org](http://www.hibbittsdesign.org) and the development of [Trilby Media](http://trilby.media).

View file

@ -1,7 +1,7 @@
name: Git Sync
type: plugin
slug: git-sync
version: 2.3.2
version: 3.0.0
description: Allows to synchronize portions of Grav with Git Repositories (GitHub, BitBucket, GitLab)
icon: git
author:
@ -15,8 +15,8 @@ docs: https://github.com/trilbymedia/grav-plugin-git-sync
license: MIT
dependencies:
- { name: grav, version: '>=1.6.0' }
- { name: form, version: '>=2.16.3' }
- { name: grav, version: '>=1.7.0' }
- { name: form, version: '>=3.0.0' }
form:
validation: strict

View file

@ -502,6 +502,8 @@ class GitSync extends Git
throw new \RuntimeException($message);
}
return 0;
}
/**

View file

@ -77,7 +77,7 @@ class Helper
return $repository;
}
return str_replace('://', "://${user}${password}@", $repository);
return str_replace('://', "://{$user}{$password}@", $repository);
}
/**

View file

@ -41,5 +41,7 @@ class InitCommand extends ConsoleCommand
$plugin->addRemote();
$this->output->writeln('completed.');
return 0;
}
}

View file

@ -71,6 +71,8 @@ class PasswdCommand extends ConsoleCommand
$this->output->writeln('');
$this->output->writeln('<green>User / Password updated.</green>');
$this->output->writeln('');
return 0;
}
private function console_header($readable, $cmd = '', $remote_action = false)

View file

@ -129,6 +129,8 @@ EOF
} else {
$this->console_header('Looks good: use <info>--fetch</info> option to check for updates.');
}
return 0;
}
private function console_header($readable, $cmd = '', $remote_action = false)

View file

@ -46,6 +46,8 @@ class SyncCommand extends ConsoleCommand
$plugin->sync();
$this->output->writeln('completed.');
return 0;
}
}

View file

@ -98,8 +98,8 @@ class GitSyncPlugin extends Plugin
$secret = $config['webhook_secret'] ?? false;
$enabled = $config['webhook_enabled'] ?? false;
if ($route === $webhook && $_SERVER['REQUEST_METHOD'] === 'POST') {
if ($secret && $enabled) {
if ($enabled && $route === $webhook && $_SERVER['REQUEST_METHOD'] === 'POST') {
if ($secret) {
if (!$this->isRequestAuthorized($secret)) {
http_response_code(401);
header('Content-Type: application/json');