Commit Graph

339 Commits

Author SHA1 Message Date
Laura Gorzitze
38d0325b4c Check on duplicate name for rename
Add check whether namespace and name already exist
when renaming a repository.
2024-06-24 10:12:53 +02:00
Eduard Heimbuch
2efcbfa759 Improve repository overview
- Sort repositories alphanumerically case insensitive per namespace
- Make the namespaces collapsible and store the collapsed state in local storage

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-08-22 19:59:53 +02:00
Thomas Zerr
1750eae2d1 Fix marshalling invalid XML characters
If someone tries to persist data with invalid XML characters, they now get filtered out.

Committed-by: Rene Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-08-10 14:20:07 +02:00
Eduard Heimbuch
cc54e2ce6b Caches for internal stores and files
This adds optional caches for configuration stores and
backing data files for data stores.

These stores can be enabled using the system properties
`scm.storeCache.enabled=true` and `scm.cache.dataFileCache.enabled=true`.

In addition, this adds the possibility to overwrite cache configurations
from the guice cache (see file `gcache.xml`) with system properties.
The maximum size of the external group cache for example can be
overwritten with the system property `scm.cache.externalGroups.maximumSize`.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-06-28 12:38:15 +02:00
Rene Pfeuffer
86b8be9f17 In-memory implementations of the store api using JaxB
The new implementations are ment to be used in test
classes replacing the older implementations like
`InMemoryConfigurationStoreFactory`. The benefit
of these new classes is that the serialization using JaxB
is testet implicitly avoiding mistakes made with XML
annotations on the data classes.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-06-07 10:04:50 +02:00
Konstantin Schaper
b812922142 Implement namespace configurations & permissions
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>

Reviewed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2023-05-25 18:51:29 +02:00
Rene Pfeuffer
68110ee6b3 Retry failing integration tests
This uses 'RetryingTest' from junit jupiter to retry integration tests that are known to fail from time to time. We explicitly mark single tests in contrast to set a global retry to be able to trace those, whenever this is intended.

To do so, we have to update to the latest version of JUnit. Unfortunately, this brought a new behaviour for the @TempDir annotation: In contrast to the former behaviour where for one test all annotated parameters got the same directory, in the new version the parameters get different directories assigned. This led to the need of some consolidation between @BeforeEach methods and the related tests.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-03-22 06:24:33 +01:00
Eduard Heimbuch
b511789620 Fix audit log issues:
- Use store name as label for repository related changes if no explicit labels are set.
- Introduce 'ignore' flag
- Fix missing call to store
- Create audit logs for permissions
- Set flex attributes for input field to use full available space

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-03-21 12:03:51 +01:00
Eduard Heimbuch
2f0b46f615 Remove dependency locks 2023-03-10 13:48:55 +01:00
Rene Pfeuffer
f3027ba9f8 Update resteasy to 4.5.9.Final
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-03-10 08:29:34 +01:00
Eduard Heimbuch
56265be9a2 Add initial audit log API
Introduce audit log API which logs all creations,
modifications and deletions of annotated entities
and everything which is stored inside a
ConfigurationStore. Without the related Audit
Log Plugin installed this API does nothing.
2023-03-09 11:25:33 +01:00
Rene Pfeuffer
e74225e168 Synchronize jaxb context generation 2023-03-09 10:38:56 +01:00
Rene Pfeuffer
83c7e0523d Fix various performance issues
- Avoiding read attempts for stores that do not exist (AbstractStore).
- Use of ReadWrite locks (everything withLockedFileForRead or withLockedFileForWrite)
- Caching of JAXB Context (TypedStoreContext.java)
- Avoid unnecessary writes to the UserGroupCache

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-03-02 11:05:04 +01:00
Rene Pfeuffer
8cef21e32c With this change, the creation of API keys will throw an error if one tries to create a new API key. To make this error distinguishable from other errors, we use a 404 (not found) in this case (a 409 would be indistinguishable from a "real" conflict, 401 or 403 could be misleading). Doing this, the cli client can print better error messages.
In addition, this removes the links to API keys in user hal objects, when API keys are disabled.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-02-28 10:01:27 +01:00
Rene Pfeuffer
962df5309c Update SVNKit to 1.10.10-scm1
Fix lockfiles and update slf4j



Committed-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
Co-authored-by: Florian Scholdei <florian.scholdei@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-02-15 08:44:30 +01:00
Rene Pfeuffer
e1b107849e Permission Overview
Adds an overview of the permissions of a user including its groups. To do so, a new cache is introduced that stores the groups of a user, when the user is authenticated. In doing so, SCM-Manager can also list groups assigned by external authentication plugins such as LDAP. On the other hand, the user has to have been logged in at least once to get external groups, and even then the cached groups may be out of date when the overview is created. Internal groups will always be added correctly, nonetheless.

Due to the cache, another problem arised: On some logins, the xml dao for the cache failed to be read, because it was read and written at the same time. To fix this, a more thorough synchronization of the stores has been implemented.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-02-09 10:29:05 +01:00
René Pfeuffer
a5349da034 Update shiro to v1.10.0 2022-12-07 11:05:17 +01:00
Eduard Heimbuch
df2a91fafe Prevent concurrent access during Copy-on-Write (#2143)
Prevent concurrent access on files during Copy-on-Write which could led to inconsistent or corrupt files.
2022-10-27 10:31:26 +02:00
René Pfeuffer
9d3a205dd7 Fix lockfiles 2022-10-18 15:31:34 +02:00
Eduard Heimbuch
b70a35c2f2 Expose jackson datatypes as api to be available by plugins 2022-10-18 14:46:31 +02:00
Konstantin Schaper
e99d77cb04 Upgrade Jackson to version 2.13.4 2022-10-17 17:27:36 +02:00
Eduard Heimbuch
67c083ee54 Reduce code smells (#2089)
Reduce code smells found by deepsource.io. We focused on the low-hanging fruits and not breaking any api.
2022-07-15 15:33:37 +02:00
Eduard Heimbuch
162dd6ad0a CLI Support for repository actions (#1987)
To make SCM-Manager more accessible and to make it easier using scripts against the server, we created a command line interface. This command line interface can be used to perform the default actions like create, modify and delete repositories. It is also very flexible and can be extended by plugins.

The CLI already supports internationalization, help texts, input validation, loose and table-like templates and nested subcommands. Check the cli guidelines to learn how add new cli commands.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2022-04-04 12:02:16 +02: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
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
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
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
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
Eduard Heimbuch
922dc27c49 Add delete method for configuration store (#1814)
Add method to delete configuration stores completely.
2021-09-30 08:54:22 +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
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
René Pfeuffer
c8621061bf Overwrite files on import 2021-02-25 17:29:14 +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
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
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
Sebastian Sdorra
22375c8096 Do not abort on failing test, if we run on ci server 2021-01-14 12:01:34 +01:00
Sebastian Sdorra
17706161ba Use Java 11 for build but 8 as target platform 2021-01-14 12:01:33 +01:00
Sebastian Sdorra
8c27af2661 Remove maven build related files 2021-01-14 12:01:30 +01:00
Sebastian Sdorra
5c379a5bb4 Align dependency configurations and versions 2021-01-14 11:56:05 +01:00
Sebastian Sdorra
290e7decd8 Migrate module scm-dao-xml 2021-01-14 11:55:27 +01:00
CES Marvin
374d085fdd prepare for next development iteration 2020-12-17 15:24:34 +00:00
CES Marvin
38a7ff6acb release version 2.12.0 2020-12-17 14:55:08 +00: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
CES Marvin
56c63cb5b7 prepare for next development iteration 2020-12-07 15:01:20 +00:00
CES Marvin
baf04a551c release version 2.11.1 2020-12-07 14:24:49 +00:00
René Pfeuffer
eaf59f91c4 Harmonize logging string for repositories 2020-12-04 11:48:32 +01:00
CES Marvin
87d06a708b prepare for next development iteration 2020-12-04 08:10:20 +00:00
CES Marvin
df62ffbe16 release version 2.11.0 2020-12-04 07:27:13 +00:00