Commit Graph

4151 Commits

Author SHA1 Message Date
René Pfeuffer
de9984ae2c Do not process missing index types (#1985)
Fixes an error that arises, when a plugin with search
indices for repositories is removed and later on a repository
is deleted. This led to a null pointer exception in the
SearchableTypeResolver, but only because an "illegal" index
detail without proper type was given as a parameter. This
type cannot be resolved any longer due to the removed plugin.
We therefore can simply filter these index details.
2022-03-30 15:30:54 +02:00
René Pfeuffer
4bba593714 Remove plugin center login without url (#1978)
This removes the "login" button for the plugin center, when the authentication url is not set.
2022-03-21 08:21:36 +01: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
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
Eduard Heimbuch
9fa0396167 Fix missing css for migration wizard 2022-02-17 10:25:14 +01:00
René Pfeuffer
2ededac869 Update RestEasy (#1953)
Updates RestEasy to version 4.7.5.Final.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-02-15 14:51:09 +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
466334aaa7 Update vulnerable version of cron-utils (#1942)
* Update lock files

* Replace usage of org.apache.commons.lang3 with guava

* Update vulnerable version of cron-utils

Update cron-util from version 9.1.3 to 9.1.6.
Version 9.1.6 fixes an arbitrary code execution
vulnerability (CVE-2021-41269).
SCM-Manager is not affected by this issue,
because it is related to the el parsing
of an annotation which we don't use.
2022-02-01 18:06:53 +01:00
Sebastian Sdorra
44be389d0c Enable Gradle dependency locking (#1922)
Enable gradle dependency locking for all subprojects. This change allows us to use dependency ranges, without loosing reproducible builds.
It also makes it easier for third party services such as snyk to detect dependencies and their versions.
2022-02-01 15:14:18 +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
32cf1f0044 Fix unit tests for #1916
Fixup for commit e9f22e89ec
2022-01-11 17:37:26 +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
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
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
271576fcf2 Update javahg to v1.0.0 (#1865)
Updates javahg (https://foss.heptapod.net/mercurial/javahg) to release 1.0.0. Therefore, all packages have to be changed from com.aragost.javahg to org.javahg.
2021-11-23 13:10:16 +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
Eduard Heimbuch
b78742ed0b Read all errors with screen reader (#1839)
Make error notifications accessible for screen readers.
2021-11-03 08:14:54 +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