2
0
Commit Graph

105 Commits

Author SHA1 Message Date
Fabian Zaremba
3127448c1e Git LFS support v2 (#122)
* Import github.com/git-lfs/lfs-test-server as lfs module base

Imported commit is 3968aac269a77b73924649b9412ae03f7ccd3198

Removed:

Dockerfile CONTRIBUTING.md mgmt* script/ vendor/ kvlogger.go
.dockerignore .gitignore README.md

* Remove config, add JWT support from github.com/mgit-at/lfs-test-server

Imported commit f0cdcc5a01599c5a955dc1bbf683bb4acecdba83

* Add LFS settings

* Add LFS meta object model

* Add LFS routes and initialization

* Import github.com/dgrijalva/jwt-go into vendor/

* Adapt LFS module: handlers, routing, meta store

* Move LFS routes to /user/repo/info/lfs/*

* Add request header checks to LFS BatchHandler / PostHandler

* Implement LFS basic authentication

* Rework JWT secret generation / load

* Implement LFS SSH token authentication with JWT

Specification: https://github.com/github/git-lfs/tree/master/docs/api

* Integrate LFS settings into install process

* Remove LFS objects when repository is deleted

Only removes objects from content store when deleted repo is the only
referencing repository

* Make LFS module stateless

Fixes bug where LFS would not work after installation without
restarting Gitea

* Change 500 'Internal Server Error' to 400 'Bad Request'

* Change sql query to xorm call

* Remove unneeded type from LFS module

* Change internal imports to code.gitea.io/gitea/

* Add Gitea authors copyright

* Change basic auth realm to "gitea-lfs"

* Add unique indexes to LFS model

* Use xorm count function in LFS check on repository delete

* Return io.ReadCloser from content store and close after usage

* Add LFS info to runWeb()

* Export LFS content store base path

* LFS file download from UI

* Work around git-lfs client issue with unauthenticated requests

Returning a dummy Authorization header for unauthenticated requests
lets git-lfs client skip asking for auth credentials
See: https://github.com/github/git-lfs/issues/1088

* Fix unauthenticated UI downloads from public repositories

* Authentication check order, Finish LFS file view logic

* Ignore LFS hooks if installed for current OS user

Fixes Gitea UI actions for repositories tracking LFS files.
Checks for minimum needed git version by parsing the semantic version
string.

* Hide LFS metafile diff from commit view, marking as binary

* Show LFS notice if file in commit view is tracked

* Add notbefore/nbf JWT claim

* Correct lint suggestions - comments for structs and functions

- Add comments to LFS model
- Function comment for GetRandomBytesAsBase64
- LFS server function comments and lint variable suggestion

* Move secret generation code out of conditional

Ensures no LFS code may run with an empty secret

* Do not hand out JWT tokens if LFS server support is disabled
2016-12-26 09:16:37 +08:00
Ethan Koenig
eb4274aecc Bug fixes and tests for modules/base (#442)
Also address other TODOs
2016-12-22 16:58:04 +08:00
Denis Denisov
6669a9d490 Fix random string generator (#384)
* Remove unused custom-alphabet feature of random string generator

Fix random string generator

Random string generator should return error if it fails to read random data via crypto/rand

* Fixes variable (un)initialization mixed assign
Update test GetRandomString
2016-12-20 13:32:02 +01:00
Nico Mandery
2943f04b65 serve video files using the HTML5 video tag (#418)
* serve video files using the HTML5 video tag

* lint fix: add comment to IsVideoFile
2016-12-20 16:09:11 +08:00
Lunny Xiao
fb12d964b8 Don't use custom PBKDF2 function (#382) 2016-12-15 09:24:27 +08:00
Lunny Xiao
c9d61f0e2a Golint fixed for modules/setting (#262)
* golint fixed for modules/setting

* typo fixed and renamed UNIXSOCKET to UnixSocket
2016-11-27 18:14:25 +08:00
Lunny Xiao
f76e02aca6 golint fixed for modules/base 2016-11-24 15:17:44 +08:00
Thibault Meyer
43e3c1d1cc Normalize files with gofmt 2016-11-11 13:11:45 +01:00
Sandro Santilli
acb138c244 Update import paths from github.com/go-gitea to code.gitea.io (#135)
- Update import paths from github.com/go-gitea to code.gitea.io
- Fix import path for travis

See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
2016-11-10 17:24:48 +01:00
Matthias Loibl
0b88021476 Make long godoc comment 2 lines 2016-11-07 23:31:40 +01:00
Matthias Loibl
5e45c406b6 Add tests for StringsToInt64s() & Int64sToStrings() 2016-11-07 23:31:40 +01:00
Matthias Loibl
47669ddf80 Use TruncateString(sha1,10) in ShortSha and deprecate it. 2016-11-07 23:31:39 +01:00
Matthias Loibl
a6fcff1c05 Add tests for EllipsisString() and fix bug if param length < 3 2016-11-07 23:31:39 +01:00
Matthias Loibl
aa2ded6f3a Test AvatarLink and refactor with tests passing 2016-11-07 23:31:39 +01:00
Matthias Loibl
da55a8bf60 Start to add tests for modules/base/tool 2016-11-07 23:29:41 +01:00
Rémy Boulanouar
61ec6729e6 Change import reference to match gitea instead of gogs (#37) 2016-11-03 10:29:56 -02:00
Unknwon
6eda7a4d63 #3559 fix template error 2016-08-31 13:59:23 -07:00
Unknwon
e40f64e2c9 router/repo: code refactoring 2016-08-30 02:08:38 -07:00
Thibault Meyer
4a7d79a68c Fix #3321: commit tag shortener (#3418)
* Fix #3321: commit tag shortener

* Check short commit

* remove debug

* Edit unit tests

* Show 10-char short SHA
2016-08-11 15:34:00 -07:00
Unknwon
90d24701ae #3320 code cleanup 2016-08-07 11:01:47 -07:00
Sandro Santilli
82d2c65308 Add support for federated avatars (#3320)
* Add support for federated avatars

Fixes #3105

Removes avatar fetching duplication code
Adds an "Enable Federated Avatar" checkbox in user settings
(defaults to unchecked)

Moves avatar settings all in the same form, making
local and remote avatars mutually exclusive

Renames UploadAvatarForm to AvatarForm
as it's not anymore only for uploading

* Run gofmt on all modified files

* Move Avatar form in its own page

* Add go-libravatar dependency to vendor/ dir

Hopefully helps with accepting the contribution.
See also #3214

* Revert "Add go-libravatar dependency to vendor/ dir"

This reverts commit a8cb93ae640bbb90f7d25012fc257bda9fae9b82.

* Make federated avatar setting a global configuration

Removes the per-user setting

* Move avatar handling back to base tool, disable federated avatar in offline mode

* Format, handle error

* Properly set fallback host

* Use unsupported github.com mirror for importing go-libravatar

* Remove comment showing life exists outside of github.com

... pity, but contribution would not be accepted otherwise

* Use Combo for Get and Post methods over /avatar

* FEDERATED_AVATAR -> ENABLE_FEDERATED_AVATAR

* Fix persistance of federated avatar lookup checkbox at install time

* Federated Avatars -> Enable Federated Avatars

* Use len(string) == 0 instead of string == ""

* Move import line where it belong

See
https://github.com/Unknwon/go-code-convention/blob/master/en-US/import_packages.md

Pity the import url is still the unofficial one, but oh well...

* Save a line (and waste much more expensive time)

* Remove redundant parens

* Remove an empty line

* Remove empty lines

* Reorder lines to make diff smaller

* Remove another newline

Unknwon review got me start a fight against newlines

* Move DISABLE_GRAVATAR and ENABLE_FEDERATED_AVATAR after OFFLINE_MODE

On re-reading the diff I figured what Unknwon meant here:
https://github.com/gogits/gogs/pull/3320/files#r73741106

* Remove newlines that weren't there before my intervention
2016-08-07 10:27:38 -07:00
Sandro Santilli
f213268f7e Use a gopher as default avatar (rather than the gravatar logo) (#3208)
Also changes the avatar from a jpeg to a png, to allow for
transparent background. The indexed png is also smaller in size.

Note that at the moment the default avatar is only used when
the user requested a custom avatar and the custom avatar file
is not found (should never happen).

In the future the default avatar could be used as a default
return when by-mail avatar lookups fail too (both gravatar
and libravatar support passing a default)
2016-06-27 18:12:30 +08:00
Kim Carlbäcker
b251031230 PDF-Previews in file-lists now working (#3000) 2016-04-26 21:48:44 -04:00
Unknwon
cdaad39e02 Fix ref comment from commit create empty feed 2016-03-11 05:11:58 -05:00
Unknwon
5158dbfde8 #1157 some avatar setting changes
- Allow to delete current avatar
2016-03-05 00:51:51 -05:00
Unknwon
69f420490d Make markdown as an independent module 2016-02-20 17:10:05 -05:00
Unknwon
354dd25700 Remove cache avatar support and add its tests 2016-02-14 23:14:55 -05:00
Kim "BKC" Carlbäcker
f852ab7ada Not working, but slightly better... 2016-01-27 21:48:57 +01:00
Kim "BKC" Carlbäcker
93d56ee5af Custom URL-Schemas for Markdown 2016-01-27 02:02:03 +01:00
Kim "BKC" Carlbäcker
49bfb31540 Made Sanitizer-setup cleaner 2016-01-14 03:00:05 +01:00
Kim "BKC" Carlbäcker
125aa91d30 Checklist-rendering implemented 2016-01-13 13:25:52 +01:00
Unknwon
ee97f04f27 #2287 Truncate repository name if too long 2016-01-11 20:41:43 +08:00
Unknwon
535758a58d #2185 fall back to use custom chardet lib 2015-12-31 22:13:47 -05:00
Unknwon
035b4e4415 #2282 fast detection of utf-8 2015-12-27 17:02:36 -05:00
Unknwon
53398d6473 #2283 set text/plain for non-binary files in raw mode 2015-12-25 05:45:07 -05:00
Unknwon
a54e0bff4f #2282 fix utf-8 recognized as windows-1252 2015-12-25 05:25:47 -05:00
Unknwon
9e27955942 #2185 use Go sub-repo to detect encoding 2015-12-13 19:56:33 -05:00
Unknwon
f354dd37d0 fix #2020 2015-11-24 18:49:34 -05:00
Unknwon
9fe7b7125d Show custom avatars in commits 2015-11-13 17:10:25 -05:00
Unknwon
1627582b87 #1595 pushing new branch will rereference issues in previous branch 2015-09-10 07:53:40 -04:00
Hongcai Deng
9ad08ec200 add regexp to restrict <code class=""></code> 2015-09-10 09:06:09 +08:00
Hongcai Deng
e35b06692f add allow attribute class to <code> 2015-09-09 17:31:14 +08:00
Unknwon
0f2cbfcf5e new org dashboard issues 2015-08-25 23:22:05 +08:00
Unknwon
a628783db1 fix timezone 2015-08-20 00:32:18 +08:00
Unknwon
928c2419ea print time to debug 2015-08-20 00:25:32 +08:00
Unknwon
feb2e92c43 #1500 use UTC for TimeSince 2015-08-20 00:16:54 +08:00
Unknwon
08a2c12fc3 finish view comments on issue page 2015-08-13 16:07:11 +08:00
Unknwon
ed4fd6151d finish create issue with labels 2015-08-10 16:52:08 +08:00
Unknwon
b702955573 #1024: OFFLINE_MODE Still Uses Gravatar 2015-03-12 20:32:38 -04:00
Peter Smit
327d3cd26f Remove the "PHP" style formatting function
The "PHP" formatting function doesn't add anything, except an undocumented date format.

All usages in the templates have been replaced with DateFmtShort and DateFmtLong for convenience.
2015-02-16 14:44:27 +02:00