diff --git a/SourceGitea/LICENSE b/SourceGitea/LICENSE
new file mode 100644
index 000000000..22def7ca3
--- /dev/null
+++ b/SourceGitea/LICENSE
@@ -0,0 +1,23 @@
+Copyright (c) 2024 Pasquale Pizzuti
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/SourceGitea/SourceGitea.php b/SourceGitea/SourceGitea.php
new file mode 100644
index 000000000..c47f31c61
--- /dev/null
+++ b/SourceGitea/SourceGitea.php
@@ -0,0 +1,405 @@
+author = 'Pasquale Pizzuti';
+ $this->contact = 'paspiz85@gmail.com';
+ }
+
+ public function show_type() {
+ return plugin_lang_get( 'gitea' );
+ }
+
+ public function show_changeset( $p_repo, $p_changeset ) {
+ $t_ref = substr( $p_changeset->revision, 0, 8 );
+ $t_branch = $p_changeset->branch;
+
+ return "$t_branch $t_ref";
+ }
+
+ public function show_file( $p_repo, $p_changeset, $p_file ) {
+ return "$p_file->action - $p_file->filename";
+ }
+
+ public function url_base( $p_repo ) {
+ $t_root = rtrim($p_repo->info['hub_root'], '/');
+ return $t_root . '/' . $p_repo->info['hub_ownerid'] . '/' . $p_repo->info['hub_repoid'];
+ }
+
+ public function url_repo( $p_repo, $p_changeset=null ) {
+ if( empty( $p_repo->info ) ) {
+ return '';
+ }
+ $t_ref = '';
+ if ( !is_null( $p_changeset ) ) {
+ $t_ref = "/src/branch/$p_changeset->revision";
+ }
+ return $this->url_base( $p_repo ) . $t_ref;
+ }
+
+ public function url_changeset( $p_repo, $p_changeset ) {
+ return $this->url_base( $p_repo ) . '/commit/' . $p_changeset->revision;
+ }
+
+ public function url_file( $p_repo, $p_changeset, $p_file ) {
+ # Can't link to a deleted file
+ if( $p_file->action == SourceFile::DELETED ) {
+ return '';
+ }
+ $t_ref = $p_changeset->revision;
+ $t_filename = $p_file->getFilename();
+ return $this->url_base( $p_repo ) . "/src/branch/$t_ref/$t_filename";
+ }
+
+ public function url_diff( $p_repo, $p_changeset, $p_file ) {
+ return $this->url_changeset( $p_repo, $p_changeset );
+ }
+
+ public function update_repo_form( $p_repo ) {
+ $t_hub_root = null;
+ $t_hub_ownerid = null;
+ $t_hub_repoid = null;
+ $t_hub_app_secret = null;
+
+ if ( isset( $p_repo->info['hub_root'] ) ) {
+ $t_hub_root = $p_repo->info['hub_root'];
+ }
+ if ( isset( $p_repo->info['hub_ownerid'] ) ) {
+ $t_hub_ownerid = $p_repo->info['hub_ownerid'];
+ }
+ if ( isset( $p_repo->info['hub_repoid'] ) ) {
+ $t_hub_repoid = $p_repo->info['hub_repoid'];
+ }
+ if ( isset( $p_repo->info['hub_app_secret'] ) ) {
+ $t_hub_app_secret = $p_repo->info['hub_app_secret'];
+ }
+ if ( isset( $p_repo->info['master_branch'] ) ) {
+ $t_master_branch = $p_repo->info['master_branch'];
+ } else {
+ $t_master_branch = $this->get_default_primary_branches();
+ }
+?>
+
<[^>]*(?:h=|/commit/)([0-9a-f]*)#', $t_gitweb_data, $t_matches ) ) {
foreach( $t_matches[1] as $t_match ) {
$t_parents[] = $t_commit['parent'] = $t_match;
}
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 0a8c81bb0..82a89b21d 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -10,6 +10,61 @@ specification.
# Releases for MantisBT 2.x
+## 2.9.1 - 2025-01-26
+
+### Fixed
+
+- Commits time is displayed in the wrong timezone
+ [#419](https://github.com/mantisbt-plugins/source-integration/issues/419)
+
+
+## 2.9.0 - 2025-01-17
+
+### Changed
+
+- Minimum MantisBT version increased to 2.26.4
+ [#266](https://github.com/mantisbt-plugins/source-integration/issues/266)
+ [#380](https://github.com/mantisbt-plugins/source-integration/issues/380)
+
+### Fixed
+
+- checkin.php returning HTTP 200 when errors occur
+ [#266](https://github.com/mantisbt-plugins/source-integration/issues/266)
+- github: API token causes webhook to fail silently
+ [#380](https://github.com/mantisbt-plugins/source-integration/issues/380)
+- gitweb: find parent commits with pathinfo URLs
+ [#418](https://github.com/mantisbt-plugins/source-integration/issues/418)
+
+
+## [2.8.0] - 2024-09-06
+
+### Added
+
+- New Gitea VCS Plugin, thanks to Pasquale Pizzuti
+ [#375](https://github.com/mantisbt-plugins/source-integration/issues/375)
+
+### Fixed
+
+- Code cleanup
+
+
+## [2.7.0] - 2024-01-04
+
+### Changed
+
+- Minimum MantisBT version increased to 2.26.0
+ [#372](https://github.com/mantisbt-plugins/source-integration/issues/372)
+- Use print_form_button() to display "Detach" buttons in view page
+ [#372](https://github.com/mantisbt-plugins/source-integration/issues/372)
+
+### Fixed
+
+- PHP 8.2: Creation of dynamic property is deprecated
+ [#409](https://github.com/mantisbt-plugins/source-integration/issues/409)
+- Page redirections trigger a deprecation warning since MantisBT 2.26.0
+ [#411](https://github.com/mantisbt-plugins/source-integration/issues/411)
+
+
## [2.6.0] - 2022-07-15
### Changed
@@ -660,8 +715,12 @@ Support for the 0.x branch ended on 2017-06-30.
## [0.9] - 2008-04-11
-[Unreleased]: https://github.com/mantisbt-plugins/source-integration/compare/v2.6.0...HEAD
+[Unreleased]: https://github.com/mantisbt-plugins/source-integration/compare/v2.9.1...HEAD
+[2.9.1]: https://github.com/mantisbt-plugins/source-integration/compare/v2.9.0...v2.9.1
+[2.9.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.8.0...v2.9.0
+[2.8.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.7.0...v2.8.0
+[2.7.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.6.0...v2.7.0
[2.6.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.5.2...v2.6.0
[2.5.2]: https://github.com/mantisbt-plugins/source-integration/compare/v2.5.1...v2.5.2
[2.5.1]: https://github.com/mantisbt-plugins/source-integration/compare/v2.5.0...v2.5.1
diff --git a/docs/CONFIGURING.SourceGitea.md b/docs/CONFIGURING.SourceGitea.md
new file mode 100644
index 000000000..61527543a
--- /dev/null
+++ b/docs/CONFIGURING.SourceGitea.md
@@ -0,0 +1,25 @@
+## One time Mantis source integration setup
+
+ - Copy the source integration plugins into mantis "plugins/" subdirectory
+ - Install required plugins with Mantis plugin admin page
+ - Get the "API Key" (like 'abcdeb8129a4451a35f47881') from the Source Integration plugin "manage_config_page"
+ http://mantis.server.intra/plugin.php?page=Source/manage_config_page
+
+## Gitea setup
+
+ - Login with an Owner (or Administrator) of a Project, go to *Settings -> Webhooks* and
+ add a Gitea hook with Mantis URL and Mantis Source Integration plugin "API Key":
+ `http://mantis.server.intra/plugin.php?page=Source/checkin&api_key=abcdeb8129a4451a35f47881`
+ - Go to your user *Settings -> Applications -> Manage Access Tokens* and create a token. You will need it as "hub_app_secret" in Mantis configuration.
+
+## Mantis repository setup
+
+ - In Mantis administration, create a repository with a unique name and of type "Gitea".
+ - URL field is not used by the plugin.
+ - Gitea config fields are:
+ - hub_root: root url of the Gitea webserver, required to access Web API
+ - hub_ownerid: name of the Gitea repository owner, can be an organization or an user.
+ - hub_repoid: name of the Gitea repository.
+ - hub_app_secret: the "Private token" of a user.
+ - master_branch: use '*' or a list of branches to track
+
diff --git a/tools/bump-version.php b/tools/bump-version.php
index 7b0c5afef..dc9a28a5d 100755
--- a/tools/bump-version.php
+++ b/tools/bump-version.php
@@ -16,8 +16,13 @@
*/
// Path to MantisBT root, relative to the Source Integration Plugin's git root
-// Change this based on your dev environment's setting
-$g_mantis_root = '../../mantisbt';
+// Change this based on your dev environment's setting. The default assumes the
+// following directory structure:
+// / Dev root
+// +-- mantis MantisBT root
+// +-- plugins
+// +-- source-integration Source Integration Plugin's git root
+$g_mantis_root = '../../mantis';
// ---------------------------------------------------------------------------
// Main program