Commit Graph

2379 Commits

Author SHA1 Message Date
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
c1d7230fbd Add "enable file search" flag on global config.
Make the repository file search deactivatable
via the global config. This feature could
overwhelm the server on repositories with
millions of file therefore it now can be turned off.

Committed-by: Rene Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-07-06 08:47:51 +02:00
Eduard Heimbuch
0e7a3ec53b Improve general performance
- Adjust logging
- Optimize cache speed
- Cleanup classes

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>

Reviewed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2023-06-28 14:18:18 +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
5c505457bb Implement delete for audit log wrapper
This fixes errors when deleting configurations.
The error occured during "unmirror" in the mirror plugin.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-06-08 10:30:37 +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
Eduard Heimbuch
a50e456969 Ignore duplicate contributors for single changeset
Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-05-25 19:26:38 +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
Eduard Heimbuch
c6df84557b Refactor general configuration
Use standard configuration store api for general configuration. This is best practice and also required for the audit log to work properly.

Besides that we still need to load the general configuration manually for the instance injection binding in ScmServletModules. Since the instance injection does not resolve the bindings regularly we need also still need to update the injectable scm config using the "load" hack in the resource.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-04-12 12:37:52 +02:00
Eduard Heimbuch
aa78cb6f03 Cleanup hg permissions 2023-04-11 09:02:09 +02:00
Rene Pfeuffer
8eb2687e10 Fix branch and tag name validation
The validation for branch and tag names has been
too limited. This led to errors in the frontend for
branches, that had been created using the
cli tools for git or hg but have not been seen as
valid by SCM-Manager.

To fix this, the patterns to validate branch and
tag names are relaxed and relate to the git
rules (https://git-scm.com/docs/git-check-ref-format).
Because these rules could not be expressed
using regular expressions alone, in addition
possible exceptions will be handled in the
git branch and tag commands.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-04-05 11:45:15 +02:00
Eduard Heimbuch
026ffa18fd Replace static mercurial permission handling
Replace our own hg permission handling with the default hg permission which is controlled by the `web` config
2023-04-03 09:47:15 +02:00
Rene Pfeuffer
796330f883 Fix NotFoundExceptions with SVN externals
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-03-21 16:10:04 +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
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
Eduard Heimbuch
f28eaeca15 Fix repository resolution for ssh urls with context path
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-02-23 10:57:43 +01:00
Rene Pfeuffer
0361ae3c6c Sets the default branch for a new git repository from an import to the HEAD reference of the imported repository.
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2023-02-23 10:10:33 +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
Eduard Heimbuch
eb044d8953 Make the default encryption util public to access from plugins. 2023-02-07 14:59:41 +01:00
Eduard Heimbuch
ac419daa3f Add ConfigurationAdapterBase and extension points for trash bin
Adds the new abstract class ConfigurationAdapterBase to simplify the creation of global configuration views. In addition there is some cleanup, interfaces and extension points for the repository trash bin plugin.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-01-13 13:08:51 +01:00
René Pfeuffer
a5349da034 Update shiro to v1.10.0 2022-12-07 11:05:17 +01:00
Konstantin Schaper
7b933c6821 Improve plugin center error feedback and cache invalidation (#2147)
The plugin center cache was not invalidated when the proxy configuration was changed in the global settings. This caused stale and inconsistent state to be displayed to the user while there was no feedback that something was wrong.
2022-11-04 11:49:08 +01:00
René Pfeuffer
54081ccdc6 Git import with lfs support (#2133)
This adds the possibility to load files managed by lfs to the repository import of git repositories.

Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2022-10-25 09:14:40 +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
Eduard Heimbuch
8212b9ac20 Try to fix jackson dependency brainfuck 2022-10-18 11:40:06 +02:00
Konstantin Schaper
e99d77cb04 Upgrade Jackson to version 2.13.4 2022-10-17 17:27:36 +02:00
Konstantin Schaper
74702591ed Revert "Add feedback form (#1967)"
This reverts commit 4407dc6d8a.

# Conflicts:
#	scm-ui/ui-api/src/config.ts
#	scm-ui/ui-api/src/index.ts
#	scm-ui/ui-webapp/public/locales/en/commons.json
#	scm-ui/ui-webapp/src/containers/App.tsx
#	scm-ui/ui-webapp/src/containers/Feedback.tsx
2022-09-27 10:27:08 +02:00
René Pfeuffer
e17934ae09 Fix lazy loading in the source view (#2120)
The lazy loading feature implemented for git was broken,
because the repeated usage in the BrowserResultCollapser
has overwritten the request in the command. Therefore
the command could no longer update the cache in the
BrowseCommandBuilder.

To fix this, we now use a browse command factory (represented
by a simple supplier) that will create a dedicated command
implementation for each request issued in the collapser.
2022-09-14 14:28:40 +02:00
René Pfeuffer
e0a56a1369 Implement commit search features for git (#2111)
Implements the required features for the commit search plugin for git.
2022-09-01 15:31:33 +02:00
Eduard Heimbuch
6055ba145f Remove cache for ChangesetsCommand since we do not want to use stale data here 2022-08-29 16:53:22 +02:00
Konstantin Schaper
56ace2811b Implement reindex mechanism for search (#2104)
Adds a new button to repository settings to allow users to manually delete and re-create search indices. The actual re-indexing is happening in plugins that subscribe to the newly created event.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-08-17 13:22:34 +02:00
Eduard Heimbuch
e590a3ee68 Add changesets command to enable commit search (#2106)
Introduce changesets command to find all changesets for a single repository. This is required to index all changesets for the commit search.
2022-08-17 12:44:59 +02:00
Eduard Heimbuch
550ebefd93 Context sensitive search (#2102)
Extend global search to search context-sensitive in repositories and namespaces.
2022-08-04 12:14:46 +02:00
René Pfeuffer
67a9dce7e6 Add namespace cli commands (#2093)
Adds the CLI commands that are available to handle repository permissions on repositories for namespaces.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-07-26 09:58:00 +02:00
René Pfeuffer
3b4b1a1767 Add cli commands to modify repository permissions (#2090)
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2022-07-20 09:17:14 +02:00
Eduard Heimbuch
fc28da90b3 Enable plugin management via CLI (#2087)
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2022-07-19 09:02:00 +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
Florian Scholdei
f3f19426c8 Unify password validation (#2077)
Passwords should be checked when created or changed in the frontend just as they are in the backend for REST and CLI.
Also extend the password validation to allow upto 1024 characters instead of 32.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-07-07 11:19:51 +02:00
René Pfeuffer
b0b2375f78 Mirror LFS files for git (#2075)
If a mirrored git repository uses LFS, SCM-Manager will now also load the binaries, so that the mirrored repository can be used without missing LFS files.
2022-06-24 11:55:36 +02:00
René Pfeuffer
32dad5ffbf Do not close hg context for diff as string (#2067)
Normally, all resources (like the hg process) will be released after
the stream of the diff. But this may lead to errors, when
DiffCommandBuilder#getContent is used and other commands are used
afterwards.

So with this we introduce a new interface method in the DiffCommand
that can be implemented without closing resources. This method is
used for the computation of the diff as string.

We use this to distinguish between the computation of diffs as a
stream like in rest calls, and the computation as a single string
result that may we followed by other commands using the same context.
2022-06-13 08:19:28 +02:00
Eduard Heimbuch
084fe9e2ae Add api to overwrite content type resolver (#2051)
Introduce content type resolver extension to provide
custom content types for specific file extensions.
2022-06-07 11:02:56 +02:00
Eduard Heimbuch
4f83670824 Hardcode instance id for development instances (#2054)
We need this to recognize our development instances in the collected prometheus metrics.
2022-06-03 13:08:59 +02:00
René Pfeuffer
c5b4dcb19e Fix character encoding in diffs (#2046)
Fixes encodings in diff results. The is especially necessary for Windows systems.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-06-01 09:32:12 +02:00
Konstantin Schaper
1b18191c57 Add plugin wizard initialization step (#2045)
Adds a new initialization step after setting up the initial administration account that allows administrators to initialize the instance with a selection of plugin sets.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
2022-05-31 15:15:30 +02:00
Eduard Heimbuch
8f0facf394 Order repo info extensions (#2041)
Set order priority for repository information extensions.
Also add new annotation to set custom resource bundles for cli commands.
2022-05-23 15:06:08 +02:00