Commit Graph

2108 Commits

Author SHA1 Message Date
Sebastian Sdorra
21a6943980 Refactor Search API and allow analyzer per field (#1755)
The Search api is now simpler, because it provides useful defaults. Only if you want to deviate from the defaults, you can set these values. This is mostly reached by using the builder pattern. Furthermore it is now possible to configure an analyzer per field. The default analyzer is still the one which is derived from the index options, but it is possible to configure a new indexer with the analyzer attribute of the indexed annotation. The attribute allows the configuration for code, identifiers and path. The current implementation uses the same analyzer code, identifiers and path. The new implemented splits tokens on more delimiters as the default analyzer e.g.: dots, underscores etc.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-08-05 08:21:46 +02:00
Sebastian Sdorra
7c10926244 Add embedded repository to search result hit (#1756)
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-08-04 16:29:23 +02:00
Sebastian Sdorra
e492a30eea Expose content type resolver api to plugins (#1752)
Expose an api which makes it easy to detect the content type of files. The api is based on the spotter api, but does not expose spotter classes.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-08-03 10:41:38 +02:00
Sebastian Sdorra
91fec0f478 Add detailed search result ui (#1738)
Add a dedicated search page with more results and different types.
Users and groups are now indexed along with repositories.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-07-28 11:19:00 +02:00
René Pfeuffer
ad6000722d LRU semantic for workdir cache (#1735)
Introduces a maximum size for the simple workdir cache. On cache overflow workdirs are evicted using an LRU strategy.
Furthermore parallel requests for the same repository will now block until the workdir is released.
2021-07-28 07:54:37 +02:00
Eduard Heimbuch
f52c0b07bf Enhance push command with username/password authentication (#1734) 2021-07-23 13:42:39 +02:00
Sebastian Sdorra
39d2f12b66 Return separate links for searchable types instead of single templated link (#1733)
The search link of the index resource is now an array of links instead of single templated link.
The array contains one link for each searchable type.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-07-21 10:07:41 +02:00
Sebastian Sdorra
e75d937ee5 Prepare search api for different types (#1732)
We introduced a new annotation '@IndexedType' which gets collected by the scm-annotation-processor. All classes which are annotated are index and searchable. This opens the search api for plugins.
2021-07-19 08:48:43 +02:00
Sebastian Sdorra
e321133ff7 Add search engine and quick search for repositories (#1727)
Add a powerful search engine based on lucene to the scm-manager api.
The api can be used to index objects, simply by annotating them and add them to an index.
The first indexed object is the repository which could queried by quick search in the header.
2021-07-14 11:49:38 +02:00
Eduard Heimbuch
7a3db7ee3f Include cloudogu plugins to plugin center (#1709)
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-06-25 09:22:53 +02:00
René Pfeuffer
d9d3547a22 Create custom initial user (#1707)
Using a default user with a default password has the implicit risk, that this user is not changed and therefore this system can be compromised. With this change, SCM-Manager does not create the default user with the default password on startup any more, but it shows an initial form where the initial values for the administration user have to be entered by the user. To secure this form, a random token is created on startup and printed in the log.

To implement this form, the concept of an InitializationStep is introduced. This extension point can be implemented to offer different setup tasks. The creation of the administration user is the first implementation, others might be things like first plugin selections or the like.

Frontend components are selected by the name of these initialization steps, whose names will be added to the index resource
(whichever is active at the moment) and will be show accordingly.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-06-24 09:29:42 +02:00
Eduard Heimbuch
97b32f3918 Clear caches if gpg key was added or deleted (#1701)
Clear more caches if GPG key was added or deleted. It seems quite difficult to find the right way to invalidate partial caches so for now we keep purging everything.

Maybe we could add an API to efficiently find out what parts of the cache can be removed.

Fixes #1668
2021-06-15 19:10:48 +02:00
Florian Scholdei
f274b7f4b2 Add handling when duplicated branch part cannot be created (#1692)
Add handling when duplicated branch cannot be created because a part of the name already exists as a branch
2021-06-09 14:58:59 +02:00
René Pfeuffer
fc16424e28 Clean up read only API (#1686)
Cleans up an interface method that was badly named but escaped the review process.
2021-06-08 20:35:37 +02:00
Eduard Heimbuch
dd0975b49a Feature/mirror (#1683)
Add mirror command and extension points.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2021-06-04 14:05:47 +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
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
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
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
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
Eduard Heimbuch
c5720b36b5 Collect metrics over lifetime of working copies (#1591)
Capture metrics about the lifetime of working copies used, for example, by the merge and modify commands. Working copies are internal repository clones that can place a large load on the server. Therefore, these metrics can be helpful in identifying sources of large server load.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-03-24 13:03:20 +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
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
Sebastian Sdorra
7656c2dc14 Add API for metrics based on Micrometer (#1576) 2021-03-10 10:07:29 +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
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
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
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
b8bd140934 Debug test failure 2021-02-16 10:18:09 +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
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
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
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
René Pfeuffer
bd3671b428 Use repository specific work dirs (#1510)
With this change, work dirs are created in the
directory of the repository and no longer in the
global scm work dir directory. This is relevant due
to two facts:

1. Repositories may contain confidential data and therefore
   reside in special directories (that may be mounted on
   special drives). It may be considered a breach when these
   directories are cloned or otherwise copied to global
   temporary drives.
2. Big repositories may overload global temp spaces. It may be
   easier to create special drives with more space for such
   big repositories.
2021-01-28 12:53:39 +01:00
Eduard Heimbuch
0046c78b40 Git import and export (#1507)
* create git bundle command

* create git unbundle command

* Apply suggestions from code review

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-01-28 12:35:18 +01:00
Eduard Heimbuch
d91c71ace1 Add the repository import and export with metadata for Subversion repositories (#1501)
* Add store exporter to collect the repository metadata
* Add EnvironmentInformationXmlGenerator
* Collect export data and put into compressed tar archive output stream
* Create full repository export endpoint.
* Add full repository export to ui
* Ignore irrelevant files from config store directory
* write metadata stores to file since a baos could teardown the server memory
* Migrate store name for git lfs files (#1504)

Changes the directory name for the git LFS blob store by
removing the repository id from the store name.

This is necessary for im- and exports of lfs blob stores,
because the original name had the repository id as a part
of it and therefore the old store would not be found when
the repository is imported with another id.

Existing blob files will be moved to the new store location
by an update step.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>

* Introduce util for migrations (#1505)

With this util it is more simple to rename
or delete stores.

* Rename files in export

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-01-28 11:40:35 +01:00
Konstantin Schaper
94304f96a3 migrate integration tests to bdd (#1497)
Migrates the existing e2e tests towards a cucumber bdd-style and utilizes the integration-test-runner package.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-01-26 12:58:48 +01:00
Sebastian Sdorra
02e8e3795a Move scm-core module.xml
We move module.xml from scm-core to scm-annotations to avoid conflict with the annotation processor.
2021-01-14 11:55:27 +01:00
Sebastian Sdorra
9d27c12de3 Read version from build-info.properties instead of pom.properties 2021-01-14 11:55:27 +01:00
René Pfeuffer
c58bd2f664 Include JRE version in plugin center url (#1494) 2021-01-13 09:18:28 +01:00
Eduard Heimbuch
adf7bac665 Subversion repository export
Add the repository export function for Subversion repositories. The repository will be exported as dump file which can be downloaded directly or inside a gzip compressed archive.
2021-01-08 09:19:33 +01:00