Commit graph

7901 commits

Author SHA1 Message Date
Antoine GIRARD
954fe0e4e0
swagger/fix: []string are not enum by swagger definition (#7916)
* []string are not enum by swagger definition

* apply suggestion of @guillep2k

* re-generate swagger file
2019-08-26 20:13:10 +02:00
Mike Schwörer
042089fbaf API method to list all commits of a repository (#6408)
* Added API endpoint ListAllCommits (/repos/{owner}/{repo}/git/commits)

Signed-off-by: Mike Schwörer <mailport@mikescher.de>

* Fixed failing drone build

Signed-off-by: Mike Schwörer <mailport@mikescher.de>

* Implemented requested changes (PR reviews)

Signed-off-by: Mike Schwörer <mailport@mikescher.de>

* gofmt

Signed-off-by: Mike Schwörer <mailport@mikescher.de>

* Changed api route from "/repos/{owner}/{repo}/git/commits" to "/repos/{owner}/{repo}/commits"

* Removed unnecessary line

* better error message when git repo is empty

* make generate-swagger

* fixed removed return

* Update routers/api/v1/repo/commits.go

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

* Update routers/api/v1/repo/commits.go

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

* go fmt

* Refactored common code into ToCommit()

* made toCommit not exported

* added check for userCache == nil
2019-08-26 16:09:10 +02:00
Tamal Saha
6b3f52fe5f Run CORS handler first for /api routes (#7967)
Signed-off-by: Tamal Saha <tamal@appscode.com>
2019-08-26 13:33:06 +02:00
6543
5409dec8fd [Branch View] show "New Pull Request" Button only if posible (#7977)
* add check Commits Ahead is gt 0

* code format
to start drone-ci test again
and formate code is also nice :)
2019-08-26 13:47:41 +03:00
David Svantesson
c9546d4cdd Include description in repository search. (#7942)
* Add description in repository search.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Refactor SearchRepositoryByName with a general function SearchRepository

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Allow to specify if description shall be included in API repo search.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add new app.ini setting for whether to search within repo description.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Search keyword in description (if setting enabled) on:
 - Explore page
 - Organization profile page
 - User profile page
 - Admin repo page

Do not search keyword in description on:
 - Any non-keyword search (not relevant)
 - Incremental search (uses API)

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Put parameters related to keyword directly after it

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add test cases for including (and not including) repository description in search.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Rename test function from TestSearchRepositoryByName to TestSearchRepository.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Make setting SEARCH_REPO_DESCRIPTION default to true

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
2019-08-25 20:06:36 +03:00
David Svantesson
8c24bb9e43 Abort syncrhonization from LDAP source if there is some error. (#7960)
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
2019-08-24 21:53:37 +03:00
guillep2k
e3115cc019 Add support for DEFAULT_ORG_MEMBER_VISIBLE (#7669)
* Add support for DEFAULT_ORG_MEMBER_VISIBLE

* Correct formatting

* Improved description in cheat sheet.

* Add test for DefaultOrgMemberVisible

* Remove dead code
2019-08-24 15:28:59 +03:00
Lunny Xiao
f83db078f0 Move database settings from models to setting (#7806)
* move database settings from models to setting

* update docs

* fix checkout pr

* fix tests

* fix lint

* remove unsupported tidb options

* correct wrong variable name

* remove tidb totally
2019-08-24 11:24:45 +02:00
David Svantesson
26af3401c3 Document possibility to limit API Repo search to topics only. (#7957)
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
2019-08-23 23:17:10 -04:00
David Svantesson
ce45a8c257 Allow token as authorization for accessing attachments (#7909)
* Allow token as authorization for accessing attachments

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Only allow token authentication for attachments if it is a download (GET)
2019-08-24 02:33:32 +02:00
leigh capili
70d2244e49 Support SSH_LISTEN_PORT env var in docker app.ini template (#7829)
Signed-off-by: leigh capili <leigh@null.net>
2019-08-24 01:44:24 +02:00
GiteaBot
7c8166d331 [skip ci] Updated translations via Crowdin 2019-08-23 16:42:05 +00:00
Tamal Saha
171b359877 Use gitea forked macaron (#7933)
Signed-off-by: Tamal Saha <tamal@appscode.com>
2019-08-23 12:40:29 -04:00
David Svantesson
ca6fb004ac Change repo search to use exact match for topic search. (#7941)
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
2019-08-22 22:37:35 -04:00
John Olheiser
4ea9a377db Add config option and shortcode for Gitea version (#7940)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-08-23 09:55:06 +08:00
Lunny Xiao
9f58187f11 Add release notes of 1.9.2 (#7934) (#7939)
* Add release notes of 1.9.2

* add missing issue
2019-08-22 17:42:28 +01:00
Lunny Xiao
111d31d681
don't convert buffer to string (#7115) 2019-08-22 12:52:40 +08:00
Lunny Xiao
09ca391230
Add file status on API (#7671)
* add file status on API

* fix tests

* fix tests

* fix tests
2019-08-21 13:16:22 +08:00
Gary Kim
5f7fccaf55 Revert RenderCommitMessageLink part of #7659 (#7923)
RenderCommitMessageLink may have the
potential for issues and is overall
not very intuitive for the user in its
current state.

This commit will revert the usage
of RenderCommitMessageLink that was
added in #7659 to work on addressing
some of those issues to and merge this
feature again in a more polished state.

Signed-off-by: Gary Kim <gary@garykim.dev>
2019-08-20 22:08:16 +01:00
Lunny Xiao
ed58919bfc fix bug when migrating a private repository (#7917) 2019-08-20 21:21:07 +01:00
Mura Li
3ac45e3cb5 Fix pull creation with empty changes (#7920)
* Logs the stderr of git-apply
* Add an integration test
* Skip testPatch when patch is empty
2019-08-20 13:43:00 -04:00
GiteaBot
31f5713a1f [skip ci] Updated translations via Crowdin 2019-08-20 15:09:59 +00:00
Lunny Xiao
9b9d162194 fix wrong sender when send slack webhook (#7918) 2019-08-20 17:05:30 +02:00
GiteaBot
8c10d91086 [skip ci] Updated translations via Crowdin 2019-08-20 12:43:28 +00:00
Gary Kim
852876a982 Provide links in commit summaries in commits table/view list (#7659)
* Provide links in commit summaries in commits table/view list

Signed-off-by: Gary Kim <gary@garykim.dev>

* Check that hashes are commits before making them links

Signed-off-by: Gary Kim <gary@garykim.dev>

* Revert "Check that hashes are commits before making them links"

This reverts commit a88564b8bc9872d4bf11062a4ebcb2f42b702200.

* Add Commit Message Links to Files List

Signed-off-by: Gary Kim <gary@garykim.dev>
2019-08-20 20:40:06 +08:00
Mario Lubenka
08c63190c6 Evaluate emojis in commit messages in list view (#7906)
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
2019-08-18 18:53:50 +03:00
Lunny Xiao
2d0b90c967 Fix upload file type check (#7890)
* fix upload file type check

* make the function simple and added tests

* Update comment as per @silverwind
2019-08-17 13:10:17 +03:00
Mura Li
a678ea44b8 Update MAINTAINERS (#7896) 2019-08-16 23:17:34 -04:00
GiteaBot
4bc4acd02b [skip ci] Updated translations via Crowdin 2019-08-16 22:53:51 +00:00
guillep2k
de5986ae03 Reduce quote usage to bypass bug in GIT_SSH_COMMAND (#7893) 2019-08-16 23:28:55 +01:00
zeripath
bee1227b2f
Extract the username and password from the mirror url (#7651)
* Explode out mirror username and password

* Update models/repo_mirror.go

* Just roundtrip the password

* remove unused declaration

* Update templates/repo/settings/options.tmpl
2019-08-16 22:56:57 +01:00
Norwin
867f46f78e Detect delimiter in CSV rendering (#7869)
* detect csv delimiter in csv rendering

fixes #7868

* make linter happy

* fix failing testcase & use ints where possible

* expose markup type to template

previously all markup had the .markdown class, which is incorrect,
as it applies markdown CSS & JS logic to CSV rendering

* fix build (missing `make css`)

* ignore quoted csv content for delimiter scoring

also fix html generation
2019-08-16 01:09:50 +03:00
guillep2k
0a86d25e6a Add myself to maintainers (#7881)
* Add myself to maintainers

* Add missing handle

Co-Authored-By: techknowlogick <matti@mdranta.net>
2019-08-15 13:23:57 -04:00
guillep2k
5661773018 Remove unique filter from repo indexer analyzer. (#7878)
* Remove unique filter from repo indexer analyzer.

* Bump repoIndexerLatestVersion to 4

* Corrrect fmt

* make vendor to remove unique dependency
2019-08-15 23:38:55 +08:00
Lunny Xiao
85202d4784
Display ui time with customize time location (#7792)
* display ui time with customize time location

* fix lint

* rename UILocation to DefaultUILocation

* move time related functions to modules/timeutil

* fix tests

* fix tests

* fix build

* fix swagger
2019-08-15 22:46:21 +08:00
guillep2k
5a44be627c Convert files to utf-8 for indexing (#7814)
* Convert files to utf-8 for indexing

* Move utf8 functions to modules/base

* Bump repoIndexerLatestVersion to 3

* Add tests for base/encoding.go

* Changes to pass gosimple

* Move UTF8 funcs into new modules/charset package
2019-08-15 20:07:28 +08:00
Antoine GIRARD
c2c35d169c lfs/lock: round locked_at timestamp to second (#7872)
* lfs/lock: round locked_at timestamp to second

* test returned locked_at values

* tests: use time RFC3339
2019-08-15 18:53:28 +08:00
Lunny Xiao
a077c9d551
Add changelog of v1.9.1 (#7859) (#7866)
* add changelog of v1.9.1

* Update CHANGELOG.md

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

* mention releases build by go1.12.8

* Update CHANGELOG.md

Co-Authored-By: Lauris BH <lauris@nix.lv>
2019-08-15 10:45:21 +08:00
Lanre Adelowo
a315c8d992 fix non existent milestone with 500 error (#7867) 2019-08-14 19:43:50 -04:00
GiteaBot
14230ca843 [skip ci] Updated translations via Crowdin 2019-08-14 15:35:51 +00:00
Lunny Xiao
c021890930
move CreateReview to moduels/pull (#7841) 2019-08-14 23:32:19 +08:00
GiteaBot
eaa4d4ea98 [skip ci] Updated translations via Crowdin 2019-08-14 11:34:49 +00:00
zeripath
176ba79e96
Fix local runs of ssh-requiring integration tests (#7855) 2019-08-14 12:19:13 +01:00
GiteaBot
cbe30783c7 [skip ci] Updated translations via Crowdin 2019-08-14 09:39:51 +00:00
zeripath
def84840db Attempt to fix hook problem (#7854) 2019-08-14 12:25:05 +03:00
Gary Kim
7eed11e5e9 Check commit message hashes before making links (#7713)
* Check commit message hashes before making links

Previously, when formatting commit messages, anything
that looked like SHA1 hashes was turned into a link
using regex. This meant that certain phrases or numbers
such as `777777` or `deadbeef` could be recognized as a commit
even if the repository has no commit with those hashes.

This change will make it so that anything that looks
like a SHA1 hash using regex will then also be checked
to ensure that there is a commit in the repository
with that hash before making a link.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Use gogit to check if commit exists

This commit modifies the commit hash check
in the render for commit messages to use
gogit for better performance.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Make code cleaner

Signed-off-by: Gary Kim <gary@garykim.dev>

* Use rev-parse to check if commit exists

Signed-off-by: Gary Kim <gary@garykim.dev>

* Add and modify tests for checking hashes in html link rendering

Signed-off-by: Gary Kim <gary@garykim.dev>

* Return error in sha1CurrentPatternProcessor

Co-Authored-By: mrsdizzie <info@mrsdizzie.com>

* Import Gitea log module

Signed-off-by: Gary Kim <gary@garykim.dev>

* Revert "Return error in sha1CurrentPatternProcessor"

This reverts commit 28f561cac46ef7e51aa26aefcbe9aca4671366a6.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Add debug logging to sha1CurrentPatternProcessor

This will log errors by the git command run in
sha1CurrentPatternProcessor if the error is one
that was unexpected.

Signed-off-by: Gary Kim <gary@garykim.dev>
2019-08-14 16:04:55 +08:00
Antoine GIRARD
46d6b92ad0 Import topics during migration (#7851)
* add GetTopics interface

* CreateTopics

* remove un-needed comment
2019-08-14 14:16:12 +08:00
techknowlogick
99a004c343
Update golangci-lint to v1.17.1 (#7848) 2019-08-13 23:32:38 -04:00
clavinet
2f2a4cb898 Update app.ini.sample (#7816)
grammar fix
2019-08-13 23:28:11 -04:00
Antoine GIRARD
7ffa3fcfa0 gpg/bugfix: Use .ExpiredUnix.IsZero to display green color of forever valid gpg key (#7846)
* Use .ExpiredUnix.IsZero for display green color of gpg key

* remove useless parentheses
2019-08-14 09:39:44 +08:00