Support for SSH log level #358
Reference in New Issue
Block a user
No description provided.
Delete Branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Re https://gitea.com/gitea/helm-chart/issues/224#issuecomment-717087
Nice catch!
Setting the required environment variable for changing the log level is already possible using the
.statefulset.env
configuration.Reopened. See https://gitea.com/gitea/helm-chart/issues/224#issuecomment-718042
Sorry for closing.
@ -0,0 +210,4 @@
- name: GITEA_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
key: password
Reviewing the example config file,
SSH_LOG_LEVEL
seems to be no valid app.ini setting but only an environment variable being used for ssh templating. I suggest either not locating it at.Values.gitea.config.server
to prevent this value from being written to the config file, or filtering it out during inline-config processing in_helpers.tpl
.A possible location for this could be a new object
.Values.gitea.ssh
with keylogLevel
. Doing so would implicitly ease the way for #321 (disable ssh features).In any way, a default value must be defined when not checking the existence of a values key.
Thanks for checking so thoroughly, @justusbunsi! I did not look at the example
app.ini
as the naming seemed to make sense inline with the other SSH options.This, in combination with a comment why the SSH settings are located in their own block, would be elegant.
@pi3ch Would you be interested in moving into this direction (within this PR)?
I found all SSH related settings under Server section of the cheatsheet (https://docs.gitea.io/en-us/config-cheat-sheet/#server-server) so it made sense to keep the SSH settings all in once place. Putting it in a difference place could be confusing.
I may suggest Logs section would be more appropriate because firstly there is already another SSH related setting, secondly it is simple for new users to find it out (https://docs.gitea.io/en-us/config-cheat-sheet/#log-log).
Sounds also reasonable. Might be a bit harder to get all SSH-related settings with a on/off switch then if they are split across multiple categories but the LOG_LEVEL one should not make any difference at all if SSH is off anyway.
I understand what you mean and it kind of makes sense. Though, I'd still prefer extracting that option into a new object. The whole object
.Values.gitea.config
simply applies all its content to the app.ini. That's what it's designed for. Without using this Helm Chart you would not add an option to app.ini which has no effect. You would define the environment variable. Even if there are other related options inside app.ini. You know what I mean? It just doesn't feel right adding it there.With a dedicated object supporting ssh application options and ssh environment options, the chart user wouldn't have to search through the config cheat sheet. The user wouldn't have to configure application options via
.Values.gitea.config
at all. That would be a feature of this helm chart to simplify ssh configuration as the chart would know what it has to use in which part of the generated helm release.Surely, supporting all ssh related options at once is totally out of scope of this PR and I don't ask for it. But this PR could lead the way into that direction, even if there is yet another option until it's fully supported.
I personally don't mind and either option is fine with me. Perhaps it is better we cast vote and decide on this so this MR can get in soon.
Good idea. @gitea/Maintainers any opinions on this?
Anyway, there should be a default value for this setting. Otherwise the environment variable is empty which might cause side effects.
Let's put things together:
gitea.config.server.SSH_*
: Would be in line with existing SSH settings but the helm chart would be somewhat off as it would add a setting togitea.config.server
which does not exist in Gitea itselfgitea.ssh
in the helm chart.statefulset.env
and treating is as a normal env var which is picked up by some service internally.(1) Only makes sense if the setting would be supported by Gitea itself, as Justus pointed out. Given all the other SSH options existing there, putting the new one there would help with consistency. However, this would require a change in Gitea core and not result in a quick solution to the problem.
(2) Might be cleaner and quicker than (1) in the first place but needs clear documentation stating why this one SSH setting lives there and not in
gitea.config.server
.(3) Is more like an option for additional, user-based env vars which should be injected additionally.
A hybrid solution could also be to start with (2) for a quick fix and aim for (1) longterm, i.e. trying to get
SSH_LOG_LEVEL
to be an official option in Gitea so the helm chart can define it ingitea.config.server
?I agree with @justusbunsi it doesn't really feel right to add it to
gitea.config
therefore I also vote for creating a dedicated ssh object for all ssh related settings.
gitea.ssh
seems to be fitting here :)@pi3ch With regards to Chart maintainability I would like to prevent a quick fix resulting in a breaking change or at least inconsistency when adding related features such as #321.
Do you want to continue with this PR or do you mind granting write permissions to maintainers via checkbox on the right?
Sure. Granted you the access.
@pi3ch, I thought using the checkbox on the right would also grant write permissions to your fork branch. Using "Update branch by merge" button worked but pushing from command line is rejected with "Unauthorized" message. Do you have some sort of branch protection configured? Do you mind granting me explicit write permissions to the PR branch? Or shall I create a Pull Request towards your repository?
@justusbunsi Gitea UI is all new to me. where can I find exclusive write PR? I've just pressed "Update by merge", unsure that added your changes.
I didn't setup any branch protection, was just a vanilla PR.
You can try to PR to my branch and I MR here.
@pi3ch Let's do it that way. I've created https://gitea.com/pi3ch/helm-chart/pulls/1 to your PR branch.
@justusbunsi done. All good?
LGTM. Thanks @pi3ch for your patience.
@pat-s Do you agree with what I changed? If so, we can merge it.