Commit Graph

10804 Commits

Author SHA1 Message Date
zeripath ac88b0ee83
Ensure that schema search path is set with every connection on postgres (#14131)
* Ensure that schema search path is set with every connection on postgres

Unfortunately every connection to postgres requires that the search path is
set appropriately.

This PR shadows the postgres driver to ensure that as soon as a connection
is open, the search_path is set appropriately.

Fix #14088

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

* no golangci-lint that is not a helpful suggestion

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

* Use Execer if available

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-01-02 10:07:43 +08:00
Lunny Xiao d44f192d3e
When visit /favicon.ico but the static file is not exist return 404 but not continue to handle the route (#14211)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-01-01 17:05:45 -05:00
Lunny Xiao 8c086bae6e
Fix wrong publisher id (#14212)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
2021-01-01 16:03:31 -05:00
Kyle D 0f99edf123
Prevent clipping input text in Chrome (#14179) 2021-01-01 14:05:40 -05:00
silverwind 1bf7d71a0a
Consolidate Logos and update README header (#14136)
* Consolidate Logos and update README header

- Remove unused `logo-lg.png`, `logo-sm.png` and `logo-192.png`.
- Consolidate `favicon.svg` and `logo.svg` to just `logo.svg`.
- Remove Safari Mask icon, it seems to work fine with just `favicon.png` (no SVG support).
- Remove Fluid Icon. It only served Firefox and SVG works just fine there.
- Update customization instructions.
- Update README.md to use SVG icon, increase logo size and center it and badges.

* Update README_ZH.md

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>

* Update README_ZH.md

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-01-01 14:04:35 -05:00
Lunny Xiao 21adeaad70
Fix dashboard issues labels filter bug (#14210)
Co-authored-by: zeripath <art27@cantab.net>
2021-01-01 12:49:42 -05:00
Johnny Oskarsson a07e67d9cc
Minimal OpenID Connect implementation (#14139)
This is "minimal" in the sense that only the Authorization Code Flow
from OpenID Connect Core is implemented.  No discovery, no configuration
endpoint, and no user scope management.

OpenID Connect is an extension to the (already implemented) OAuth 2.0
protocol, and essentially an `id_token` JWT is added to the access token
endpoint response when using the Authorization Code Flow.  I also added
support for the "nonce" field since it is required to be used in the
id_token if the client decides to include it in its initial request.

In order to enable this extension an OAuth 2.0 scope containing
"openid" is needed. Other OAuth 2.0 requests should not be impacted by
this change.

This minimal implementation is enough to enable single sign-on (SSO)
for other sites, e.g. by using something like `mod_auth_openidc` to
only allow access to a CI server if a user has logged into Gitea.

Fixes: #1310

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2021-01-02 00:33:27 +08:00
techknowlogick 4f2f08bd80
deprecate building for mips (#14174)
Co-authored-by: zeripath <art27@cantab.net>
2021-01-01 23:22:32 +08:00
techknowlogick c9b9b462d2
Update owners for 2021 (#14206)
Fix #13801
2021-01-01 01:41:03 +02:00
a1012112796 b003116fca
fix branch selector on new issue page (#14194)
fix #14185

Signed-off-by: a1012112796 <1012112796@qq.com>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-12-31 13:32:11 -05:00
zeripath ef825bd242
Check for notExist on profile repository page (#14197)
Fix #14189
2020-12-31 15:45:54 +08:00
Chester Liu 632800eda7
Check for 'main' as potential default branch name (#14193) 2020-12-30 15:46:26 +00:00
Kyle D c074e46292
Hide migration failed by default (#14188) 2020-12-30 11:04:30 +08:00
GiteaBot af2fe9a733 [skip ci] Updated translations via Crowdin 2020-12-29 23:49:34 +00:00
silverwind 8e5aea88c7
Improve label and text wrapping (#14113)
* Improve label wrapping

- Adjust issue list styles so labels can wrap on the same line as the
  text. This relies on `display: inline` with the HTML whitespace being
  used as the separator.
- Add global word-break: break-word. This should generally avoid text
  overflows in various places.

* add whitespace to history labels

* use overflow-wrap

* restore word-break rules

* use correct pre

* use better selector for middle align

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-12-29 18:48:28 -05:00
GiteaBot cfc3916b3f [skip ci] Updated translations via Crowdin 2020-12-29 00:39:54 +00:00
techknowlogick 9164ff7791
frontport 1.13.1 changelog (#14175)
* frontport 1.13.1 changelog

* Update config.yaml

Co-authored-by: zeripath <art27@cantab.net>
2020-12-28 19:38:44 -05:00
silverwind 9a4050f1e8
Consolidate clone button templates (#14023)
The four clone button templates are pretty much identical except the one
in a non-empty repo had a few features which the others lacked.

Consolidate them in a single shared template which also makes the JS
that remembers protocol work on them all.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-12-28 13:30:06 -05:00
0xflotus 366ce66cad
fix: small typo error (#14170)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-12-28 12:08:01 -05:00
Lunny Xiao 11555d850b
Fix bug of link query order on markdown render (#14156)
* Fix bug of link query order on markdown render

* Fix bluemonday bug and fix one wrong test

Co-authored-by: 6543 <6543@obermui.de>
2020-12-29 00:28:27 +08:00
Daniil Pankratov 3175d08626
CLI support for OAuth sources custom icons (#14166)
Co-authored-by: Daniil Pankratov <daniil.pankratov@t-systems.com>
2020-12-28 09:39:12 +01:00
GiteaBot d75f011345 [skip ci] Updated translations via Crowdin 2020-12-28 02:37:00 +00:00
Timo Ley 2b2a4a53bf
Custom icons for OAuth sources (#14161)
* Add Icon URL to Backend

* Template for Icon URL

* Localization & Edit Icon URL

* Improve Custom Icon URL

* Removed not working else

Co-authored-by: 6543 <6543@obermui.de>
2020-12-28 03:35:55 +01:00
GiteaBot f6ca44c706 [skip ci] Updated translations via Crowdin 2020-12-27 19:59:15 +00:00
Jimmy Praet 40274b4a93
Team dashboards (#14159) 2020-12-27 21:58:03 +02:00
Bagas Sanjaya 25f8970b2c
[Docs] Database preparation: Clarify why database client is installed on Gitea server (#12833)
* Database preparation: Clarify why database client is installed on Gitea server

The database client program (`mysql` or `psql`) is used to test database
connection, but Gitea use Go's database driver to do the same.

Also, rename "server part" and "client part" to "server application" and
"client program" to disambiguate.

* Update docs/content/doc/installation/database-preparation.en-us.md

Co-authored-by: 6543 <6543@obermui.de>
2020-12-27 23:55:45 +08:00
silverwind 50a2dd52ba
Update JS dependencies and webpack (#14118)
* Update JS dependencies

- Update all JS dependencies
- Adapt webpack config for version 5
- Update to Less 4.0, adapting usage of removed mixin syntax
- Enable new ESLint rules and fix discovered issues

* update license-webpack-plugin to fix missing licenses

* update license-webpack-plugin once more to get webpack into the license output

* switch to license-checker-webpack-plugin again for performance

* update deps again

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-12-27 15:24:27 +01:00
silverwind fe403725f4
Improve basic button and label styles (#14119)
* Improve disabled styles for repo buttons

- Simplify disabled styling of label by matching for the disabled
  attribute.
- Raise fomantic disabled opacity from .45 to .55 to for more contrast.
- Use CSS vars for basic button styles.

* restore clickability on label

* color tweaks and remove arc-green style

* slightly reduce button size

* consolidate vars

* also cover active class

* slightly more distinct active class

* remove useless rule
2020-12-27 18:53:53 +08:00
Lunny Xiao dd08853b10
Dump github/gitlab/gitea repository data to a local directory and restore to gitea (#12244)
* Dump github/gitlab repository data to a local directory

* Fix lint

* Adjust directory structure

* Allow migration special units

* Allow migration ignore release assets

* Fix lint

* Add restore repository

* stage the changes

* Merge

* Fix lint

* Update the interface

* Add some restore methods

* Finish restore

* Add comments

* Fix restore

* Add a token flag

* Fix bug

* Fix test

* Fix test

* Fix bug

* Fix bug

* Fix lint

* Fix restore

* refactor downloader

* fmt

* Fix bug isEnd detection on getIssues

* Refactor maxPerPage

* Remove unused codes

* Remove unused codes

* Fix bug

* Fix restore

* Fix dump

* Uploader should not depend downloader

* use release attachment name but not id

* Fix restore bug

* Fix lint

* Fix restore bug

* Add a method of DownloadFunc for base.Release to make uploader not depend on downloader

* fix Release yml marshal

* Fix trace information

* Fix bug when dump & restore

* Save relative path on yml file

* Fix bug

* Use relative path

* Update docs

* Use git service string but not int

* Recognize clone addr to service type
2020-12-27 11:34:19 +08:00
6543 212fa340cf
Migration: drop to long repo topics (#14152) 2020-12-27 09:23:57 +08:00
Lunny Xiao cf9d471631
Change topic name size from 25 to 50 (#14150)
* Change topic name size from 25 to 50

* recreateTable requires full bean definition

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

Co-authored-by: zeripath <art27@cantab.net>
2020-12-26 23:28:47 +00:00
zeripath 236e70f135
Fix escaping issue in diff (#14153)
Ensure that linecontent is escaped before passing to template.HTML

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-12-26 21:58:21 +00:00
GiteaBot 5a1ccacac7 [skip ci] Updated translations via Crowdin 2020-12-26 18:23:50 +00:00
Norwin 24ecdbdb0d
Fix UI on edit auth source page (#14137)
* do not override OAuth URLs with default values when editing an auth source (fixes #12014)
* show custom url inputs by default for providers that don't provide an official hosted service
2020-12-26 18:22:42 +00:00
zeripath ad1164f73b
Disable SSH key deletion of externally managed Keys (#13985)
* Disable SSH key addition and deletion when externally managed

When a user has a login source which has SSH key management
key addition and deletion using the UI should be disabled.

Fix #13983

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

* Make only externally managed keys disabled

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

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-12-25 23:24:47 -05:00
6543 a19447aed1
migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models

* dont use "com.ToStr()"

* replace "com.ToStr" with "fmt.Sprint" where its easy to do

* more refactor

* fix test

* just "proxy" Copy func for now

* as per @lunny
2020-12-25 11:59:32 +02:00
silverwind 04ae0f2f3f
Disable Fomantic's custom scrollbars (#14109)
We already have custom scrollbars in our own CSS which are superior to
Fomantic's so diable them to save a few bytes and prevent interference.
2020-12-24 22:34:49 +00:00
Lunny Xiao 2c8d302eb1
Fix heatmap total contributions (#14141) 2020-12-24 20:58:30 +00:00
Daniil Pankratov 5a94db37ed
Fix creating OAuth2 auth source from CLI (#14116)
Fix creation OAuth2 auth source from CLI.

Fix #8356

Co-authored-by: Daniil Pankratov <daniil.pankratov@t-systems.com>
2020-12-24 19:47:17 +00:00
Norwin bdeccc3688
Fix api doc response code (#14123)
Fixes #14120
2020-12-24 18:14:01 +00:00
zeripath fa2e34928d
Ensure that search term and page are not lost on adoption page-turn (#14133)
Fix #14111

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

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-12-24 23:26:19 +08:00
GiteaBot 4c2a1c01a8 [skip ci] Updated translations via Crowdin 2020-12-24 04:26:32 +00:00
Lunny Xiao 19ae6439b0
Improve vfsgen to not unzip bindata files but send to browser directly (#7109)
* Don't unzip files from bindata but send to browser directly

* remove dependent for httpgzip

* Add tests for parseAcceptEncoding

* Update docs for ENABLE_GZIP

* Fix bug

* Fix bug

Co-authored-by: zeripath <art27@cantab.net>
2020-12-24 12:25:17 +08:00
silverwind 87a0396719
Fix admin monitoring margin (#14134) 2020-12-23 21:38:29 +01:00
6543 5b958315c1
API: Make BasicAuth Prefix case insensitive (#14106) 2020-12-23 20:52:46 +01:00
GiteaBot a9876bca82 [skip ci] Updated translations via Crowdin 2020-12-23 19:11:05 +00:00
silverwind cd5278a44c
Fix manifest encoding (#14114)
The previous URL encoding would encode spaces to '+' for the app name
which is incorrect. Use base64 encoding instead which does not have such
issues.
2020-12-23 19:09:54 +00:00
Jimmy Praet e0c753e770
Fix spelling avator -> avatar (#14115) 2020-12-22 22:28:03 +01:00
6543 27fa4814b8
Fix git.parseTagData (#14105)
* Fix git.parseTagData()
close #14092

* Add Test

* add message to test

* limit readers

* git tag -m trims and terminates with a newline

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
2020-12-22 21:44:25 +01:00
GiteaBot 30edcd5c71 [skip ci] Updated translations via Crowdin 2020-12-22 15:55:30 +00:00