Commit Graph

2500 Commits

Author SHA1 Message Date
Florian Scholdei
9a2ff75f9b Remove duplicated notification endpoints in openapi (#1677)
Remove duplicated notification endpoints in openapi
2021-06-01 13:56:48 +02:00
Florian Scholdei
42745c9e34 Notifications for health checks (#1664)
Add list of emergency contacts to global configuration. This user will receive e-mails and notification if some serious system error occurs like repository health check failed.
2021-05-20 08:30:20 +02:00
René Pfeuffer
20bf646c4f Simplify type support check (#1658)
Simplifies the class RepositoryTypeSupportChecker. There is no need to fall back to the super type Type`.
So we do not need to manually check for type safety.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-05-17 08:51:15 +02:00
Sebastian Sdorra
8e16fa11c9 Add extension point for repository creators (#1657)
Adds an extension point for repository creator such as repository create, repository import or repository mirror.
2021-05-14 09:15:35 +02:00
Eduard Heimbuch
a71766ad4d Add TrustManagerProvider (#1654) 2021-05-12 08:56:51 +02:00
Sebastian Sdorra
9e45d8255d Fix sse for notifications behind nginx reverse proxy (#1650) 2021-05-10 08:57:46 +02:00
Sebastian Sdorra
b975fb655d Feature/global notifications (#1646)
Add global notifications
2021-05-05 14:43:16 +02:00
Eduard Heimbuch
8f91c217fc Add patch endpoint for global config (#1629)
Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-04-28 08:47:29 +02:00
René Pfeuffer
6cd8fc5ba4 Fix deserialization of embedded values in HAL objects (#1630)
The embedded avatar object of the repository avatar plugin
leads to an exception without this configuration, when
a repository json object is deserialized. This happens
for example when the description of a repository should
be modified.
2021-04-26 08:11:13 +02:00
Eduard Heimbuch
7579d91505 Fix limit with negative integer for SearchUtil (#1627)
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-04-21 16:19:16 +02:00
René Pfeuffer
1e83c34823 Enable Health Checks (#1621)
In the release of version 2.0.0 of SCM-Manager, the health checks had been neglected. This makes them visible again in the frontend and adds the ability to trigger them. In addition there are two types of health checks: The "normal" ones, now called "light checks", that are run on startup, and more intense checks run only on request.

As a change to version 1.x, health checks will no longer be persisted for repositories.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-04-21 10:09:23 +02:00
Sebastian Sdorra
f1fdee3d90 Add more system metrics (#1609)
Add metrics about logging, file descriptors, process threads and process memory.
Rename scm.http.requests to http.server.requests to match micrometer defaults.
With this change the exposed metrics are now compatible (except for the tomcat metrics) to the official micrometer grafana dashboard (https://grafana.com/grafana/dashboards/4701).
2021-03-26 09:28:01 +01:00
Sebastian Sdorra
4cbe6b9873 Improve error messages for invalid media types (#1607)
Show separate error messages for invalid partial media types and application/json if it unsupported for the url.
2021-03-25 13:09:40 +01:00
Eduard Heimbuch
d94ebb2e3e Validate filepath and filename to prevent path traversal (#1604)
Validate filepath and filename to prevent path traversal in modification
command and provide validations for editor plugin.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-03-25 12:50:24 +01:00
Eduard Heimbuch
73c1609d92 Add flag to global config to enable/disable api keys as additional authentication method (#1606)
Add flag to global config to enable/disable API keys as additional authentication method.

Fixes #1599
2021-03-25 12:06:22 +01:00
René Pfeuffer
96d2e2cc1b Fix stacktrace in response for invalid url (#1605)
This fixes responses with complete stack traces for
requests with invalid urls, for example such containing
backslash ('') in the query parameter part (eg. q=search).
In this case the response contains an error object due to
this error, and requesting the uri info would trigger the
same error a second time, only that now the exception mapper
would not catch the error again. So we check whether we have
an error object before trying to create an enricher context.
2021-03-25 11:53:30 +01:00
Eduard Heimbuch
22a0362892 Feature/unicode groupname validation (#1600)
Allow all UTF-8 characters except URL identifiers as user and group names and for namespaces.

Fixes #1513

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-03-25 09:59:23 +01:00
Sebastian Sdorra
8f2272885b Metrics for events (#1601)
Updates legman to version 2, which allows the usage of the MicrometerPlugin. The plugin will collect metrics for subscriber invocations and the underlying executor.

Furthermore this change will fix the usage of wrong subject context in the asynchronous events.
2021-03-24 15:54:29 +01:00
Eduard Heimbuch
3ec499d22c Authentication metrics (#1595)
Expose metrics about:

- User login attempts
- Failed user logins
- User logouts
- General successful accesses to SCM-Manager via any authentication realm
- General failed accesses to SCM-Manager

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-03-24 08:50:14 +01:00
Eduard Heimbuch
5a20eaea49 Collect cache metrics using guava cache statistics instead own counters. (#1590)
Collect guava cache statistics as metrics using micrometer. We replaced the own counter implementation of guava statistics with the guava internal caching statistics.
2021-03-22 08:56:26 +01:00
Sebastian Sdorra
26b65582ce Core metrics (#1586)
Expose metrics for http requests and executor services.
2021-03-17 11:09:52 +01:00
René Pfeuffer
5bb6b73526 Fix names for open api spec (#1582)
Names must not contain spaces, therefore we replace
them with underscores.
2021-03-15 15:26:54 +01:00
René Pfeuffer
84c8e02bf1 Feature Partial Diff (#1581)
With this pull request, diffs for Git are loaded in chunks. This means, that for diffs with a lot of files only a part of them are loaded. In the UI a button will be displayed to load more. In the REST API, the number of files can be specified. This only works for diffs, that are delivered as "parsed" diffs. Currently, this is only available for Git.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-03-12 13:52:17 +01:00
Eduard Heimbuch
831877564d Fix null check 2021-03-10 15:12:21 +01:00
Sebastian Sdorra
7656c2dc14 Add API for metrics based on Micrometer (#1576) 2021-03-10 10:07:29 +01:00
Eduard Heimbuch
644b2e106c Add privileged startup api (#1573)
Add privileged startup api to perform startup action with
administration context. This extracts the different startup
actions into own classes. Doing so, they will run independently
of settings for the user creation.
2021-03-05 15:43:09 +01:00
Sebastian Sdorra
89548d45bd Filepath search (#1568)
Add search for files to the sources view. The search is only for finding file paths. It does not search any file metadata nor the content. Results get a rating, where file names are rated higher than file paths. The results are sorted by the score and the first 50 results are displayed.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-03-04 10:39:58 +01:00
René Pfeuffer
e295be20bf Suppress sonar cipher warning 2021-03-02 08:11:08 +01:00
Eduard Heimbuch
7852d1034e Fix build warnings (#1562)
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-03-01 09:08:01 +01:00
René Pfeuffer
0695ca3bac Add import protocol (#1558)
Adds a protocol for repository imports (either from an URL, a dump file or a SCM-Manager repository archive).
This protocol documents single steps of an import, the time and the user and is accessible via a dedicated REST
endpoint or a simple ui.

The id of the log is added to the repository imported event, so that plugins like the landingpage or mail can link to these logs.
2021-02-26 13:52:29 +01:00
Sebastian Sdorra
888f5d699b Fire RepositoryImportHookEvent instead of PostReceiveRepositoryHookEvent (#1561)
We will fire an RepositoryImportHookEvent instead of PostReceiveRepositoryHookEvent for repository imports with metadata. The event is only fired if all parts of the repository could be successfully imported. The extra event is required to avoid heavy recalculations which can be triggered by the PostReceiveRepositoryHookEvent for example the scm-statistic-plugin uses the PostReceiveRepositoryHookEvent to calculate its statistics.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-02-26 09:49:34 +01:00
René Pfeuffer
ff4d9224f9 Decrypt import only if password is given 2021-02-25 17:29:02 +01:00
Eduard Heimbuch
db2ce98721 Feature/import export encryption (#1533)
Add option to encrypt repository exports with a password and add possibility to decrypt them on repository import. Also make the repository export asynchronous. This implies that the repository export will be created on the server and can be downloaded multiple times. The repository export will be deleted automatically 10 days after creation.
2021-02-25 13:01:03 +01:00
René Pfeuffer
3c94ce91d6 Set update step info for new repositories (#1554)
Sets versions for repository update steps to newest versions for new repositories to prevent unnecessary updates.
2021-02-25 08:12:16 +01:00
Konstantin Schaper
3a8d031ed5 Introduce stale while revalidate pattern (#1555)
This Improves the frontend performance with stale while
revalidate pattern.

There are noticeable performance problems in the frontend that
needed addressing. While implementing the stale-while-revalidate
pattern to display cached responses while re-fetching up-to-date
data in the background, in the same vein we used the opportunity
to remove legacy code involving redux as much as possible,
cleaned up many components and converted them to functional
react components.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-02-24 08:17:40 +01:00
René Pfeuffer
ee02ba096f Mark config entry stores explicitly in exports (#1545)
The default (XML) store of SCM-Manager does not distinguish between config and config entry stores in regards to
storage locations. Nonetheless, we want to make a difference in export files, so that other store providers can handle
these stores differently. To do so, this change adds an attribute to the top level xml element of config entry stores
to mark them. In exports, these store files can now be exported in a different folder. To mark existing stores, this
introduces an update step.
2021-02-23 09:37:59 +01:00
René Pfeuffer
d0df8977ef Bugfix for long filenames in tar (#1552)
Fixes errors with long file names in tar archives. This may arise with hg repositories with deep directories.
2021-02-18 16:30:35 +01:00
Sebastian Sdorra
d8427ed4ed Improve cache api for usage in plugins (#1540)
This change allows usage of Cache as Shiro authentication and authorization cache. It will also fix loading cache configurations from plugins.
2021-02-17 09:15:01 +01:00
René Pfeuffer
3146e32a8e Remove unnecessary fields from dto 2021-02-15 16:24:36 +01:00
Eduard Heimbuch
5ea28a84fc Change file order inside repository archive (#1538)
Change repository archive order to export/import repository stores before the actual repository. This is done due to import stores before importing the actual repository and firing hooks that may trigger unnecessary computations otherwise.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-02-15 15:43:26 +01:00
Sebastian Sdorra
1a2dabeb66 Do not resolve external groups for system accounts (#1541)
This change modifies the behaviour of the DefaultGroupCollector.
The collector does not longer resolve external groups for the anonymous user and it does not resolve internal nor external groups for the account which is used by the AdministrationContext.
This should reduce the requests which are send to external systems like ldap servers.
2021-02-15 08:45:47 +01:00
Eduard Heimbuch
996a3b6f16 Fix NPE 2021-02-12 08:23:09 +01:00
René Pfeuffer
e0d2630a08 Feature repository specific data migration (#1526)
This adds a new migration mechanism for repository data. Instead of using UpdateSteps for all data migrations, repository data shall from now on be implemented with RepositoryUpdateSteps. The general logic stays the same. Executed updates are stored with the repository. Doing this, we can now execute updates on imported repositories without touching other data. This way we can import repositories even though they were exported with older versions of SCM-Manager or a plugin.
2021-02-10 08:12:48 +01:00
Eduard Heimbuch
877713574a Merge imported repository permissions with existing repository permissions (#1520) 2021-02-05 12:20:55 +01:00
Eduard Heimbuch
ac5d145266 Repository export read-only lock (#1519)
* Lock repository for read-only access only while exporting
* Create read-only check api

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-02-04 15:29:49 +01:00
Eduard Heimbuch
e283195530 Fix permission check on branch deletion (#1515) 2021-02-01 14:48:19 +01:00
Sebastian Sdorra
4202178c01 Fix usage of custom realm description for scm protocols (#1512)
Fixes missing usage of custom realm description for scm client operations.

Fixes #1487
2021-01-29 07:59:18 +01:00
Eduard Heimbuch
8ea24e796b remove type from full export endpoint 2021-01-28 14:56:20 +01:00
Eduard Heimbuch
845f0688f7 Use proper repository file extension on import/export with metadata 2021-01-28 14:35:45 +01:00
Eduard Heimbuch
c3ab6bc5d5 Bundle and unbundle command for mercurial (#1511)
Support for exporting and importing mercurial repositories as tar ball

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-01-28 13:09:47 +01:00