Commit Graph

2108 Commits

Author SHA1 Message Date
René Pfeuffer
c5b4dcb19e Fix character encoding in diffs (#2046)
Fixes encodings in diff results. The is especially necessary for Windows systems.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-06-01 09:32:12 +02:00
Konstantin Schaper
1b18191c57 Add plugin wizard initialization step (#2045)
Adds a new initialization step after setting up the initial administration account that allows administrators to initialize the instance with a selection of plugin sets.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
2022-05-31 15:15:30 +02:00
Eduard Heimbuch
8f0facf394 Order repo info extensions (#2041)
Set order priority for repository information extensions.
Also add new annotation to set custom resource bundles for cli commands.
2022-05-23 15:06:08 +02:00
René Pfeuffer
256106545d Fix character encoding for basic authentication (#2038)
Regarding to RFC 7617 (see
https://datatracker.ietf.org/doc/html/rfc7617), the default
encoding for basic auth strings should be UTF-8.
2022-05-18 09:44:38 +02:00
Eduard Heimbuch
6a7dc8253d Fix diff command content (#2036)
Fix diff command getContent which returned always empty string because the results were ignored.
2022-05-13 17:59:33 +02:00
Eduard Heimbuch
77046bb6fd Throw error if repo is created with not supported type (#2019)
Throw error if repository is created with not supported type. Currently we only allow git, svn or hg all lowercase.
2022-05-03 16:06:38 +02:00
René Pfeuffer
d2e81ce121 Add cli commands for users and groups (#1993)
Adds cli commands to manage users and groups.

Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
2022-04-11 10:04:19 +02:00
Eduard Heimbuch
4823ed59a2 Add version command for cli client (#1988)
Implement version command to show client and server versions on command line client.
2022-04-05 08:20:18 +02:00
Eduard Heimbuch
162dd6ad0a CLI Support for repository actions (#1987)
To make SCM-Manager more accessible and to make it easier using scripts against the server, we created a command line interface. This command line interface can be used to perform the default actions like create, modify and delete repositories. It is also very flexible and can be extended by plugins.

The CLI already supports internationalization, help texts, input validation, loose and table-like templates and nested subcommands. Check the cli guidelines to learn how add new cli commands.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2022-04-04 12:02:16 +02:00
René Pfeuffer
07afe4b439 Fixes incorrect warning "could not set executable flag"
This warning was triggered, when the change was successful. Of course,
this should be the other way.
2022-04-01 11:29:03 +02:00
Eduard Heimbuch
b7f44315b2 Not unique revisions on compare (#1974)
* Throw more specific exception if compared revisions are ambiguous.
* Add changelog entry
* Move changelog entry in intended folder
* Small typo

Co-authored-by: Florian Scholdei <florian.scholdei@cloudogu.com>
2022-03-14 10:34:17 +01:00
Eduard Heimbuch
4407dc6d8a Add feedback form (#1967)
Add feedback button and form. This feedback form can be used to provide direct feedback to the SCM-Manager Team.

Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
2022-03-10 09:39:17 +01:00
René Pfeuffer
f125f75dc6 Enhance contributor API (#1966)
This adds a core API to handle contributors in changesets for plugins.
2022-02-28 15:03:00 +01:00
Matthias Thieroff
44f0046f25 Collapse folders with only one child folder (#1951)
Collapses a folder in code view which only has another folder as its only child. This lets you access a sub-folder which has content directly instead of navigating down the folder tree by clicking every folder separately.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2022-02-15 10:59:32 +01:00
René Pfeuffer
0ac6273eaa Make comparable null safe (#1933)
A request with a sortBy would have lead to a null pointer exception,
when at least one value for the objects is null. This adds checks to
avoid these exceptions. With this, null values are considered to be
less than non-null values.
2022-01-26 10:05:53 +01:00
Eduard Heimbuch
63ec4e6172 Add security notifications to inform about vulnerabilities (#1924)
Add security notifications in SCM-Manager to inform running instances about known security issues. These alerts can be core or plugin specific and will be shown to every user in the header.

Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
Co-authored-by: Philipp Ahrendt <philipp.ahrendt@cloudogu.com>
Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2022-01-19 11:58:55 +01:00
Matthias Thieroff
11673e6d07 Fix display of ellipsis in search fragments (#1896)
Display ellipsis as an indicator that there is more content before or behind a search result fragment only if there really is more content.
2021-12-15 15:07:46 +01:00
René Pfeuffer
c86c9a21c0 Suppress sonar issue
This issue should not be valid, because branches should have been validated by
other layers beforehand.
2021-12-13 18:09:59 +01:00
Sebastian Sdorra
e2d63cc2a1 Use more accurate language detection for syntax highlighting (#1891)
Updated spotter to version 4 in order to get prism syntax mode for detected coding languages.
Expose syntax modes of coding languages as headers on content endpoint and as fields on diff dto.
Remove leading line break on search result fragments.
Use mark instead of span or strong for highlighted search results.
Add option to use syntax highlighting in TextHitField component.

Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
2021-12-13 17:03:08 +01:00
Sebastian Sdorra
6eba01161f Integrate Plugin Center myCloudogu Authentication (#1884)
Allows scm-manager instances to authenticate with the configured plugin center. If the default plugin center is used, a myCloudogu account is used for authentication which in turn enables downloading special myCloudogu plugins directly through the plugin administration page.

Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
Co-authored-by: Matthias Thieroff <93515444+mthieroff@users.noreply.github.com>
Co-authored-by: Philipp Ahrendt <philipp.ahrendt@cloudogu.com>
2021-12-13 15:15:57 +01:00
Eduard Heimbuch
b8d6c219ee Add extension point to branches overview (#1888)
Prepare branches overview to show additional branch details.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-12-10 11:04:59 +01:00
Eduard Heimbuch
9cc134f5a8 Feature/branch details (#1876)
Enrich branch overview with more details like last committer and ahead/behind commits. Since calculating this information is pretty intense, we request it in chunks to prevent very long loading times. Also we cache the results in frontend and backend.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-12-01 14:19:18 +01:00
René Pfeuffer
6ea77b42ca Fix edge cases in move (#1874)
Fixes edge cases for "move" in the modify command, like

- reject backslashes in validation
- add overwrite option
- check for invalid source and target options

This is an update to the implementation of "move" in #1859.

Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
2021-11-30 08:49:47 +01:00
Sebastian Sdorra
9dee08f68d Update Gradle to 7.3 (#1873)
Update Gradle to 7.3. in order to profit from the performance improvement and to prepare for dependency lockfiles. Due to the upgrade to 7.x we had to use a license plugin which supports Gradle 7.
2021-11-29 09:05:24 +01:00
Matthias Thieroff
f0ab0950a2 Fix move in modify command for windows (#1872)
On Windows the path after moving files was not recognized correctly by git, hg and svn. The move resulted in a deletion without adding new files. Therefore we now change the path to unix style before adding files whenever we detect a non unix style file separator.
2021-11-24 14:23:20 +01:00
René Pfeuffer
b26ed95333 Autocloseable streams in XML DB (#1868)
Introduce autocloseable streams for file handling in xml database module.
2021-11-22 10:26:00 +01:00
StNekroman
b09284f1f5 Handle resources, never left left opened file handler on windows (#1857)
On windows unit tests are failing because junit checks if all @tempdir directries are empty and can be deleted after test run.
But due to opened file handles (not closed resource streams) Windows keeps files, which are "in use".
Linux is less strict in this area.
Additionally I want highlight that XMLStreamReaderImpl/XMLStreamWriterImpl from apache.xerces library (in OpenJDK11 at least) which are picked at runtime as xml parser implementation - they don't close associated resources.
BTW, I thing that relying on some runtime (sometimes - unpredictable) dependencies - is bad practice, but this it up to separate topic.
Additional fix: in IOUtil is file is locked (due to permissions or opened handle) - it will undlessly try-and-retry to delete it until end of the world, on windows.
2021-11-22 10:22:46 +01:00
Konstantin Schaper
13590676fd Add move to modify command (#1859)
dds a move/rename functionality to the modify command. This currently only works for absolute destination paths and does not work with backslashes. If the destination path does not exist, it is created. The action fails if the target file already exists.
2021-11-19 08:43:44 +01:00
Sebastian Sdorra
42d79bad63 Multipart form support for AdvancedHttpClient (#1856)
Add support for mutlipart form data to the AdvancedHttpClient API.
2021-11-11 15:48:16 +01:00
René Pfeuffer
7a72359bc9 File lock for svn (#1847)
Implements the file lock command for SVN.
2021-11-11 10:58:26 +01:00
René Pfeuffer
3792374d59 Fix serialization error with health check failures 2021-11-10 14:44:28 +01:00
René Pfeuffer
e1a2d27256 Implement file lock for git (#1838)
Adds a "file lock" command that can be used to mark files as locked by a specific user. This command is implemented for git using a store to keep the locks.

Additionally, the Git LFS locking API is implemented.

To display locks, the scm-manager/scm-file-lock-plugin can be used.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-11-01 16:54:58 +01:00
Sebastian Sdorra
87aea1936b Remove www from scm-manager.org url (#1837) 2021-10-28 11:00:24 +02:00
René Pfeuffer
41b8f091c0 Add recursive deletion in modify command (#1821)
Adds a method in the ModifyCommand to delete not only files, but also directories recursively.
2021-10-07 14:40:48 +02:00
Sebastian Sdorra
d1de7bf214 Clear external group cache on explicit logout or user deletion (#1819)
Clears the external group cache whenever a user gets logged out by the logout rest method or the user gets deleted.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-10-06 14:34:10 +02:00
René Pfeuffer
2b85081032 Make EMail computation available for DisplayUser (#1815)
Adds an internal api call to determine a email address for a DisplayUser instance
in class EMail. This was available only for the User class before, but there is no
reason, why this should be limited.

Additionally one can also set the author for the merge command as DisplayUser,
which will trigger the fallback mechanisms for the email address, if it is missing.

This is introduced to make merge commits possible for users without email addresses
in the review plugin (scm-manager/scm-review-plugin#149).
2021-09-30 14:32:31 +02:00
Eduard Heimbuch
922dc27c49 Add delete method for configuration store (#1814)
Add method to delete configuration stores completely.
2021-09-30 08:54:22 +02:00
Eduard Heimbuch
8a65660278 Auto mapper binding (#1807)
Bind mapper implementations automatically to related mappers using the annotation processor. With this change it is not longer required to bind mapper explicitly using mapper modules which reduces some boilerplate code.
2021-09-14 09:26:47 +02:00
René Pfeuffer
13d72d45c6 Prevent multiple instances of working copy pool (#1797)
The working copy pool has to be a singleton, because
otherwise there could be multiple instances with their
own caches and therefore no reuse and maybe more relevant
working directories that will never be deleted.
2021-09-06 08:40:22 +02:00
Sebastian Sdorra
70fba6c990 More flexible delete and query api (#1790)
Replaces the filter and delete by repository api's with a more flexible api, which allows to filter and delete by any id part.
2021-09-01 16:19:19 +02:00
Sebastian Sdorra
765a39e4ce Remove unsafe index options api (#1787)
The IndexOptions api has several problems:
- It is possible to open the same index with different options, which could lead to scoring problems
- If the index is already opened from another task, the options are ignored and the one from the opening task are used
- The analyzer which is derived from the options is used for every field which has not configured a specific analyzer
- This change removes the options api completely.

Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2021-08-31 14:03:16 +02:00
Sebastian Sdorra
571025032c Create a more flexible and typesafe id for indexed objects (#1785)
Id's can now be combined with more than just a repository. It is now possible to build a more complex Id such as Comment -> Pull request -> Repository. The id's now bound to a specific type. This makes it harder to accidentally use a id within an index of the wrong type.
2021-08-31 11:27:49 +02:00
Sebastian Sdorra
0a26741ebd One index per type and parallel indexing (#1781)
Before this change the search uses a single index which distinguishes types (repositories, users, etc.) with a field (_type).
But it has turned out that this could lead to problems, in particular if different types have the same field and uses different analyzers for those fields. The following links show even more problems of a combined index:

    https://www.elastic.co/blog/index-vs-type
    https://www.elastic.co/guide/en/elasticsearch/reference/6.0/removal-of-types.html

With this change every type becomes its own index and the SearchEngine gets an api to modify multiple indices at once to remove all documents from all indices, which are related to a specific repository, for example.

The search uses another new api to coordinate the indexing, the central work queue.
The central work queue is able to coordinate long-running or resource intensive tasks. It is able to run tasks in parallel, but can also run tasks which targets the same resources in sequence. The queue is also persistent and can restore queued tasks after restart.

Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2021-08-25 15:40:11 +02:00
Konstantin Schaper
44f25d6b15 Fix disabled local proxy configuration being used over global config (#1780)
The original proxy configuration implementation only used the global configuration if the local proxy configuration was not provided (i.e. null). This PR adds the corner case where a local configuration is provided, but disabled. In this case, the global proxy configuration will be used as a fallback as well.
2021-08-25 08:19:52 +02:00
Sebastian Sdorra
519748106e Fix too heavy logging of SchemeBasedWebTokenGenerator (#1777)
Reduce log level of `could not create token from authentication header from warn to debug, because it is normal that these message is logged if multiple SchemeBasedWebTokenGenerator are registered.

Fixes #1772
2021-08-23 20:07:52 +02:00
Sebastian Sdorra
7f9f4e566c Proxy support for pull, push and mirror commands (#1773)
Apply proxy support for jGit by extracting the required functionality from the DefaultAdvancedHttpClient into its own class HttpURLConnectionFactory. This new class is now used by the DefaultAdvancedHttpClient and jGit.
The HttpURLConnection also fixes proxy server authentication, which was non functional in DefaultAdvancedHttpClient.
The proxy support for SVNKit is implemented by using the provided method of the BasicAuthenticationManager.
For mercurial the support is configured by writing the required settings to a temporary hgrc file.
2021-08-19 11:27:51 +02:00
Sebastian Sdorra
3e6ce4e814 Add DefaultBranchChangedEvent (#1763)
The DefaultBranchChangedEvent is fired whenever the default branch of repository changes.
2021-08-11 09:28:00 +02:00
René Pfeuffer
8558572c99 Modifications command between two revisions (#1761)
Adds the option to compute the modifications between two revisions unsing the modifications command.
2021-08-09 12:13:41 +02:00
Konstantin Schaper
ddd2fc1055 Add additional help to quick search and an advanced search documentation page (#1757)
Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-08-09 12:07:28 +02:00
Sebastian Sdorra
8ce69d9848 Allow enrichment of embedded repositories on search hits (#1760)
* Introduce RepositoryCoordinates

RepositoryCoordinates will be used for the enrichment of the embedded repositories of search result hits. This is required, because if we used the normal repository for the enrichment, we would get a lot of unrelated enrichers would be applied.

* Add builder method to HalEnricherContext

With the new builder method it is possible to add an object to the context with an interface as key.

* Add enricher support for embedded repository by applying enricher for RepositoryCoordinates

* Use embedded repository for avatars
2021-08-05 15:12:48 +02:00