Commit Graph

197 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Sebastian Sdorra
7e6257ec48 Compile and test scm-webapp 2021-01-14 11:55:27 +01:00
René Pfeuffer
8e3b0e4145 Archive repository (#1477)
This adds a flag "archived" to repositories. Repositories marked with this can no longer be modified in any way. To do this, we switch to a new version of Shiro Static Permissions (sdorra/shiro-static-permissions#4) and specify a permission guard to check for every permission request, whether the repository in question is archived or not. Further we implement checks in stores and other activies so that no writing request may be executed by mistake.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2020-12-16 10:58:29 +01:00
Sebastian Sdorra
7ba7147d27 Fix potential vulnerability
Fixes a potential vulnerability that allows to overwrite files outside the plugin directory using a manipulated SMP archive.
2020-09-15 09:48:35 +02:00
René Pfeuffer
2433c50d64 Add test for "real" merge commits 2020-08-07 08:01:13 +02:00
René Pfeuffer
6f20781812 Add first integration tests for merge detection 2020-08-06 17:12:14 +02:00
Eduard Heimbuch
060cd6f47e merge with develop 2020-05-25 13:26:07 +02:00
René Pfeuffer
705a175221 Add test helper for (de)serialization of arbitrary objects 2020-04-30 15:51:08 +02:00
René Pfeuffer
fa8afc9fbf Add simple test util to verify serializability 2020-04-30 14:59:05 +02:00
Sebastian Sdorra
f3d94588d8 fixed compiler error of InMemoryConfigurationEntryStore 2020-04-28 16:42:15 +02:00
Sebastian Sdorra
dbc97d8993 simplified structure of store builders 2020-04-28 09:47:16 +02:00
Sebastian Sdorra
b97dfd7ded added missing license headers 2020-03-24 10:19:10 +01:00
Sebastian Sdorra
967c802588 merge with develop 2020-03-24 10:17:57 +01:00
Florian Scholdei
f1b34eb502 Changeover to MIT license (#1066)
* prepare license-maven-plugin for license migration
* added license mapping for tsx files and added some more excludes
* Changeover to MIT license
* Fix build problems
* Delete old remaining licenses
* Add more exclude path for license checker
* Rename included netbeans license, add exclude .m2/repository/
* Specify .m2 exclude because not only repository/, also wrapper/ must match
* Add .cache/ exclude for license check
* Modify formatting of license in java classes to comply with convention and IDE
* Add IntelliJ documentation for license configuration
* Update CHANGELOG.md
* Exclude tmp/workspace/ dir for license check
* Edit README.md

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2020-03-23 15:35:58 +01:00
Sebastian Sdorra
de3db6252e implemented restarter to move control over the restart process to the core 2020-02-12 14:45:13 +01:00
Rene Pfeuffer
8df43e7b4e Let background computations abort for browse command 2019-12-12 11:47:03 +01:00
Rene Pfeuffer
9caf6c0984 Update cache after each file 2019-12-11 14:01:17 +01:00
Rene Pfeuffer
093c0abb02 Add unit test for asynchronous browse 2019-12-11 13:32:05 +01:00
Rene Pfeuffer
a37df2c20b Fix test helper 2019-12-11 12:58:01 +01:00
Rene Pfeuffer
ce15b116bd Introduce SyncAsyncExecutor 2019-12-11 10:10:56 +01:00
Rene Pfeuffer
6e40f77973 Add exception to default exception mapper set 2019-12-06 13:33:37 +01:00
Rene Pfeuffer
d0f8e4ccf2 Rename utility class 2019-12-05 17:43:21 +01:00
Rene Pfeuffer
e363f057b2 Merge with bugfix/classloader_leak 2019-12-05 17:04:27 +01:00
Sebastian Sdorra
854e42a609 merge with default branch 2019-11-27 15:01:09 +01:00
Rene Pfeuffer
6bf86fab8d Introduce abstraction layer for RESTeasy mock dispatcher 2019-11-25 17:04:58 +01:00
Sebastian Sdorra
e4c8783c61 return null if commit was not merged into requested branch 2019-11-04 11:46:27 +01:00
Rene Pfeuffer
20338c1bb6 Add integration tests for anonymous access 2019-10-17 11:53:23 +02:00
René Pfeuffer
c35363b79f Store repository id in git config for each repository
This is needed after migration from v1 to v2 and is done in
GitV1UpdateStep.java. Therefore we hat to make the 'forAllPaths' method
in PathBasedRepositoryLocationResolver available in the interface of
RepositoryLocationResolver.
2019-07-03 07:48:06 +02:00
Eduard Heimbuch
841df69fc3 check RepoId in InMemoryConfigurationStoreFactory 2019-06-28 08:53:03 +02:00
René Pfeuffer
f8954846c4 Add test support for plugin migration 2019-06-21 11:09:41 +02:00
René Pfeuffer
d3b65ac3bd Check stored values instead of resulting xml files 2019-06-19 10:38:22 +02:00
René Pfeuffer
d43ad44da9 Enhance in-memory store factories for tests 2019-06-19 10:14:29 +02:00
René Pfeuffer
fae3de7b6c Extract update step test util 2019-06-19 09:31:56 +02:00
René Pfeuffer
b274952fa9 Create explicit method to create new repository locations 2019-06-05 14:27:35 +02:00
René Pfeuffer
e52518a12b Cleanup
- Mark PathBasedRepositoryLocationResolver as singleton so that other
  users will get the same instance and will not overwrite the paths
  set by migration.
- Set path kept by InlineMigrationStrategy in location resolver to
  store the path.
- Add logging
- Add type of repository to migration web page
2019-06-05 08:21:37 +02:00
René Pfeuffer
6244713970 Move constant to interface 2019-06-03 13:47:05 +02:00
René Pfeuffer
64fcdde749 Create v2 repository entities for old v1 repositories 2019-05-21 13:09:33 +02:00
René Pfeuffer
a83e2813a3 Fix path computation and resolving 2019-05-10 13:26:06 +02:00
René Pfeuffer
7f4792ec49 Remove PathBasedRepositoryDAO
The computation of the file path for the repository is done by
RepositoryLocationResolver.
2019-05-10 08:06:36 +02:00
René Pfeuffer
c44d38cc61 Introduce abstraction for repository location 2019-05-09 14:08:18 +02:00