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.
When implementing the remark rehype rework, which was supposed to be backwards-compatible, incorrect mdast was produced by the remarkValuelessTextAdapter in some edge-cases. This caused markdown generated by other plugins, such as the issue-tracker-plugin, to be faulty (e.g. Und die #10 ist *so* toll caused visual artifacts). This PR solves the issue by inlining the children of the empty text node instead of wrapping them in a paragraph. This is also more consistent with the previous output, as can be observed when pairing SCM-Manager <= 2.15.0 with the issue-tracker-plugin and using the aforementioned snippet.
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>
Tweaking the existing color scheme for SCM-Mananger to fulfill accessibility requirements lead to the conclusion, that an additional high-contrast-mode is necessary. The proposed colors are demonstrated in the PR.
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
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.
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.
It should also be possible to create new files in empty non-initiated repositories with the help of scm-manager/scm-editor-plugin/pull/39. So that the plugin can mount itself, a new endpoint was provided hereby.
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
* Fixed missing update if content of diff changes
* Add property to disable automatic refetch in diffs
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
When initially implementing react-query, we focussed on core features. This pull request now replaces the remaining apiClient usages in ui-components and ui-webapp with react-query hooks.
It was possible to download the default SCM-Manager gpg keys and overwrite them with the same raw key. This made the new key deletable. This behaviour is not longer possible.
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>
Implements react-query and replaces direct apiClient usage for sources, annotate and history content views.
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Sets aka "fixes" the language attribute of the top level html tag. This was hard coded to 'en' before, what led to bad experiences with screen readers. We now set overwrite the attribute with the language from i18next.
Currently the mirror command implementation for git fires post receive repository hook events, that return every changeset of the repository instead of those really added by the single mirror update.
This fixes this issue by first creating a working copy, running the fetch and the update in this clone, and then pushing back the result to the central repository. This triggers the internal mechanisms used in other commands like the modify command.
The downside of this is, that we first have to create the clone, so for big mirrors a cached working copy is strongly recommended.
When SCM-Manager is used behind a reverse proxy like
Nginx it may be the case, that lfs PUT requests are
buffered by the reverse proxy and will be sent to the
SCM-Manager after the whole file has been received. Due
to the expiration time of 5 minutes for the authentivation
token that had been requested by Git before the upload
has been started, this request from the proxy to
SCM-Manager fails if the upload from the client to the
reverse proxy took longer than these 5 minutes.
To solve this, we make this expiration time configurable,
so that whenever you have very large files or small
bandwidth the expiration timeout can be increased.
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
The recently integrated form library react-hook-form does not submit disabled inputs, but a behaviour where interaction with an input is not possible and it is still submitted is necessary. This feature implements a readOnly property for all components that support react-hook-form. It is visually indistinguishable from a disabled input but will be submitted when the form is submitted. All form fields use disabled fieldset wrappers to accomplish this goal because react-hook-form only checks the disabled property on the input itself, not any ancestors, and the inputs are still correctly displayed as disabled.