Commit Graph

2572 Commits

Author SHA1 Message Date
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
René Pfeuffer
ecb14eb380 Fix branch overview page (#1963) 2022-02-24 08:59:06 +01:00
René Pfeuffer
2490bf07d5 Fix ClassNotFoundException on startup (#1958) 2022-02-21 13:51:04 +01:00
Eduard Heimbuch
a50e38077c Fix npe for searchable types which no longer exist because the plugin that provided the type was deleted 2022-02-18 08:19:51 +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
Sebastian Sdorra
c74e9984f6 Handle Plugin Center Authentication failures (#1940)
If the plugin center authentication fails,
the plugins are fetched without authentication
and a warning is displayed on the plugin page.

Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2022-01-31 15:41:12 +01:00
Matthias Thieroff
0f01bb82c6 Fix bugs in unit tests which occur on Windows only (#1927)
On Windows it is much more necessary to close files to avoid locked files which prevent deleting a temporary file or folder. Also paths need to be handled differently because of the drive letter and colon appearing on Windows.
2022-01-20 08:48:13 +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
Eduard Heimbuch
07fa753f80 Encrypt myCloudogu refresh token on file system (#1923)
Encrypt myCloudogu refresh token on file system and update current stored tokens using an update step.
2022-01-19 09:26:01 +01:00
René Pfeuffer
f2a1effc77 Sorted autocomplete (#1918)
Users, groups, repositories and repository roles have been sorted in the rest layer by default if no other sort option was given. In the layers "below" (aka the manager classes or the dao), the collections have been unsorted. This led to the effect, that the autocomplete resource, which did not sort all values beforehand, returned unsorted results. As a sideeffect, direct matches for an input could occur at a random position or not at all (as reported in #1695), when there were enough other matches.

With this pull request the databases for users, groups, repositories and repository roles will use instances of TreeMap instead of LinkedHashMap internally, so that these values are sorted implicitly (by id respectively name for users, groups and repository roles and namespace/name for repositories).

Due to this change the default sort applied in the rest layer could be removed.
2022-01-18 09:46:10 +01:00
René Pfeuffer
6ca88e6772 Merge branch 'master' into develop 2022-01-18 08:22:37 +01:00
Sebastian Sdorra
3f1b519f97 Fix path traversal vulnerability 2022-01-17 16:01:09 +01:00
René Pfeuffer
e9f22e89ec Autocomplete for namespaces (#1916)
Changes the "namespace" input in the repository creation form or the "rename repository" dialog to an
autocomplete input. Of course this is only available for the "custom" namespace strategy.
2022-01-11 16:17:57 +01:00
Matthias Thieroff
bc86ed4474 Display search result fixes (#1901)
Fix syntax highlighting on non highlighted fields. Fix ellipsis on new lines in code syntax highlighting. Fix ellipsis on content start or end in non code fields.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-12-21 15:10:08 +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
1118ddd146 Ahead/behind in branch details (#1893)
Adds the ahead/behind count to the branch details view.
2021-12-15 15:03:40 +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
René Pfeuffer
b2d7ed88e4 Explain provision exception (#1890)
When the ResourceLinks class could not access the
scmPathInfoStore due to an invalid request scope
(that is outside http requests), this might
lead to confusion due to messages from guice. We
try to "fix" these by using an own explanation to
what probably went wrong and how to mitigate this.
2021-12-09 15:48:42 +01:00
René Pfeuffer
65d1e4ffd2 Fix access to ScmPathInfoStore as Provider to prevent injection errors (#1889)
Fix access to ScmPathInfoStore as Provider to prevent injection errors. Errors might happen, if beans using ScmPathInfoStore (like the BranchLinkProvider) are injected in beans that are singletons or that have be created outside of request scope otherwise. We do so knowing that this might lead to runtime errors (eg. when links shall be build in a thread that has no request scope). We have decided nonetheless that injection errors on startup are worse for plugin developers, that may have no clue how to solve injection problems.
2021-12-09 07:05:12 +01:00
Sebastian Sdorra
9375d2694c Highlight only queried fields (#1887)
Expert queries highlight only the fields which are used in the query.
2021-12-07 08:08:21 +01:00
Sebastian Sdorra
ad5bbfeef3 Fix search highlighting conflict with jsx code (#1886)
Replaces "<>", "</>" highlighting marks with "<|[[--" and "--]]|>" to avoid conflicts when highlighting jsx code.
2021-12-06 16:49:31 +01:00
René Pfeuffer
fa17c339a2 Bugfix for files with colons (#1881)
Fix source code view for files with colons (:).
2021-12-02 09:29:23 +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
ce2eae1843 Enhance error messages on gpg key import (#1879) 2021-11-30 12:22:54 +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
1082d39120 Keep whole lines for code highlighting in search (#1871)
We now use SimpleSpanFragmenter with a fragment size of 200 for each highlighted field. For code fields we ensure that each line is complete.
2021-11-25 13:48:36 +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
Sebastian Sdorra
2938074e1a Update to webpack v5 (#1848)
Update webpack in the following components to version 5:

ui-styles (StyleGuide)
ui-components (Storybook)
ui-scripts (gradle run/build)
This change will also fix a circular dependency between ui-api and ui-components.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-11-10 10:10:17 +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
Eduard Heimbuch
e44867b6b9 Fix diff link templating for repositories named as "source" or "target" (#1834)
Fix templated links for repositories or namespaces which are named "source" or "target".
2021-10-21 09:54:25 +02:00
René Pfeuffer
39e367bd70 Prevent deletion of default branch (#1827)
Adds a pre receive repository hook that prevents the deletion of the default branch.
Mirrored repositories will change their default branches to another branch, when it is deleted.
2021-10-19 17:31:35 +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
Sebastian Sdorra
24effd9041 Fix deletion of repositories from search index (#1813) 2021-09-27 13:15:29 +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
e1ff57e0a9 Fix API description for url import (#1805) 2021-09-13 07:35:17 +02:00
Sebastian Sdorra
5b4d032611 Fix query for enum fields (#1800)
The enum fields were not searchable, because they were stored without analysation or transformation, but if an enum field was searched for within a query, the StandardAnalyzer was used. This means that the enum was stored in the index as an uppercase string, but the query searches for lowercase (the StandardAnalyzer uses a lowercase filter).
To fix this problem we are now using the KeywordAnalyzer for every non tokenized field. The StandardAnalyzer is only used for tokenized fields, which does not specify an other analyzer such code, path or id.
For enum fields we have introduced a new analyzer which uses an uppercase filter by default, this makes it possible to ignore case during search for enum fields.
2021-09-08 10:56:57 +02:00
René Pfeuffer
c408b38f10 Fix repository index
The index was missing the repository itself. This lead
to no repositories in the search detail page.
2021-09-02 11:14:12 +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
ea7964d224 Add support for enum fields during indexing (#1792)
* Add support for enum fields during indexing

* Add missing value extractor for enums
2021-09-01 15:40:38 +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
Sebastian Sdorra
da2b34e528 Preserve request method on force base url (#1778)
The redirect which is used to force base url uses now 307 instead of 302 in order to preserve the request method.

Closes #1771
2021-08-23 20:02:12 +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
d1ea249539 Improve search syntax page (#1770)
Remove non-searchable fields from syntax site, do no translate field names, use field name for title if no translation is available, refactor syntax page to respect error states
2021-08-16 13:17:25 +02:00