Warn on SSH connection for incorrect configuration#19317
Conversation
- When `setting.RepoRootPath` cannot be found(most likely due to incorrect configuration) show "Gitea: Incorrect configuration" on the client-side to help easier with debugging the problem.
Co-authored-by: delvh <[email protected]>
There was a problem hiding this comment.
fail(RepoRootPath) would leak some server information to end users.
Since it's a rare case and shouldn't occur when Gitea works correctly, I can accept it.
A better approach is only showing the RepoRootPath in logs.
Update: only the first arg of fail (aka userMessage) will be returned to end user, while the second arg won't and it's for server log. Sorry for the misleading.
|
|
That's a problem, those kinds of logs would only be show when |
This comment was marked as outdated.
This comment was marked as outdated.
* giteaofficial/main: (22 commits) Add logic to switch between source/rendered on Markdown (go-gitea#19356) Fixed registry host value. (go-gitea#19363) [skip ci] Updated translations via Crowdin Allow package linking to private repository (go-gitea#19348) Use "main" as default branch name (go-gitea#19354) Move milestone to models/issues/ (go-gitea#19278) Refactor CSRF protection modules, make sure CSRF tokens can be up-to-date. (go-gitea#19337) Remove dependent on session auth for api/v1 routers (go-gitea#19321) API: Search Issues, dont show 500 if filter result in empty list (go-gitea#19244) [skip ci] Updated translations via Crowdin Never use /api/v1 from Gitea UI Pages (go-gitea#19318) [skip ci] Updated translations via Crowdin Show ssh command directly in template instead of i18n translation (go-gitea#19335) Package registry changes (go-gitea#19305) [skip ci] Updated translations via Crowdin Add `ENABLE_SSH_LOG` to debugging problems (go-gitea#19316) Warn on SSH connection for incorrect configuration (go-gitea#19317) escape fake link Allow custom redirect for landing page (go-gitea#19324) [skip ci] Updated translations via Crowdin ...
* Warn on SSH connection for incorrect configuration - When `setting.RepoRootPath` cannot be found(most likely due to incorrect configuration) show "Gitea: Incorrect configuration" on the client-side to help easier with debugging the problem. * Update cmd/serv.go Co-authored-by: delvh <[email protected]> * Don't leak configuration * Update cmd/serv.go Co-authored-by: delvh <[email protected]> Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: techknowlogick <[email protected]>
|
-> #19437 |
Backport #19317 - Warn on SSH connection for incorrect configuration - When `setting.RepoRootPath` cannot be found(most likely due to incorrect configuration) show "Gitea: Incorrect configuration" on the client-side to help easier with debugging the problem. Co-authored-by: delvh <[email protected]> Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: techknowlogick <[email protected]>
|
To correct the review before (which was incorrect):
Only the first arg of |
* Warn on SSH connection for incorrect configuration - When `setting.RepoRootPath` cannot be found(most likely due to incorrect configuration) show "Gitea: Incorrect configuration" on the client-side to help easier with debugging the problem. * Update cmd/serv.go Co-authored-by: delvh <[email protected]> * Don't leak configuration * Update cmd/serv.go Co-authored-by: delvh <[email protected]> Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: techknowlogick <[email protected]>
- This should prevent SSH failures from happening as described in go-gitea#19317
- Backport go-gitea#22754 - This should prevent SSH failures from happening as described in go-gitea#19317
If a user's `app.ini` contains a `APP_DATA_PATH` which refers to a non-absolute path then `gitea serv` etc. become dependent on the `AppWorkPath`. `gitea serv` may then require `--work-path` to be set in the `authorized_keys` if the `AppWorkPath` determined by `gitea web` and `gitea serv` are different. This would occur if `GITEA_WORK_DIR` is set, `--work-path` is used to run `gitea web` or if the AppPath cannot be determined at start-up. This PR adds some code to attempt to automatically determine if this is necessary and adds some documentation to suggest adding `--work-path` to the template. This should prevent SSH failures from happening as described in go-gitea#19317 Replace go-gitea#22754 Signed-off-by: Andrew Thornton <[email protected]>
setting.RepoRootPathcannot be found(most likely due to incorrect configuration) show "Gitea: Incorrect configuration" on the client-side to help easier with debugging the problem.