Compare commits

...

762 Commits

Author SHA1 Message Date
751f01936b Add changelog for v1.3.0-rc2 (#2998) 2017-11-27 08:28:25 +02:00
b16e5a42eb Fix over-escaped characters (#2992) 2017-11-27 07:01:13 +02:00
460d0d9077 Fix go-get, src and raw urls to new scheme (#2978) (#2986) 2017-11-27 10:02:08 +08:00
9c07d909e6 Fix error when add user has full name to team (#2973) (#2975)
* fix error when add user has full name to team

* add comment for extra uname check
2017-11-26 19:53:07 +02:00
93d1ec4514 Fix files/commits of merged PRs (#2970) 2017-11-25 21:38:15 +02:00
be41955407 Update golang x/crypto dependencies (#2923) (#2951)
* Update golang x/crypto dependencies (#2923)

* Fix govendor for x/crupto curve25519 (#2925)
2017-11-21 06:25:53 +02:00
c31e8777b7 Fix memcache support when value is returned as string always (#2924) (#2950) 2017-11-21 11:46:44 +08:00
4683e540ad Add changelog for v1.3.0-rc1 (#2921) 2017-11-15 16:58:13 +02:00
a8832e1227 [skip ci] Updated translations via Crowdin 2017-11-14 23:40:26 +00:00
fb6348976e Backport 1.2.x changelog to master (#2904) 2017-11-15 01:39:17 +02:00
72fc829b05 [skip ci] Updated translations via Crowdin 2017-11-14 11:25:14 +00:00
84498301ca update screenshots on README (#2910) 2017-11-14 13:23:55 +02:00
44bd5ff466 [skip ci] Updated translations via Crowdin 2017-11-14 00:57:08 +00:00
e735d8cb25 Gogs -> Gitea (#2909)
rename label
2017-11-14 08:55:57 +08:00
afa85f9b55 [skip ci] Updated translations via Crowdin 2017-11-13 14:54:11 +00:00
f4d12f8d97 Fix run command race (#1470)
* Use exec.CommandContext to simplfy timeout handling

And fixing the data races which can be identified by the added tests when -race enabled.

* Use sleep commmand instead of reading from stdin

* Make the error handling go-esque
2017-11-13 22:51:45 +08:00
e9728bf3b4 [skip ci] Updated translations via Crowdin 2017-11-13 09:33:29 +00:00
f94e6fd7a5 Correct ldap username validation. (#2880)
PR #342 was only partially applied. Spaces should not be at the start
and end of a username but they can be inside.
2017-11-13 11:32:16 +02:00
134958fd9f Fix localization texts that contain semicolon (#2900) 2017-11-13 09:56:10 +02:00
4725f91543 Fix inconsistencies in user settings ui (#2901) 2017-11-13 09:21:41 +02:00
f26f4a7e01 Update swagger documentation (#2899)
* Update swagger documentation

Add docs for missing endpoints
Add documentation for request parameters
Make parameter naming consistent
Fix response documentation

* Restore delete comments
2017-11-13 09:02:25 +02:00
4287d100b3 [skip ci] Updated translations via Crowdin 2017-11-13 01:37:21 +00:00
5481be0ac5 Fix issue link rendering in commit messages (#2897)
* Fix issue link rendering in commit messages

* Update page.tmpl

* No links for parens

* remove comment
2017-11-13 09:35:55 +08:00
47f40ccd5e Add integration test for user deleting account (#2891) 2017-11-12 21:36:16 +08:00
5abd1d2a68 Add integration test for logging out (#2892) 2017-11-11 23:29:07 -06:00
1ebf257bed [skip ci] Updated translations via Crowdin 2017-11-11 23:19:22 +00:00
dd026a4ebb Fix adding a new authentication source after selecting OAuth (#2889) 2017-11-12 01:18:21 +02:00
524cca3a1e [skip ci] Updated translations via Crowdin 2017-11-11 01:33:50 +00:00
0a9fd454da Fix new branch creation to new url scheme (#2884) 2017-11-10 19:32:46 -06:00
e22be08ab6 [skip ci] Updated translations via Crowdin 2017-11-08 13:06:17 +00:00
ba2e0240c6 Add LFS object verification step after upload (#2868)
* Add LFS object verification step after upload

* Fix file verification condition and small refactor

* Fix URLs

* Remove newline and return status 422 on failed verification

* Better error hadling
2017-11-08 15:04:19 +02:00
61f5c22503 [skip ci] Updated translations via Crowdin 2017-11-07 06:34:16 +00:00
62d0a4d882 Add external markup render support (#2570)
* add external markup render support

* bug fixed

* refacotr codes and fix wrong error log

* fix comments and add check to prevent leaks

* add check for config file and improve the example

* check file close error

* use ioutil.TempFile instead uuid

* correct Render -> Parser

* improve warning when incorrect markup setting

* fix typos
2017-11-07 08:33:06 +02:00
ddb75191ec [skip ci] Updated translations via Crowdin 2017-11-07 04:34:18 +00:00
6e2e7b325f Fix LFS not returning correct content length when requesting a range of bytes (#2864) 2017-11-07 06:33:04 +02:00
cdc4600725 Fix fork repository cycle to self (#2860)
* fix fork repository cycle to self

* rename testForkRepo to traverseParentRepo
2017-11-06 12:12:55 +08:00
ff9daa3e9b fix click create pull request button 404 (#2859) 2017-11-05 21:11:35 +02:00
80a4643359 Fix attachments icon size on zoom in/out (#2853)
* fix attachments icon size on zoom in/out

* make public/css/index.css
2017-11-05 14:12:27 +02:00
9bdce5d21b Launch Gitea with custom UID/GID for 'git' user (fixes #2286) (#2791) 2017-11-05 10:40:31 +08:00
be523152a8 Clean repository ROOT directory name with filepath.Clean (#2846)
For better compatibility with Windows.
2017-11-04 23:36:49 +02:00
d91fe5254d Fix ignored errors in API route (#2850)
* Fix ignored errors in API route
2017-11-04 19:10:01 +01:00
57de1ff991 Fix API raw file content access for default branch (#2849) 2017-11-04 19:26:38 +02:00
76b8c3c68f "[skip ci] Updated translations via Crowdin" 2017-11-04 15:56:28 +00:00
6a49ada260 Update TRANSLATORS (#2843)
* Update TRANSLATORS

* Change order to alphabetical
2017-11-04 17:56:06 +02:00
1febbf0da9 "[skip ci] Updated translations via Crowdin" 2017-11-04 13:33:10 +00:00
bd6f24b4ab Add deleted_branch table fixture (#2832)
* Add deleted_branch table fixture

* Fix deleted branches tests

* Remove unneeded global variable
2017-11-04 15:31:59 +02:00
1621069f83 "[skip ci] Updated translations via Crowdin" 2017-11-04 11:54:55 +00:00
091f3669ba change the email and name to GitBot account. (#2848)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-11-04 06:53:59 -05:00
93f726352c Link members and repositories count to each page on org home. (#2787) 2017-11-04 13:46:34 +08:00
dcb009aa86 '[skip ci] Updated translations via Crowdin' 2017-11-03 23:24:26 +00:00
08b124dd47 Fix API raw requests for commits and tags (#2841) 2017-11-04 01:23:59 +02:00
e6bb8e7a4d Translator pt-BR (#2838)
* Translator pt-BR

* rectification translators pt-BR
2017-11-03 16:45:21 +02:00
240609432b Issue content should not be updated when closing with comment (#2833) 2017-11-03 17:23:17 +08:00
8798cf4e3b Set session and indexers' data files rel to AppDataPath (#2192)
* Set session and indexers' data files rel to AppDataPath

The setting AppDataPath is now relative to the working directory.
The session svc's PROVIDER_CONFIG now defaults to AppDataPath/data/sessions.
The issue indexer's IssuePath now defaults to AppDataPath/indexers/issues.bleves.

* fix bug
2017-11-03 10:56:20 +02:00
95637e046f Fix order of comments (#2835) 2017-11-03 11:11:42 +08:00
2e08f230ca Use different directories for session files in integration tests (#2834) 2017-11-03 02:48:47 +02:00
3ee7248970 '[skip ci] Updated translations via Crowdin' 2017-11-02 23:33:59 +00:00
9500ad1e92 Fix removing backslash before quotes in translations (#2831) 2017-11-03 01:33:43 +02:00
1f04c00e2f Fix redirect url of legacy commits route (#2825) 2017-11-03 00:01:22 +02:00
529f9d03ce Fix ordering in app.ini and fix run mode option (#2829) 2017-11-02 23:08:21 +02:00
f70758dec9 Add git clone test on integration test (#1682) 2017-11-02 18:51:03 +01:00
eecaba2031 Configurable SSH key exchange algorithm and MAC suite (#2806) 2017-11-02 23:26:41 +08:00
d94e2a1c22 '[skip ci] Updated translations via Crowdin' 2017-11-02 13:01:46 +00:00
8a9cc86bf6 added myself to the translation list (#2828) 2017-11-02 15:00:42 +02:00
122a66f6e0 Fix commits page url (#2823)
* Fix commits page url

* Check all view types
2017-11-02 08:30:19 +08:00
85e99b6a6b '[skip ci] Updated translations via Crowdin' 2017-11-01 19:44:17 +00:00
25acd6c822 Use custom search for each filter type in dashboard (#2343)
* Do custom search for each filter in repo-search

* Fix search url

* Simplify code

* Remove loader and reset counts when changing filter
2017-11-01 21:39:05 +02:00
266ebf8200 Revert en-US locale (#2821) 2017-11-02 00:03:10 +08:00
3217102516 '[skip ci] Updated translations via Crowdin' 2017-11-01 15:47:40 +00:00
c7ade55d39 fix update-translations on drone (#2822) 2017-11-01 23:46:28 +08:00
1ccaddcfbb '[skip ci] Updated translations via Crowdin' 2017-11-01 12:53:57 +00:00
de9915023d Fix wrong translations (#2818)
* fix wrong translations

* fix tab on yml
2017-11-01 20:52:48 +08:00
6f84569629 '[skip ci] Updated translations via Crowdin' 2017-11-01 09:14:08 +00:00
c22f443f58 add gitea remote in drone. (#2817)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-11-01 04:13:47 -05:00
dc6dad87d4 add remote name for git push. (#2816)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-11-01 03:48:40 -05:00
e9595a962b Download and pushing translations (#2727)
* Download and pushing translations

* Adding empty line between build steps
2017-11-01 14:14:49 +08:00
1b6a962e70 Include HTTP method in test error message (#2815) 2017-11-01 00:54:24 -05:00
e6a97b6675 Use api.TrackedTime in API (#2807)
* Use api.TrackedTime in API

* APIFormat() method

* Rename function
2017-11-01 10:25:14 +08:00
e22549747c Fix dropdown menu position on explore repo (#2808)
Signed-off-by: Mulia Arifandi Nasution <mul14.net@gmail.com>
2017-10-31 21:16:07 +02:00
605038dca9 Fix typo (#2810)
Signed-off-by: Mulia Arifandi Nasution <mul14.net@gmail.com>
2017-10-31 19:10:22 +02:00
d545e32b56 Add environment variable support for Docker image (#2201)
* Add `gettext` dependencies as we need `envsubst` command;
* Modified s6's gitea setup script, instead of `cp` the template if no
`app.ini` exist, it will substitude the envvars and generate the new
`app.ini`;
* Make `/docker/etc/templates/app.ini` a template contains environment
variables;

Signed-off-by: Tao Wang <twang2218@gmail.com>
2017-10-31 16:55:46 +08:00
b0b24a2dbb Use RelAvatarLink() in GetActAvatar() (#2800) 2017-10-31 16:08:23 +08:00
82fc50f4ee Fix Git LFS object/repo link storage in database and small refactoring (#2803) 2017-10-30 20:11:56 +08:00
513375c429 Make URL scheme unambiguous (#2408)
* Make URL scheme unambiguous

Redirect old routes to new routes

* Fix redirects to new URL scheme, and update template

* Fix branches/_new endpoints, and update integration test
2017-10-30 10:04:25 +08:00
6e98812ecf Fix copy in email templates (#2801) 2017-10-29 23:57:05 +02:00
638509b217 Add Safari pinned tab icon (#2799)
Closes #2753

Signed-off-by: Bastian Rinsche <bastian.rinsche@gmail.com>
2017-10-28 20:01:42 -05:00
9ddbbd9d5a improve force push detect when push (#2798) 2017-10-28 22:36:20 +03:00
1da17db717 Fix Various Grammar Issues and Adjust Unnatural Wording (#2737)
* Fix Comma Splices

Replace comma splices with more fitting punctuation—usually semicolons.

Signed-off-by: Omar Assadi <omar@assadi.ru>

* Turn Some Conjunctions into Sentences

Turn conjunctions—which are capable of standing on their own—into their standalone sentences.

Signed-off-by: Omar Assadi <omar@assadi.ru>

* Reword Sections and Fix Issues in Docs

Reword sections of the contributing docs and readme file to be more
natural and clear. Additionally, fix the majority of the grammar
mistakes.

Signed-off-by: Omar Assadi <omar@assadi.co.il>
2017-10-28 18:22:44 +03:00
5866eb2321 Code/repo search (#2582)
Indexed search of repository contents (for default branch only)
2017-10-27 09:10:54 +03:00
762f1d7237 Add wrapping to long diff lines (#2789)
* Add wrapping to long diff lines to fix #1827

* Fix  css class and make changes to source (less) files

* Fix wrong space indentation

* Fix indentation inconsistencies and remove very old WebKit workaround
2017-10-27 12:30:54 +08:00
ddb7f59ef4 Add search mode option to /api/repo/search (#2756)
* Add repo type option to /api/repo/search

* Add tests and fix result of collaborative filter in specific condition

* Fix/optimize search & tests

* Improve integration tests

* Fix lint errors

* Fix unit tests

* Change and improve internal implementation of repo search

* Use NonexistentID

* Make search api more general

* Change mirror and fork search behaviour

* Fix tests & typo in comment
2017-10-27 00:16:13 +03:00
4d01ecaef3 Show Sendmail settings on admin config page (#2782)
* Show Sendmail settings on admin config page

* Remove unecessary if statement
2017-10-26 16:47:16 +08:00
6a107e57f6 Add checks for commits with missing author and time (#2771)
* Add checks for commits with missing author and time

* Fix validate commits with emails if it has no Author
2017-10-26 15:45:14 +08:00
bc84110989 don't check minimum key size when disabled (#1754)
* cleanup old comments for ed25519

These comments were added when x/crypto/ed25519 could not yet handle
ed25519. It does now, so it should be removed.
Also the key type is now replaced with the proper constant.

* move the minimum key size config before the check

This moves the actual config lookup before any check is done. This
avoids problems with calling to ssh-keygen which doesn't support the
expected output format and returning an error, when the check is disabled.
2017-10-26 09:49:41 +08:00
eca05b09aa Add commit count caching (#2774)
* Add commit count caching

* Small refactoring

* Add different key prefix for refs and commits

* Add configuratuion option to allow to change caching time or disable it
2017-10-26 09:37:33 +08:00
3ab580c8d6 Add branch overiew page (#2108)
* Add branch overiew page

* fix changed method name on sub menu

* remove unused code
2017-10-26 08:49:16 +08:00
e86a0bf3fe Add support for extra sendmail arguments (#2731)
* Add support for extra sendmail arguments

* Sendmail args to exec.command should be a list

* Add go-shellquote package

* Use go-shellquote lib for parsing Sendmail args

* Only parse if sendmail is configured
2017-10-25 22:27:25 +03:00
3af5b67ed0 Sync MaxGitDiffLineCharacters with conf/app.ini (#2779)
MAX_GIT_DIFF_LINE_CHARACTERS was updated in #1845 but the corresponding
default value of MaxGitDiffLineCharacters was not changed. This can lead
to inconsistencies.
2017-10-25 16:28:58 +08:00
178bd498b9 fix imports 2017-10-25 13:30:29 +08:00
219ca5cadb some fixes 2017-10-25 13:26:14 +08:00
796be03e9b fix discord hook bug (#2778) 2017-10-25 13:13:45 +08:00
b0f04e7593 Fix Polish language name spelling (#2766) 2017-10-24 21:35:34 -05:00
6eeadb2082 Hide unactive on explore users and some refactors (#2741)
* hide unactive on explore users and some refactors

* fix test for removed Organizations

* fix test for removed Organizations

* fix imports

* fix logic bug

* refactor the toConds

* Rename TestOrganizations to TestSearchUsers and add tests for users

* fix other tests

* fix other tests

* fix watchers tests

* fix comments and remove unused code
2017-10-24 20:36:19 +03:00
03900303a9 add default ssh ciphers (#2761) 2017-10-23 23:20:44 +08:00
9ba7898911 Update vendor git (#2765) 2017-10-23 16:36:14 +03:00
81d1e54a49 Use identicon image for default gravatar. (#2767)
* Use identicon image for default gravatar.

* Fixed tests.
2017-10-23 03:50:07 -05:00
e4990ba205 Fix emojify image URL (#2769) 2017-10-23 03:48:56 -05:00
a257f88a09 Remove manual of unsupported option (#2757) 2017-10-21 21:17:48 -02:00
0e9e48bd5c Fix activity css conflit with semantic ui (#2758) 2017-10-21 18:07:06 -02:00
619b9b5547 Move swagger-ui under /api/v1 (#2746)
* Move swagger interface under /api/v1

* Update swagger-ui

* Add /api/swagger and prepare for multiple api version

* Update test links

* Fix footer link
2017-10-21 22:05:50 +08:00
bc8d72666c Admin grammar fixes and improvements (#2056) 2017-10-21 16:30:21 +03:00
7131c7d40d Configurable SSH cipher suite (#913)
* Configurable SSH cipher suite

* Update configuration file comment

* Add default in settings loading code

* Fix fmt and log messsage

* Remove default from code as this could probably might not be good idea
2017-10-21 16:13:41 +03:00
985a39590b Use buffersize to reduce database connection when iterate (#2724)
* use buffersize to reduce database connection when iterate

* fix typo

* add default value on app.ini comment
2017-10-21 14:26:23 +08:00
2112eb8741 Update vendor github.com/lib/pq (#2752) 2017-10-21 12:05:58 +08:00
d4c9399576 Set default lfs content path (#2521) 2017-10-19 09:52:37 +03:00
222244836f Fix IE unsupported javascript construction (#2736) 2017-10-19 14:00:36 +08:00
847272a70d Only update mirror last update after successful sync (#2730) 2017-10-18 21:50:41 +03:00
30afce1523 Fix tabs according to semantic-ui docs (#2733) 2017-10-18 21:18:31 +03:00
2a184f5924 Fix typos in app.ini (#2732) 2017-10-17 21:11:23 -05:00
ccd3577970 Fix repository search function (#2689)
* Fix and remove FIXME

* Respect membership visibility

* Fix/rewrite searchRepositoryByName function

* Add unit tests

* Add integration tests

* Remove Searcher completely

* Remove trailing space
2017-10-17 23:20:22 +08:00
af4a094e5d Fix semantic-ui style conflict with v-cloak (#2722) 2017-10-17 02:24:43 -05:00
f4190f8df8 Render plain text README.txt monospaced (#2721)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2017-10-17 02:17:22 +03:00
33647aa43b Fixing wrong translations on sorttype oldest/latest (#2720) 2017-10-16 23:26:11 +03:00
9e865cee67 Merge password and 2fa page on user settings (#2695)
* merge password and 2fa page on user settings
2017-10-16 11:14:12 +02:00
c1b0c9e7c4 Fix PR, milestone and label functionality if issue unit is disabled (#2710)
* Fix PR, milestone and label functionality if issue unit is disabled or not assigned to user

* Fix multi-actions in PR page

* Change error message

* Fix comment update and delete functionality in PR
2017-10-16 10:55:43 +03:00
a75d5c72bb Fix plain readme didn't render correctly on repo home page (#2705)
* fix plain readme didn't render correctly on repo home page

* fix missing render

* remove unused template variables
2017-10-16 09:04:34 +02:00
c7f4f07765 Integration test for activity page (#2704)
* Integration test for activity page

* Small code refactoring for acitvity page

* Move activity stats calculation logic to model
2017-10-16 00:54:53 +03:00
f3833b7ce4 Create new branch from branch selection dropdown (#2130)
* Create new branch from branch selection dropdown and rewrite it to VueJS

* Make updateLocalCopyToCommit as not exported

* Move branch name validation to model

* Fix possible race condition
2017-10-15 22:59:24 +03:00
c25303b11c Fix activity locale (#2709) 2017-10-15 21:30:26 +03:00
4ccb0fe338 fix .netrc authentication (#2700)
* provide both possible authentication solutions

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-10-15 18:35:43 +03:00
1ec4dc6c1d Fix so that user can still fork his own repository to owned organizations (#2699)
* Fix so that user can still fork his own repository to his organizations

* Fix to only use owned organizations

* Add integration test for forking own repository to owned organization
2017-10-15 18:06:07 +03:00
32ca299650 Remove direct user adding to organization members (#2641) 2017-10-15 10:24:24 +08:00
f42dbdbae5 Add Activity page to repository (#2674)
* Add Activity page to repository

* Add request data for activity

* Add issue data for activity

* Add user unit right checks

* Add releases to activity

* Log repository unit loading error
2017-10-15 02:17:39 +03:00
8863e74f2a Fix organization watch migration (#2703) 2017-10-14 20:47:05 +03:00
e89bb7ef6a Allow custom SSH user in UI for built-in SSH server (#2617) (#2678)
* Allow custom SSH user in UI for built-in SSH server (#2617)

* Some fixes

* Did make fmt

* Updated according to review

- Renamed config to BUILTIN_SSH_SERVER_USER
- Removed unnecessary default string value for config item

* Updated according to review

* Fixed some minor issues
2017-10-14 18:51:00 +03:00
514006a2e5 Fix orgnization user watch repository (#2670)
* remove orgnization watch repositories

* fix migration

* fix typo and missing change

* remove unused code
2017-10-14 22:37:43 +08:00
a4cd4616c6 Update hard-coded version to 1.3.0-dev (#2390)
* Use -dev (1.3.0-dev is less than 1.3.0, according to semver)

* Use fake version for testing purpose
2017-10-12 14:40:42 +03:00
dff26e25ca Remove redudant functions and code (#2652)
* Remove redudant functions and code
2017-10-10 22:37:18 +02:00
c2346e4469 Add repository search unit and integration tests (#2575)
* Add more repo search tests

* Fix repo search tests

* Always test returned repos length

* Add test with lower pagesize limit (test more pages)

* Add and fix /api/repo/search integration tests

* Simplify unit tests code

* Simplify and unify integration tests code

* Improve test coverage

* Temporary fix tests due to bugs in current repo search implementation

* Revert removing not nil Searcher

* Add more checks to tests

* Simplify privacy checks in /api/repo tests

* Temporary remove privacy check from repo search tests
2017-10-10 09:23:29 +08:00
0cef8ce192 fix panic on gogs webhook creation (#2675)
* fix panic on gogs webhook creation

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix panic in gogs webhook edit

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-10-08 19:37:31 +08:00
ebac051e72 Rewrite migrations to not depend on future code changes (#2604)
* v38 migration used an outdated version of RepoUnit model (#2602)

* change repoUnit model in migration

* fix v16 migration repo_unit table

* fix lint error

* move type definition inside function

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix lint error

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Fix time tracking migration

* Refactor code

* Fix migration from Gogs

* v38 migration used an outdated version of RepoUnit model (#2602)

* change repoUnit model in migration

* fix v16 migration repo_unit table

* fix lint error

* move type definition inside function

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix lint error

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Fix time tracking migration

* Refactor code

* Fix migration from Gogs

* add error check

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* Additiomal fixes for migrations

* Fix timetracking migration

* Add back nil check
2017-10-08 19:08:18 +08:00
92123fe82a GPG key email verification no longer case sensitive (#2661) (#2663)
* GPG key email verification no longer case sensitive (#2661)

* case insensitive GPG key email verification now cached (#2661)

Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
2017-10-06 23:28:21 +03:00
ffab139c91 table pull_request wasn't updated correctly (#2649)
* Fix: table `pull_request` won't be updated correctly

* Update also status column when manually merged
2017-10-06 00:25:40 +03:00
6b62f042c6 Update MAINTAINERS (#2660) 2017-10-05 03:57:37 -05:00
68674649df Add maintainer label for docker file (#2658)
* Add maintainer label for docker file

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

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-10-05 03:41:10 -05:00
67e1c29dc5 Refactor duplicated code in repo handlers (#2657)
* Refactor duplicated code in repo handlers

* ctx.Handle
2017-10-05 10:32:25 +03:00
43253202e9 Change default sort order (#2647)
* sort repositories by `updated_unix` in Explore

* Fix UI problem

* Added missing sort order "newest"

* Change default sort order

* fmt
2017-10-05 08:02:43 +03:00
aa962deec0 Replace deprecated Id method with ID (#2655) 2017-10-05 07:43:04 +03:00
e1266a19c8 Change pull description text (#2075) (#2646)
* Change pull description text

* move duplicated code into helper function
2017-10-04 20:35:01 +03:00
fcca037576 hide navbar when only 1 sign-in method is available (#2648) 2017-10-04 19:57:00 +03:00
a79af9cf6f Fix index column deletion (#2651) 2017-10-04 14:26:13 +03:00
4b2c8ca533 Use session when creating user (#2638) 2017-10-03 09:29:26 +03:00
b3cfa5a77e Use Semantic UI's Search component for user and repo search (#2636)
* Use search component on org invitation user input.

* Search component for collaboration and members.

* Search component for repo search.

* minCharacters for search input

* Display full_name for user search.

* Fixed missing uid query parameter for repo search.

* Removed unused comment.
2017-10-03 06:27:48 +03:00
a04718a2a6 Remove repo unit index (#2621)
* Remove repo unit index

* Fix sqlite
2017-10-02 23:22:25 +03:00
46cc45f049 Fix go get response if only app URL is custom in configuration (#2634)
* Fix go get response if only app URL is custom in configuration

* Rewrite to update Domain setting to match AppURL
2017-10-02 21:55:09 +08:00
a8717e5e3a Use AfterLoad instead of AfterSet on Structs (#2628)
* use AfterLoad instead of AfterSet on Structs

* fix the comments on AfterLoad

* fix the comments on action AfterLoad
2017-10-01 19:52:35 +03:00
1ad902d529 Fix implementation of repo Home func (#2601)
* Fix implementation of repo Home func

* Make fixture changes for testing
2017-10-01 16:50:56 +03:00
bae9cbce9c Remove redudant CheckUnit calls in router (#2627) 2017-09-30 12:04:16 +08:00
fbaa52a3a8 Link to gitea-specific Vagrant example (#2624)
.. rather than a gogs one
2017-09-30 08:50:19 +08:00
26e49b8e3d Fix doubled issue tab introduced in migration v16 (#2611)
* fix duplicate issue tab as UnitTypeIssue and UnitTypeExternalTracker are existing at the same time

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-28 16:14:51 +03:00
cc84ca40d7 Remove redudant issue LoadAttributes() calls (#2614) 2017-09-27 09:41:52 -03:00
339d7de409 Fix translation upload to crowdin (#2599) 2017-09-25 10:59:19 +03:00
dd55534b82 Reduce usage of allcols on update (#2596)
* reduce usage of allcols on update

* fix bug and tests
2017-09-25 12:59:27 +08:00
6b6f16cfae backport from v1.2 branch: add secrets for github release (#2588) (#2598) 2017-09-25 11:40:34 +08:00
fa28de820e Make indexer code more reusable (#2590) 2017-09-25 03:08:48 +03:00
0b0d85c90d Add pre-build step for nodejs stuff (#2581) 2017-09-25 00:49:32 +03:00
086eb62691 Compress css with nodejs (#2580) 2017-09-24 22:47:10 +03:00
fa6d7c7b99 Automatic update of translations (#2585)
* Adding build step for uploading translations

* Fixing crowdin project name

* Using crowdin plugin

* Changing secret name

* Adding pull: true
2017-09-23 19:08:42 +03:00
2ef8b8bcbe fix go get subpackage bug (#2584)
* fix go get subpackage bug

* merge the duplicated funtions
2017-09-23 16:24:24 +03:00
2db424c3f1 Fix broken migration to add can_push field back to table (#2574) 2017-09-23 16:45:41 +08:00
ccff57103a Automatically regenerate indexer for incompatible versions (#2524) 2017-09-23 00:30:56 +03:00
28f4de205f Fix drone for tags (#2573) 2017-09-22 18:34:02 +03:00
9a75a5d59b Use custom type and constants to hold order by options (#2572) 2017-09-22 15:53:21 +03:00
ca68a75b5b Expand fixtures (#2571)
* Add more repo search tests

* Add and fix /api/repo/search integration tests

* Add owner to access table for organization repositories

* Remove tests
2017-09-22 13:51:16 +03:00
b4b0280e33 Ctrl + Enter to submit forms (#2540)
* Hotfix for "Add time manually" (https://github.com/go-gitea/gitea/pull/2211#issuecomment-328780125)

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Submit forms if Ctrl+Enter is pressed inside a textarea

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Adding separate class for Ctrl+Enter-Submit
Checking if alt key is pressed too

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Changing .ctrlenter to .js-quick-submit

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2017-09-22 14:17:31 +08:00
1be2b4a262 fix readme view bug (#2566) 2017-09-21 21:24:19 +03:00
1eedd983ea Complete push webhooks (#2530)
* implemented missing 'delete' push webhooks

moreover created ActionDeleteBranch and ActionDeleteTag

* add CommitRepoAction tests for tag/branch creation/deletion

* fixed error where push webhook not called if is new branch or tag
removed unnecessary code

* moved prepare unit test environment into separate method to be used across unit tests

* add missing if clause in pushUpdate

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-21 10:43:26 +03:00
0d80af649a Add init support of orgmode document type on file view and readme (#2525)
* add init support of orgmode document type on file view and readme

* fix imports

* fix imports and readmeExist

* fix imports order

* fix format

* remove unnecessary convert
2017-09-21 13:20:14 +08:00
66bc0ac251 Fix sending mail with a non-latin display name. #2102 (#2559)
* Fix sending mail with a non-latin display name. #2102

Signed-off-by: Rémi Saurel <contact@remi-saurel.com>

* Take into account the possibility that setting.MailService.From is in `name <email@address>` format. #2102

Signed-off-by: Rémi Saurel <contact@remi-saurel.com>
2017-09-21 12:29:45 +08:00
1fbfccb4fc Use standard lessc and minify CSS using Node.js (#2337)
* Use standard lessc and minify CSS using Node.js

This changes the previous nonstandard `lessc` to the official one and
enables CSS minification via the clean-css module.

To build CSS, Node.js is required along with a `npm install` to get the
tools installed locally in node_modules so there is no dependency on
binaries in PATH. Benefits include:

- Allows one to have a standard lessc in PATH.
- Can now use command line switches on lessc.
- Minified CSS brings faster page load times and also has the benefit
  of discouraging contributors from editing CSS directly.

To build CSS, Node.js is required along with a `npm install` to get the
tools installed locally based on the information in `package.json`.

The 'make stylesheet' task was modified to run without condition. This
makes it easier to work on the make task itself without having to delete
files.

Also fixes: https://github.com/go-gitea/gitea/issues/2198

* install node, npm and modules on drone

* .PHONY

* use 'minify' to minify CSS
2017-09-21 11:35:11 +08:00
fa1cbc2896 Always run fmt check in CI (#2546) 2017-09-21 09:34:32 +08:00
6718ea6ff1 Fix can_push value to false in protected_branch (#2560) 2017-09-20 17:52:23 +03:00
6f380a22a4 Remove go version check for make fmt (#2558) 2017-09-20 08:58:29 -03:00
80b430d7c0 Fix /api/repo/search integration tests (#2550) 2017-09-20 12:24:38 +03:00
7a0297819d Sync releases table with tags on push and for mirrors (#2459)
* Sync releases table with tags on push and for mirrors

* Code style fixes

* Fix api to return only releases

* Optimize release creation and update
Minimize posibility of race conditions

* Fix release lower tag name updating

* handle tag reference update by addionally comparing commit id
2017-09-20 13:26:49 +08:00
8b6236d67b Fix duplicated rel attribute (#2549)
According to the HTML 5.1 recommendation "The rel attribute on a
and area elements controls what kinds of links the elements create.
The attribute’s value must be a set of space-separated tokens."
(source https://www.w3.org/TR/html51/links.html#links-created-by-a-and-area-elements)
2017-09-20 07:20:11 +03:00
acecedc410 Use named ActionType constants in template helper (#2545) 2017-09-20 09:22:42 +08:00
4eed85db56 add @daviian as maintainer (#2552)
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-19 23:03:31 +02:00
a1ed239bf2 Fix fmt errors (#2544) 2017-09-19 19:44:49 +08:00
23645fe05f Sort repository tree entries in natural way (#2506)
* Sort repository tree entries in natural way

* Fix sort for different length strings with first parts equal

* Improve test case

* Refactor return statements

* Update gitea/git dependency
2017-09-19 11:37:03 +03:00
4cb9394a97 Fix lint errors (#2547) 2017-09-19 11:08:30 +03:00
d155d0e665 Make basic functionality work without JavaScript (#2541) 2017-09-19 01:03:01 +02:00
566e8ecce0 Fork permission bug fixes (#2534)
* Hotfix for "Add time manually" (https://github.com/go-gitea/gitea/pull/2211#issuecomment-328780125)

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Checking if Code unit is enabled before creating a fork.

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Adding a discrete function for RepoIDAssignment

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Improved Documentation
2017-09-18 22:52:20 +08:00
6c6533fb31 Make integration tests more user-friendly (#2536) 2017-09-18 16:35:42 +08:00
b0f7457d9e Improve issue search (#2387)
* Improve issue indexer

* Fix new issue sqlite bug

* Different test indexer paths for each db

* Add integration indexer paths to make clean
2017-09-16 23:16:21 +03:00
52e11b24bf Restructure markup & markdown to prepare for multiple markup language… (#2411)
* restructure markup & markdown to prepare for multiple markup languages support

* adjust some functions between markdown and markup

* fix tests

* improve the comments
2017-09-16 20:17:57 +03:00
911ca02153 Convert spaces to tabs in footer.tmpl (#2520) 2017-09-16 17:04:27 +08:00
d766d0c4e0 Prevent sending emails and notifications to inactive users (#2384)
* Filter inactive users before sending emails or creating browser notifications

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* fix formatting issues

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* included requested changes

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* optimized database queries

* rebasing new master and add tablenames for clarification in xorm queries

* remove escaped quotationmarks using backticks

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-16 08:18:25 +08:00
b496e3e1cc Fix unit test race condition (#2516) 2017-09-15 10:54:25 +03:00
cbe50587ba Added bucket name to s3 drone plugin (#2505) 2017-09-15 14:45:38 +08:00
ad24a3134d Fixes 500 error on dashboard when using MSSQL (#2504)
MSSQL rejects the query:
  SELECT "repository"."id" FROM "repository"
  INNER JOIN "team_repo" ON "team_repo".repo_id="repository".id AND
  "repository".is_mirror=1
  WHERE (
    ("repository".owner_id=2 AND "repository".is_private=0)
        OR team_repo.team_id IN (1)
        )
        GROUP BY "repository".id ORDER BY updated_unix DESC

when the order by term (updated_unix) is not included in the group by
term.
2017-09-15 09:14:06 +03:00
0f9e20b3d7 fix updated update on public key (#2514)
* fix updated update on public key

* update vendor.json

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

* fix root path

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-09-15 11:23:48 +08:00
e5d80b7090 Implementation of all repositories of a user from user->settings (#1740)
* Implementation of all repositories of a user from user->settings

* Update message when no repository found

* Update according to comments

* Change UI to have a better look

* improved user repositories UI
2017-09-14 14:46:14 +03:00
1739e84ac0 improve protected branch to add whitelist support (#2451)
* improve protected branch to add whitelist support

* fix lint

* fix style check

* fix tests

* fix description on UI and import

* fix test

* bug fixed

* fix tests and languages

* move isSliceInt64Eq to util pkg; improve function names & typo
2017-09-14 16:16:22 +08:00
be3319b3d5 Display commit status on landing page of repo (#1784)
* Display commit status on landing page of repo

* improve last status of commits and add link to ci

* fix last commit status since the order of ids are desc
2017-09-14 14:51:31 +08:00
a89692d158 fix wrong rendering of commit detail page (#2503)
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-09-14 08:12:56 +02:00
633de01cf7 Hotfix for "Add time manually" (https://github.com/go-gitea/gitea/pull/2211#issuecomment-328780125) (#2499)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2017-09-13 21:02:04 +02:00
35b473d8d3 Remove repository mirrors from "collaborative" list (#2497) 2017-09-13 19:02:37 +03:00
3e89e89670 add codecov.io service. (#2493)
* add codecov.io service.

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

* update

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

* only PR or master branch (for coverage badge)

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

* update

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

* update init

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-09-13 20:57:55 +08:00
9ef83a98e5 fix release (#2496) 2017-09-13 17:20:15 +08:00
fb1ed5de94 Dockerfile: Updated alpine image to 3.6. (#2486)
Signed-off-by: Jonathan Davies <jpds@protonmail.com>
2017-09-13 14:37:42 +08:00
377cd1ae38 Allow changing integration test database connection using env variables (#2484) 2017-09-13 14:03:20 +08:00
005900baea Use created & updated instead BeforeInsert & BeforeUpdate (#2482)
* use created & updated instead BeforeInsert & BeforeUpdate

* fix vendor checksum

* only show generated SQL when development mode

* remove extra update column updated_unix

* remove trace config
2017-09-13 08:18:22 +03:00
4c2b1be3a4 Basic VSCode configuration for building and debugging (#2483)
* Basic VSCode configuration for building and debugging

* Fix building and debugging in Windows

* Move to contrib folder and add instructions
2017-09-12 20:27:44 +08:00
8c3a2e817b Add missing fixture to clean gpg_key table (#2494)
* Add missing fixture to clean gpg_key table

* Fix possible too fast request execution in timetracker start/stop test
2017-09-12 13:54:45 +03:00
9bdbfbf6f3 Disable custom Git Hooks globally via configuration file (#2450)
* Create option to disable githooks globally via configuration file

* Update comment in app.ini to align with @ethantkoenig's suggestion

Signed-off-by: Matti Ranta <matti@mdranta.net>
2017-09-12 12:25:42 +03:00
3fecf94086 Open external wiki in new window (#2489) 2017-09-12 10:29:35 +03:00
5ccecb44ad Feature: Timetracking (#2211)
* Added comment's hashtag to url for mail notifications.
* Added explanation to return statement + documentation.
* Replacing in-line link generation with HTMLURL. (+gofmt)
* Replaced action-based model with nil-based model. (+gofmt)
* Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants.
* Updating comment for mailIssueCommentToParticipants
* Added link to comment in "Dashboard"
* Deleting feed entry if a comment is going to be deleted
* Added migration
* Added improved migration to add a CommentID column to action.
* Added improved links to comments in feed entries.
* Fixes #1956 by filtering for deleted comments that are referenced in actions.
* Introducing "IsDeleted" column to action.
* Adding design draft (not functional)
* Adding database models for stopwatches and trackedtimes
* See go-gitea/gitea#967
* Adding design draft (not functional)
* Adding translations and improving design
* Implementing stopwatch (for timetracking)
* Make UI functional
* Add hints in timeline for time tracking events
* Implementing timetracking feature
* Adding "Add time manual" option
* Improved stopwatch
* Created report of total spent time by user
* Only showing total time spent if theire is something to show.
* Adding license headers.
* Improved error handling for "Add Time Manual"
* Adding @sapks 's changes, refactoring
* Adding API for feature tracking
* Adding unit test
* Adding DISABLE/ENABLE option to Repository settings page
* Improving translations
* Applying @sapk 's changes
* Removing repo_unit and using IssuesSetting for disabling/enabling timetracker
* Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu
* Improving documentation
* Fixing vendor/ folder
* Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks )
* Restricting write access to timetracking based on the repo settings (Proposed by @lafriks )
* Fixed minor permissions bug.
* Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo
* Allow assignees and authors to track there time too.
* Fixed some build-time-errors + logical errors.
* Removing unused Get...ByID functions
* Moving IsTimetrackerEnabled from context.Repository to models.Repository
* Adding a seperate file for issue related repo functions
* Adding license headers
* Fixed GetUserByParams return 404
* Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons
* Adding /repos/:username/times to get all tracked times of the repo
* Updating sdk-dependency
* Updating swagger.v1.json
* Adding warning if user has already a running stopwatch (auto-timetracker)
* Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions)
* Changing code.gitea.io/sdk back to code.gitea.io/sdk
* Correcting spelling mistake
* Updating vendor.json
* Changing GET stopwatch/toggle to POST stopwatch/toggle
* Changing GET stopwatch/cancel to POST stopwatch/cancel
* Added migration for stopwatches/timetracking
* Fixed some access bugs for read-only users
* Added default allow only contributors to track time value to config
* Fixed migration by chaging x.Iterate to x.Find
* Resorted imports
* Moved Add Time Manually form to repo_form.go
* Removed "Seconds" field from Add Time Manually
* Resorted imports
* Improved permission checking
* Fixed some bugs
* Added integration test
* gofmt
* Adding integration test by @lafriks
* Added created_unix to comment fixtures
* Using last event instead of a fixed event
* Adding another integration test by @lafriks
* Fixing bug Timetracker enabled causing error 500 at sidebar.tpl
* Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning.
* Returning TrackedTime instead of AddTimeOption at AddTime.
* Updating SDK from go-gitea/go-sdk#69
* Resetting Go-SDK back to default repository
* Fixing test-vendor by changing ini back to original repository
* Adding "tags" to swagger spec
* govendor sync
* Removed duplicate
* Formatting templates
* Adding IsTimetrackingEnabled checks to API
* Improving translations / english texts
* Improving documentation
* Updating swagger spec
* Fixing integration test caused be translation-changes
* Removed encoding issues in local_en-US.ini.
* "Added" copyright line
* Moved unit.IssuesConfig().EnableTimetracker into a != nil check
* Removed some other encoding issues in local_en-US.ini
* Improved javascript by checking if data-context exists
* Replaced manual comment creation with CreateComment
* Removed unnecessary code
* Improved error checking
* Small cosmetic changes
* Replaced int>string>duration parsing with int>duration parsing
* Fixed encoding issues
* Removed unused imports

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2017-09-12 09:48:13 +03:00
69dfe43ffc Fix some tests : make coverage -> test (#2492)
* Fix test : make coverage -> test

* Refactor integration tests to be able to run them in parallel

* Add custom local repository temp path
2017-09-12 13:51:12 +08:00
eab4579e17 Fix fmt error in mailer (#2490) 2017-09-12 09:04:14 +08:00
01d7189c2d Fix slice out of bounds error in mailer (#2479) 2017-09-11 14:33:28 +08:00
250f1236dc * Fix fileview rendering bug #2470 (#2477) 2017-09-10 22:21:26 +02:00
fd85e25f5f Hotfix for integration testing (#2473)
* Hotfix for integration testing

* Comment sqlite tests because of database locking issues
2017-09-10 09:54:11 +08:00
4b8fef143e Changes for latest DroneCI (#2362) 2017-09-07 19:22:15 +02:00
95c408ffa5 hide branch on pull request view or create UI (#2454) 2017-09-06 15:02:51 +03:00
4f9a28e1f5 Make repo private to no interfere with other tests (#2467) 2017-09-06 00:33:33 +03:00
7c417bbb0d Only check at least one email gpg key (#2266)
* Only require one email (possibly not yet validated)

* Update message error and check validation of commit

* Add integrations tests

* Complete integration for import

* Add pre-check/optimization

* Add some test (not finished)

* Finish

* Fix fixtures

* Fix typo

* Don't guess key ID
2017-09-05 21:45:18 +08:00
5f4210a9b0 add release notes of v1.1.4 (#2463) 2017-09-05 09:00:55 +03:00
a569d3dedc Fix migration from pre-v15 to 1.2.0 (#2460) 2017-09-05 08:28:06 +08:00
32238e0ac9 Add changelog config file for generate changelog (#2461) 2017-09-04 13:07:57 +03:00
caa61a2b99 bug fixed 2017-09-04 14:22:07 +08:00
b689bb6180 Webhooks for repo creation/deletion (#1663)
* Webhooks for repo creation/deletion

* add createHookTask

* Add handles for GetSlackPayload and GetDiscordPayload
2017-09-03 11:20:24 +03:00
79f7839633 Wrap most text to 80 columns (#2452) 2017-09-02 22:38:31 +03:00
04ec79579c fix orgnization webhooks (#2422)
* fix org webhooks

* remove trace code
2017-08-30 13:36:52 +08:00
5de94a67cf some refactors for issue and comments (#2419) 2017-08-30 07:31:33 +03:00
edc817a1dc Wrap most paragraphs to 80 columns (#2396)
Reduces patches size and makes them more readable
2017-08-30 09:27:23 +08:00
3e6fed368b fix webhook test (#2415)
* fix webhook test

* fix error message

* fix typo
2017-08-29 22:55:24 +08:00
491f0ebc58 Fix route handler order (#2409)
* Fix route handler order

* Fix more routes
2017-08-29 14:53:51 +08:00
15d3872281 fix missing orgnization discord webhook (#2414) 2017-08-29 09:20:35 +08:00
019c90ab8f Update CONTRIBUTING following #2329 discussion
Creation of release branch before end of release dev and releases candidates + follow semver semantic (minor, patch)
2017-08-28 19:08:24 +02:00
edb95faba2 Fix releases to be counted from database not tags (#2389) 2017-08-28 22:06:10 +08:00
d23b36c598 Error message for integration test (#2410) 2017-08-28 21:36:02 +08:00
8e61823ec4 Fix tests code to prevent some runtime errors (#2381)
* Fix tests code to prevent some runtime errors

* Reduce nesting
2017-08-28 12:17:45 +03:00
ced50e0ec1 Implementation of discord webhook (#2402)
* implementation of discord webhook

* fix webhooks

* fix typo and unnecessary color values

* fix typo

* fix imports and revert changes to webhook_slack.go
2017-08-28 13:06:45 +08:00
e41da3845d fix duplicated feed (#2370) 2017-08-28 10:26:04 +08:00
0f2c98adcd Fix "index out of range" runtime error in repo_list tests (#2376) 2017-08-28 09:33:38 +08:00
ae08e6c5be Clarify Translation Process. Also fix branch names (#2378)
* Clarify Translation Process. Also fix branch names

* Update CONTRIBUTING.md
2017-08-28 09:26:27 +08:00
d9d8fad230 Add UseCompatSSHURI setting (#2356)
* Add UseCompatSSHURI setting

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com> (+1 squashed commits)

Squashed commits:

[dda2dc79] Add ForceCloneSSHURL setting

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>

* Make protocol if construct more readable

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>
2017-08-26 15:57:41 +02:00
f61a1d210c Fix missing collabrative repos (#2367)
* fix missing collabrative repos

* fix bug of collabrative

* fix SQL quotes
2017-08-24 22:01:03 +08:00
da230a2872 Add possibility to record branch or tag information in an issue (#780) 2017-08-24 15:30:27 +03:00
174255e74e Log failed authentication attempts with remote address for fail2ban (#2334)
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-08-24 08:57:54 +03:00
233bbcfa94 Fix integration test after librejs location change (#2374)
Fixes #2373
2017-08-24 08:54:06 +03:00
874f9be3e6 Move themes to plugin directory. Fixes #2372 (#2375) 2017-08-24 08:52:42 +03:00
0fd9289810 update translation from crowdin (#2368) 2017-08-23 23:17:25 +08:00
a915a09e4f Moved vendored js/css into public/vendor and documented sources (#1484) (#2241)
* Cleaning up public/ and documenting js/css libs.

This commit mostly addresses #1484 by moving vendor'ed plugins into a
vendor/ directory and documenting their upstream source and license in
vendor/librejs.html.

This also proves gitea is using only open source js/css libraries which
helps toward reaching #1524.

* Removing unused css file.

The version of this file in use is located at:
  vendor/plugins/highlight/github.css

* Cleaned up librejs.html and added javascript header

A SafeJS function was added to templates/helper.go to allow keeping
comments inside of javascript.

A javascript comment was added in the header of templates/base/head.tmpl
to mark all non-inline source as free.

The librejs.html file was updated to meet the current librejs spec. I
have now verified that the librejs plugin detects most of the scripts
included in gitea and suspect the non-free detections are the result of
a bug in the plugin. I believe this commit is enough to meet the C0.0
requirement of #1534.

* Updating SafeJS function per lint suggestion

* Added VERSIONS file, per request
2017-08-23 16:58:05 +02:00
64b7068846 Add more test for login links and fix a bug on action retrieve (#2361)
* add more test for login links and fix a bug on action retrieve
2017-08-23 12:53:35 +03:00
8aadf79f80 Add integration tests for signin (#2363)
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-08-23 10:30:33 +03:00
fd6e91077a Fix SQL condition bug in GetFeeds(..) (#2360) 2017-08-23 08:51:58 +03:00
9413b48a0b fix bug on create repo link on dashboard (#2359) 2017-08-23 12:08:20 +08:00
be4f6a754c Revert "Changes for latest DroneCI (#2355)" (#2358)
This reverts commit faf4b503b24d33a2a0f455d26bb782345ab8e0c9.
2017-08-22 20:56:57 -05:00
1a5fe4326f Add collaborative repositories to the dashboard (#2205)
* Add collaborative repositories to the dashboard

Remove some unused code from the Dashboard func

* fix some bug and some refactor

* fix tests
2017-08-23 09:30:54 +08:00
faf4b503b2 Changes for latest DroneCI (#2355) 2017-08-22 20:08:30 -05:00
7455604f0c Remove (almost) server side data rendering from repo-search component (#2317)
* Rename some shorthands

* Remove (almost) server side data rendering from repo-search component template
2017-08-22 21:00:34 +08:00
2c6a0fdca8 update latest xorm version to vendor (#2353) 2017-08-22 14:39:52 +03:00
5c29b0a5fe Add badge and link to the Matrix room (#2348) 2017-08-21 23:35:08 +08:00
fd8e8a421a Improve swagger doc (#2274)
* Add swagger comment for adminCreateOrg

* Add swagger comment for admin route

* add hook swagger doc

* Add tags

* Add auth

* Fix name of responses

* Edit name method

* Update vendor

* make generate-swagger
2017-08-21 14:13:47 +03:00
951c909a67 Add INTERNAL_TOKEN to integration .ini file (#2346)
Avoids override of source file upon running `make test-pgsql`

Long story: settings.NewContext *adds* an INTERNAL_TOKEN if none
is found; the other ini files under integration/ all have an
INTERNAL_TOKEN
2017-08-21 14:47:23 +08:00
53e6c947f1 Fix order of elements in dashboard html (#2344) 2017-08-20 22:48:41 +03:00
100ec93a65 Remove integration test executables on make clean (#2340) 2017-08-20 11:09:24 +08:00
2c3a229a3c Add OpenID configuration in install page (#2276) 2017-08-19 17:34:49 +02:00
e7653a67a1 No error log entries for repo 404 (#2200) 2017-08-19 15:32:18 +03:00
5707ad3bb7 Add AppURL without trailing slash to TOTP issuer parameter to prevent conflicting accounts on multiple gitea installations (#2335)
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
2017-08-19 09:39:43 +08:00
4c13a8458b Fix repo-search template errors for go1.7 (#2336) 2017-08-19 09:37:48 +08:00
e08d1fcc15 Fix variable name typo (#2327) 2017-08-18 14:21:46 +03:00
9df090e551 Add missing forks key for dashboard repository component (#2325)
Missing key that is used in #2285
2017-08-18 14:56:04 +08:00
f3486360d2 Make use of Vue more universal (#2318) 2017-08-17 19:04:39 +03:00
9e9e1e0e52 Add public links check (#2323)
* add public links check

* more links for query parameters
2017-08-17 23:52:28 +08:00
aec826b023 fix template error on explore repos (#2319) 2017-08-17 15:20:21 +03:00
934dd41fa6 Make SHOW_USER_EMAIL also apply to profiles (#2258)
The e-mail address is currently only hidden from the explore page.
2017-08-17 17:08:03 +08:00
7907786040 Trigger sync webhooks on UI commit (#2302)
* Trigger sync webhooks on UI commit

* Also fix UI upload/delete
2017-08-17 15:22:08 +08:00
951fb572a7 Fix and improve dashboard repo UI (#2285)
* Fix and improve dashboard repo UI

* Change order of scripts loading

* Remove "mirror" tab

* Remove single tab panel for "org user"

* Add localization strings

* Create vue component and change event for search

* Add "mirrors" filter
2017-08-17 09:31:34 +08:00
722bcefbbf refactor(Makefile): allow overriding default go program (#2310) 2017-08-16 08:46:41 +08:00
c76ee5688b Revert to upstream ini dependency (#2304) 2017-08-14 10:37:41 -03:00
fc29a405e8 More tweaks to repo top panel (#2267)
* More tweaks to repo top panel

* undo hiding of compare button on master

* attempt to fix ci issue

* another ci attempt
2017-08-13 19:49:38 -03:00
29f3a6e492 Fix rendering of external links (#2292) 2017-08-13 19:30:27 -03:00
2282e24028 Use /dev/urandom to create random password (#2298)
* Make sure generated password is random

Use /dev/urandom to get a 32 char password

* Make sure generated password is random

Use /dev/urandom to generate 32 char password

* Make sure generated password is random
2017-08-13 14:18:05 +08:00
f960e19c59 Only update needed columns when update user (#2296)
* only update needed columns when update user

* fix missing update_unix column
2017-08-12 22:18:44 +08:00
921d90fd8b fix 500 error when view an issue which's milestone deleted (#2297) 2017-08-12 10:15:30 +08:00
be29d5f7ad fix webhook link 2017-08-11 03:45:54 +02:00
e90bbcaa52 Comment help text for issues (#2281) 2017-08-09 12:13:33 +08:00
27798c3efc Temporarily patch go-ini/ini with fork (#2255) 2017-08-07 09:42:48 +08:00
54381f438b File path tweaks in UI (#2264) 2017-08-06 11:13:20 +08:00
d05150a331 Make short link pattern greedy (#2259)
Multiple links on the same line are currently not recognized correctly.
2017-08-06 00:52:19 +03:00
a3262636b8 update drone sig file. (#2262)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-08-05 12:15:20 +03:00
9ff371a147 ignore coverage steps. (#2257)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-08-04 22:08:50 +08:00
G
34df9deff1 Convert xorm literal queries to method calls (#2253) 2017-08-04 12:42:51 +08:00
fa8d40faca Fix internal requests when gitea listens to unix socket or only external IP (#2234)
* Fix internal requests when gitea listens to unix socket or only external IP

* When Gitea is set to listen using FastCGI use AppURL for LocalURL
2017-08-03 23:32:13 +08:00
a4ca54425f update code.gitea.io/git in vendor to fix #2245 (#2250) 2017-08-03 21:48:36 +08:00
4c54139afc add changelog of release v1.1.3 (#2252) 2017-08-03 16:15:39 +08:00
7e0654bd9e Fix counts on issues dashboard (#2215)
* Fix counts on issues dashboard

* setupSess -> setupSession

* Unit test

* Load repo owners for issues
2017-08-03 13:09:16 +08:00
f29458bd3a EnableUnit() -> UnitEnabled() (#2242) 2017-08-02 11:46:54 +03:00
539d9f4c30 Fix git version check with four digits (1.8.3.1) (#2236) 2017-08-01 21:59:22 +03:00
G
66e8262530 Replace calls to xorm UseBool with Where (#2237) 2017-08-01 13:47:31 +08:00
31411a9462 Prevent selection of diff line numbers (#2240) 2017-08-01 10:27:17 +08:00
a804f0e052 go get github.com/wadey/gocovmerge when needed (#2235) 2017-07-31 09:29:50 +08:00
1193627014 Fix Commits nil pointer dereference (#2203) 2017-07-31 09:23:10 +08:00
9a505fafda Improve docs for PROTOCOL and HTTP_ADDR options (#2231)
Fixes: #2230
2017-07-30 23:07:23 +03:00
d74d8ecc2e Generate small and large logos at 4x resolution (#2233)
To support High-DPI displays, generate images at 4 times their displayed
resolution, which should be enough to support all current devices
according to https://material.io/devices/.
2017-07-30 23:04:01 +03:00
27c2dcf60e Fixed robots.txt 404 error (#2226)
* Update routes.go

* Update routes.go
2017-07-30 22:32:10 +08:00
49df677c47 Check for access in /repositories/:id (#2227)
* Check for access in /repositories/:id

* Integration test
2017-07-30 09:13:33 +08:00
a9cc538ab5 remove unused variable on makefile (#2225) 2017-07-29 12:22:10 +03:00
60d7e56c69 Add task to generate images from SVG and change to new logo (#2194)
* Add makefile task to generate images from SVG and change to new logo

* use absolute path on generate-images
2017-07-28 13:51:20 +08:00
04c4028aea fix some bug 2017-07-28 13:49:36 +08:00
fd45a032a7 Fix bare-repo bugs (#2199)
* Fix bare-repo bugs

* Integration tests

* Unused import
2017-07-27 12:23:38 +03:00
aff11bc65e Fix hooks for integration repo (#2216) 2017-07-27 14:12:56 +08:00
a27863b6d1 Fix issue updated_unix bug (#2204) 2017-07-27 09:20:38 +08:00
5f37944dff Fix unclosed session bug (#2214) 2017-07-26 17:30:47 +08:00
7e12aac61c Only allow token authentication with 2FA enabled (#2184)
* Don't allow for plain username/password authentication when 2FA is enabled

* Removed debugging statement

* Don't assume a token belongs to a given user, handle two-factor errors properly

* Simplified user/token matching, refactored error handling for two-factor authentication

* Change authentication response to avoid bruteforcing

* Add TODO item as a comment for changing the response for security purposes
2017-07-26 15:33:16 +08:00
1d032f5220 Fix compiling without sqlite and gcc (#2177) 2017-07-26 15:27:30 +08:00
41cc110e62 Use sqlite3 database as default for Docker image (#2182)
Signed-off-by: Tao Wang <twang2218@gmail.com>
2017-07-26 15:21:23 +08:00
8f171210b9 Revert "Add ability to fork your own repos (#761)" (#2193) 2017-07-26 15:17:38 +08:00
48898e5d0b Fix PR nil-dereference bug (#2195)
* Fix PR nil-dereference bug

* Revert to original error format
2017-07-26 15:16:45 +08:00
dde0052ca2 Fix key usage time update if the key is used in parallel for multiple operations (#2185) 2017-07-20 11:15:10 +08:00
3702dac0d5 Fix profile update for non-local users (#2178) 2017-07-19 09:36:37 +08:00
f33e6ae09e Remove unit types commits and settings (#2161)
* Remove unit types commits and settings

* Can not limit units in administrator teams

* Limit changing units only to teams with read and write access mode

* Small code optimization
2017-07-17 10:04:43 +08:00
047a67a90b Refactor vue delimeters to use es6 template delimeters (#2171) 2017-07-15 22:22:26 +08:00
0b177574c9 Only show SSH clone URL if signed in (#2169) (#2170)
* Add configuration flag SSH_EXPOSE_ANONYMOUS

If this flag (default True) is set to false, the SSH clone URL will only be exposed if the current user is signed in.

* Default SSH exposure set to false

To match GitHub and for security reasons, SSH URL exposure is disabled by default.
In addition to that. minor code changes have been applied.

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>

* Add integration tests

* Hide clone button neither HTTP and SSH is enabled

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
2017-07-15 22:21:51 +08:00
32f289ae3b Make compare button URL aware if current repo is a fork (#2162) (#2163)
* Make compare button URL aware if current repo is a fork (#2162)

* Optimize code

* To not change current behaviour check if signed in user has fork of base repository

* Fix to check only if signed user has forked repo otherwise it will still redirect to wrong page
2017-07-15 11:14:02 +08:00
bit
98c5a1e006 Only show "No Description" to repo admins (#2167)
Only show note about missing description ("No Description") to repo admins, nobody else can change it.
2017-07-14 20:30:03 +03:00
dd758ad8dc More integration tests for comment API (#2156) 2017-07-14 01:33:26 +03:00
c4ccf16c43 Fix OpenID registration route (#2160)
Fixes #2101
2017-07-13 23:58:53 +03:00
6a3c03762a API: support '/orgs/:org/repos' (#2047)
* API: support '/orgs/:org/repos'
2017-07-13 13:14:15 +02:00
f011d6d4d7 fix: replace tmp with TMPDIR. (#2152) 2017-07-13 14:09:29 +03:00
b639fa1648 Ignore invalid issue numbers in commit messages. Fixes #2022 (#2150) 2017-07-12 22:35:47 -05:00
7d61834dc9 Update code.gitea.io/git dependency (#2149) 2017-07-12 22:35:21 -05:00
a739991b36 Fix repository settings collobration list display (#2151) 2017-07-12 22:32:28 -05:00
858324c21a Fix username rendering bug (#2122)
* Fix username rendering bug

* XSS integration test

* Migration to unescape user full names
2017-07-12 17:58:52 +03:00
2c3efd72ce fix typo (#2145)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-07-12 16:52:00 +08:00
2b05b104ef Add verify changed less-file step to Makefile (#1861) 2017-07-12 04:28:57 +02:00
89845f6728 Fix SHA1 hash linking (#2143)
This changes the regex to look for a hash from 7 to 40 characters,
to match the use of abbreviated hash lookups in both git and github.
The restriction of not being a pure number is also removed because
1234567 is now considered a valid abbreviated hash, as is deadbeef.

A note has been added to the top of the code to state that the
literal regex match is fine, but no extra validation is currently
performed so some false positives are expected.

A future change could ensure that the hash exists in the repository
before rendering it as a link, although this might incur a slight
performance penalty.

Reverts part of commit 4a46613 and fixes #2053.
2017-07-12 04:26:54 +02:00
ceb3544697 Small grammar fixes (#2144) 2017-07-12 04:25:45 +02:00
93a1de4842 Fix repo API bug (#2133)
Don't require token when not necessary
2017-07-12 03:23:41 +02:00
da89afda58 feat: upgrade drone docker image to support multi-stage build. (#1732)
* feat: upgrade drone docker image to support multi-stage build.

* update drone sig file.

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

* update drone sig file.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-07-11 02:16:18 -05:00
8f1d62ad3b Fix GET /users/:username/repos endpoint (#2125) 2017-07-10 14:07:39 +03:00
c016d48735 Use POSIX complaint ! operator in find (#2132)
* Use POSIX complaint ! operator in find

-not is a GNU extension and not all find(8) implementations
support it. It's just an alias for ! which is POSIX compliant.

Now gitea compiles on NetBSD at least.

* Revert change in vendor directory as requested
2017-07-10 09:48:46 +08:00
5e9bcb6301 Missing signed commit display translation (#2134) 2017-07-10 09:46:06 +08:00
89cd4dd424 Cache session cookies in tests (#2128) 2017-07-09 10:07:29 +08:00
4c57db7924 Remove unused files (#2124) 2017-07-07 21:52:30 +02:00
f1adaef458 Less verbose integration tests (#2123)
* Helper functions for intergration test boilerplate
2017-07-07 21:36:47 +02:00
5651cc7413 Merge pull request #2119 from ethantkoenig/fix/wiki
Fix wiki preview links
2017-07-07 11:00:31 -03:00
e58237ee3f Fix import order 2017-07-06 16:38:38 -04:00
e14ea9979b Relative URL tests 2017-07-06 12:46:31 -04:00
b1d7348a20 Fix wiki preview links 2017-07-06 12:07:15 -04:00
30787e48f2 Improve org error handling (#2117)
* Improve ErrOrgNotExist type
Return new error type
Use good error check
Use new method to check error
Update tests

* Fix unchanged method name report
2017-07-06 21:30:19 +08:00
2ef33b5338 vendor: update sqlite to fix "database is locked" errors (#2116)
closes #2040

upstream commit: acfa601240
2017-07-06 14:43:30 +08:00
a52cd59727 Fix unchecked error bug (#2110) 2017-07-04 09:30:41 +08:00
2fd039864b Fix missing-return bug (#2109) 2017-07-04 09:29:57 +08:00
310866525b Sync latest translations from crowdin (#2104) 2017-07-03 21:44:20 +08:00
dde9a8648e Add make command update-translations for update translations from crodwin (#2097)
* add make command update-translations for update translations from crowdin to options/locale

* use curl & resolve double quote on make file
2017-07-03 16:37:00 +03:00
f189ccd2d6 Fix git hooks update to receive required arguments. Fixes #2090 (#2095)
* Changed migration calling so that migrations can use models package
2017-07-02 21:50:57 +08:00
f99489d5c5 Fix API for branches with slashes (#2096) 2017-07-02 10:03:57 +08:00
fea902adc8 Check for valid renamed usernames (#2077)
* Check for valid renamed usernames

* Integration test

* Test for username with space

* Make name field required
2017-07-01 22:48:29 +03:00
678fec3f6a upgrade git source code. (#2094)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-07-01 23:05:01 +08:00
eae9154811 Fix SQL bug in models.PullRequests 2017-07-01 14:08:43 +03:00
3c0705ecf3 Absolute path for setting.CustomConf (#2085) 2017-07-01 11:10:04 +08:00
12cb6cd3c9 Merge pull request #2087 from Bwko/fix_error_exit
Fix exit status 1 not handled @ getMergeCommit (#2087)
2017-06-30 15:46:49 +03:00
b36849dc1f Fix exit status 1 not handled @ getMergeCommit 2017-06-30 12:35:26 +02:00
8fd43f215c Revert "Reduce number of layer" (#2086)
This reverts commit 789188f13c93e47b8a758c379bd463f7c2792f13.
2017-06-30 01:10:37 -05:00
789188f13c Reduce number of layer (#2078)
Somes layer are created and aren't usefull, so I compress this :)
2017-06-30 08:58:57 +08:00
935b40fd8e Merge pull request #2083 from ethantkoenig/check_err/org_avatar
Don't ignore gravatar error
2017-06-29 21:30:05 -03:00
2b410e44b2 lint 2017-06-29 12:11:34 -04:00
05e3726415 Use default avatar on error 2017-06-29 12:10:33 -04:00
783b1967e2 Fix release display and correct paging (#2080) 2017-06-29 23:11:38 +08:00
23f0728879 Don't ignore gravatar error 2017-06-29 10:37:55 -04:00
33f3165296 remove unnecessary blank lines and wrong error log 2017-06-28 19:00:08 +02:00
3f9016430f Pagination on releases page (#2035)
* Added count to GetReleasesByRepoID so pagination will work

* Separated it out to a new function, can then also leave the API part unaffected

* Remove extra whitespace added in untouched function

* Added comment and corrected name in error handler

* Account for if the user is owner or not in the count

* Also check if repo is draft

* revert back to the correct count in the ReleasesToDisplay loop

* Fixed lint error regarding else with return statement

* Use Cond struct instead of string, corrected name in error handler

* Removed unused return variable names
2017-06-28 22:47:00 +08:00
1f4d84b7b2 Update git module (#2074) 2017-06-28 22:43:58 +08:00
858197b453 Fix #1271: Call location.reload after XHR finishes (#2071)
location.reload was being called when the related dropdown
was hidden, even if a request initiated before to update this
value hadn't finished. This caused troubles on Firefox.
2017-06-28 16:55:28 +08:00
6b13dafe61 Fix org hooks UI (#2072) 2017-06-28 16:53:50 +08:00
d389ed25a5 Fix: http: multiple response.WriteHeader calls (#2038)
We can't change the http status code here, because the response has been written.
2017-06-28 14:08:47 +08:00
32fc44aa83 Make time diff translatable (#2057) 2017-06-28 13:43:28 +08:00
9d8fba62b3 Smaller watch, star, and fork buttons (#2052) 2017-06-28 09:40:28 +08:00
79daf31058 Setting to disable authorized_keys backup (#1856)
* Add setting to disable authorized_keys backup when rewriting public keys

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Update default value to comply with documentation

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Use tmp-file instead of bak-file for saving manually added keys.

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change casing

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change casing and build bakpath with sprintf only

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Only close file once

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Do not modify calcFingerprint

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Fix casing

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change style from disable to enable

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change name, just SSH_BACKUP_AUTHORIZED_KEYS

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Do not check for directory existence if backup is disabled

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
2017-06-28 09:35:35 +08:00
a037cd81ff Add link to forum in issue template (#2070) 2017-06-28 09:33:37 +08:00
80707c4736 Fix default ghost assignee bug (#2069) 2017-06-28 09:27:12 +08:00
5db8cf3bd1 Always return valid go-get meta, even if unauthorized (#2010)
* Always return valid go-get meta, even if unauthorized

* don't leak information
2017-06-26 09:06:40 +08:00
49d397a9ee drone sign -.- 2017-06-25 21:51:55 +02:00
441986a473 Fix "Dashboard shows deleted comments" (#1995) 2017-06-25 20:20:29 +02:00
735676267e Integration tests for issues API (#2059) 2017-06-25 22:51:07 +08:00
4c0e567062 Fix improper setup for integration tests (#2050) 2017-06-25 17:34:30 +08:00
b4e8a7c4d1 Skip sqlite integration in CI (#2058) 2017-06-25 17:34:07 +08:00
2559a34b97 Load label ID in NewLabels (#2045) 2017-06-25 14:15:09 +08:00
f64c232953 Improve integration test helper functions (#2049)
Set request headers in helper functions, and new helper for requests with string-formatted URLs
2017-06-25 08:15:42 +08:00
3ffedeab03 Fix bug in issue labels API (#2048) 2017-06-25 07:52:51 +08:00
bf187304dc Fix wording (#2024)
* Fix wording

* Update locale_en-US.ini

* Update keys_gpg.tmpl
2017-06-24 01:37:03 -05:00
f2afed3098 Enable assignee e-mail notification (#2003)
* Enable assignee e-mail notification

* Check assignee and doer to avoid self made comment notifications.

* Assignee not always defined

* New method to avoid error when assignee deleted

* Assignee empty check
2017-06-23 21:43:37 +08:00
09cb999145 add missing lfs config on example file (#2039)
* add missing lfs config on example file

* leveal jwt secret empty
2017-06-23 03:39:17 -05:00
f6450b8f92 remove deprecated code for Gogs compitable (#2041) 2017-06-23 14:29:53 +08:00
c259c436d7 update git module (#2037) 2017-06-23 08:06:43 +08:00
cc6b3f60c6 Fix displaying commits and files of PR created from now deleted fork (#2023)
Fix displaying commits and files of PR created from now deleted fork
2017-06-22 19:40:47 +02:00
228247511a repo/editor: fix breadcrumb path cuts parent dirs (#3859) (#2032) 2017-06-22 23:30:47 +08:00
75b5be236a Display config file path on admin panel (#2030) 2017-06-22 08:21:56 -05:00
32f1c41f28 ROOT_URL setting use the default as shown in conf/app.ini (#1823)
The well commented conf/app.ini file that comes with the code shows the
ROOT_URL (i.e. setting.AppURL) as:

    ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/

However the installed custom/conf/app.ini file does not include this setting as
shown, and the default in the setting module was hard coded to
http://localhost:3000/ instead of what is shown above.

With this change the ROOT_URL will default to what is shown above if it is not
set in the custom/conf/app.ini.

Of course it is still possible to override the default by adding the ROOT_URL
setting to your custom/conf/app.ini file as usual.

Signed-off-by: Mike Fellows <mike.fellows@shaw.ca>
2017-06-22 15:35:14 +08:00
2852cca99e Add discourse link (#2027) 2017-06-22 09:07:13 +08:00
902a749fd9 Fix fast-forward PR bug (#1989) 2017-06-22 09:06:57 +08:00
826c606952 Keep sort when switching page (#2013) 2017-06-22 09:06:21 +08:00
d71fad2ab7 Fix #2001 and fix issue comments hidden (#2016)
* revert #2001 and fix issue comments hidden

* fix #2001

* fix import

* improve comment type

* reduce unnecessary join

* fix comment on FindCommentsOptions
2017-06-21 09:00:44 +08:00
0a5dc640a1 Make branch deletion URL more like GitHub's, fixes #1397 (#1994)
* Make branch deletion URL more like GitHub's, fixes #1397

* Add PR branch deletion integration test

* Do not allow deleting protected branch

* Change http error code to 403 if user has no write rights to repository

* Add check to not panic if forked repository has alrady been deleted
2017-06-21 09:00:03 +08:00
6db387a21e Refactor session close as xorm already does everything needed internally (#2020) 2017-06-21 08:57:05 +08:00
63504bf132 Fix displaying commits and files of PR created from now deleted forked repository 2017-06-21 01:25:38 +03:00
754482bf5d Add integration test for repository migration (#1983) 2017-06-20 19:23:16 +08:00
75f166b6b9 Update code.gitea.io/git (#2014) 2017-06-20 13:05:32 +08:00
165cf33771 Wrong PR merge commit ID saved (#2007) 2017-06-19 17:37:11 +08:00
4d2ea7dc41 Add integration test for issue creating (#2002) 2017-06-18 21:25:58 +08:00
255adc40ae Don't show non-comments in comments API (#2001) 2017-06-18 17:06:17 +08:00
4df1a24096 Let not-logged-in users view releases (#1999) 2017-06-18 11:38:24 +08:00
6e452c4da7 Update code.gitea.io/git (#1998) 2017-06-18 08:30:23 +08:00
b7812be33a fix misspell (#1996)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-18 08:30:04 +08:00
90f9bb12c6 fix golint error and rename func for suggestion. (#1997)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-17 11:29:59 -05:00
6233e88f7f Use testing benchmark interface (#1993) 2017-06-17 23:01:03 +08:00
d7570895cc update drone discord plugin to 0.0.4 version (#1992)
* update drone discord plugin to 0.0.3 version

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

* update to 0.0.4

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

* update sig file.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-17 19:12:43 +08:00
1a906f800d Fix GPG email checking to be case insensitive (#1988) 2017-06-17 18:56:40 +08:00
6678593b3c fix typo (#1990) 2017-06-17 12:54:37 +08:00
e2ec4b7c23 fix bu ong normal user visit public repo (#1984) 2017-06-17 12:53:51 +08:00
8fc64741d9 Fix deleted milestone bug (#1942)
* Fix deleted milestone bug

* Use locale for ghost milestone name

* Fix pointer bug
2017-06-17 12:51:28 +08:00
ce9b86082c Consolidate boilerplate in integration tests (#1979) 2017-06-17 12:49:45 +08:00
a3868ef536 update drone sig file (#1981)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-15 21:32:14 -05:00
b7d597e40c Merge pull request #1976 from ethantkoenig/log/integration_test
Set console to debug for integration tests
2017-06-15 14:57:29 -03:00
2bcd9471c9 Separate generate swagger + fix sed os specific (#1791)
* Separate generate-swagger

* Remove go generate rules

* Add missing definition replacement + remove use of -i sed flag

for compatibility with mac os default sed version.
This is a little hacky a better solution could be use.

* Use custom SED_INPLACE

depending of platform detection

* Use SED_INPLACE for swagger-ui also
2017-06-15 08:51:23 -05:00
d1e4af66c1 Set console to debug for integration tests 2017-06-15 08:12:30 -04:00
01322af2e8 Add integration test for pull-request merge (#1912) 2017-06-15 19:20:39 +08:00
13f0e1255a Fix typo (#1974) 2017-06-15 17:38:54 +08:00
792cde7081 Coverage reports for integration tests (#1960) 2017-06-15 17:38:33 +08:00
033aaf4b38 Add pull-create integration test (#1972) 2017-06-15 02:01:51 -05:00
2691673588 send notification if status changed (#1973)
send notification if status changed
2017-06-15 08:56:23 +02:00
0d560f3441 send notification if status changed
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-15 14:46:08 +08:00
8fcda0442e Fix search by issue type (#1914)
* Fix search by issue type
2017-06-15 05:09:03 +02:00
bf48c8ebdd SQLite has a query timeout. Hopefully fixes most 'database locked' errors (#1961)
* SQLite has a query timeout. Fixes 'database locked' errors
2017-06-15 04:51:17 +02:00
31b5e9177f fix collborators lack of units on orgnization repositories (#1968)
* fix collborators lack of units on orgnization repositories

* also change log level to debug
2017-06-15 04:50:12 +02:00
5b0cbf3788 switch gitter to discord for drone. (#1971)
* switch gitter to discord for drone.

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

* add event

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

* only notify build fail message.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-15 10:47:42 +08:00
57cabb3ad3 Fix diff of renamed and modified file (#1967) 2017-06-14 04:07:09 -05:00
274149dd14 Switch to keybase go-crypto (for some elliptic curve key) + test (#1925)
* Switch to keybase go-crypto (for some elliptic curve key) + test

* Use assert.NoError 

and add a little more context to failing test description

* Use assert.(No)Error everywhere 🌈

and assert.Error in place of .Nil/.NotNil
2017-06-14 08:43:43 +08:00
5e92b82ac6 Fix uppercase default branch bug (#1965) 2017-06-14 08:42:36 +08:00
96152c38b1 Fix bug in Action.loadRepo() (#1959) 2017-06-14 08:37:50 +08:00
0168b7073d Use monospace font in githook editor (#1958) 2017-06-13 10:48:49 +08:00
889409ba31 Fix setting.AppPath for integration tests (#1923)
Fix setting.AppPath for integration tests
2017-06-13 04:20:32 +02:00
e8c63e21af Fix missing backslash in Dockerfile.rpi (#1952) 2017-06-13 10:07:11 +08:00
b38b61bbc1 Fix import order (#1951) 2017-06-12 10:01:09 -05:00
635273cea6 Merge pull request #1829 from ethantkoenig/no_branches
Commitless repos should be bare
2017-06-12 11:05:01 -03:00
b5d2780b22 Merge pull request #1945 from appleboy/master
[ci skip] add 1.1.2 change log.
2017-06-12 15:26:18 +02:00
00733b4468 Add myself as a maintainer (#1948) 2017-06-12 08:11:50 -05:00
884c60480d [ci skip] add 1.1.2 change log.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-12 17:07:52 +08:00
ad70af1248 Add repo fork swagger (#1941) 2017-06-12 08:59:51 +08:00
91f27bf9bd Merge pull request #1940 from cez81/discord_links
Update links to Discord server
2017-06-11 19:41:08 -03:00
cc5484de10 Update links to Discord server 2017-06-11 19:42:08 +02:00
9fbdd7d787 Fix engine bug in getIssueByID (#1934) 2017-06-11 14:39:12 +08:00
e0a63a20e0 Fix errors caused by force push (#1927) 2017-06-10 21:59:13 -05:00
96b4780727 Gracefully handle bare repositories on API operations. (#1932)
Signed-off-by: Dennis Keitzel <github@pinshot.net>
2017-06-10 21:57:28 -05:00
f2fcd9dcd8 Support CRLF when splitting code lines for display (#1862)
* Support CRLF when splitting code lines for display

* refactor, fix mixed match

* fmt

* split on both LF and CRLF, use raw literals in regexes

* simplify
2017-06-10 23:20:25 +08:00
446a41d595 [ci skip] update discord badge. (#1930)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-10 21:38:00 +08:00
65b6301ea2 Change join chat from gitter to discord (#1929) 2017-06-10 07:40:56 -05:00
23d0735f90 Absolute path for setting.CustomConf 2017-06-09 22:27:13 -04:00
d3efca3982 Merge pull request #1926 from go-gitea/bkcsoft-update-changelog
Update changelog with v1.1.1
2017-06-10 03:07:09 +02:00
61716bd8f7 Display URLs in integration test logs (#1924) 2017-06-09 19:41:36 -05:00
6d613fb28e No highlighting for .txt files (#1922) 2017-06-09 19:39:16 -05:00
a5444fb3db Update changelog with v1.1.1 2017-06-10 02:10:25 +02:00
e9b1b908ee Fix setting.AppPath for integration tests 2017-06-09 15:42:48 -04:00
4a3f40460b Don't run 'make release' on PRs (#1908) 2017-06-09 09:52:23 +08:00
73836ce8c4 Fix ghost user bug (#1913)
Fix bug where unassigned issues would appear to be assigned to a ghost user
2017-06-09 09:51:31 +08:00
b1b8c5e9f4 Set TMPDIR enviroment variable for dump command (#1915) 2017-06-08 19:24:15 -05:00
662b8bc2a2 Add integration test for file editing (#1907) 2017-06-08 19:15:41 +08:00
afe1f1c4af Fix 500 in public activity page (#1901) 2017-06-08 03:48:49 -05:00
9ddc35e343 Cache ctx.User in retrieveFeeds (#1902) 2017-06-08 10:11:41 +08:00
ff7424179e Delete Public SSH Key tmp file after calculating fingerprint (#1855)
* Delete public key tmp file after calculating fingerprint

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Move line

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Remove defer statement

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Readd defer statement and move remove

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Delete space

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
2017-06-08 10:08:22 +08:00
65cf6cc848 Merge pull request #1905 from ethantkoenig/fix/org_api_auth
Require token before checking membership/ownership
2017-06-07 16:49:52 -03:00
a70073e768 Merge pull request #1904 from ethantkoenig/fix/org_api
Bug fixes for org member API
2017-06-07 16:49:33 -03:00
815715e5a2 Merge pull request #1896 from typeless/add-integration-test-for-forking
Add integration test for repository forking
2017-06-07 15:55:12 -03:00
4bc7240eee Merge pull request #1903 from camlafit/patch-1
A missing / to provide a correct endpoint
2017-06-07 15:50:13 -03:00
971e3a35c1 Require token before checking membership/ownership 2017-06-07 12:20:32 -04:00
f38842320e Bug fixes for org member API 2017-06-07 12:10:35 -04:00
952cb8046f A missing / to provide a correct endpoint
solve #1899
2017-06-07 17:57:28 +02:00
30a831698e Add integration test for repository forking 2017-06-07 20:02:37 +08:00
d9a8eff2de Send mails as HTML as default. Setting for send as plain text. (#1648)
* Send mails as HTML as default. Setting for send as plain text.
 * Add new option SendAsPlainText. remove EnableHTMLAlternative
 * Send HTML mails as default
 * Add html check if html2text should be performed

* Send only multipart or plain. Add deprication warning for ENABLE_HTML_ALTERNATIVE

* Still use ENABLE_HTML_ALTERNATIVE for backward compatibility

* Changed to not ignore html2text errors
2017-06-07 09:14:31 +08:00
295f560a12 Merge pull request #1892 from sapk-fork/update-git
Update code.gitea.io/git
2017-06-06 16:35:05 -03:00
0cf89a83c1 Update code.gitea.io/git 2017-06-06 19:36:48 +02:00
f6b58964d7 Include formatting check to the make test (and thus also check) rule (#1366)
* Include formatting check to the `make check` rule

... and give it its own standalone target too (make fmt-check)

Show diff on fmt-check failure
Do not allow running "fmt-check" with incompatible go version
Also simplify the `fmt` rule

* Forbid running "make fmt" with Go version != 1.7 or 1.8

* Ignore bindata.go for spelling and formatting checks

also remove duplicated variable assignment for GOFILES

* Run `make fmt`
2017-06-06 08:53:16 -05:00
6ec07a6bd7 Make LocalCopyPath a setting instead of a hard-coded path (#1881) 2017-06-06 04:09:54 -05:00
cbdd5f787c Center-aligned login topbar (#1880)
* Center-aligned login topbar

* Center-align OpenID login
2017-06-06 15:05:06 +08:00
ca9169fbe9 Migration to fix existing owner team units (#1873) 2017-06-05 05:40:25 -05:00
ae922afa2d Prevent accidential selection of line numbers in code view (#1860) 2017-06-05 02:52:35 -05:00
703d18e50d feat: add check misspelling (#1877) 2017-06-05 02:49:46 -05:00
ed31dff5ab Merge pull request #1874 from ethantkoenig/typo/issue_test
Fix misspelled variables
2017-06-04 17:10:40 -03:00
858126bca1 Merge pull request #1875 from ethantkoenig/test/unused
Run unused test
2017-06-04 17:10:10 -03:00
9f9289fc68 Run unused test 2017-06-04 14:28:17 -04:00
1a09afc729 Fix misspelled variables 2017-06-04 13:39:08 -04:00
e7ae13deef fix: error from mktemp command in MacOS. (#1837)
* fix: error from mktemp command in MacOS.

* [ci skip] udpate temp name.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-04 03:48:18 -05:00
023cad4461 gofmt (#1868) 2017-06-04 11:10:16 +08:00
3e74b5cf51 Rename misnamed migration (#1867) 2017-06-04 11:09:50 +08:00
817a405118 Fix paginater length (#1866) 2017-06-04 11:07:20 +08:00
a97d6bf24b Use production version of vuejs. (#1869) 2017-06-04 11:04:42 +08:00
009a073990 Remove annoying difference in button heights. (#1853)
* Remove annoying difference in button heights.

Why was that even there?

See before & after: http://imgur.com/a/yKdUR

* (2/2) Remove annoying difference in button heights
2017-06-03 16:58:43 +08:00
2ec5dc1661 Fix 404 for external tracking issues (#1852)
* Fix 404 for external tracking issues

* Fix 404 for new/upload file
2017-06-03 00:56:36 -05:00
b900c04316 Display draft releases (#1854)
* Display draft releases

* Include ctx.User in user cache

* Integration test
2017-06-03 11:46:56 +08:00
036ce3f813 Fix bug in removeOrgRepo (#1858) 2017-06-02 20:06:09 -05:00
62f600cf1c Display all organization from user settings (#1739)
* Display all organization from user settings

* fix Tab selection

* Update locale_en-US.ini

* Add a condition for display Create organization button

* Remove french translation

* Remove unnecessary admin flag
2017-06-02 03:43:44 -05:00
976c2a05fa Fix change introduce by update of go-swagger. (#1727) 2017-06-01 23:35:31 -05:00
4e5ee2b67a Fix user profile activity feed (#1848)
* Fix user profile activity feed

* gofmt, and avoid overlapping database connections
2017-06-02 08:42:25 +08:00
5ca6867aaf Fix some mistakes (#1833)
* Fix some mistakes

* Fixes

* Not correct -> incorrect or invalid

* Update according to comments
2017-06-02 08:41:52 +08:00
04c6c31f8e fix: only run test coverage on master branch. (#1838) 2017-06-01 20:07:24 +02:00
abb19eff39 Update code.gitea.io/git (#1849) 2017-06-01 09:43:11 +08:00
31e8436a1c Use a better default MAX_GIT_DIFF_LINE_CHARACTERS (#1845)
Tests indicate that line length alone does not make browsers slow, so
increase the default threshold after which diffs get surpressed for line
length from 500 to a more reasonable 5000 characters.

Fixes: https://github.com/go-gitea/gitea/issues/1826
2017-05-31 20:10:11 -05:00
a977ab7889 Don't ignore error in getMergeCommit (#1843) 2017-05-31 19:51:24 -05:00
336e311a7c Fix locking bug in removeOrgRepo (#1842) 2017-06-01 08:41:14 +08:00
5554165a0c Fix pull request compare link (#1832)
* Fix pull request compare link

* Integration test
2017-05-31 09:47:42 -05:00
bfb44f8854 Fix status table race condition (#1835) 2017-05-31 16:57:17 +08:00
0f5b399e35 Add variable for docker tag (#1825)
Signed-off-by: Shunsuke Mie <sux2mfgj@gmail.com>
2017-05-31 09:16:51 +08:00
24859fe5b6 Fix FOUC on Firefox (#1728)
Firefox users will experience a flash of unstyled content on loading
various pages, this patch will fix this issue using Filament Groups
loadCSS library to asynchronously load the CSS responsible for the FOUC.

Will fix #1698.

Signed-off-by: Sondre Nilsen <nilsen.sondre@gmail.com>
2017-05-31 09:05:49 +08:00
642f844735 Fix PR template error (#1834) 2017-05-30 07:04:12 -05:00
474d636794 Update code.gitea.io/git (#1824)
* Update code.gitea.io/git

* Update function calls

* govendor fetch
2017-05-30 04:32:01 -05:00
367ff327ed Use ghost users in issues/PRs (#1831) 2017-05-30 14:08:36 +08:00
2525195749 use writeTmpKeyFile in calcFingerprint (#1828)
this makes calcFingerprint use SSH.KeyTestpath instead of os temp dir.
2017-05-29 19:51:16 +08:00
b93568cce4 xxx_active_code_live setting in printed in hours and minutes instead … (#1814)
* xxx_active_code_live setting in printed in hours and minutes instead of just hours

* Update app.ini description of xxx_code_lives settings
2017-05-29 02:35:47 -05:00
e0c6ab2d44 Add Gitea Webhook (#1755)
* Replace Gogs by Gitea

* Fix missing changes

* Create Gitea webhook and put Gogs webhook apart.
2017-05-29 02:17:15 -05:00
c85ff532e9 Commitless repos should be bare 2017-05-28 22:31:40 -04:00
e67ece26f0 Merge pull request #1750 from andreynering/dashboard-search-org-repos
More fixes for dashboard search
2017-05-27 17:40:09 -03:00
12dbdaac76 Fix private repo icon 2017-05-27 13:40:54 -03:00
bafd778c25 Fix invalid reference in feeds template (#1820)
* Fix invalid reference in feeds template

* Comment for GetActAvatar

* Add integration test
2017-05-27 11:34:11 +08:00
97f7f88bed Improve clarity between is_activated and prohibit_login (#1788)
It used to be unclear what the difference between the two are.
2017-05-27 09:14:13 +08:00
3b51da9dae resign drone and fix #1816 (#1819) 2017-05-26 23:08:38 +08:00
7e6ff69c00 Fix 500 for GET /teams/:id endpoints (#1811)
* Fix 500 for GET /teams/:id endpoints

* Integration test for GET /team/:id

* Clean up integration test
2017-05-26 08:15:45 -05:00
3611a3e552 fix bug to deny to add orgnization as a member of an orgnization or team (#1815) 2017-05-26 08:12:02 -05:00
39348cd27e Give all units to owner team (#1812) 2017-05-26 16:03:37 +08:00
9c66d1d9ea Fix deadlock in updateRepository (#1813) 2017-05-26 13:08:13 +08:00
0c332f0480 Fix activity feed (#1779)
* Fix activity feed

Preserve actions after user/repo name change

* Add missing comment

* Fix migration, and remove fields completely

* Tests
2017-05-26 09:38:18 +08:00
03912ce014 Adding #issuecomment to the URL in E-Mail notifications (#1674)
* Added comment's hashtag to url for mail notifications.

Signed-off-by: Jonas <info@jonasfranz.software>

* Added comment's hashtag to url for mail notifications.
Added explanation to return statement.

Signed-off-by: Jonas <info@jonasfranz.software>

* Added comment's hashtag to url for mail notifications.
Added explanation to return statement + documentation.

Signed-off-by: Jonas <info@jonasfranz.software>

* Added comment's hashtag to url for mail notifications.

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Replacing in-line link generation with HTMLURL. (+gofmt)

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Replaced action-based model with nil-based model. (+gofmt)

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants.

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Updating comment for mailIssueCommentToParticipants

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2017-05-25 10:38:56 +08:00
cb74f1b84d Remove stale rule from Makefile (#1782) 2017-05-25 08:53:03 +08:00
ff96bda138 Only run coverage on merges/pushes to master (#1783) 2017-05-25 00:13:18 +08:00
19d889daa2 fix bug not to trim space of login username (#1796) 2017-05-25 00:12:00 +08:00
ff2464c87d Fix renaming bug (#1786) 2017-05-24 14:01:02 +08:00
98ae013e90 Make navbar scroll on overflow (#1777)
* Scrollbars on overflow of horizontal nav

* Update _base.less

* Add fade out on right side of overflowing nav

* Update _base.less
2017-05-24 14:00:40 +08:00
7b907ed348 Rename RepoCreationNum -> MaxCreationLimit (#1766) 2017-05-24 08:27:08 +08:00
de39d09caa Improve grammar (#1775) 2017-05-23 16:01:27 +08:00
bdc90aeaee Delete repo redirects on repo deletion (#1776) 2017-05-23 16:00:10 +08:00
cc2071c3fd Make side nav on dashboard stackable (#1778) 2017-05-23 15:58:43 +08:00
1e40c2e579 fix: #1757 fix set MAX_CREATION_LIMIT as zero. (#1762)
* fix: #1757 fix set MAX_CREATION_LIMIT as zero.

* fix: missing default value
2017-05-21 22:48:35 +08:00
b0308d86dc Fix unloaded owner (#1770) 2017-05-21 14:35:45 +08:00
cf02cd7ba0 Fix and test for delete user (#1713)
* Fix and test for delete user

* Run updates in batches

* Unit test
2017-05-20 16:48:22 +08:00
85a7396525 Add error direclty when user tries to create new repo and limit already hit (#1767) 2017-05-20 16:47:48 +08:00
be5323a05f Update HighlightJS and fix YAML files highlighting (#1764)
* Update HighlightJS to 9.11.0

* Fix YAML files highlighting
2017-05-20 11:52:35 +08:00
80cea8747f Admin should always be allowed to create repos even if hit limit (#1765) 2017-05-20 11:51:19 +08:00
977dcf96e0 fixes wrong after field in webhook payload (#1746) 2017-05-19 12:12:27 +02:00
281a0389c1 fix admin lost permission caused by #947 (#1753) 2017-05-19 12:10:17 +02:00
6362462da8 fix admin lost permission caused by #947 2017-05-19 08:59:26 +08:00
25d6e2a660 Add button to admin ui (#1738)
* Add button to admin ui

* Update according to review

* Update locale_fr-FR.ini

* Rollback to locale french file
2017-05-19 08:20:41 +08:00
0161e46b5a Add swagger comment for MirrorSync (#1747)
* Add swagger comment for MirrorSync

* Generate swagger.v1.json
2017-05-19 08:20:06 +08:00
8906b2891b Fix test
There was a panic when there's no logged in user
2017-05-18 14:35:06 -03:00
fd6034aaf2 Add units to team (#947)
* add units to team

* fix lint

* finish team setting backend

* finished permission controll on routes

* fix import blank line

* add unit check on ssh/http pull and push and fix test failed

* fix fixtures data

* remove unused code
2017-05-18 22:54:24 +08:00
5db5e16ab6 Correct grammar in APIEmpty documentation (#1748)
* Correct grammar in APIEmpty doc

* Generate swagger.v1.json
2017-05-18 22:39:42 +08:00
dc2b28ed76 Show repos acording to user/organization 2017-05-18 11:28:29 -03:00
c746875fcf Remove colaborative repo panel 2017-05-18 11:16:04 -03:00
8917f47347 Fix org repos not showing on dashboard search 2017-05-18 11:15:32 -03:00
407fbfa6ce fixes wrong after field in webhook payload
when merge pull request
2017-05-18 12:16:36 +07:00
c4b5b121a5 Fix bad grammar and wordiness (#1741)
* Fix bad grammar and wordiness

* Update locale_en-US.ini

* Update locale_en-US.ini

* Update locale_en-US.ini

* Update locale_en-US.ini

* Update locale_en-US.ini

* Update locale_en-US.ini

* Update locale_en-US.ini
2017-05-18 09:03:43 +08:00
03d6bab643 Change two factor code entry box from text to number (#1733) 2017-05-16 15:30:20 +08:00
bc299b8317 fix avatar update bug (#1729) 2017-05-16 08:36:09 +08:00
91417e9715 re-Generate swagger.json (#1722)
changes introduced to repo format by : go-gitea/gitea#1687 go-gitea/go-sdk#58  go-gitea/gitea#1668 go-gitea/go-sdk#56
2017-05-14 17:37:15 +08:00
e214728725 Add new text for reset password flash (#1718)
* Forgot password should use ResetPwdCodeLives, not ActiveCodeLives
 * Improve documentation for different send mail functions related to password reset
 * Improve documentation in conf/app.ini regarding xxx_CODE_LIVE_MINUTES settings
2017-05-14 10:38:30 +08:00
9e627af9a4 gofmt (#1710) 2017-05-12 16:09:53 +08:00
5ca3046da6 Fix rendering of issue checkboxes (#1709) 2017-05-12 15:52:45 +08:00
2cf80f4b18 Hide the create organization button (in dashboard/organization section) (#1705)
when the user has no such permission.
2017-05-12 15:10:25 +08:00
397474ecb1 Added Parent property to the repo API (#1687)
Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
2017-05-12 11:09:26 +08:00
251fb935ff Don't recreate database in integration tests (#1697) 2017-05-11 23:32:43 +08:00
ddb63a7897 Correct spelling mistakes (#1703)
* Nitpicking
2017-05-11 09:03:34 +08:00
524885dd65 LDAP user synchronization (#1478) 2017-05-10 15:10:18 +02:00
fd76f090a2 markup: microoptimise for many short filenames in directory (#1534)
* markup: microoptimise for many short filenames in directory

Move strings.ToLower() after the early-return length check. This is a safe operation in all cases and should slightly improve directory listing performance when a directory contains many thousands of files with short filenames.

* markup: expand test cases for IsReadmeFile()
2017-05-09 22:20:22 +08:00
d98a86d2a2 remove sqlite tag when integration test with mysql/postgres AND recreate database when init integration test (#1693) 2017-05-09 15:42:55 +02:00
377acb9757 Realy don't cache apk index
Actualy the "-U --no-cache" effectivly is treated as --no-cache
was never specified:

/ # apk -U --no-cache add sed
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz
(1/1) Installing sed (4.2.2-r0)
Executing busybox-1.25.1-r0.trigger
OK: 4 MiB in 12 packages
/ # ls -la /var/cache/apk/
total 1004
drwxr-xr-x    1 root     root            70 May  8 11:08 .
drwxr-xr-x    1 root     root            29 Mar  3 11:20 ..
-rw-r--r--    1 root     root        732807 May  5 07:11 APKINDEX.c51f8f92.tar.gz
-rw-r--r--    1 root     root        293014 May  1 12:37 APKINDEX.d09172fd.tar.gz

So removing the "-U" fix this behavior.
2017-05-09 15:34:33 +02:00
ab79069dc7 Improve dashboard repo search (#1652)
* Add VueJS

* Improve dashboard search

* Fix tab switching

* Fix input autofocus
2017-05-09 08:31:30 +08:00
51d0becb42 Add configuration option for default permission to create Organizations (#1686) 2017-05-08 21:51:53 +02:00
a85c5ab9ff fix potential sqlite lock #1680 2017-05-08 10:02:44 +02:00
2bb8b3a562 fix bug when push a branch name with / & fix an integration test bug (#1689) 2017-05-08 10:55:27 +08:00
79494047b0 Show commit status icon in commits table (#1688)
* Show commit status icon in commits table

* Add comments

* Fix icons

* Few more places where commit table is displayed

* Change integration test to use goquery for parsing html

* Add integration tests for commit table and status icons

* Fix status to return lates status correctly on all databases

* Rewrote lates commit status selects
2017-05-07 22:40:31 +08:00
c864ccf9b1 Enforce netgo build tag while cross-compilation (#1690) 2017-05-07 22:06:30 +08:00
930d1759ae Remove env user salt since no need to use (#1515)
* remove env user salt since no need to use

* remove unused variable from update.go
2017-05-06 21:21:22 +08:00
9a0b0da1fe Fix commit sha1 URL rendering in markdown (#1677)
* Fix commit sha1 URL rendering in markdown

* Add unit test for commit sha1 markdown rendering when sha1 has space before it

* Change to better variable name
2017-05-05 16:49:13 +08:00
2e17dda8bb Remove sha1 hash display in repository table and add latest commit GPG check (#1678) 2017-05-05 15:15:36 +08:00
935caa7f95 Download files to their original filename (#1676) 2017-05-05 14:03:54 +08:00
98460a8d9d Exposes in API the Repo entity's Size and IsBare property (#1668)
* Exposes in API the Repo entity's IsBare property as IsEmpty

Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>

* Exposes in API the Repo entity's Size property

Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
2017-05-05 10:55:54 +08:00
36f02c0c32 fix potential sqlite lock 2017-05-05 10:13:48 +08:00
a503947fba Upgrade alpine to v3.5 in Dockerfile (#1633) 2017-05-05 08:47:20 +08:00
0f3923c4d7 fix potential lock when sqlite (#1647) 2017-05-05 08:47:03 +08:00
b6206e4788 Fix static files permission under public/ (#1675) 2017-05-05 08:42:28 +08:00
75f1afd1fd fix: tag contain character ) will http 500 on release page (#1670) 2017-05-04 23:38:34 +08:00
700b6b524b Add @lafriks as maintainer 2017-05-04 16:47:48 +02:00
a5f28a4544 gofmt (#1662) 2017-05-04 13:54:56 +08:00
1773e88643 Drop db operations from hook commands (#1514)
* move all database operations from hook command to web command and instead of internal routes

* bug fixed

* adjust the import path sequences

* remove unused return value on hookSetup
2017-05-04 13:42:02 +08:00
59f5bbab0d Fix CSS for wiki markdown (#1660) 2017-05-03 20:22:14 +08:00
3edb0c5894 Generate swagger json (#1402)
- Generate swagger.json into public/
- Add swagger-ui auto-installation
- Add footer link to local swagger-ui
- Add /swagger url for using app url.
- Fix Swagger-UI version via git tag
2017-05-02 15:35:59 +02:00
bb5f694fc5 Improve govendor testing (#1623)
- Use `govendor list +outside +unused` for finding missing or unused deps and govendor status for catching modified vendor.  
- Remove appengine import
2017-05-02 15:22:21 +02:00
0d1e001b9c fix multiple readme file rendering and fix #1657 (#1658)
* fix multiple readme file rendering and fix #1657

* remove unnecessary loop
2017-05-02 16:57:54 +08:00
98548c83d3 Add primary key and index to external login user table (#1656) 2017-05-02 16:41:44 +08:00
87efc8c6d4 Sort on repo size in admin panel (#1654)
* fix #1653 sort on repo size

* fix minor mistake in en-us locale
2017-05-02 16:34:28 +08:00
3792867955 Update xorm to latest version (#1651)
* Update xorm to latest version

* Update xorm/builder
2017-05-02 08:50:33 +08:00
0144817971 Do not allow commiting to protected branch from online editor (#1502)
* Do not allow commiting to protected branch from online editor

* Add editor integration tests for adding new file and not allowing to add new file to protected branch
2017-05-02 08:49:55 +08:00
3ebbdfaa75 make openid support default false for compitable with v1.1 (#1650) 2017-05-02 00:27:53 +08:00
950f2e2074 Additional OAuth2 providers (#1010)
* add google+

* sort signin oauth2 providers based on the name so order is always the same

* update auth tip for google+

* add gitlab provider

* add bitbucket provider (and some go fmt)

* add twitter provider

* add facebook provider

* add dropbox provider

* add openid connect provider incl. new format of tips section in "Add New Source"

* lower the amount of disk storage for each session to prevent issues while building cross platform (and disk overflow)

* imports according to goimport and code style

* make it possible to set custom urls to gitlab and github provider (only these could have a different host)

* split up oauth2 into multiple files

* small typo in comment

* fix indention

* fix indentation

* fix new line before external import

* fix layout of signin part

* update "broken" dependency
2017-05-01 21:26:53 +08:00
2368bbb672 Optimize png images via Google zopflipng [ci skip] (#1639) 2017-04-30 20:04:36 +08:00
66c803fae2 MySQL, Postgres integration tests in drone (#1638)
* MySQL, Postgres integration tests in drone

* Fix .drone.yml

* sign drone

* resign drone
2017-04-30 14:30:12 +08:00
0308d44a16 fix #1643 and improve integration test (#1645) 2017-04-30 13:08:09 +08:00
00324cea10 Limit clone depth when drone-building (#1644)
* Limit clone depth when drone-building

* sign drone
2017-04-30 12:32:30 +08:00
9a8ca3e877 Fix broken migration v27 (#1504)
Mirror.interval column type needed to be changed to bigint.
Correct interval where the interval set is < MinInterval.
2017-04-30 10:08:16 +08:00
1562e9ab70 Refactor Dockerfile
1. Use `apk -U --no-cache add` instead of `apk update` + `apk add` +
manually cache clean up.
2. Separate package installation and user, group setup, the combination
to reduce a docker image layer didn't bring benefits here, only makes
Dockerfiles more complex.
2017-04-29 21:05:25 +02:00
e31c02d4bf fix bug on issue view when not login (#1624)
* fix bug on issue view when not login

* hide issue watch when not login

* update the tests

* fix test on issue
2017-04-29 13:52:25 +08:00
61b08b5c01 bug fixed for API to get user's repos (#1622)
* bug fixed for API to get user's repos

* add tests and fix another place

* test user2 since user1 has no repos
2017-04-29 12:33:25 +08:00
cebe3a6b2f Revert "Set VERSION from git once, in a variable (#1447)"
This reverts commit 410af6971b87ac5dc7ac198f538d8383c1f47a1f.
2017-04-28 20:28:38 +02:00
91d64656a4 update git which fixes #1133 (#1614) 2017-04-28 16:20:58 +02:00
18f46fd7cf [ci skip] Add "Table of Contents" in CONTRIBUTING.md (#1634) 2017-04-28 21:56:28 +08:00
fca7ddc6ea improve integration test to resue models/fixtures and store git repos with tests (#1627)
* improve integration test to resue models/fixtures and store git repos with source

* use gitea-integration-meta dir instead .tar.gz and cleanup every before every test

* fix import package name
2017-04-28 21:23:28 +08:00
431b26f6d7 Handle display of GPG key without end date (#1628) 2017-04-28 08:44:58 +08:00
6853bf323a fix #1521 (#1621) 2017-04-27 20:15:56 +08:00
e3c2963222 remove unused vendor packages (#1620) 2017-04-27 18:10:34 +08:00
e4a0a04829 Add create_at and updated_at in PR json (#1616)
* Move new fields to object creation (use reference)
 * Vendor: Update SDK
2017-04-27 17:29:46 +08:00
8371f94d06 Rework SSH key management UI to add GPG (#1293)
* Rework SSH key management UI to add GPG

* Add more detail to gpg key display

* Update CHANGELOG.md

* Implement deletion UI

* Implement adding gpg UI

* Various fixes

- Fix duplicate entry in locale
- Re-generate hash before verification since they are consumed

* Add missing translation

* Split template

* Catch not found/verified email error
2017-04-26 21:10:43 +08:00
b7da5a6cb7 Fix service description in Debian init file (#1538) 2017-04-25 19:30:42 +02:00
c58708d3ee Integration test framework (#1290)
* Integration test framework

* udpate drone sign

* Formatting fixes and move router.go to routers/

* update sign for drone
2017-04-25 15:24:51 +08:00
3012971e92 fix bug on status API (#1533) 2017-04-24 22:33:54 +08:00
eb1075dd4c Check if missing/modified/unused deps in vendor and fix errors (#1468)
* Check if missing deps in vendor

This will catch import from other repos. (maybe by auto-import)

* Remove github.com/smartystreets unused deps

* Remove github.com/boltdb/bolt unused dep

* Fetch github.com/go-xorm/core + sync gopkg.in/ldap.v2/ldap.go

* Auto-install govendor + reinstall github.com/boltdb/bolt needed by vendor/github.com/blevesearch/bleve/index/store/boltdb

* Update go-xorm/xorm to a5cb21 in vendor.json

* Use a custom repo for implementing change to bolt dep.

* Switching bolt to github.com/go-gitea/bolt

* Switching bolt to github.com/go-gitea/bolt (fork version)

* change the drone sign
2017-04-24 22:31:46 +08:00
fcc7cdab11 Fix markdown rendering (#1530) 2017-04-24 12:18:36 +08:00
5b8fe1e181 Do not show empty collaborators segment (#1531) 2017-04-23 08:55:02 +08:00
4bea219128 Status-API (#1332) 2017-04-21 19:32:31 +08:00
52627032bc Add markup package to prepare for org markup format (#1493) 2017-04-21 09:01:08 +02:00
f0db3da713 fix go get sub package and add domain on installation to let go get work defaultly (#1518)
* fix go get sub package and add domain on installation to let go get work defaultly

* fix import sequence

* fix .git problem
2017-04-21 10:43:29 +08:00
42072783c9 support health check via / and fix #969 (#1520) 2017-04-20 20:14:21 +08:00
bb14c97d40 Fix empty file download (#1506) 2017-04-20 10:38:56 +08:00
fa2a513c62 feat: add download count field and unit testing for attachment. (#1512)
* feat: add download count field and unit testing.

* fix: unit testing

* refactor: improve testing.

* fix: update comment

* add default value.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-04-20 10:31:31 +08:00
a2d365c81f fix #1501 ssh hangs caused by #1461 (#1513) 2017-04-19 19:16:36 +08:00
f995bcc87a Add repo mirror sync API endpoint (#1508)
* API: Add repo mirror sync

* Correct error message

* Change http status to 200
2017-04-19 19:09:49 +08:00
2eeae84cbd Add internal routes for ssh hook comands (#1471)
* add internal routes for ssh hook comands

* fix lint

* add comment on why package named private not internal but the route name is internal

* add comment above package private why package named private not internal but the route name is internal

* remove exp time on internal access

* move routes from /internal to /api/internal

* add comment and defer on UpdatePublicKeyUpdated
2017-04-19 11:45:01 +08:00
f42ec6120e Better URL validation (#1507)
* Add correct git branch name validation

* Change git refname validation error constant name

* Implement URL validation based on GoLang url.Parse method

* Backward compatibility with older Go compiler

* Add git reference name validation unit tests

* Remove unused variable in unit test

* Implement URL validation based on GoLang url.Parse method

* Backward compatibility with older Go compiler

* Add url validation unit tests
2017-04-19 11:02:20 +08:00
941281ae12 Use MAINTAINERS file in repository in CONTRIBUTING (#1489)
* Use MAINTAINERS file in repository because teams are not publicly available

* Use relative link
2017-04-18 08:56:28 +08:00
c764a542c0 Adding @sapk to MAINTAINERS (#1497) 2017-04-16 20:51:38 +08:00
cf91cfb993 Migrate WatchInfo struct to api (#1492)
* Remove WatchInfo and link to api struct

* Add vendor temporary update

* Return to gitea vendor source
2017-04-16 20:51:04 +08:00
237270ef50 Orgs: fix org page title when full name is not defined (#1495) 2017-04-15 10:02:46 +08:00
d409d3ab57 Sanitation fix from Gogs (#1461)
* Santiation fix from Gogs

* Linting

* Fix build-errors

* still not working

* Fix all the things!

* gofmt

* Add code-injection checks
2017-04-13 10:52:24 +08:00
21290d4e80 Optimize and fix autolink function (#1442) (#1444)
* Optimize and fix autolink function (#1442)

* Fix bug in autolink recursive fallback function
2017-04-12 16:01:08 +08:00
22295944df refactor: show command help message. (#1486) 2017-04-12 15:44:54 +08:00
be6edaddcb Repo size in admin panel (#1482)
* Implementation of the feature to view repository size in admin panel
 * Move GetRepoSize to git module
 * Repository.RepoSize -> Repository.Size
 * RepoSize -> Size in template
 * Redo a few bits and pieces
 * Update size when syncing mirror or forking
 * Remove GetRepoSize
 * Changed fatal errors to error message

* Copy migration code from Gogs

* make fmt
2017-04-11 21:30:15 +08:00
54f0293f0a Mirror sync interval specified as duration string (#1407)
* Sync interval specifed as duration string

* Changed mirror interval text

* make fmt

* Add MinInterval for mirror sync

* Use duration internally

* Changed min default to 10m

* make fmt

* Incorrect default

* Removed defaults in MustDuration()

* Add Mirror interval migration

* Default values corrected

* Use transaction during migration

* Change http 500 to page with error message

* Cleanup session.commit()
2017-04-08 23:27:26 +08:00
edbb9eefd6 Fix race when running commands with timeout (#1465)
Update vendored module code.gitea.io/git
2017-04-07 19:23:39 -07:00
5c0bee9b20 refactor update ssh key use time (#1466) 2017-04-07 17:40:38 -07:00
d9db188274 Fix #1418 (#1456) 2017-04-07 22:50:40 +08:00
e0df611cbc Autofocus on 2fa passcode fields (#1460)
* Autofocus on 2fa passcode field

* Autofocus on 2fa scratch code field
2017-04-07 06:07:37 -07:00
5acfc7c4bc fix migrate failed and org dashboard failed on MSSQL database (#1448) 2017-04-06 18:47:25 -07:00
cf6699fb4f fix gpg API panic when no verification (#1451)
* fix gpg API panic when no verification

* fix if condition
2017-04-06 18:40:05 -07:00
cbeeaa1b11 Fix and simplify repo branches UI (#1435) 2017-04-06 23:33:57 +08:00
410af6971b Set VERSION from git once, in a variable (#1447) 2017-04-06 23:32:28 +08:00
a78a0266c4 Correct broken unaligned load/store in armv5 (#1355)
Update vendor github.com/boltdb/bolt to take care of the issue #1354.
2017-04-05 18:50:33 -07:00
d800305b34 Commit search appearence fixes (#1254)
* Fix button text to be consisstent with rest of UI

* Make all commits checkbox look nicer
2017-04-05 18:32:59 -07:00
0cee52e0d3 fix: remove str2html from org full name (#1360)
* fix: remove str2html for security issue.

* fix: update
2017-04-05 18:31:31 -07:00
e7493e953f Corrected Mirror.NextUpdate not set (#1388) 2017-04-05 17:56:45 -07:00
2d1efcc270 Add GOFLAGS and EXTRA_GOFLAGS (#1438) 2017-04-05 16:10:32 +08:00
b746757209 Remove unused mutex field (#1440) 2017-04-04 01:54:02 -07:00
93c25c9a35 Fix races in the log module by using syncmap (#1421) 2017-04-03 10:22:26 +08:00
5d6b71fdbb fixes pull request hanging indefinitely when it contains normal and LFS file pointers (#1425) 2017-04-03 10:21:09 +08:00
21fd3da6f5 Fix disabled fields in repo settings UI (#1431) 2017-04-03 10:19:51 +08:00
37a34c1a28 Merge pull request #1410 from andreynering/notification/issue-watch
[Notifications Step 6] Per issue/PR watch/unwatch
2017-04-01 15:12:24 -03:00
f6e5ce65b2 Improve tests a little 2017-04-01 10:05:58 -03:00
e5c56fe30d Code style fixes 2017-04-01 09:58:20 -03:00
88112a5324 Fix "Error: No issue number specified" when pushing (#1393)
* Fix "Error: No issue number specified"  when pushing

* update pr
2017-03-31 18:05:39 -07:00
095e1f5155 Support for custom html meta (#1423)
* Support for custom html meta

* Changed html meta description default
2017-03-31 18:03:01 -07:00
6a39250579 Add length check for the return string (#1420)
* Add length check for the return string

* Differentiate error paths and logging messages

* Rectify error message
2017-03-31 16:42:23 +08:00
fac7a6fecf Merge pull request #1390 from Morlinest/commit-graph-UI
Use whole button (commit graph) as link
2017-03-30 20:29:57 -03:00
e6781d5488 Add unit tests for issue_watch 2017-03-30 20:20:08 -03:00
a90ffffb1a Use variables for times 2017-03-30 19:14:16 -03:00
18952c40f8 Add copyright headers 2017-03-30 19:11:58 -03:00
4b284f814c UI and translation improvements 2017-03-30 19:10:30 -03:00
4fa691c4dd Make issue in commit graph "clickable" (#1392) 2017-03-30 18:05:38 +08:00
912b340d0d Simplify settings pages with item list (#1389)
* Remove point column on ssh key setting page

* Remove un-used css

* Some cleaning

* Use octicon-key
2017-03-30 09:02:37 +08:00
caed86fc6e Fix lint 2017-03-29 21:18:28 -03:00
e4a33ed4d0 Add octicons to watch/unwatch buttons 2017-03-29 21:08:46 -03:00
cb362513f0 Add updated_unix column on issue_watch 2017-03-29 20:59:28 -03:00
aa6e949b3d Consider issue_watchers while sending notifications 2017-03-29 20:54:57 -03:00
b674460748 Add watch button on issue 2017-03-29 20:31:47 -03:00
a0d0de7233 Create issue_watch table 2017-03-29 19:55:40 -03:00
129b0d6a4b Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION (#1369)
* Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION

Omit the configuration variable (the default) to be dependent.
Fixes #1363

* Move OpenID settings under Service object

* Show OpenID SignUp and SignIn status in admin panel / configuration
2017-03-29 18:57:43 +08:00
08f7fded3c refactor: remove workaround after the golang 1.7 release. (#1349)
* refactor: remove workaround after the golang 1.7 release.

* remove unused import.

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

* refactor: Add remove function.

* refactor: rename

* refactor: update build flag
2017-03-29 10:05:23 +08:00
d0298ea2fb Use whole button as link 2017-03-27 12:46:46 +02:00
6a451a2b59 Minor improvements on commit graph UI (#1380)
* Make "Commit Graph" link a button and translate it

* Add title on Commit Graph page
2017-03-24 10:32:40 +08:00
ae9b02b079 Fix FCGI (over TCP) support (#1368) 2017-03-23 15:57:43 +08:00
fe94032f74 rewrite pre-commit, post-commit and options hooks (fixes #1250) (#1257)
* issue #1250, replace {pre,post}-receive and update hooks with a single shell script that does not require custom hooks to be a sh-script

* issue #1250, make script posix compilant

* v23, add migration script to update {pre,post}-receive and update hooks

* migration: use a more common name and rename v23 to v26 to avoid conflicts

* gofmt'ed and added copyright header

* fix SyncRepositoryHooks to also sync wiki repos
2017-03-23 09:12:51 +08:00
d330a23ce1 fix migration failed when authorized_keys is not exist (#1180) 2017-03-23 00:04:31 +08:00
d349f059af Cleaner IMO (#1361) 2017-03-22 22:30:40 +08:00
bbbd08edc1 Changed text when password reset disabled. (#1364)
Fixes #1340
2017-03-22 22:29:29 +08:00
1b1b85439e Remove href on first/last link when on first/last page (#1345)
Signed-off-by: Arthur Loupforest <arthur.loupforest@outlook.fr>
2017-03-22 19:37:47 +08:00
14fe9010ae GPG commit validation (#1150)
* GPG commit validation

* Add translation

+ some little fix

* Move hash calc after retrieving of potential key + missing translation

* Add some little test
2017-03-22 18:43:54 +08:00
9224405155 LFS: Fix SSH authentication for trailing arguments (#1328)
Fixes #1296
2017-03-22 18:43:28 +08:00
c05bd1789c Reduce conditionals in signin/signup inner forms (#1138) 2017-03-22 00:50:56 +01:00
16732fbfde Removed email copyright year (#1348) 2017-03-21 18:00:39 +08:00
9a9f8fa25b Fix broken table layout (#1344) 2017-03-21 09:44:59 +08:00
f73e734411 Run "make fmt" with go-1.6 (#1333) 2017-03-21 08:55:00 +08:00
888dee3b5f fix delete user failed on sqlite (#1321) 2017-03-20 22:13:52 +08:00
bd8fe49076 fix wiki bugs (#1294) 2017-03-20 21:36:19 +08:00
dbabc35e71 Delete the useless code (#1335) 2017-03-20 21:17:07 +08:00
15f5d8e794 Reduce conditionals in signin/signup inner forms
by always using SignInLink and SignUpLink in the form action
2017-03-20 09:40:42 +01:00
5586445207 LFS: Return 404 for unimplemented endpoints (#1330)
Without this patch a 401 is returned for unspecified endpoints, making
the LFS client ask for HTTP credentials. This behaviour was introduced
with the new locking API:

https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md
2017-03-20 16:40:20 +08:00
9182a35f18 Show user OpenID URIs in their profile (#1314) 2017-03-20 09:31:08 +01:00
e1586898b2 Add change-password admin command (#1304)
* Add change-password admin command
2017-03-20 09:23:38 +01:00
97ee88975a Add captcha support to OpenID based signup 2017-03-20 08:58:00 +01:00
f00a4c8078 Gitea OpenID-2.0 login has been tested with livejournal.com too 2017-03-20 08:51:56 +01:00
a9de85d31d Improve style of user OpenID setting page (#1324)
* Improve user openid list CSS and regenerate CSS
2017-03-20 08:51:33 +01:00
608cd54a68 fix gpg wrong column types 2017-03-20 02:55:07 +01:00
430cc4f42a Use readonly input form to show the validated OpenID URI (#1308) 2017-03-20 09:50:24 +08:00
8bcb643a03 remove empty file (#1326) 2017-03-19 21:43:04 +08:00
2aad4a5f97 Use font-awesome OpenID icon more (#1320) 2017-03-19 16:25:24 +08:00
b57b0c6e40 Fix inconsistency in layout (#1316) 2017-03-18 19:00:09 +08:00
1c3bd436cc feat: Only use issue and wiki on repo. (#1297) 2017-03-18 18:59:07 +08:00
5ecb369dac Specify that time interval units are seconds (#1311) 2017-03-18 11:10:30 +08:00
71d16f69ff Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
0693fbfc00 Refactor repo/issue/view_content.tmpl (#1276) 2017-03-17 13:57:43 +08:00
7a81cd16c5 Refactor admin/auth/new.tmpl (#1277) 2017-03-17 13:55:04 +08:00
ebbcf6fe12 Allow push to init a wiki repo (#1279)
* allow push to init a wiki repo

* compact error check
2017-03-17 12:59:42 +08:00
3cf0e513e6 fix wrong log when push to a new branch (#1220) 2017-03-17 10:15:00 +08:00
925b252927 Fix missing less sources for oauth (#1288) 2017-03-17 08:49:24 +08:00
1476bf909e Make wording of commit search more clear 2017-03-17 01:34:35 +01:00
f1d2f16b54 Add notice that LFS mirroring is not supported (#1251)
* Add notice that LFS mirroring is not supported

* Drop German translation
2017-03-16 19:33:22 +08:00
447c9b428f Send notifications to partecipants in issue comments (#1217)
* Send notifications to partecipants in issue comments

Closes #1216

Includes test (still failing)

* Do not include "labelers" to participants

Fix test to expect what GetParticipants return
2017-03-16 09:34:24 +08:00
ca1c3f1926 Implement GPG api (#710)
* Implement GPG API

* Better handle error

* Apply review recommendation + simplify database operations

* Remove useless comments
2017-03-16 09:27:35 +08:00
43c5469f81 Merge pull request #1258 from ethantkoenig/fix/access
Fix nil-dereference bug
2017-03-15 21:21:57 -03:00
efbb895ebe Cleaner ui for admin, repo settings, and user settings page (#1269) (#1270) 2017-03-15 23:39:38 +01:00
03d79983ee Cleaner UI for explore page (#1253) (#1255)
* Take navbar out of column
* Add styles to navbar
* Changed navbar classes
* Remove unneeded !important from index.css
* Remove unneeded !important from _explore.less
2017-03-15 19:55:12 +01:00
17f403fbcd Fix nil-dereference bug 2017-03-15 14:09:44 -04:00
780cb692d6 Make sure both scripts/ can live side by side (#1264) 2017-03-15 16:11:26 +01:00
42032fdecf Synced licenses with github repo (#1246)
* Added script to download licenses from github

* Synced licenses with github repo
2017-03-15 13:30:16 +01:00
a06c3ad2c0 Synced gitignores with github repo (#1245)
* Renamed scripts directory into contrib

* Added script to download gitignores from github

* Synced gitignores with github repo
2017-03-15 13:30:00 +01:00
09fe4a2ae9 Batch updates for issues (#926) 2017-03-15 02:10:35 +01:00
021904e4e6 Fix typos in models/ and modules/ (#1248) 2017-03-15 08:52:01 +08:00
ec0ae5d50c Refactor and fix incorrect comment (#1247) 2017-03-15 08:51:46 +08:00
7d8f9d1c46 Rename /forget_password url to /forgot_password
Also renames `forgot_password` translation key to
`forgot_password_title` and `forget_password` to
`forgot_password`

Includes entry in CHANGELOG about the breaking change
(and some markdown fixes in there)
2017-03-14 22:54:07 +01:00
8746fb3385 Fix migration comment (#1241) 2017-03-14 14:39:02 +08:00
79ec33fd60 Update locale_en-US.ini (#1235) 2017-03-14 11:24:46 +08:00
1ccdf19fae fix forget migration for wiki hooks (#1227) 2017-03-13 14:27:29 +08:00
be5738243c fix repo settings external tracker failed and check external urls (#1215) 2017-03-13 09:41:40 +08:00
08aae4952b Add myself to maintainers (#1229) 2017-03-13 08:48:39 +08:00
f0efb615c5 Add LibreJS support (#1201)
See See https://www.gnu.org/software/librejs/

Closes #1200
2017-03-12 22:50:20 +08:00
608bbedee1 fix 500 caused by branches settings introduced by #1198 (#1214) 2017-03-12 21:50:26 +08:00
0475e7351f Reserve the "explore" user/org name (#1222) 2017-03-12 09:39:38 +08:00
bdcc1a23e0 Add integration test for signup (#1135)
* Add integration test for signup

* Remove unused functions

* Refactoring

* Add repo_create_test.go

* Rollback the incomplete repo create test

* Comply with linter requirements and simplify the code a little bit
2017-03-11 22:30:29 +08:00
8a98a25d8e Show a link to password reset from password change and delete account (#862)
It's helpful when you forgot your password thus cannot change it
(can happen if you log in via OAuth2 or OpenID)

Also make sure that both the delete-account and password-change
links to forgot-password will have the primary email pre-filled
2017-03-11 17:11:54 +08:00
c99e7e1a62 Simplify RepositoryList.loadAttributes() (#1211) 2017-03-11 16:50:12 +08:00
3803f257fb Move user_follow to separate file (#1210)
Also add unit tests
2017-03-11 16:46:53 +08:00
1e3548b7e7 Unit tests for issue_list (#1209) 2017-03-11 16:46:23 +08:00
64214a9426 Search bar fixes for #1187 and #1205 (#1207) 2017-03-11 16:45:15 +08:00
e2b2fd6e78 fix #1189, commit messages containing a pipe (#1203) 2017-03-11 12:01:38 +08:00
ccc15b9e1a Make strings translatable (#1188) (#1198)
* Add strings to ini

* Make strings translatable (#1188)
2017-03-11 09:28:25 +08:00
74cde12677 Fix upgrade failed after ever rollback (#1194)
* fix upgrade failed after rollback

* fix upgrade failed after rollback

* fix possible upgrade twice fail after rollback
2017-03-10 23:43:51 +08:00
f5476bdbb1 bug fixed for delete repo failed (#1193) 2017-03-10 22:05:53 +08:00
656efdc1c7 fix ini format incomiptable with crowdin (#1177) 2017-03-10 19:40:25 +08:00
dbcd452758 rename OSX to macOS (#1176) 2017-03-10 16:20:17 +08:00
05f0c4bbf5 Dockerfile for aarch64 (#1128) (#1130) 2017-03-10 10:02:55 +08:00
5463640fe6 Fix double borders on edit page (#1152) (#1153)
* Fix double borders on edit page (#1152)

* Add border modifications to less file
2017-03-10 09:33:35 +08:00
4e716fb0fa add mssql to app.ini db config comment (#1172) 2017-03-10 09:33:19 +08:00
d87596aec4 Add MSSQL to issues template (#1171) 2017-03-10 09:31:57 +08:00
2902 changed files with 134817 additions and 34717 deletions

44
.changelog.yml Normal file
View File

@ -0,0 +1,44 @@
repo: go-gitea/gitea
groups:
-
name: BREAKING
labels:
- kind/breaking
-
name: FEATURE
labels:
- kind/feature
-
name: BUGFIXES
labels:
- kind/bug
-
name: ENHANCEMENT
labels:
- kind/enhancement
- kind/refactor
- kind/ui
-
name: SECURITY
labels:
- kind/security
-
name: TESTING
labels:
- kind/testing
-
name: TRANSLATION
labels:
- kind/translation
-
name: BUILD
labels:
- kind/build
- kind/lint
-
name: DOCS
labels:
- kind/docs
-
name: MISC
default: true

View File

@ -2,42 +2,144 @@ workspace:
base: /srv/app
path: src/code.gitea.io/gitea
pipeline:
clone:
image: plugins/git
clone:
git:
image: plugins/git:1
depth: 50
tags: true
test:
pipeline:
download_translations:
image: jonasfranz/crowdin
pull: true
secrets: [ crowdin_key ]
project_identifier: gitea
ignore_branch: true
download: true
export_dir: options/locale/
when:
event: [ push ]
branch: [ master ]
update-translations:
image: alpine:3.6
commands:
- mv ./options/locale/locale_en-US.ini ./options/
- sed -i -e 's/="/=/g' -e 's/"$$//g' ./options/locale/*.ini
- sed -i -e 's/\\\\"/"/g' ./options/locale/*.ini
- mv ./options/locale_en-US.ini ./options/locale/
when:
event: [ push ]
branch: [ master ]
git_push:
image: appleboy/drone-git-push
pull: true
secrets: [ git_push_ssh_key ]
remote: git@github.com:go-gitea/gitea.git
force: false
commit: true
commit_message: "[skip ci] Updated translations via Crowdin"
author_name: GiteaBot
author_email: teabot@gitea.io
when:
event: [ push ]
branch: [ master ]
pre-build:
image: webhippie/nodejs:latest
pull: true
commands:
- npm install
- make stylesheets-check
when:
event: [ push, tag, pull_request ]
build:
image: webhippie/golang:edge
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- apk -U add openssh-client
- make clean
- make generate
- make vet
- make lint
- make test
- make fmt-check
- make misspell-check
- make test-vendor
- make build
when:
event: [ push, tag, pull_request ]
test:
image: webhippie/golang:edge
pull: true
group: test
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make unit-test-coverage
when:
event: [ push, pull_request ]
branch: [ master ]
test:
image: webhippie/golang:edge
pull: true
group: test
environment:
TAGS: bindata
GOPATH: /srv/app
commands:
- make test
when:
event: [ tag ]
# Commented until db locking have been resolved!
# test-sqlite:
# image: webhippie/golang:edge
# pull: true
# group: test
# environment:
# TAGS: bindata
# GOPATH: /srv/app
# commands:
# - make test-sqlite
# when:
# event: [ push, tag, pull_request ]
test-mysql:
image: webhippie/golang:edge
pull: true
group: test
environment:
TAGS: bindata
GOPATH: /srv/app
commands:
- make integration-test-coverage
when:
event: [ push, pull_request ]
branch: [ master ]
test-mysql:
image: webhippie/golang:edge
pull: true
group: test
environment:
TAGS: bindata
GOPATH: /srv/app
commands:
- make test-mysql
when:
event: [ push, tag, pull_request ]
event: [ tag ]
test-pgsql:
image: webhippie/golang:edge
pull: true
group: test
environment:
TAGS: bindata
GOPATH: /srv/app
@ -46,6 +148,27 @@ pipeline:
when:
event: [ push, tag, pull_request ]
generate-coverage:
image: webhippie/golang:edge
pull: true
environment:
TAGS: bindata
GOPATH: /srv/app
commands:
- make coverage
when:
event: [ push, pull_request ]
branch: [ master ]
coverage:
image: robertstettner/drone-codecov
secrets: [ codecov_token ]
files:
- coverage.all
when:
event: [ push, pull_request ]
branch: [ master ]
static:
image: karalabe/xgo-latest:latest
pull: true
@ -55,24 +178,21 @@ pipeline:
commands:
- make release
when:
event: [ push, tag, pull_request ]
coverage:
image: plugins/coverage
server: https://coverage.gitea.io
when:
event: [ push, tag, pull_request ]
event: [ push, tag ]
docker:
image: plugins/docker
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
repo: gitea/gitea
tags: [ '${DRONE_TAG##v}' ]
when:
event: [ tag ]
branch: [ refs/tags/* ]
docker:
image: plugins/docker
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
repo: gitea/gitea
tags: [ '${DRONE_BRANCH##release/v}' ]
when:
@ -80,7 +200,9 @@ pipeline:
branch: [ release/* ]
docker:
image: plugins/docker
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
repo: gitea/gitea
tags: [ 'latest' ]
when:
@ -88,17 +210,24 @@ pipeline:
branch: [ master ]
release:
image: plugins/s3
image: plugins/s3:1
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: releases
endpoint: https://storage.gitea.io
path_style: true
strip_prefix: dist/release/
source: dist/release/*
target: /gitea/${DRONE_TAG##v}
when:
event: [ tag ]
branch: [ refs/tags/* ]
release:
image: plugins/s3
image: plugins/s3:1
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: releases
endpoint: https://storage.gitea.io
path_style: true
strip_prefix: dist/release/
source: dist/release/*
@ -108,7 +237,11 @@ pipeline:
branch: [ release/* ]
release:
image: plugins/s3
image: plugins/s3:1
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: releases
endpoint: https://storage.gitea.io
path_style: true
strip_prefix: dist/release/
source: dist/release/*
@ -118,15 +251,34 @@ pipeline:
branch: [ master ]
github:
image: plugins/github-release
image: plugins/github-release:1
pull: true
secrets: [ github_token ]
files:
- dist/release/*
when:
event: [ tag ]
branch: [ refs/tags/* ]
gitter:
image: plugins/gitter
upload_translations:
image: jonasfranz/crowdin
pull: true
secrets: [ crowdin_key ]
project_identifier: gitea
ignore_branch: true
download: false
files:
locale_en-US.ini: options/locale/locale_en-US.ini
when:
event: [ push ]
branch: [ master ]
discord:
image: appleboy/drone-discord:1.0.0
pull: true
secrets: [ discord_webhook_id, discord_webhook_token ]
when:
event: [ push, tag, pull_request ]
status: [ changed, failure ]
services:
mysql:

View File

@ -1 +0,0 @@
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9zcnYvYXBwCiAgcGF0aDogc3JjL2NvZGUuZ2l0ZWEuaW8vZ2l0ZWEKCnBpcGVsaW5lOgogIGNsb25lOgogICAgaW1hZ2U6IHBsdWdpbnMvZ2l0CiAgICB0YWdzOiB0cnVlCgogIHRlc3Q6CiAgICBpbWFnZTogd2ViaGlwcGllL2dvbGFuZzplZGdlCiAgICBwdWxsOiB0cnVlCiAgICBlbnZpcm9ubWVudDoKICAgICAgVEFHUzogYmluZGF0YSBzcWxpdGUKICAgICAgR09QQVRIOiAvc3J2L2FwcAogICAgY29tbWFuZHM6CiAgICAgIC0gYXBrIC1VIGFkZCBvcGVuc3NoLWNsaWVudAogICAgICAtIG1ha2UgY2xlYW4KICAgICAgLSBtYWtlIGdlbmVyYXRlCiAgICAgIC0gbWFrZSB2ZXQKICAgICAgLSBtYWtlIGxpbnQKICAgICAgLSBtYWtlIHRlc3QKICAgICAgLSBtYWtlIGJ1aWxkCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoLCB0YWcsIHB1bGxfcmVxdWVzdCBdCgogIHRlc3QtbXlzcWw6CiAgICBpbWFnZTogd2ViaGlwcGllL2dvbGFuZzplZGdlCiAgICBwdWxsOiB0cnVlCiAgICBlbnZpcm9ubWVudDoKICAgICAgVEFHUzogYmluZGF0YQogICAgICBHT1BBVEg6IC9zcnYvYXBwCiAgICBjb21tYW5kczoKICAgICAgLSBtYWtlIHRlc3QtbXlzcWwKICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2gsIHRhZywgcHVsbF9yZXF1ZXN0IF0KCiAgdGVzdC1wZ3NxbDoKICAgIGltYWdlOiB3ZWJoaXBwaWUvZ29sYW5nOmVkZ2UKICAgIHB1bGw6IHRydWUKICAgIGVudmlyb25tZW50OgogICAgICBUQUdTOiBiaW5kYXRhCiAgICAgIEdPUEFUSDogL3Nydi9hcHAKICAgIGNvbW1hbmRzOgogICAgICAtIG1ha2UgdGVzdC1wZ3NxbAogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgcHVzaCwgdGFnLCBwdWxsX3JlcXVlc3QgXQoKICBzdGF0aWM6CiAgICBpbWFnZToga2FyYWxhYmUveGdvLWxhdGVzdDpsYXRlc3QKICAgIHB1bGw6IHRydWUKICAgIGVudmlyb25tZW50OgogICAgICBUQUdTOiBiaW5kYXRhIHNxbGl0ZQogICAgICBHT1BBVEg6IC9zcnYvYXBwCiAgICBjb21tYW5kczoKICAgICAgLSBtYWtlIHJlbGVhc2UKICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2gsIHRhZywgcHVsbF9yZXF1ZXN0IF0KCiAgY292ZXJhZ2U6CiAgICBpbWFnZTogcGx1Z2lucy9jb3ZlcmFnZQogICAgc2VydmVyOiBodHRwczovL2NvdmVyYWdlLmdpdGVhLmlvCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoLCB0YWcsIHB1bGxfcmVxdWVzdCBdCgogIGRvY2tlcjoKICAgIGltYWdlOiBwbHVnaW5zL2RvY2tlcgogICAgcmVwbzogZ2l0ZWEvZ2l0ZWEKICAgIHRhZ3M6IFsgJyR7RFJPTkVfVEFHIyN2fScgXQogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgdGFnIF0KICAgICAgYnJhbmNoOiBbIHJlZnMvdGFncy8qIF0KCiAgZG9ja2VyOgogICAgaW1hZ2U6IHBsdWdpbnMvZG9ja2VyCiAgICByZXBvOiBnaXRlYS9naXRlYQogICAgdGFnczogWyAnJHtEUk9ORV9CUkFOQ0gjI3JlbGVhc2Uvdn0nIF0KICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2ggXQogICAgICBicmFuY2g6IFsgcmVsZWFzZS8qIF0KCiAgZG9ja2VyOgogICAgaW1hZ2U6IHBsdWdpbnMvZG9ja2VyCiAgICByZXBvOiBnaXRlYS9naXRlYQogICAgdGFnczogWyAnbGF0ZXN0JyBdCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoIF0KICAgICAgYnJhbmNoOiBbIG1hc3RlciBdCgogIHJlbGVhc2U6CiAgICBpbWFnZTogcGx1Z2lucy9zMwogICAgcGF0aF9zdHlsZTogdHJ1ZQogICAgc3RyaXBfcHJlZml4OiBkaXN0L3JlbGVhc2UvCiAgICBzb3VyY2U6IGRpc3QvcmVsZWFzZS8qCiAgICB0YXJnZXQ6IC9naXRlYS8ke0RST05FX1RBRyMjdn0KICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHRhZyBdCiAgICAgIGJyYW5jaDogWyByZWZzL3RhZ3MvKiBdCgogIHJlbGVhc2U6CiAgICBpbWFnZTogcGx1Z2lucy9zMwogICAgcGF0aF9zdHlsZTogdHJ1ZQogICAgc3RyaXBfcHJlZml4OiBkaXN0L3JlbGVhc2UvCiAgICBzb3VyY2U6IGRpc3QvcmVsZWFzZS8qCiAgICB0YXJnZXQ6IC9naXRlYS8ke0RST05FX0JSQU5DSCMjcmVsZWFzZS92fQogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgcHVzaCBdCiAgICAgIGJyYW5jaDogWyByZWxlYXNlLyogXQoKICByZWxlYXNlOgogICAgaW1hZ2U6IHBsdWdpbnMvczMKICAgIHBhdGhfc3R5bGU6IHRydWUKICAgIHN0cmlwX3ByZWZpeDogZGlzdC9yZWxlYXNlLwogICAgc291cmNlOiBkaXN0L3JlbGVhc2UvKgogICAgdGFyZ2V0OiAvZ2l0ZWEvbWFzdGVyCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoIF0KICAgICAgYnJhbmNoOiBbIG1hc3RlciBdCgogIGdpdGh1YjoKICAgIGltYWdlOiBwbHVnaW5zL2dpdGh1Yi1yZWxlYXNlCiAgICBmaWxlczoKICAgICAgLSBkaXN0L3JlbGVhc2UvKgogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgdGFnIF0KICAgICAgYnJhbmNoOiBbIHJlZnMvdGFncy8qIF0KCiAgZ2l0dGVyOgogICAgaW1hZ2U6IHBsdWdpbnMvZ2l0dGVyCgpzZXJ2aWNlczoKICBteXNxbDoKICAgIGltYWdlOiBteXNxbDo1LjcKICAgIGVudmlyb25tZW50OgogICAgICAtIE1ZU1FMX0RBVEFCQVNFPXRlc3QKICAgICAgLSBNWVNRTF9BTExPV19FTVBUWV9QQVNTV09SRD15ZXMKICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2gsIHRhZywgcHVsbF9yZXF1ZXN0IF0KCiAgcGdzcWw6CiAgICBpbWFnZTogcG9zdGdyZXM6OS41CiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBQT1NUR1JFU19EQj10ZXN0CiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoLCB0YWcsIHB1bGxfcmVxdWVzdCBdCg.hp6IsxbFIQOaxJdmGv32Vf34-Nra3KqVIWzH52W687I

View File

@ -15,10 +15,14 @@ indent_size = 8
indent_style = tab
indent_size = 4
[*.{less,yml}]
[*.{less}]
indent_style = space
indent_size = 4
[*.{yml}]
indent_style = space
indent_size = 2
[*.js]
indent_style = space
indent_size = 4

View File

@ -1,9 +1,11 @@
1. Please speak English, this is the language all of us can speak and write.
2. Please ask questions or configuration/deploy problems on our Gitter channel: https://gitter.im/go-gitea/gitea
3. Please take a moment to search check that your issue doesn't already exist.
4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report.
**You MUST delete the content above including this line before posting, otherwise your issue will be invalid.**
<!--
1. Please speak English, this is the language all of us can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your issue doesn't already exist.
4. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
-->
- Gitea version (or commit ref):
- Git version:
@ -11,6 +13,7 @@
- Database (use `[x]`):
- [ ] PostgreSQL
- [ ] MySQL
- [ ] MSSQL
- [ ] SQLite
- Can you reproduce the bug at https://try.gitea.io:
- [ ] Yes (provide example URL)
@ -25,4 +28,4 @@
## Screenshots
**If this issue involves the Web Interface, please include a screenshot**
<!-- **If this issue involves the Web Interface, please include a screenshot** -->

17
.gitignore vendored
View File

@ -10,6 +10,9 @@ _test
# IntelliJ
.idea
# MS VSCode
.vscode
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
@ -26,7 +29,8 @@ _testmain.go
*.test
*.prof
coverage.out
*coverage.out
coverage.all
/modules/options/bindata.go
/modules/public/bindata.go
@ -36,6 +40,8 @@ coverage.out
*.log
/gitea
/debug
/integrations.test
/bin
/dist
@ -44,3 +50,12 @@ coverage.out
/indexers
/log
/public/img/avatar
/integrations/gitea-integration-mysql
/integrations/gitea-integration-pgsql
/integrations/gitea-integration-sqlite
/integrations/indexers-mysql
/integrations/indexers-pgsql
/integrations/indexers-sqlite
/integrations/mysql.ini
/integrations/pgsql.ini
/node_modules

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +1,126 @@
# Contribution Guidelines
## Table of Contents
- [Contribution Guidelines](#contribution-guidelines)
- [Introduction](#introduction)
- [Bug reports](#bug-reports)
- [Discuss your design](#discuss-your-design)
- [Testing redux](#testing-redux)
- [Vendoring](#vendoring)
- [Translation](#translation)
- [Code review](#code-review)
- [Styleguide](#styleguide)
- [Sign your work](#sign-your-work)
- [Release Cycle](#release-cycle)
- [Maintainers](#maintainers)
- [Owners](#owners)
- [Versions](#versions)
- [Copyright](#copyright)
## Introduction
This document explains how to contribute changes to the Gitea project. It assumes you have followed the [installation instructions](https://docs.gitea.io/en-us/). Sensitive security-related issues should be reported to [security@gitea.io](mailto:security@gitea.io).
This document explains how to contribute changes to the Gitea project.
It assumes you have followed the
[installation instructions](https://docs.gitea.io/en-us/).
Sensitive security-related issues should be reported to
[security@gitea.io](mailto:security@gitea.io).
For configuring IDE or code editor to develop Gitea see [IDE and code editor configuration](contrib/ide/)
## Bug reports
Please search the issues on the issue tracker with a variety of keywords to ensure your bug is not already reported.
Please search the issues on the issue tracker with a variety of keywords
to ensure your bug is not already reported.
If unique, [open an issue](https://github.com/go-gitea/gitea/issues/new) and answer the questions so we can understand and reproduce the problematic behavior.
If unique, [open an issue](https://github.com/go-gitea/gitea/issues/new)
and answer the questions so we can understand and reproduce the
problematic behavior.
To show us that the issue you are having is in Gitea itself, please write clear, concise instructions so we can reproduce the behavior (even if it seems obvious). The more detailed and specific you are, the faster we can fix the issue. Check out [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html).
To show us that the issue you are having is in Gitea itself, please
write clear, concise instructions so we can reproduce the behavior—
even if it seems obvious. The more detailed and specific you are,
the faster we can fix the issue. Check out [How to Report Bugs
Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html).
Please be kind, remember that Gitea comes at no cost to you, and you're getting free help.
Please be kind, remember that Gitea comes at no cost to you, and you're
getting free help.
## Discuss your design
The project welcomes submissions but please let everyone know what you're working on if you want to change or add something to the Gitea repositories.
The project welcomes submissions. If you want to change or add something,
please let everyone know what you're working on—[file an issue](https://github.com/go-gitea/gitea/issues/new)!
Significant changes must go through the [change proposal process](https://github.com/go-gitea/proposals)
before they can be accepted.
Before starting to write something new for the Gitea project, please [file an issue](https://github.com/go-gitea/gitea/issues/new). Significant changes must go through the [change proposal process](https://github.com/go-gitea/proposals) before they can be accepted.
This process gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits inside the goals for the project and tools. It also checks that the design is sound before code is written; the code review tool is not the place for high-level discussions.
This process gives everyone a chance to validate the design, helps
prevent duplication of effort, and ensures that the idea fits inside
the goals for the project and tools. It also checks that the design is
sound before code is written; the code review tool is not the place for
high-level discussions.
## Testing redux
Before sending code out for review, run all the tests for the whole tree to make sure the changes don't break other usage and keep the compatibility on upgrade. To make sure you are running the test suite exactly like we do, you should install the CLI for [Drone CI](https://github.com/drone/drone), as we are using the server for continous testing, following [these instructions](http://readme.drone.io/usage/getting-started-cli). After that you can simply call `drone exec` within your working directory and it will try to run the test suite locally.
Before sending code out for review, run all the tests for the
whole tree to make sure the changes don't break other usage
and keep the compatibility on upgrade. To make sure you are
running the test suite exactly like we do, you should install
the CLI for [Drone CI](https://github.com/drone/drone), as
we are using the server for continous testing, following [these
instructions](http://readme.drone.io/usage/getting-started-cli). After that,
you can simply call `drone exec` within your working directory and it will try
to run the test suite locally.
## Vendoring
We keep a cached copy of dependencies within the `vendor/` directory, managing updates via [govendor](http://github.com/kardianos/govendor).
We keep a cached copy of dependencies within the `vendor/` directory,
managing updates via [govendor](http://github.com/kardianos/govendor).
Pull requests should only include `vendor/` updates if they are part of the same change, be it a bugfix or a feature addition.
Pull requests should only include `vendor/` updates if they are part of
the same change, be it a bugfix or a feature addition.
The `vendor/` update needs to be justified as part of the PR description, and must be verified by the reviewers and/or merger to always reference an existing upstream commit.
The `vendor/` update needs to be justified as part of the PR description,
and must be verified by the reviewers and/or merger to always reference
an existing upstream commit.
## Translation
We do all translation work inside [Crowdin](https://crowdin.com/project/gitea).
The only translation that is maintained in this git repository is
[`en_US.ini`](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini)
and is synced regularily to Crowdin. Once a translation has reached
A SATISFACTORY PERCENTAGE it will be synced back into this repo and
included in the next released version.
## Building Gitea
Generally, the go build tools are installed as-needed in the `Makefile`.
An exception are the tools to build the CSS and images.
- To build CSS: Install [Node.js](https://nodejs.org/en/download/package-manager)
with `npm` and then run `npm install` and `make stylesheets`.
- To build Images: ImageMagick, inkscape and zopflipng binaries must be
available in your `PATH` to run `make generate-images`.
## Code review
Changes to Gitea must be reviewed before they are accepted, no matter who makes the change even if it is an owner or a maintainer. We use GitHub's pull request workflow to do that and we also use [LGTM](http://lgtm.co) to ensure every PR is reviewed by at least 2 maintainers.
Changes to Gitea must be reviewed before they are acceptedno matter who
makes the change, even if they are an owner or a maintainer. We use GitHub's
pull request workflow to do that. And, we also use [LGTM](http://lgtm.co)
to ensure every PR is reviewed by at least 2 maintainers.
Please try to make your pull request easy to review for us. Please read the "[How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/devel/faster_reviews.md)" guide, it has lots of useful tips for any project you may want to contribute. Some of the key points:
Please try to make your pull request easy to review for us. And, please read
the *[How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/devel/faster_reviews.md)* guide;
it has lots of useful tips for any project you may want to contribute.
Some of the key points:
* Make small pull requests. The smaller, the faster to review and the more likely it will be merged soon.
* Don't make changes unrelated to your PR. Maybe there are typos on some comments, maybe refactoring would be welcome on a function... but if that is not related to your PR, please make *another* PR for that.
* Split big pull requests into multiple small ones. An incremental change will be faster to review than a huge PR.
* Make small pull requests. The smaller, the faster to review and the
more likely it will be merged soon.
* Don't make changes unrelated to your PR. Maybe there are typos on
some comments, maybe refactoring would be welcome on a function... but
if that is not related to your PR, please make *another* PR for that.
* Split big pull requests into multiple small ones. An incremental change
will be faster to review than a huge PR.
## Styleguide
@ -63,37 +141,86 @@ import (
)
```
## Sign your work
## Sign-off your work
The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: If you can certify [DCO](DCO), then you just add a line to every git commit message:
The sign-off is a simple line at the end of the explanation for the
patch. Your signature certifies that you wrote the patch or otherwise
have the right to pass it on as an open-source patch. The rules are
pretty simple: If you can certify [DCO](DCO), then you just add a line
to every git commit message:
```
Signed-off-by: Joe Smith <joe.smith@email.com>
```
Please use your real name, we really dislike pseudonyms or anonymous contributions. We are in the open-source world without secrets. If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`.
Please use your real name; we really dislike pseudonyms or anonymous
contributions. We are in the open-source world without secrets. If you
set your `user.name` and `user.email` git configs, you can sign-off your
commit automatically with `git commit -s`.
## Release Cycle
We adopted a release schedule to streamline the process of working on, finishing, and issuing releases. The overall goal is to make a major release every two months, which breaks down into one month of general development followed by one month of testing and polishing known as the release freeze. A release is maintained by issuing minor releases to only correct critical problems such as crashes or security issues. All the feature pull requests should be merged in the first month of one release period.
We adopted a release schedule to streamline the process of working
on, finishing, and issuing releases. The overall goal is to make a
minor release every two months, which breaks down into one month of
general development followed by one month of testing and polishing
known as the release freeze. All the feature pull requests should be
merged in the first month of one release period. And, during the frozen
period, a corresponding release branch is open for fixes backported from
master. Release candidates are made during this period for user testing to
obtain a final version that is maintained in this branch. A release is
maintained by issuing patch releases to only correct critical problems
such as crashes or security issues.
The current release cycle is aligned to start on December 25 to February 24, next is February 25 to April 24, and etc. On this cycle, we also maybe publish the previous release minor version. For example, the current release version is v1.1, but we maybe also publish v1.0.2. When we publish v1.2, then we will stop publish v1.0.3.
Major release cycles are bimonthly. They always begin on the 25th and end on
the 24th (i.e., the 25th of December to February 24th).
During a development cycle, we may also publish any necessary minor releases
for the previous version. For example, if the latest, published release is
v1.2, then minor changes for the previous release—e.g., v1.1.0 -> v1.1.1—are
still possible.
## Maintainers
To make sure every PR is checked, we have [team maintainers](https://github.com/orgs/go-gitea/teams/maintainers). Every PR **MUST** be reviewed by at least two maintainers (or owners) before it can get merged. A maintainer should be a contributor of Gitea (or Gogs) and contributed at least 4 accepted PRs. A contributor should apply as a maintainer in the [Gitter develop channel](https://gitter.im/go-gitea/develop). The owners or the team maintainers may invite the contributor. A maintainer should spend some time on code reviews. If a maintainer has no time to do that, they should apply to leave the maintainers team and we will give them the honor of being a member of the [advisors team](https://github.com/orgs/go-gitea/teams/advisors). Of course, if an advisor has time to code review, we will gladly welcome them back to the maintainers team. If a maintainer is inactive for more than 3 months and forgets to leave the maintainers team, the owners may move him or her from the maintainers team to the advisors team.
To make sure every PR is checked, we have [team
maintainers](MAINTAINERS). Every PR **MUST** be reviewed by at least
two maintainers (or owners) before it can get merged. A maintainer
should be a contributor of Gitea (or Gogs) and contributed at least
4 accepted PRs. A contributor should apply as a maintainer in the
[Discord](https://discord.gg/NsatcWJ) #develop channel. The owners
or the team maintainers may invite the contributor. A maintainer
should spend some time on code reviews. If a maintainer has no
time to do that, they should apply to leave the maintainers team
and we will give them the honor of being a member of the [advisors
team](https://github.com/orgs/go-gitea/teams/advisors). Of course, if
an advisor has time to code review, we will gladly welcome them back
to the maintainers team. If a maintainer is inactive for more than 3
months and forgets to leave the maintainers team, the owners may move
him or her from the maintainers team to the advisors team.
## Owners
Since Gitea is a pure community organization without any company support, to keep the development healthy we will elect three owners every year. All contributors may vote to elect up to three candidates, one of which will be the main owner, and the other two the assistant owners. When the new owners have been elected, the old owners will give up ownership to the newly elected owners. If an owner is unable to do so, the other owners will assist in ceding ownership to the newly elected owners.
Since Gitea is a pure community organization without any company support,
to keep the development healthy we will elect three owners every year. All
contributors may vote to elect up to three candidates, one of which will
be the main owner, and the other two the assistant owners. When the new
owners have been elected, the old owners will give up ownership to the
newly elected owners. If an owner is unable to do so, the other owners
will assist in ceding ownership to the newly elected owners.
After the election, the new owners should proactively agree with our [CONTRIBUTING](CONTRIBUTING.md) requirements on the [Gitter main channel](https://gitter.im/go-gitea/gitea). Below are the words to speak:
After the election, the new owners should proactively agree
with our [CONTRIBUTING](CONTRIBUTING.md) requirements in the
[Discord](https://discord.gg/NsatcWJ) #general channel. Below are the
words to speak:
```
I'm honored to having been elected an owner of Gitea, I agree with [CONTRIBUTING](CONTRIBUTING.md). I will spend part of my time on Gitea and lead the development of Gitea.
I'm honored to having been elected an owner of Gitea, I agree with
[CONTRIBUTING](CONTRIBUTING.md). I will spend part of my time on Gitea
and lead the development of Gitea.
```
To honor the past owners, here's the history of the owners and the time they served:
To honor the past owners, here's the history of the owners and the time
they served:
* 2016-11-04 ~ 2017-12-31
* [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
@ -102,9 +229,16 @@ To honor the past owners, here's the history of the owners and the time they ser
## Versions
Gitea has the `master` branch as a tip branch and has version branches such as `v0.9`. `v0.9` is a release branch and we will tag `v0.9.0` for binary download. If `v0.9.0` has bugs, we will accept pull requests on the `v0.9` branch and publish a `v0.9.1` tag, after bringing the bug fix also to the master branch.
Gitea has the `master` branch as a tip branch and has version branches
such as `release/v0.9`. `release/v0.9` is a release branch and we will
tag `v0.9.0` for binary download. If `v0.9.0` has bugs, we will accept
pull requests on the `release/v0.9` branch and publish a `v0.9.1` tag,
after bringing the bug fix also to the master branch.
Since the `master` branch is a tip version, if you wish to use Gitea in production, please download the latest release tag version. All the branches will be protected via GitHub, all the PRs to every branch must be reviewed by two maintainers and must pass the automatic tests.
Since the `master` branch is a tip version, if you wish to use Gitea
in production, please download the latest release tag version. All the
branches will be protected via GitHub, all the PRs to every branch must
be reviewed by two maintainers and must pass the automatic tests.
## Copyright
@ -116,4 +250,6 @@ Code that you contribute should use the standard copyright header:
// license that can be found in the LICENSE file.
```
Files in the repository contain copyright from the year they are added to the year they are last changed. If the copyright author is changed, just paste the header below the old one.
Files in the repository contain copyright from the year they are added
to the year they are last changed. If the copyright author is changed,
just paste the header below the old one.

View File

@ -1,10 +1,10 @@
FROM alpine:3.4
MAINTAINER Thomas Boerger <thomas@webhippie.de>
FROM alpine:3.6
LABEL maintainer="The Gitea Authors"
EXPOSE 22 3000
RUN apk update && \
apk add \
RUN apk --no-cache add \
su-exec \
ca-certificates \
sqlite \
@ -14,10 +14,9 @@ RUN apk update && \
s6 \
curl \
openssh \
tzdata && \
rm -rf \
/var/cache/apk/* && \
addgroup \
gettext \
tzdata
RUN addgroup \
-S -g 1000 \
git && \
adduser \
@ -27,7 +26,7 @@ RUN apk update && \
-u 1000 \
-G git \
git && \
echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
ENV USER git
ENV GITEA_CUSTOM /data/gitea

43
Dockerfile.aarch64 Normal file
View File

@ -0,0 +1,43 @@
FROM multiarch/alpine:aarch64-v3.6
LABEL maintainer="The Gitea Authors"
EXPOSE 22 3000
RUN apk --no-cache add \
su-exec \
ca-certificates \
sqlite \
bash \
git \
linux-pam \
s6 \
curl \
openssh \
gettext \
tzdata
RUN addgroup \
-S -g 1000 \
git && \
adduser \
-S -H -D \
-h /data/git \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
ENV USER git
ENV GITEA_CUSTOM /data/gitea
COPY docker /
COPY gitea /app/gitea/gitea
ENV GODEBUG=netdns=go
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]

View File

@ -1,10 +1,10 @@
FROM hypriot/rpi-alpine-scratch:v3.4
MAINTAINER Thomas Boerger <thomas@webhippie.de>
FROM multiarch/alpine:armhf-v3.6
LABEL maintainer="The Gitea Authors"
EXPOSE 22 3000
RUN apk update && \
apk add \
RUN apk --no-cache add \
su-exec \
ca-certificates \
sqlite \
@ -14,10 +14,9 @@ RUN apk update && \
s6 \
curl \
openssh \
tzdata && \
rm -rf \
/var/cache/apk/* && \
addgroup \
gettext \
tzdata
RUN addgroup \
-S -g 1000 \
git && \
adduser \
@ -27,7 +26,7 @@ RUN apk update && \
-u 1000 \
-G git \
git && \
echo "git:$(date +%s | sha256sum | base64 | head -c 32)" | chpasswd
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
ENV USER git
ENV GITEA_CUSTOM /data/gitea

View File

@ -12,3 +12,9 @@ Rémy Boulanouar <admin@dblk.org> (@DblK)
Sandro Santilli <strk@kbt.io> (@strk)
Thibault Meyer <meyer.thibault@gmail.com> (@0xbaadf00d)
Thomas Boerger <thomas@webhippie.de> (@tboerger)
Patrick G <geek1011@outlook.com> (@geek1011)
Antoine Girard <sapk@sapk.fr> (@sapk)
Lauris Bukšis-Haberkorns <lauris@nix.lv> (@lafriks)
Jonas Östanbäck <jonas.ostanback@gmail.com> (@cez81)
David Schneiderbauer <dschneiderbauer@gmail.com> (@daviian)
Peter Žeby <morlinest@gmail.com> (@morlinest)

268
Makefile

File diff suppressed because it is too large Load Diff

View File

@ -3,33 +3,48 @@
# Gitea - Git with a cup of tea
[![Build Status](https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg)](https://drone.gitea.io/go-gitea/gitea)
[![Join the chat at https://gitter.im/go-gitea/gitea](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-gitea/gitea?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the Discord chat at https://discord.gg/NsatcWJ](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
[![Join the Matrix chat at https://matrix.to/#/#gitea:matrix.org](https://img.shields.io/badge/matrix-%23gitea%3Amatrix.org-7bc9a4.svg)](https://matrix.to/#/#gitea:matrix.org)
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
[![Coverage Status](https://coverage.gitea.io/badges/go-gitea/gitea/coverage.svg)](https://coverage.gitea.io/go-gitea/gitea)
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
[![Release](https://github-release-version.herokuapp.com/github/go-gitea/gitea/release.svg?style=flat)](https://github.com/go-gitea/gitea/releases/latest)
||||
|:-------------:|:-------:|:-------:|
|![Dashboard](https://i.imgur.com/3iEQsux.jpg)|![Repository](https://i.imgur.com/glqFnj8.jpg)|![Commits History](https://i.imgur.com/ad1FEpi.jpg)|
|![Profile](https://i.imgur.com/q81EcGa.jpg)|![Admin Dashboard](https://i.imgur.com/L2CQeN0.jpg)|![Diff](https://i.imgur.com/cNuvMum.jpg)|
|![Issues](https://i.imgur.com/xCYRqaF.jpg)|![Releases](https://i.imgur.com/ILpRBCe.jpg)|![Organization](https://i.imgur.com/0BHnrcL.jpg)|
||||
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Wiki](https://image.ibb.co/dYV9YG/9.png)|
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|
## Purpose
The goal of this project is to make the easiest, fastest, and most painless way of setting up a self-hosted Git service. Using Go, this can be done with an independent binary distribution across **all platforms** which Go supports, including Linux, macOS, and Windows on x86, amd64, ARM and PowerPC architectures. Want to try it before doing anything else? Do it [with the online demo](https://try.gitea.io/)! This project has been [forked](https://blog.gitea.io/2016/12/welcome-to-gitea/) from [Gogs](https://gogs.io).
The goal of this project is to make the easiest, fastest, and most
painless way of setting up a self-hosted Git service.
Using Go, this can be done with an independent binary distribution across
**all platforms** which Go supports, including Linux, macOS, and Windows
on x86, amd64, ARM and PowerPC architectures.
Want to try it before doing anything else?
Do it [with the online demo](https://try.gitea.io/)!
This project has been
[forked](https://blog.gitea.io/2016/12/welcome-to-gitea/) from
[Gogs](https://gogs.io) since 2016.11 but changed a lot.
## Notes
1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.**
2. If you found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
2. If you have found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
3. If you're interested in using our APIs, we have experimental support with [documentation](https://godoc.org/code.gitea.io/sdk/gitea).
## Docs
For more information and instructions about how to install Gitea please look at our [documentation](https://docs.gitea.io/en-us/). If you cannot find some specific information, then head over to our [Gitter](https://gitter.im/go-gitea/gitea) channel to chat with us.
For more information and instructions about how to install Gitea, please look
at our [documentation](https://docs.gitea.io/en-us/). If you have questions
that are not covered by the documentation, you can get in contact with us on
our [Discord server](https://discord.gg/NsatcWJ),
[Matrix room](https://matrix.to/#/#gitea:matrix.org),
or [forum](https://discourse.gitea.io/)!
## Contributing
@ -43,4 +58,6 @@ Fork -> Patch -> Push -> Pull Request
## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file for the full license text.
This project is licensed under the MIT License.
See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file
for the full license text.

View File

@ -3,19 +3,19 @@
# Gitea - Git with a cup of tea
[![Build Status](https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg)](https://drone.gitea.io/go-gitea/gitea)
[![Join the chat at https://gitter.im/go-gitea/gitea](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-gitea/gitea?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
[![Coverage Status](https://coverage.gitea.io/badges/go-gitea/gitea/coverage.svg)](https://coverage.gitea.io/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
[![Release](https://github-release-version.herokuapp.com/github/go-gitea/gitea/release.svg?style=flat)](https://github.com/go-gitea/gitea/releases/latest)
||||
|:-------------:|:-------:|:-------:|
|![Dashboard](https://i.imgur.com/3iEQsux.jpg)|![Repository](https://i.imgur.com/glqFnj8.jpg)|![Commits History](https://i.imgur.com/ad1FEpi.jpg)|
|![Profile](https://i.imgur.com/q81EcGa.jpg)|![Admin Dashboard](https://i.imgur.com/L2CQeN0.jpg)|![Diff](https://i.imgur.com/cNuvMum.jpg)|
|![Issues](https://i.imgur.com/xCYRqaF.jpg)|![Releases](https://i.imgur.com/ILpRBCe.jpg)|![Organization](https://i.imgur.com/0BHnrcL.jpg)|
||||
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Wiki](https://image.ibb.co/dYV9YG/9.png)|
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|
## 目标
@ -31,7 +31,7 @@ Gitea的首要目标是创建一个极易安装运行非常快速安装和
## 文档
关于如何安装请访问我们的 [文档站](https://docs.gitea.io/zh-cn/),如果没有找到对应的文档,你也可以通过 [Gitter - 英文](https://gitter.im/go-gitea/gitea) 和 QQ群 328432459 来和我们交流。
关于如何安装请访问我们的 [文档站](https://docs.gitea.io/zh-cn/),如果没有找到对应的文档,你也可以通过 [Discord - 英文](https://discord.gg/NsatcWJ) 和 QQ群 328432459 来和我们交流。
## 贡献流程

160
assets/logo.svg Normal file
View File

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="512"
height="512"
viewBox="0 0 135.46667 135.46667"
version="1.1"
id="svg8"
sodipodi:docname="logo.svg"
inkscape:version="0.92.1 r15371"
inkscape:export-filename=""
inkscape:export-xdpi="48.000004"
inkscape:export-ydpi="48.000004">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="0.70710678"
inkscape:cx="418.13805"
inkscape:cy="177.57445"
inkscape:document-units="mm"
inkscape:current-layer="layer2"
showgrid="false"
units="px"
width="256px"
showguides="false"
inkscape:window-width="1920"
inkscape:window-height="1137"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="false"
inkscape:measure-start="283.373,243.952"
inkscape:measure-end="290.267,236.527">
<sodipodi:guide
position="0,0"
orientation="0,512"
id="guide3699"
inkscape:locked="false" />
<sodipodi:guide
position="135.46667,0"
orientation="-512,0"
id="guide3701"
inkscape:locked="false" />
<sodipodi:guide
position="135.46667,135.46667"
orientation="0,-512"
id="guide3703"
inkscape:locked="false" />
<sodipodi:guide
position="0,135.46667"
orientation="512,0"
id="guide3705"
inkscape:locked="false" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-161.53334)"
style="display:inline">
<path
style="fill:#609926;fill-opacity:1;stroke:#428f29;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 27.709937,195.15095 c -9.546573,-0.0272 -22.3392732,6.79805 -21.6317552,23.90397 1.105534,26.72889 25.4565952,29.20839 35.1916502,29.42301 1.068023,5.01357 12.521798,22.30563 21.001818,23.21667 h 37.15277 c 22.27763,-1.66785 38.9607,-75.75671 26.59321,-76.03825 -46.781583,2.47691 -49.995146,2.13838 -88.599758,0 -2.495053,-0.0266 -5.972321,-0.49474 -9.707935,-0.5054 z m 2.491319,9.45886 c 1.351378,13.69267 3.555849,21.70359 8.018216,33.94345 -11.382872,-1.50473 -21.069822,-5.22443 -22.851515,-19.10984 -0.950962,-7.4112 2.390428,-15.16769 14.833299,-14.83361 z"
id="path3722"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sscccccsccsc" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2"
style="display:inline">
<rect
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.24757317;stroke-opacity:1"
id="rect4599"
width="34.762054"
height="34.762054"
x="87.508659"
y="18.291576"
transform="rotate(25.914715)"
ry="5.4825778" />
<path
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26644793px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 79.804947,57.359056 3.241146,1.609954 V 35.255731 h -3.262698 z"
id="path4525"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Layer 3"
style="display:inline">
<g
style="display:inline"
id="g4539">
<circle
transform="rotate(-19.796137)"
r="3.4745038"
cy="90.077766"
cx="49.064713"
id="path4606"
style="fill:#609926;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-opacity:1" />
<circle
transform="rotate(-19.796137)"
r="3.4745038"
cy="102.1049"
cx="36.810425"
id="path4606-3"
style="fill:#609926;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-opacity:1" />
<circle
transform="rotate(-19.796137)"
r="3.4745038"
cy="111.43928"
cx="46.484283"
id="path4606-1"
style="fill:#609926;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-opacity:1" />
<rect
transform="rotate(26.024158)"
y="18.061695"
x="97.333458"
height="27.261492"
width="2.6726954"
id="rect4629-8"
style="fill:#609926;fill-opacity:1;stroke:none;stroke-width:0.27444693;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path4514"
d="m 76.558096,68.116343 c 12.97589,6.395378 13.012989,4.101862 4.890858,20.907244"
style="fill:none;stroke:#609926;stroke-width:2.68000007;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -8,10 +8,10 @@ package cmd
import (
"fmt"
"github.com/urfave/cli"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli"
)
var (
@ -23,6 +23,7 @@ var (
to make automatic initialization process more smoothly`,
Subcommands: []cli.Command{
subcmdCreateUser,
subcmdChangePassword,
},
}
@ -57,8 +58,59 @@ to make automatic initialization process more smoothly`,
},
},
}
subcmdChangePassword = cli.Command{
Name: "change-password",
Usage: "Change a user's password",
Action: runChangePassword,
Flags: []cli.Flag{
cli.StringFlag{
Name: "username,u",
Value: "",
Usage: "The user to change password for",
},
cli.StringFlag{
Name: "password,p",
Value: "",
Usage: "New password to set for user",
},
},
}
)
func runChangePassword(c *cli.Context) error {
if !c.IsSet("password") {
return fmt.Errorf("Password is not specified")
} else if !c.IsSet("username") {
return fmt.Errorf("Username is not specified")
}
setting.NewContext()
models.LoadConfigs()
setting.NewXORMLogService(false)
if err := models.SetEngine(); err != nil {
return fmt.Errorf("models.SetEngine: %v", err)
}
uname := c.String("username")
user, err := models.GetUserByName(uname)
if err != nil {
return fmt.Errorf("%v", err)
}
user.Passwd = c.String("password")
if user.Salt, err = models.GetUserSalt(); err != nil {
return fmt.Errorf("%v", err)
}
user.EncodePasswd()
if err := models.UpdateUserCols(user, "passwd", "salt"); err != nil {
return fmt.Errorf("%v", err)
}
fmt.Printf("User '%s' password has been successfully updated!\n", uname)
return nil
}
func runCreateUser(c *cli.Context) error {
if !c.IsSet("name") {
return fmt.Errorf("Username is not specified")

View File

@ -16,6 +16,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"
"github.com/Unknwon/cae/zip"
"github.com/Unknwon/com"
"github.com/urfave/cli"
@ -73,6 +74,11 @@ func runDump(ctx *cli.Context) error {
}
log.Printf("Creating tmp work dir: %s", TmpWorkDir)
// work-around #1103
if os.Getenv("TMPDIR") == "" {
os.Setenv("TMPDIR", TmpWorkDir)
}
reposDump := path.Join(TmpWorkDir, "gitea-repo.zip")
dbDump := path.Join(TmpWorkDir, "gitea-db.sql")
@ -120,10 +126,7 @@ func runDump(ctx *cli.Context) error {
var sessionAbsPath string
if setting.SessionConfig.Provider == "file" {
if len(setting.SessionConfig.ProviderConfig) == 0 {
setting.SessionConfig.ProviderConfig = "data/sessions"
}
sessionAbsPath, _ = filepath.Abs(setting.SessionConfig.ProviderConfig)
sessionAbsPath = setting.SessionConfig.ProviderConfig
}
if err := zipAddDirectoryExclude(z, "data", setting.AppDataPath, sessionAbsPath); err != nil {
log.Fatalf("Failed to include data directory: %v", err)

View File

@ -7,20 +7,18 @@ package cmd
import (
"bufio"
"bytes"
"crypto/tls"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"code.gitea.io/git"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/httplib"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"github.com/Unknwon/com"
"github.com/urfave/cli"
)
@ -64,6 +62,12 @@ var (
}
)
func hookSetup(logPath string) {
setting.NewContext()
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
models.LoadConfigs()
}
func runHookPreReceive(c *cli.Context) error {
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
return nil
@ -75,16 +79,15 @@ func runHookPreReceive(c *cli.Context) error {
setting.CustomConf = c.GlobalString("config")
}
if err := setup("hooks/pre-receive.log"); err != nil {
fail("Hook pre-receive init failed", fmt.Sprintf("setup: %v", err))
}
hookSetup("hooks/pre-receive.log")
// the environment setted on serv command
repoID, _ := strconv.ParseInt(os.Getenv(models.ProtectedBranchRepoID), 10, 64)
isWiki := (os.Getenv(models.EnvRepoIsWiki) == "true")
//username := os.Getenv(models.EnvRepoUsername)
//reponame := os.Getenv(models.EnvRepoName)
//repoPath := models.RepoPath(username, reponame)
username := os.Getenv(models.EnvRepoUsername)
reponame := os.Getenv(models.EnvRepoName)
userIDStr := os.Getenv(models.EnvPusherID)
repoPath := models.RepoPath(username, reponame)
buf := bytes.NewBuffer(nil)
scanner := bufio.NewScanner(os.Stdin)
@ -102,35 +105,38 @@ func runHookPreReceive(c *cli.Context) error {
continue
}
//oldCommitID := string(fields[0])
oldCommitID := string(fields[0])
newCommitID := string(fields[1])
refFullName := string(fields[2])
// FIXME: when we add feature to protected branch to deny force push, then uncomment below
/*var isForce bool
// detect force push
if git.EmptySHA != oldCommitID {
output, err := git.NewCommand("rev-list", oldCommitID, "^"+newCommitID).RunInDir(repoPath)
if err != nil {
fail("Internal error", "Fail to detect force push: %v", err)
} else if len(output) > 0 {
isForce = true
}
}*/
branchName := strings.TrimPrefix(refFullName, git.BranchPrefix)
protectBranch, err := models.GetProtectedBranchBy(repoID, branchName)
protectBranch, err := private.GetProtectedBranchBy(repoID, branchName)
if err != nil {
log.GitLogger.Fatal(2, "retrieve protected branches information failed")
}
if protectBranch != nil {
if protectBranch != nil && protectBranch.IsProtected() {
// detect force push
if git.EmptySHA != oldCommitID {
output, err := git.NewCommand("rev-list", "--max-count=1", oldCommitID, "^"+newCommitID).RunInDir(repoPath)
if err != nil {
fail("Internal error", "Fail to detect force push: %v", err)
} else if len(output) > 0 {
fail(fmt.Sprintf("branch %s is protected from force push", branchName), "")
}
}
// check and deletion
if newCommitID == git.EmptySHA {
fail(fmt.Sprintf("branch %s is protected from deletion", branchName), "")
} else {
fail(fmt.Sprintf("protected branch %s can not be pushed to", branchName), "")
//fail(fmt.Sprintf("branch %s is protected from force push", branchName), "")
userID, _ := strconv.ParseInt(userIDStr, 10, 64)
canPush, err := private.CanUserPush(protectBranch.ID, userID)
if err != nil {
fail("Internal error", "Fail to detect user can push: %v", err)
} else if !canPush {
fail(fmt.Sprintf("protected branch %s can not be pushed to", branchName), "")
}
}
}
}
@ -149,9 +155,7 @@ func runHookUpdate(c *cli.Context) error {
setting.CustomConf = c.GlobalString("config")
}
if err := setup("hooks/update.log"); err != nil {
fail("Hook update init failed", fmt.Sprintf("setup: %v", err))
}
hookSetup("hooks/update.log")
return nil
}
@ -167,13 +171,10 @@ func runHookPostReceive(c *cli.Context) error {
setting.CustomConf = c.GlobalString("config")
}
if err := setup("hooks/post-receive.log"); err != nil {
fail("Hook post-receive init failed", fmt.Sprintf("setup: %v", err))
}
hookSetup("hooks/post-receive.log")
// the environment setted on serv command
repoUser := os.Getenv(models.EnvRepoUsername)
repoUserSalt := os.Getenv(models.EnvRepoUserSalt)
isWiki := (os.Getenv(models.EnvRepoIsWiki) == "true")
repoName := os.Getenv(models.EnvRepoName)
pusherID, _ := strconv.ParseInt(os.Getenv(models.EnvPusherID), 10, 64)
@ -199,7 +200,7 @@ func runHookPostReceive(c *cli.Context) error {
newCommitID := string(fields[1])
refFullName := string(fields[2])
if err := models.PushUpdate(models.PushUpdateOptions{
if err := private.PushUpdate(models.PushUpdateOptions{
RefFullName: refFullName,
OldCommitID: oldCommitID,
NewCommitID: newCommitID,
@ -210,23 +211,6 @@ func runHookPostReceive(c *cli.Context) error {
}); err != nil {
log.GitLogger.Error(2, "Update: %v", err)
}
// Ask for running deliver hook and test pull request tasks.
reqURL := setting.LocalURL + repoUser + "/" + repoName + "/tasks/trigger?branch=" +
strings.TrimPrefix(refFullName, git.BranchPrefix) + "&secret=" + base.EncodeMD5(repoUserSalt) + "&pusher=" + com.ToStr(pusherID)
log.GitLogger.Trace("Trigger task: %s", reqURL)
resp, err := httplib.Head(reqURL).SetTLSClientConfig(&tls.Config{
InsecureSkipVerify: true,
}).Response()
if err == nil {
resp.Body.Close()
if resp.StatusCode/100 != 2 {
log.GitLogger.Error(2, "Failed to trigger task: not 2xx response code")
}
} else {
log.GitLogger.Error(2, "Failed to trigger task: %v", err)
}
}
return nil

View File

@ -16,7 +16,9 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"github.com/Unknwon/com"
"github.com/dgrijalva/jwt-go"
"github.com/urfave/cli"
@ -48,9 +50,9 @@ func setup(logPath string) error {
models.LoadConfigs()
if setting.UseSQLite3 || setting.UseTiDB {
workDir, _ := setting.WorkDir()
if err := os.Chdir(workDir); err != nil {
log.GitLogger.Fatal(4, "Failed to change directory %s: %v", workDir, err)
workPath := setting.AppWorkPath
if err := os.Chdir(workPath); err != nil {
log.GitLogger.Fatal(4, "Failed to change directory %s: %v", workPath, err)
}
}
@ -105,7 +107,8 @@ func runServ(c *cli.Context) error {
}
if len(c.Args()) < 1 {
fail("Not enough arguments", "Not enough arguments")
cli.ShowSubcommandHelp(c)
return nil
}
cmd := os.Getenv("SSH_ORIGINAL_COMMAND")
@ -123,8 +126,8 @@ func runServ(c *cli.Context) error {
fail("Unknown git command", "LFS authentication request over SSH denied, LFS support is disabled")
}
if strings.Contains(args, " ") {
argsSplit := strings.SplitN(args, " ", 2)
argsSplit := strings.Split(args, " ")
if len(argsSplit) >= 2 {
args = strings.TrimSpace(argsSplit[0])
lfsVerb = strings.TrimSpace(argsSplit[1])
}
@ -140,8 +143,10 @@ func runServ(c *cli.Context) error {
reponame := strings.ToLower(strings.TrimSuffix(rr[1], ".git"))
isWiki := false
unitType := models.UnitTypeCode
if strings.HasSuffix(reponame, ".wiki") {
isWiki = true
unitType = models.UnitTypeWiki
reponame = reponame[:len(reponame)-5]
}
@ -161,8 +166,6 @@ func runServ(c *cli.Context) error {
fail("Internal error", "Failed to get repository owner (%s): %v", username, err)
}
os.Setenv(models.EnvRepoUserSalt, repoUser.Salt)
repo, err := models.GetRepositoryByName(repoUser.ID, reponame)
if err != nil {
if models.IsErrRepoNotExist(err) {
@ -179,8 +182,10 @@ func runServ(c *cli.Context) error {
if verb == lfsAuthenticateVerb {
if lfsVerb == "upload" {
requestedMode = models.AccessModeWrite
} else {
} else if lfsVerb == "download" {
requestedMode = models.AccessModeRead
} else {
fail("Unknown LFS verb", "Unknown lfs verb %s", lfsVerb)
}
}
@ -232,7 +237,7 @@ func runServ(c *cli.Context) error {
fail("internal error", "Failed to get user by key ID(%d): %v", keyID, err)
}
mode, err := models.AccessLevel(user, repo)
mode, err := models.AccessLevel(user.ID, repo)
if err != nil {
fail("Internal error", "Failed to check access: %v", err)
} else if mode < requestedMode {
@ -245,6 +250,12 @@ func runServ(c *cli.Context) error {
user.Name, requestedMode, repoPath)
}
if !repo.CheckUnitUser(user.ID, user.IsAdmin, unitType) {
fail("You do not have allowed for this action",
"User %s does not have allowed access to repository %s 's code",
user.Name, repoPath)
}
os.Setenv(models.EnvPusherName, user.Name)
os.Setenv(models.EnvPusherID, fmt.Sprintf("%d", user.ID))
}
@ -296,6 +307,12 @@ func runServ(c *cli.Context) error {
gitcmd = exec.Command(verb, repoPath)
}
if isWiki {
if err = repo.InitWiki(); err != nil {
fail("Internal error", "Failed to init wiki repo: %v", err)
}
}
os.Setenv(models.ProtectedBranchRepoID, fmt.Sprintf("%d", repo.ID))
gitcmd.Dir = setting.RepoRootPath
@ -308,13 +325,7 @@ func runServ(c *cli.Context) error {
// Update user key activity.
if keyID > 0 {
key, err := models.GetPublicKeyByID(keyID)
if err != nil {
fail("Internal error", "GetPublicKeyById: %v", err)
}
key.Updated = time.Now()
if err = models.UpdatePublicKey(key); err != nil {
if err = private.UpdatePublicKeyUpdated(keyID); err != nil {
fail("Internal error", "UpdatePublicKey: %v", err)
}
}

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@ import (
"net/http"
"code.gitea.io/gitea/modules/log"
"github.com/facebookgo/grace/gracehttp"
)

141
conf/app.ini vendored
View File

@ -23,6 +23,8 @@ PULL_REQUEST_QUEUE_LENGTH = 1000
PREFERRED_LICENSES = Apache License 2.0,MIT License
; Disable ability to interact with repositories by HTTP protocol
DISABLE_HTTP_GIT = false
; Force ssh:// clone url instead of scp-style uri when default SSH port is used
USE_COMPAT_SSH_URI = false
[repository.editor]
; List of file extensions that should have line wraps in the CodeMirror editor
@ -32,6 +34,10 @@ LINE_WRAP_EXTENSIONS = .txt,.md,.markdown,.mdown,.mkd,
; Separate values by commas. Preview tab in edit mode won't show if the file extension doesn't match
PREVIEWABLE_FILE_MODES = markdown
[repository.local]
; Path for uploads. Defaults to `tmp/local-repo`
LOCAL_COPY_PATH = tmp/local-repo
[repository.upload]
; Whether repository file uploads are enabled. Defaults to `true`
ENABLED = true
@ -74,6 +80,11 @@ ORG_PAGING_NUM = 50
; Number of repos that are showed in one page
REPO_PAGING_NUM = 15
[ui.meta]
AUTHOR = Gitea - Git with a cup of tea
DESCRIPTION = Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go
KEYWORDS = go,git,self-hosted,gitea
[markdown]
; Enable hard line break extension
ENABLE_HARD_LINE_BREAK = false
@ -85,9 +96,11 @@ CUSTOM_URL_SCHEMES =
FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd
[server]
; Listen protocol. One of 'http', 'https', 'unix' or 'fcgi'.
PROTOCOL = http
DOMAIN = localhost
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
; Listen address. Either a IPv4/IPv6 address or the path to a unix socket.
HTTP_ADDR = 0.0.0.0
HTTP_PORT = 3000
; Permission for unix socket
@ -100,6 +113,8 @@ LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
DISABLE_SSH = false
; Whether use builtin SSH server or not.
START_SSH_SERVER = false
; Username to use for builtin SSH server. If blank, then it is the value of RUN_USER.
BUILTIN_SSH_SERVER_USER =
; Domain name to be exposed in clone URL
SSH_DOMAIN = %(DOMAIN)s
; Network interface builtin SSH server listens on
@ -110,11 +125,24 @@ SSH_PORT = 22
SSH_LISTEN_PORT = %(SSH_PORT)s
; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
SSH_ROOT_PATH =
; Directory to create temporary files when test publick key using ssh-keygen,
; For built-in SSH server only, choose the ciphers to support for SSH connections,
; for system SSH this setting has no effect
SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128
; For built-in SSH server only, choose the key exchange algorithms to support for SSH connections,
; for system SSH this setting has no effect
SSH_SERVER_KEY_EXCHANGES = diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, curve25519-sha256@libssh.org
; For built-in SSH server only, choose the MACs to support for SSH connections,
; for system SSH this setting has no effect
SSH_SERVER_MACS = hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1, hmac-sha1-96
; Directory to create temporary files when test public key using ssh-keygen,
; default is system temporary directory.
SSH_KEY_TEST_PATH =
; Path to ssh-keygen, default is 'ssh-keygen' and let shell find out which one to call.
SSH_KEYGEN_PATH = ssh-keygen
; Enable SSH Authorized Key Backup when rewriting all keys, default is true
SSH_BACKUP_AUTHORIZED_KEYS = true
; Enable exposure of SSH clone URL to anonymous visitors, default is false
SSH_EXPOSE_ANONYMOUS = false
; Indicate whether to check minimum key size with corresponding type
MINIMUM_KEY_SIZE_CHECK = false
; Disable CDN even in "prod" mode
@ -138,6 +166,12 @@ APP_DATA_PATH = data
ENABLE_GZIP = false
; Landing page for non-logged users, can be "home" or "explore"
LANDING_PAGE = home
; Enables git-lfs support. true or false, default is false.
LFS_START_SERVER = false
; Where your lfs files put on, default is data/lfs.
LFS_CONTENT_PATH = data/lfs
; LFS authentication secret, changed this to yourself.
LFS_JWT_SECRET =
; Define allowed algorithms and their minimum key length (use -1 to disable a type)
[ssh.minimum_key_sizes]
@ -147,7 +181,7 @@ RSA = 2048
DSA = 1024
[database]
; Either "mysql", "postgres" or "sqlite3", it's your choice
; Either "mysql", "postgres", "mssql" or "sqlite3", it's your choice
DB_TYPE = mysql
HOST = 127.0.0.1:3306
NAME = gitea
@ -157,10 +191,18 @@ PASSWD =
SSL_MODE = disable
; For "sqlite3" and "tidb", use absolute path when you start as service
PATH = data/gitea.db
; For "sqlite3" only. Query timeout
SQLITE_TIMEOUT = 500
; For iterate buffer, default is 50
ITERATE_BUFFER_SIZE = 50
[indexer]
ISSUE_INDEXER_PATH = indexers/issues.bleve
; repo indexer by default disabled, since it uses a lot of disk space
REPO_INDEXER_ENABLED = false
REPO_INDEXER_PATH = indexers/repos.bleve
UPDATE_BUFFER_LEN = 20
MAX_FILE_SIZE = 1048576
[admin]
; Disable regular (non-admin) users to create organizations
@ -181,9 +223,47 @@ REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER
MIN_PASSWORD_LENGTH = 6
; True when users are allowed to import local server paths
IMPORT_LOCAL_PATHS = false
; Prevent all users (including admin) from creating custom git hooks
DISABLE_GIT_HOOKS = false
[openid]
;
; OpenID is an open standard and decentralized authentication protocol.
; Your identity is the address of a webpage you provide, which describes
; how to prove you are in control of that page.
;
; For more info: https://en.wikipedia.org/wiki/OpenID
;
; Current implementation supports OpenID-2.0
;
; Tested to work providers at the time of writing:
; - Any GNUSocial node (your.hostname.tld/username)
; - Any SimpleID provider (http://simpleid.koinic.net)
; - http://openid.org.cn/
; - openid.stackexchange.com
; - login.launchpad.net
; - <username>.livejournal.com
;
; Whether to allow signin in via OpenID
ENABLE_OPENID_SIGNIN = true
; Whether to allow registering via OpenID
; Do not include to rely on DISABLE_REGISTRATION setting
;ENABLE_OPENID_SIGNUP = true
; Allowed URI patterns (POSIX regexp).
; Space separated.
; Only these would be allowed if non-blank.
; Example value: trusted.domain.org trusted.domain.net
WHITELISTED_URIS =
; Forbidden URI patterns (POSIX regexp).
; Space separated.
; Only used if WHITELISTED_URIS is blank.
; Example value: loadaverage.org/badguy stackexchange.com/.*spammer
BLACKLISTED_URIS =
[service]
; Time limit to confirm account/email registration
ACTIVE_CODE_LIVE_MINUTES = 180
; Time limit to confirm forgot password reset process
RESET_PASSWD_CODE_LIVE_MINUTES = 180
; User need to confirm e-mail for registration
REGISTER_EMAIL_CONFIRM = false
@ -201,6 +281,15 @@ ENABLE_CAPTCHA = true
; Default value for KeepEmailPrivate
; New user will get the value of this setting copied into their profile
DEFAULT_KEEP_EMAIL_PRIVATE = false
; Default value for AllowCreateOrganization
; New user will have rights set to create organizations depending on this setting
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
; Default value for EnableTimetracking
; Repositories will use timetracking by default depending on this setting
DEFAULT_ENABLE_TIMETRACKING = true
; Default value for AllowOnlyContributorsToTrackTime
; Only users with write permissions could track time if this is true
DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME = true
; Default value for the domain part of the user's email address in the git log
; if he has set KeepEmailPrivate true. The user's email replaced with a
; concatenation of the user name in lower case, "@" and NO_REPLY_ADDRESS.
@ -242,12 +331,14 @@ FROM =
; Mailer user name and password
USER =
PASSWD =
; Use text/html as alternative format of content
ENABLE_HTML_ALTERNATIVE = false
; Send mails as plain text
SEND_AS_PLAIN_TEXT = false
; Enable sendmail (override SMTP)
USE_SENDMAIL = false
; Specifiy an alternative sendmail binary
; Specify an alternative sendmail binary
SENDMAIL_PATH = sendmail
; Specify any extra sendmail arguments
SENDMAIL_ARGS =
[cache]
; Either "memory", "redis", or "memcache", default is "memory"
@ -258,6 +349,9 @@ INTERVAL = 60
; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
; memcache: `127.0.0.1:11211`
HOST =
; Time to keep items in cache if not used, default is 16 hours.
; Setting it to 0 disables caching
ITEM_TTL = 16h
[session]
; Either "memory", "file", or "redis", default is "memory"
@ -274,9 +368,9 @@ COOKIE_NAME = i_like_gitea
COOKIE_SECURE = false
; Enable set cookie, default is true
ENABLE_SET_COOKIE = true
; Session GC time interval, default is 86400
; Session GC time interval in seconds, default is 86400 (1 day)
GC_INTERVAL_TIME = 86400
; Session life time, default is 86400
; Session life time in seconds, default is 86400 (1 day)
SESSION_LIFE_TIME = 86400
[picture]
@ -288,7 +382,7 @@ GRAVATAR_SOURCE = gravatar
DISABLE_GRAVATAR = false
; Federated avatar lookup uses DNS to discover avatar associated
; with emails, see https://www.libravatar.org
; This value will be forced to be false in offline mode or Gravatar is disbaled.
; This value will be forced to be false in offline mode or Gravatar is disabled.
ENABLE_FEDERATED_AVATAR = false
[attachment]
@ -304,7 +398,7 @@ MAX_SIZE = 4
MAX_FILES = 5
[time]
; Specifies the format for fully outputed dates. Defaults to RFC1123
; Specifies the format for fully outputted dates. Defaults to RFC1123
; Special supported values are ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro and StampNano
; For more information about the format see http://golang.org/pkg/time/#pkg-constants
FORMAT =
@ -400,13 +494,23 @@ SCHEDULE = @every 24h
; Archives created more than OLDER_THAN ago are subject to deletion
OLDER_THAN = 24h
; Synchronize external user data (only LDAP user synchronization is supported)
[cron.sync_external_users]
; Synchronize external user data when starting server (default false)
RUN_AT_START = false
; Interval as a duration between each synchronization (default every 24h)
SCHEDULE = @every 24h
; Create new users, update existing user data and disable users that are not in external source anymore (default)
; or only create new users if UPDATE_EXISTING is set to false
UPDATE_EXISTING = true
[git]
; Disables highlight of added and removed changes
DISABLE_DIFF_HIGHLIGHT = false
; Max number of lines allowed of a single file in diff view
MAX_GIT_DIFF_LINES = 1000
; Max number of characters of a line allowed in diff view
MAX_GIT_DIFF_LINE_CHARACTERS = 500
MAX_GIT_DIFF_LINE_CHARACTERS = 5000
; Max number of files shown in diff view
MAX_GIT_DIFF_FILES = 100
; Arguments for command 'git gc', e.g. "--aggressive --auto"
@ -422,8 +526,10 @@ PULL = 300
GC = 60
[mirror]
; Default interval in hours between each check
DEFAULT_INTERVAL = 8
; Default interval as a duration between each check
DEFAULT_INTERVAL = 8h
; Min interval as a duration must be > 1m
MIN_INTERVAL = 10m
[api]
; Max number of items will response in a page
@ -431,7 +537,7 @@ MAX_RESPONSE_ITEMS = 50
[i18n]
LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR
NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,Français,Nederlands,Latviešu,Русский,日本語,Español,Português do Brasil,Polski,български,Italiano,Suomalainen,Türkçe,čeština,Српски,Svenska,한국어
NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,Français,Nederlands,Latviešu,Русский,日本語,Español,Português do Brasil,polski,български,Italiano,Suomalainen,Türkçe,čeština,Српски,Svenska,한국어
; Used for datetimepicker
[i18n.datelang]
@ -467,3 +573,12 @@ SHOW_FOOTER_BRANDING = false
SHOW_FOOTER_VERSION = true
; Show time of template execution in the footer
SHOW_FOOTER_TEMPLATE_LOAD_TIME = true
[markup.asciidoc]
ENABLED = false
; List of file extensions that should be rendered by an external command
FILE_EXTENSIONS = .adoc,.asciidoc
; External command to render all matching extensions
RENDER_COMMAND = "asciidoc --out-file=- -"
; Input is not a standard input but a file
IS_INPUT_FILE = false

12
contrib/ide/README.md Normal file
View File

@ -0,0 +1,12 @@
# IDE and code editor configuration
## Table of Contents
- [IDE and code editor configuration](#ide-and-code-editor-configuration)
- [Microsoft Visual Studio Code](#microsoft-visual-studio-code)
## Microsoft Visual Studio Code
Download Microsoft Visual Studio Code at https://code.visualstudio.com/ and follow instructions at https://code.visualstudio.com/docs/languages/go to setup Go extension for it.
Create new directory `.vscode` in Gitea root folder and copy contents of folder [contrib/ide/vscode](vscode/) to it. You can now use `Ctrl`+`Shift`+`B` to build gitea executable and `F5` to run it in debug mode.
Supported on Debian, Ubuntu, Red Hat, Fedora, SUSE Linux, MacOS and Microsoft Windows.

View File

@ -0,0 +1,31 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"buildFlags": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/main.go",
"env": {},
"args": ["web"],
"showLog": true
},
{
"name": "Launch (with SQLite3)",
"type": "go",
"request": "launch",
"mode": "debug",
"buildFlags": "-tags=\"sqlite\"",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/main.go",
"env": {},
"args": ["web"],
"showLog": true
}
]
}

View File

@ -0,0 +1,51 @@
{
"version": "2.0.0",
"tasks": [
{
"taskName": "Build",
"type": "shell",
"command": "go",
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"args": ["build"],
"linux": {
"args": [ "-o", "gitea", "${workspaceRoot}/main.go" ]
},
"osx": {
"args": [ "-o", "gitea", "${workspaceRoot}/main.go" ]
},
"windows": {
"args": [ "-o", "gitea.exe", "\"${workspaceRoot}\\main.go\""]
},
"problemMatcher": ["$go"]
},
{
"taskName": "Build (with SQLite3)",
"type": "shell",
"command": "go",
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"args": ["build", "-tags=\"sqlite\""],
"linux": {
"args": ["-o", "gitea", "${workspaceRoot}/main.go"]
},
"osx": {
"args": ["-o", "gitea", "${workspaceRoot}/main.go"]
},
"windows": {
"args": ["-o", "gitea.exe", "\"${workspaceRoot}\\main.go\""]
},
"problemMatcher": ["$go"]
}
]
}

View File

@ -15,7 +15,7 @@
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Go Git Service"
DESC="Git with a cup of tea"
NAME=gitea
SERVICEVERBOSE=yes
PIDFILE=/var/run/$NAME.pid

Some files were not shown because too many files have changed in this diff Show More