Commit Graph

4136 Commits

Author SHA1 Message Date
Rene Pfeuffer
7b74224a80 Remove exception log for api token errors
Printing the exception may reveal details about the password.
2025-01-17 14:46:17 +01:00
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
Laura Gorzitze
1ab5c3fe80 Adjust security headers to allow pdf rendering 2024-03-04 14:50:39 +01:00
Eduard Heimbuch
95142b122d Decrease general log level for development environments from TRACE to DEBUG 2023-08-16 11:13:46 +02:00
Eduard Heimbuch
8cafeefc74 Deactivate shiro's blockTraversal filter
Because it breaks our branch encodings

Committed-by: Florian Scholdei <florian.scholdei@cloudogu.com>
2023-08-02 15:27:09 +02:00
Thomas Zerr
a2c9ed67a3 User jwt sessions can now be endless
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: tzerr <thomas.zerr@cloudogu.com>

Reviewed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2023-07-27 13:03:35 +02:00
Eduard Heimbuch
0a1d9954a0 Remove content security header upgrade-insecure-requests which breaks http only server configs 2023-07-27 11:42:41 +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
bceef8ee7c Internal server error with external groups
Fixes a null pointer exception resulting in an internal
server error in the permission overview for users with
external groups, for example from ldap or cas.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-06-21 09:34:53 +02:00
Rene Pfeuffer
32a0a6868f Fix security findings
- Add security headers:
  - X-Frame-Options
  - X-Content-Type-Options
  - Content-Security-Policy
  - Permissions-Policy
- Do not send server information header

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>
2023-06-14 15:57:01 +02:00
Rene Pfeuffer
c3093a3b0d Prevent repository loading in namespace mapper
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-06-13 16:16: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
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
René Pfeuffer
30affae76d Fix hg anonymous access by sending authenticate header
If anonymous access is enabled and read requests are granted
to hg repositories for the anonymous user, write requests
fail also for users with write requests, because no
authentication header has been sent along with the 401.
This fixes this issue in the default cgi servlet.
2023-05-19 13:17:45 +02:00
Rene Pfeuffer
8025e82b1b Use pgpainless for key generation
The library pgpainless (https://gh.pgpainless.org/) makes it much more easy to create gpg keys for new users. As a benefit, these keys can be verified by GitHub.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-05-08 15:31:56 +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
Konstantin Schaper
d257c8616c Display images in diffs
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2023-03-22 11:17:22 +01: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
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
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
Rene Pfeuffer
f2f2f29791 Render images from repository correctly
This adds a markdown renderer for images, so that images
that are referenced by their repository path are resolved
correctly. In this case, the content rest endpoint is
rendered as source url. For this, two new contexts
(RepositoryContext and RepositoryRevisionContext)
have been added, that make the repository and the
current revision available, so that the content url can
be resolved properly. These new contexts may be used
by plugins like the scm-readme-plugin.

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

Reviewed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-12-19 10:12:01 +01:00
Rene Pfeuffer
6ba792e5bc Adds a new extension point repository.overview.listOptions that can be used to set the page size, whether to list archived repositories or not and potentially other options for the repository overview. If no extension is bound, the default values will be used.
Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-12-15 11:16:01 +01:00
René Pfeuffer
13467685aa Reduce log level of LoggingExporter
The `info` level might lead to a lot of logs with automated
processes, that do not have any value. Because often `info`
is the default log level, we degrade this to `debug`.
2022-12-12 16:11:41 +01:00
René Pfeuffer
6ec8041b8c Replace default scm-manager.org mail address 2022-12-12 10:28:14 +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
a009ce9397 Fix clone of git repositories with lfs files via ssh (#2144)
Cloning repositories with LFS data via ssh requires the creation of access tokens using a subject authenticated with an already scoped token (the first scoped token is created by the ssh lfs authentication command; with this token the further requests are issued which will create further tokens for the individual lfs download requests). This failed, because such a creation was rejected without further checks. Now we test, whether the requested scope is permitted by the current scope.
2022-10-28 10:31:47 +02: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
Eduard Heimbuch
8db2e76ecc Resolve plugin installation conflict were the same plugin was tried to be installed multiple times for one single action. (#2138)
The pending queue is updated after all the plugins to be installed are collected, and then we already may have duplicate entries. Because of this we check right on the collecting step if the plugin was already added during this single action.
2022-10-20 20:38:58 +02:00
Konstantin Schaper
e99d77cb04 Upgrade Jackson to version 2.13.4 2022-10-17 17:27:36 +02:00
Konstantin Schaper
fe82c967b8 Fix creating a repository permission without a name breaking the repository (#2126)
If a POST request is submitted to the rest api for repostory permissions, the regex validator ignores the name field if it is null, which leads to an internal server error and breaks any further attempts to interact with that repository. An additional not-null constraint resolves this problem.
2022-09-30 10:27:41 +02:00
Florian Scholdei
89386928b6 Add feedback links to footer (#2125)
Add feedback links in "Support" section of the footer. The links refer to the creation of a new topic in the SCMM section of the forum.
2022-09-27 16:18:03 +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
35578985c9 Reduce the output from the realm trace log (#2121)
This reduces the amount of lines logged with log level
'trace' from the DefaultRealm. This is done by concatenating
the single permissions and roles in a single line.

A log with the new layout looks something like this (the [...]
would list all further permissions in the real log output):

TRACE sonia.scm.security.DefaultRealm - authorization summary:
username   : scmadmin
roles      : user
scope      :
permissions: repository:*:ChTG0dBeUH , group:autocomplete , repository:*:[...]

In contrast, with the old layout it looks like this:

TRACE sonia.scm.security.DefaultRealm - authorization summary:
username   : scmadmin
roles      :
 - user
scope      :
permissions:
 - repository:*:ChTG0dBeUH
 - group:autocomplete
 - repository:*:5DTFWwBTiY
 - repository:*:ASTGBIVz11D
 - user:changeApiKeys:scmadmin
 - user:changePassword:scmadmin
 - user:changePublicKeys:scmadmin
 - user:readAuthorizedKeys,writeAuthorizedKeys:scmadmin
 - *
 - user:read:scmadmin
 - user:autocomplete
 - repository:*:4rT7VPex5J
2022-09-14 14:35:35 +02:00
Eduard Heimbuch
6f2be13197 Introduce NoOpIndexReader to handle missing indexes without errors (#2113)
We stumbled upon errors accessing index from plugins which were not yet initialized. To prevent this errors we use our own No-Op IndexReader for missing indices.
2022-09-06 10:06:17 +02:00
Konstantin Schaper
4b92959b9c Revert introduction of tailwind (#2109)
After many days invested in making tailwind work in the SCM-Manager environment as well as a long discussion last week, we have decided not to move further with tailwind, but still keep adding new, independent modules for frontend components. Tailwind simply overcomplicated our build pipeline because bulma was already part of the api and the two were incompatible on several occasions. Styling will continue to be guided by bulma and all parts related to tailwind are removed. We therefore continue the trend of focusing on improving our existing stack rather than adding further complexity.
2022-08-29 10:23:40 +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
Konstantin Schaper
27dbcbf28d Integrate tailwind css and create new button library (#2098)
Introduce tailwind as new frontend styling library to replace bulma in the longer run. Also create the first new ui library `ui-buttons` which will be the new standard for buttons ins SCM-Manager. In this library we reconsidered which types of buttons should be used to create a clean and consistent ui.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2022-08-02 08:39:37 +02:00