Unfortunately there was a mistake in #13164 which fails to handle
os.PathError wrapping an os.ErrNotExist
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: zeripath <[email protected]>
* Fix diff skipping lines
Backport #13154
ParsePatch previously just skipped all lines that start with "+++ " or "--- "
and makes no attempt to see these lines in context.
This PR rewrites ParsePatch to pay attention to context and position
within a patch, ensuring that --- and +++ are only skipped if
appropriate.
This PR also fixes several issues with incomplete files.
Fix https://codeberg.org/Codeberg/Community/issues/308Fix#13153
Signed-off-by: Andrew Thornton <[email protected]>
* Add testcase
Signed-off-by: Andrew Thornton <[email protected]>
* fix comment
* simplify error handling
Signed-off-by: Andrew Thornton <[email protected]>
* never return io.EOF
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Afaik, adding these lines does nothing unless the file(s) are present. Having them in let's admins supply certs instead of relying on TOFU.
Co-authored-by: zeripath <[email protected]>
* Avatar support minio
* Support repo avatar minio storage
* Add missing migration
* Fix bug
* Fix test
* Add test for minio store type on avatars and repo avatars; Add documents
* Fix bug
* Fix bug
* Add back missed avatar link method
* refactor codes
* Simplify the codes
* Code improvements
* Fix lint
* Fix test mysql
* Fix test mysql
* Fix test mysql
* Fix settings
* Fix test
* fix test
* Fix bug
* Finally fix diff names
#12771 attempted to fix diff by avoiding the git diff line as
it is possible to have an ambiguous line here.
#12254 attempted to fix diff by assuming that names would quoted
if they needed to be and if one was quoted then both would be.
Both of these were wrong.
I have now discovered `--src-prefix` and `--dst-prefix` which
means that we can set this in such a way to force the git diff
to always be unambiguous.
Therefore this PR rollsback most of the changes in #12771 and
uses these options to fix this.
Signed-off-by: Andrew Thornton <[email protected]>
* Update services/gitdiff/gitdiff.go
* Update services/gitdiff/gitdiff.go
* Update modules/repofiles/temp_repo.go
* fix test
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
* first draft
* update gitea sdk to 9e280adb4da
* adapt feat of updated sdk
* releases now works
* break the Reactions loop
* use convertGiteaLabel
* fix endless loop because paggination is not supported there !!!
* rename gitea local uploader files
* pagination can bite you in the ass
* Version Checks
* lint
* docs
* rename gitea sdk import to miss future conficts
* go-swagger: dont scan the sdk structs
* make sure gitea can shutdown gracefully
* make GetPullRequests and GetIssues similar
* rm useles
* Add Test: started ...
* ... add tests ...
* Add tests and Fixing things
* Workaround missing SHA
* Adapt: Ensure that all migration requests are cancellable
(714ab71ddc)
* LINT: fix misspells in test set
* adapt ListMergeRequestAwardEmoji
* update sdk
* Return error when creating giteadownloader failed
* update sdk
* adapt new sdk
* adopt new features
* check version before err
* adapt: 'migrate service type switch page'
* optimize
* Fix DefaultBranch
* impruve
* handle subPath
* fix test
* Fix ReviewCommentPosition
* test GetReviews
* add DefaultBranch int test set
* rm unused
* Update SDK to v0.13.0
* addopt sdk changes
* found better link
* format template
* Update Docs
* Update Gitea SDK (v0.13.1)
* Provide self-registering storage system
Signed-off-by: Andrew Thornton <[email protected]>
* More simplification
Signed-off-by: Andrew Thornton <[email protected]>
* Remove old strings from setting
Signed-off-by: Andrew Thornton <[email protected]>
* oops attachments not attachment
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
* Add timestamps to Star, Label, LanguageStat, Follow, Watch and Collaboration
* Star do not need updated
* LanguageStat do not need update (they wont change)
* fix unit-test
If team does not exist expect ErrTeamNotExist not ErrUserNotEXist
Fix#11336
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Prohibit automatic downgrades by checking the version of the db and warning if the version number should be lower.
Close#13107
Co-authored-by: Cirno the Strongest <[email protected]>
Instead of a generic HTTP 500 error page, a flash message is rendered with the deploy key page template to inform the user that a key with the intended title already exists.
Fixes#13110
This PR updates golangci-lint to the latest version 1.31.0.
The upgrade introduced a new check for which I've fixed or disabled most cases.
Signed-off-by: kolaente <[email protected]>
If there is a panic during runMigrateTask we should capture and log the underlying
panic error.
This PR ensures that the panic is logged and captured as part of the task message.
Fix#13095
Signed-off-by: Andrew Thornton <[email protected]>
* Add ssh certificate support
* Add ssh certificate support to builtin ssh
* Write trusted-user-ca-keys.pem based on configuration
* Update app.example.ini
* Update templates/user/settings/keys_principal.tmpl
Co-authored-by: silverwind <[email protected]>
* Remove unused locale string
* Update options/locale/locale_en-US.ini
Co-authored-by: silverwind <[email protected]>
* Update options/locale/locale_en-US.ini
Co-authored-by: silverwind <[email protected]>
* Update models/ssh_key.go
Co-authored-by: silverwind <[email protected]>
* Add missing creation of SSH.Rootpath
* Update cheatsheet, example and locale strings
* Update models/ssh_key.go
Co-authored-by: zeripath <[email protected]>
* Update models/ssh_key.go
Co-authored-by: zeripath <[email protected]>
* Update models/ssh_key.go
Co-authored-by: zeripath <[email protected]>
* Update models/ssh_key.go
Co-authored-by: zeripath <[email protected]>
* Update models/ssh_key.go
* Optimizations based on feedback
* Validate CA keys for external sshd
* Add filename option and change default filename
Add a SSH_TRUSTED_USER_CA_KEYS_FILENAME option which default is
RUN_USER/.ssh/gitea-trusted-user-ca-keys.pem
Do not write a file when SSH_TRUSTED_USER_CA_KEYS is empty.
Add some more documentation.
* Remove unneeded principalkey functions
* Add blank line
* Apply suggestions from code review
Co-authored-by: zeripath <[email protected]>
* Add SSH_AUTHORIZED_PRINCIPALS_ALLOW option
This adds a SSH_AUTHORIZED_PRINCIPALS_ALLOW which is default
email,username this means that users only can add the principals
that match their email or username.
To allow anything the admin need to set the option anything.
This allows for a safe default in gitea which protects against malicious
users using other user's prinicipals. (before that user could set it).
This commit also has some small other fixes from the last code review.
* Rewrite principal keys file on user deletion
* Use correct rewrite method
* Set correct AuthorizedPrincipalsBackup default setting
* Rewrite principalsfile when adding principals
* Add update authorized_principals option to admin dashboard
* Handle non-primary emails
Signed-off-by: Andrew Thornton <[email protected]>
* Add the command actually to the dashboard template
* Update models/ssh_key.go
Co-authored-by: silverwind <[email protected]>
* By default do not show principal options unless there are CA keys set or they are explicitly set
Signed-off-by: Andrew Thornton <[email protected]>
* allow settings when enabled
* Fix typos in TrustedUserCAKeys path
* Allow every CASignatureAlgorithms algorithm
As this depends on the content of TrustedUserCAKeys we should allow all
signature algorithms as admins can choose the specific algorithm on their
signing CA
* Update models/ssh_key.go
Co-authored-by: Lauris BH <[email protected]>
* Fix linting issue
Co-authored-by: silverwind <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
#11141 broke the appearance of dropzone attachments when editting
comments causing poorly updating lists.
This PR fixes this.
Fix#12583
Signed-off-by: Andrew Thornton [email protected]
`models.getUserRepoPermission(...)` calls `HasOrgVisible` which
uses `models.x` potentially outside of the transaction `e` provided
as an argument to `getUserRepoPermission`.
This PR switches to use `hasOrgVisible(e, ...)`.
Fix#12983
Signed-off-by: Andrew Thornton <[email protected]>
* Change default log configuration
This PR changes the install page and the docker default
logging configuration to match the suggested configuration
that I repeatedly end up suggesting on issues.
It further improves the logging configuration docs to
recommend specific instructions for how to configure logs
for posting to issues.
Signed-off-by: Andrew Thornton <[email protected]>
* Update docs/content/doc/advanced/logging-documentation.en-us.md
`new-password` prevents annoying autocompletion in some cases, thought
it's not semantically correct to use that for example on all three
fields on the user account page, so some annoyances remain.
Co-authored-by: Lauris BH <[email protected]>
* Disable DSA ssh keys by default
OpenSSH has disabled DSA keys since version 7.0
As the docker runs openssh > v7.0 we should just disable
DSA keys by default.
Refers to #11417
Signed-off-by: Andrew Thornton <[email protected]>
* Just disable DSA keys by default
Signed-off-by: Andrew Thornton <[email protected]>
* Appears we need to set the minimum key sizes too
Signed-off-by: Andrew Thornton <[email protected]>
* Appears we need to set the minimum key sizes too
Signed-off-by: Andrew Thornton <[email protected]>
* Remove DSA type
* Fix Tests
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
* Improve Docker container name
Use a better Docker container name than the default 'server'
* Changing to gitea and use recommended v3 Docker-compose
Use `gitea` as container name. And use version 3 of the docker-compose, which should now be used: https://docs.docker.com/compose/compose-file/compose-versioning/
Co-authored-by: techknowlogick <[email protected]>
* Cache last commit when pushing for big repository
* Fix bug
* detect force push
* Refactor cache push
* Finish cache last commit info when push
* Some improvements
* Fix lint
* Remove unused changes
* Move pull request test before cache
* Fix test mysql
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Lauris BH <[email protected]>