Commit Graph

8946 Commits

Author SHA1 Message Date
zeripath c76c70a16c Move mailer to use a queue (#9789)
* Move mailer to use a queue

* Make sectionMap map[string]bool

* Ensure that Message is json encodable
2020-01-16 18:55:36 +01:00
6543 06cd3e03a2 [refactor] notify remove unused praram (#9804) 2020-01-16 17:24:20 +01:00
Antoine GIRARD 11885daaa0
tests: configure github remaining limit + read token (#9800)
* ci: configure remaining github limmit

* prepend with github since package is common to all migrations

* add RefreshRate

* Update github.go

* add missing space

* go fmt

* Read env variable GITHUB_READ_TOKEN for token

* Update .drone.yml
2020-01-16 16:15:44 +01:00
GiteaBot fdb32ab0f8 [skip ci] Updated translations via Crowdin 2020-01-16 14:22:28 +00:00
Lunny Xiao dbd89acf98 Remove unnecessary permissions load (#9796)
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
2020-01-16 15:18:30 +01:00
Moritz f740943df4 Fix markdown anchor links (#9673)
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-16 12:23:48 +01:00
Damien Cassou c6a32ddb47 Update go-org to 0.1.9 (#9782)
* Update go-org to 0.1.9

What I did to generate this commit:

$ go get github.com/niklasfasching/go-org

* make vendor
2020-01-16 09:27:41 +01:00
6543 3ae5f8ef11 [Docs] Update Feature 'Reject unsigned commits' (#9793)
* update docs

* add link to feature
2020-01-16 01:43:02 -05:00
John Olheiser 176e7fb5d5 Fix push-to-create (#9772)
* Fix push-to-create

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Check URL path and service

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Send dummy payload on receive-pack GET

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* The space was actually a NUL byte

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Use real bare repo instead of manufactured payload

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-01-16 10:40:13 +08:00
silverwind 8716752d22 update supported browsers and add a few more (#9734)
Now includes Firefox ESR, Opera and a few more browser with usages
between 0.5% and 1%. defaults resolves to > 0.5%, last 2 versions, Firefox ESR, not dead.

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-01-16 01:28:03 +01:00
6543 665d7e91a8 Fix signing info on PR view if not signed in (#9788) 2020-01-15 22:55:25 +00:00
zeripath e7923c4bc0 Fix missing unlock in uniquequeue (#9790) 2020-01-15 23:58:33 +02:00
Lunny Xiao 9343d2fc85 Fix missing msteam webhook on organization (#9781) 2020-01-15 13:38:44 -05:00
David Svantesson f162a32604 Fix #9662 (#9767)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-01-15 14:18:02 +01:00
GiteaBot 3ac79b7101 [skip ci] Updated translations via Crowdin 2020-01-15 11:16:35 +00:00
Lunny Xiao 2b3e931cde Migrate reactions when migrating repository from github (#9599)
* Migrate reactions when migrating repository from github

* fix missed sleep

* fix tests

* update reactions when external user binding

* Fix test

* fix tests

* change the copy head

* fix test

* fix migrator add/delete reaction
2020-01-15 12:14:07 +01:00
GiteaBot 4e566df1c6 [skip ci] Updated translations via Crowdin 2020-01-15 09:56:33 +00:00
Bagas Sanjaya 3f1e062d21 err_admin_name_pattern_not_allowed String Clarification (#9731)
* err_admin_name_pattern_not_allowed clarification edit

* Apply suggestion from @zeripath

Context: username that provided as admin

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

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-15 10:53:30 +01:00
zeripath 66ee9b87f9 Add require signed commit for protected branch (#9708)
* Add require signed commit for protected branch

* Fix fmt

* Make editor show if they will be signed

* bugfix

* Add basic merge check and better information for CRUD

* linting comment

* Add descriptors to merge signing

* Slight refactor

* Slight improvement to appearances

* Handle Merge API

* manage CRUD API

* Move error to error.go

* Remove fix to delete.go

* prep for merge

* need to tolerate \r\n in message

* check protected branch before trying to load it

* Apply suggestions from code review

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* fix commit-reader

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-01-15 09:32:57 +01:00
techknowlogick 6b1fa12359
use arm drone agent for docs (#9776) 2020-01-15 00:59:13 -05:00
GiteaBot 7e44995a51 [skip ci] Updated translations via Crowdin 2020-01-15 04:34:53 +00:00
Antoine GIRARD 203e063846 ci: move some integration tests on arm64 (#9747) 2020-01-14 23:33:54 -05:00
GiteaBot 324672106b [skip ci] Updated translations via Crowdin 2020-01-15 03:55:40 +00:00
Lunny Xiao d32eac44b1 Move RepoWorkingPool to services/repository package (#9754)
* Move RepoWorkingPool to services/repository package

* Make repoWorkingPool private

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-15 04:14:50 +01:00
Antoine GIRARD fd761708fe
ci: run notify on arm64 (#9762)
* ci: run notify on arm64

Free one jobs on amrd64

* Update .drone.yml

* Update .drone.yml

* Update .drone.yml

Based on: https://github.com/appleboy/drone-discord/blob/master/.drone.yml#L339

* improve trigger

Co-authored-by: techknowlogick <matti@mdranta.net>
2020-01-15 03:14:21 +01:00
GiteaBot 9eb6793576 [skip ci] Updated translations via Crowdin 2020-01-15 00:08:04 +00:00
zeripath d171cd41b1
Fix #9752 (#9769) 2020-01-14 23:11:08 +00:00
John Olheiser cd5a44d973 Fix milestones page (#9770)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-01-14 22:57:13 +01:00
John Olheiser d89022c202 Fix SimpleMDE quote reply (#9757)
Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: zeripath <art27@cantab.net>
2020-01-14 21:47:38 +01:00
silverwind f00961abe7 move swagger-ui to webpack/npm (#9714)
Created a second webpack output file for swagger-ui which is loaded on
the /api/swagger route. One notable difference is the absence of the
swagger favicon that was previously used which is now the gitea icon. I
see no easy way to restore that favicon, so I decided to not keep it.
2020-01-14 13:02:08 -05:00
6543 44de66bf50 [API] add endpoint to check notifications [Extend #9488] (#9595)
* introduce GET /notifications/new

* add TEST

* use Sprintf instead of path.Join

* Error more verbose

* return number of notifications if unreaded exist

* 200 http status for available notifications
2020-01-14 16:37:19 +01:00
Bagas Sanjaya ce274d652f Add Privacy Policy and Terms of Service Page (#9513)
* Add privacy policy page and link

* Add TOS page and link

* Add update date

* [Docs] Add customizing PP and TOS

* Separate h2 user-generated content with its paragraph

* Reimplement Privacy Policy

The document is inspired from GitHub.

* Refactor to contrib

* [Docs] Mention how to add legal pages

* Reimplement Terms of Service

Adapted from GitHub

* Update revision date

* Rename to mark as sample file

* Apply suggestion from @sapk

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>

* Apply suggestion from @sapk

Use absolute link instead

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>

* Apply suggestion from @zeripath

Change `Last Updated` element to `<h4>`

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

* Apply suggestion from @zeripath

Close this `<li>` element instance

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

* Apply suggestion from @zeripath

Intentionally grammar fix

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

* Apply suggestion from @zeripath

Information grammar

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

* Apply suggestion from @zeripath

Cannot guarantee absolute security...

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

* Apply suggestion from @zeripath

Use `<h4>` element for last updated date

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

* Apply suggestion from @zeripath

Remove trailing `</p>` at the end of API clause

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

* Apply suggestion from @zeripath

Migrate privacy email domain to Your Gitea Instance

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

* Apply suggestions from @zeripath

Remove `<p>` container for `<ol>` definitions

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

* Apply suggestions from @zeripath

Remove `<p>` container that contain `<ol>` user-generated content

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

* Apply suggestions from @zeripath

Remove `<p>` container for private repositories `<ol>` listing

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

* Apply suggestions from @zeripath

Migrate remaining email domains to Your Gitea Instance

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

* Apply suggestion from @zeripath

Offer support

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

* Apply suggestion from @zeripath

Change "Your Gitea Instance" references to match your situation and Gitea project disclaimer

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

* Reword transmission data to reflect hosting on third-party provider

* Reword Analytics clause to reflects that not all Gitea instances deploy analytics OOTB

* Remove `<p>` container from account terms

* Migrate support email on tos to your-gitea-instance

* Reword Tracking and Analytics clause for OOTB case

* [Docs] Append privacy.html to cp destination

* Apply suggestion from @6543

Create or append to footer template

Co-Authored-By: 6543 <6543@obermui.de>

* Apply suggestion from myself

@6543 suggest replacing this `cp` line (which assumed that Gitea sources are available) with `wget` to GitHub raw link. At the time of writing this, this returned 404, but when this PR has been merged, this should get the actual page.

* Apply suggestions from @6543

1. Add gpg key to profile information
2. Add Git repos to list of User Personal Information
3. Comment out responsibility for sensitive information

Co-Authored-By: 6543 <6543@obermui.de>

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2020-01-14 14:34:40 +01:00
GiteaBot a8da7b3b8c [skip ci] Updated translations via Crowdin 2020-01-14 12:54:26 +00:00
Antoine GIRARD ebaf33873f
ci: use new mssql image (#9720)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-01-14 13:06:49 +01:00
GiteaBot 35efc7ba4f [skip ci] Updated translations via Crowdin 2020-01-14 10:31:54 +00:00
Lunny Xiao 7f869c061e Fix missing updated time on migrated issues and comments (#9744)
* Fix missing updated time on migrated issues and comments

* Fix testing and missing updated on migrating pullrequest

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-14 10:29:22 +00:00
Lunny Xiao 2677d071f9
Move newbranch to standalone package (#9627)
* Move newbranch to standalone package

* move branch functions to modules to avoid dependencies cycles

* fix tests

* fix lint

* fix lint
2020-01-14 11:38:04 +08:00
GiteaBot bca367cecc [skip ci] Updated translations via Crowdin 2020-01-14 00:08:14 +00:00
guillep2k 565eb1811c Add test for git + git lfs (#9753) 2020-01-14 00:06:54 +00:00
Manush Dodunekov 1751d5fcf2 Restricted users (#6274)
* Restricted users (#4334): initial implementation

* Add User.IsRestricted & UI to edit it

* Pass user object instead of user id to places where IsRestricted flag matters

* Restricted users: maintain access rows for all referenced repos (incl public)

* Take logged in user & IsRestricted flag into account in org/repo listings, searches and accesses

* Add basic repo access tests for restricted users

Signed-off-by: Manush Dodunekov <manush@stendahls.se>

* Mention restricted users in the faq

Signed-off-by: Manush Dodunekov <manush@stendahls.se>

* Revert unnecessary change `.isUserPartOfOrg` -> `.IsUserPartOfOrg`

Signed-off-by: Manush Dodunekov <manush@stendahls.se>

* Remove unnecessary `org.IsOrganization()` call

Signed-off-by: Manush Dodunekov <manush@stendahls.se>

* Revert to an `int64` keyed `accessMap`

* Add type `userAccess`
* Add convenience func updateUserAccess()
* Turn accessMap into a `map[int64]userAccess`

Signed-off-by: Manush Dodunekov <manush@stendahls.se>

* or even better: `map[int64]*userAccess`

* updateUserAccess(): use tighter syntax as suggested by lafriks

* even tighter

* Avoid extra loop

* Don't disclose limited orgs to unauthenticated users

* Don't assume block only applies to orgs

* Use an array of `VisibleType` for filtering

* fix yet another thinko

* Ok - no need for u

* Revert "Ok - no need for u"

This reverts commit 5c3e886aab.

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-13 18:33:46 +01:00
6543 0b3aaa6196 [API] Add "before" query to ListIssueComments and ListRepoIssue… (#9685)
* add "before" query to ListIssueComments and ListRepoIssueComments

* Add TEST

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-13 17:02:24 +01:00
GiteaBot b7ffc6a096 [skip ci] Updated translations via Crowdin 2020-01-13 14:10:01 +00:00
Antoine GIRARD dfe4564072
ci: go back to golangci-lint 1.20.0 (#9742)
Revert https://github.com/go-gitea/gitea/pull/9711
2020-01-13 15:06:49 +01:00
GiteaBot bd9d480f99 [skip ci] Updated translations via Crowdin 2020-01-13 10:42:46 +00:00
Antoine GIRARD b787aafc17
ci: re-ordering Drone CI for optimizing time (#9719)
* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try re-ordering for optimizing time

* ci: try offloading mysql8 to arm64

* Revert "ci: try offloading mysql8 to arm64"

This reverts commit c60de5db1c.

* ci: try offloading pgsql to arm64

* ci: activate ldap on arm64

* ci: test mysql8 in place pgsql arm64

* chore: clean un-needed move

* typo

* ci: revert runnning mysql on arm64

* ci: run compliance on arm

* chore: limit change

* chore: readd maybe need for release fetch-tags

* ci: remove docker-linux-amd64-dry-run

* ci: remove docker-linux-amd64-dry-run

* Revert "ci: remove docker-linux-amd64-dry-run"

This reverts commit 0715f65b11.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-01-13 11:40:10 +01:00
silverwind 80bfd5145c add package-lock=true in .npmrc (#9736)
Some users (like me) have this option disabled in their global npm
config which can lead to package-lock.json not being updated. This
explicitely enables the option for this repo, so that the file is
always updated when adding/removing dependencies.

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-13 00:11:43 +01:00
Antoine GIRARD 2ecf98ed2d ci: use docker image for golangci-lint (#9737) 2020-01-12 16:26:13 -05:00
silverwind a3977a3e51 fix webpack polyfills (#9735)
webpack polyfills did not work because useBuiltIns: 'entry' expects a
explicit core-js import. Changed it to 'usage' which does not require
these explicit imports and polyfills based on browserslist.

As a result, the built index.js now went from 128kB to 192kB.

Ref: https://babeljs.io/docs/en/babel-preset-env#usebuiltins

Co-authored-by: zeripath <art27@cantab.net>
2020-01-12 21:53:12 +01:00
silverwind 74e35aae11 remove deprecated targets from Makefile (#9729)
- remove deprecated targets
- ensure 1 empty line between targets

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
2020-01-12 18:22:26 +01:00
GiteaBot 625057c674 [skip ci] Updated translations via Crowdin 2020-01-12 16:34:48 +00:00