Commit Graph

2273 Commits (6d0f78542f4c8bc9ca73dde0c6ed3671251fed20)

Author SHA1 Message Date
Lunny Xiao d8168b356d
Add missing description of label on API ()
* add missing description of label on API

* fix comment head

* fix swagger
Antoine GIRARD 367aeb169a Use go method to calculate ssh key fingerprint ()
* Use go method to calculate key fingerprint

* add gitea copyright

* use native go method only for built-in server

* refactor and add tests

* add gitea copyright
zeripath cf2221e3ac Add LastLogin to the User API ()
zeripath cde410521c
Only warn on errors in deleting LFS orphaned files during repo deletion ()
Lunny Xiao 0323122fd7 fix duplicated file on pull request conflicted files ()
zeripath 94ceaf1c0c Allow colon between fixing word and issue ()
* Allow colon between fixing word and issue

* update test
John Olheiser 744fd6a1c8 Add error for fork already existing ()
kolaente f9ec2f89f2 Add golangci ()
Lunny Xiao 5832f8d90d Fix database lock when use random repository fallback image ()
* fix database lock when use random repository fallback image

* remove unused function
Mario Lubenka 1608f63e39 Fixes diff on merged pull requests ()
silverwind 499a8a1cdd Various fixes for issue mail notifications ()
- Send individual mails for actions and comments
- Send mail for new issues/prs without a comment
- Use correct sender for reopen/close actions
- Hopefully fixed all bugs related to missing mails

Fixes: https://github.com/go-gitea/gitea/issues/7124
Fixes: https://github.com/go-gitea/gitea/issues/5977
Lunny Xiao d93e6232e8
Move PushUpdate dependency from models to repofiles ()
* remove push_update

* move models.PushUpdate to repofiles.PushUpdate
Richard Mahn 8de0b0a3f0 Fixes - Adds the /git/tags API endpoint ()
* Fixes  - /git/tags API

* proper URLs

* Adds function comments

* Updates swagger

* Removes newline from tag message

* Removes trailing newline from commit message

* Adds integration test

* Removed debugging

* Adds tests

* Fixes bug where multiple tags of same commit show wrong tag name

* Fix formatting

* Removes unused varaible

* Fix to annotated tag function names and response

* Update modules/git/repo_tag.go

Co-Authored-By: Lauris BH <lauris@nix.lv>

* Uses TagPrefix

* Changes per review, better error handling for getting tag and commit IDs

* Fix to getting commit ID

* Fix to getting commit ID

* Fix to getting commit ID

* Fix to getting commit ID
Lunny Xiao 23a2ee3510
Add command to convert mysql database from utf8 to utf8mb4 ()
* add command to convert mysql database from utf8 to utf8mb4

* Update cmd/convert.go

Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>

* Update cmd/convert.go

Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>

* Update cmd/convert.go

Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>

* Update models/convert.go

Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>

* Update models/convert.go

Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>

* Update cmd/convert.go

Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>

* Update cmd/convert.go

Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>
Mario Lubenka 311ce2d1d0 Compare branches, commits and tags with each other ()
* Supports tags when comparing commits or branches

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Hide headline when only comparing and don't load unused data

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Merges compare logics to allow comparing branches, commits and tags with eachother

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Display branch or tag instead of commit when used for comparing

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Show pull request form after click on button

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Transfers relevant pull.go changes from master to compare.go

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Fixes error when comparing forks against a commit or tag

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Removes console.log from JavaScript file

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Show icon next to commit reference when comparing branch or tag

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Updates css file

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Fixes import order

* Renames template variable

* Update routers/repo/compare.go

Co-Authored-By: zeripath <art27@cantab.net>

* Update from master

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Allow short-shas in compare

* Renames prInfo to compareInfo

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Check PR permissions only if compare is pull request

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Adjusts comment

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Use compareInfo instead of prInfo
zeripath bd55f6ff36
Detect noreply email address as user ()
Lanre Adelowo de6539fc8c Add state param to milestone listing API ()
* Support state params

* update tests

* fix tests

* add state=all support

* update tests

* update swagger

* update swagger
Mario Lubenka 8eba27c792 Repository avatar fallback configuration ()
* Only show repository avatar in list when one was selected

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Adds fallback configuration option for repository avatar

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Implements repository avatar fallback

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Adds admin task for deleting generated repository avatars

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Solve linting issues

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Save avatar before updating database

* Linting

* Update models/repo.go

Co-Authored-By: zeripath <art27@cantab.net>
zeripath 356854fc5f Move serv hook functionality & drop GitLogger ()
* Move hook functionality internally

* Internalise serv logic

* Remove old internal paths

* finally remove the gitlogger

* Disallow push on archived repositories

* fix lint error

* Update modules/private/key.go

* Update routers/private/hook.go

* Update routers/private/hook.go

* Update routers/private/hook.go

* Updated routers/private/serv.go

* Fix LFS Locks over SSH

* rev-list needs to be run by the hook process

* fixup

* Improve git test

* Ensure that the lfs files are created with a different prefix

* Reduce the replication in git_test.go

* slight refactor

* Remove unnecessary "/"

* Restore ensureAnonymousClone

* Restore ensureAnonymousClone

* Run rev-list on server side

* Try passing in the alternative directories instead

* Mark test as skipped

* Improve git test

* Ensure that the lfs files are created with a different prefix
* Reduce the replication in git_test.go
* Remove unnecessary "/"
Richard Mahn 1831b3b571 Fixes - Adds API Endpoint for Repo Edit ()
* Feature -  - API Endpoint for Repo Editing

* Revert from merge

* Adds integration testing

* Updates to integration tests

* Revert changes

* Update year in file header

* Misspell fix

* XORM = test

* XORM = test

* revert XORM = file

* Makes RepoUnit.ID be pk and autoincr

* Fix to units

* revert header

* Remove print statement

* Adds other responses

* Improves swagger for creating repo

* Fixes import order

* Better Unit Type does not exist error

* Adds editable repo properties to the response repo structure

* Fix to api_repo_edit_test.go

* Fixes repo test

* Changes per review

* Fixes typo and standardizes comments in the EditRepoOption struct for swagger

* Fixes typo and standardizes comments in the EditRepoOption struct for swagger

* Actually can unarchive through the API

* Unlike delete, user doesn't have to be the owner of the org, just admin to the repo

* Fix to swagger comments for field name change

* Update to swagger docs

* Update swagger

* Changes allow_pull_requests to has_pull_requests
Sergey Dryabzhinsky 3fd18838aa Repository avatars ()
* Repository avatars

- first variant of code from old work for gogs
- add migration 87
- add new option in app.ini
- add en-US locale string
- add new class in repository.less

* Add changed index.css, remove unused template name

* Update en-us doc about configuration options

* Add comments to new functions, add new option to docker app.ini

* Add comment for lint

* Remove variable, not needed

* Fix formatting

* Update swagger api template

* Check if avatar exists

* Fix avatar link/path checks

* Typo

* TEXT column can't have a default value

* Fixes:

- remove old avatar file on upload
- use ID in name of avatar file - users may upload same files
- add simple tests

* Fix fmt check

* Generate PNG instead of "static" GIF

* More informative comment

* Fix error message

* Update avatar upload checks:

- add file size check
- add new option
- update config docs
- add new string to en-us locale

* Fixes:

- use FileHEader field for check file size
- add new test - upload big image

* Fix formatting

* Update comments

* Update log message

* Removed wrong style - not needed

* Use Sync2 to migrate

* Update repos list view

- bigger avatar
- fix html blocks alignment

* A little adjust avatar size

* Use small icons for explore/repo list

* Use new cool avatar preparation func by @lafriks

* Missing changes for new function

* Remove unused import, move imports

* Missed new option definition in app.ini

Add file size check in user/profile avatar upload

* Use smaller field length for Avatar

* Use session to update repo DB data, update DeleteAvatar - use session too

* Fix err variable definition

* As suggested @lafriks - return as soon as possible, code readability
zeripath 57b2ce03d5
Handle early git version's lack of get-url ()
Bo-Yi Wu 743697a549
refactor: append, build variable and type switch ()
* refactor: append, build variable and type switch

* fix: remove redundant space.
Bo-Yi Wu 66863ab770 chore: change issue mail title. ()
* chore: change issue mail title.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* change to fullname method

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Lunny Xiao c2f3938a58 fix possbile mysql invalid connnection error ()
Rob Watson df2557835b Improve handling of non-square avatars ()
* Crop avatar before resizing ()

Signed-off-by: Rob Watson <rfwatson@users.noreply.github.com>

* Fix spelling error

Signed-off-by: Rob Watson <rfwatson@users.noreply.github.com>
jpicht 8cd4c2242c Fix default for allowing new organization creation for new users ()
Fixed 

When creating users DefaultAllowCreateOrganization was ignored.

Signed-off-by: Julian Picht <julian.picht@gmail.com>

* fix TestCreateUser_Issue5882

Signed-off-by: Julian Picht <julian.picht@gmail.com>
Lunny Xiao d5a98a2969 Add support of utf8mb4 for mysql ()
zeripath 54bd63cd5c
Change UpdateRepoIndex api to include watchers ()
* Change UpdateRepoIndex api to include watchers

* Add timeout
Lunny Xiao 1f84970de0
Make webhook http connections resuable ()
* make http connections resuable

* add error handler

* fix lint
David Schneiderbauer 8de76b6e64 fix u2f registrationlist ToRegistrations() method ()
Lunny Xiao c385dcc26b
Fix index produces problem when issues/pulls deleted ()
* fix index produces problem when issues/pulls deleted

* fix tests

* fix tests

* fix tests
zeripath 96b412bb87 Stop running hooks on pr merge ()
* Stop running hooks on pr merge

* Remove SSH_ORIGINAL_COMMAND from the pushing environment
mrsdizzie 68a83cc5a2 Allow collaborators to view repo owned private org ()
Handle case where an orginization is private but a user who is not a
member of the orgninization has been added as a collaborator of a repo
within that org

Fixes 
zeripath 56ae539bed SearchRepositoryByName improvements and unification ()
techknowlogick 5fb1ad7011 Webhook Logs show proper HTTP Method, and allow change HTTP method in form ()
* Fix  - logs show proper HTTP Method, and allow change HTTP method
in form

* enforce POST method for webhook

* set default if method is empty
Lunny Xiao 710245e81e
Refactor models.NewRepoContext to extract git related codes to modules/git ()
* refactor models.NewRepoContext to extract git related codes to modules/git

* fix imports

* refactor
zeripath e55c874dd2 Add work path CLI option ()
Makes it possible to set the work path as a CLI option instead of
relying on environment variables which are somewhat opaque
Lunny Xiao 24a536d145 Remove macaron dependent on models ()
Lunny Xiao 8b36f01f45 Move xorm logger bridge from log to models so that log module could be a standalone package ()
* move xorm logger bridge from log to models so that log module could be a standalone package

* fix tests

* save logger on xorm log bridge
Lunny Xiao e63274ee09 remove macaron dependent on models/mail.go ()
Mura Li 0b785481d7 Use modules/git for git commands ()
zeripath ce8de35334 Remove local clones & make hooks run on merge/edit/upload ()
* Add options to git.Clone to make it more capable

* Begin the process of removing the local copy and tidy up

* Remove Wiki LocalCopy Checkouts

* Remove the last LocalRepo helpers

* Remove WithTemporaryFile

* Enable push-hooks for these routes

* Ensure tests cope with hooks

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Remove Repository.LocalCopyPath()

* Move temporary repo to use the standard temporary path

* Fix the tests

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Remove LocalWikiPath

* Fix missing remove

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Use AppURL for Oauth user link ()

* Use AppURL for Oauth user link

Fix 

* Update oauth.go

* Update oauth.go

* internal/ssh: ignore env command totally ()

* ssh: ignore env command totally

* Remove commented code 

Needed fix described in issue 

* Escape the commit message on issues update and title in telegram hook ()

* update sdk to latest ()

* improve description of branch protection (fix ) ()

The branch protection description text were not quite accurate.

* Fix logging documentation ()

* ENABLE_MACARON_REDIRECT should be REDIRECT_MACARON_LOG

* Allow DISABLE_ROUTER_LOG to be set in the [log] section

* [skip ci] Updated translations via Crowdin

* Move sdk structs to modules/structs ()

* move sdk structs to moduels/structs

* fix tests

* fix fmt

* fix swagger

* fix vendor
Lunny Xiao 34eee25bd4
Move sdk structs to modules/structs ()
* move sdk structs to moduels/structs

* fix tests

* fix fmt

* fix swagger

* fix vendor
zeripath d64a646c0a Escape the commit message on issues update and title in telegram hook ()
Wim 4508380cf7 Show full name if DefaultShowFullName setting activated ()
Adds a new key DEFAULT_SHOW_FULL_NAME (default false) to the [ui] section.
If enabled the full name will be shown (unless it's empty, then
the default username will be used)
Lunny Xiao 9f18b23129 Fix 404 when send pull request some situation ()
Lunny Xiao 08069dc465
Improve migrations to support migrating milestones/labels/issues/comments/pullrequests ()
* add migrations

* fix package dependency

* fix lints

* implements migrations except pull requests

* add releases

* migrating releases

* fix bug

* fix lint

* fix migrate releases

* fix tests

* add rollback

* pull request migtations

* fix import

* fix go module vendor

* add tests for upload to gitea

* more migrate options

* fix swagger-check

* fix misspell

* add options on migration UI

* fix log error

* improve UI options on migrating

* add support for username password when migrating from github

* fix tests

* remove comments and fix migrate limitation

* improve error handles

* migrate API will also support migrate milestones/labels/issues/pulls/releases

* fix tests and remove unused codes

* add DownloaderFactory and docs about how to create a new Downloader

* fix misspell

* fix migration docs

* Add hints about migrate options on migration page

* fix tests
Lunny Xiao 2382f1b057
fix 500 when reviewer is deleted with integration tests ()
zeripath 0081cd8dfe Add mssql migration tests ()