Compare commits

..

550 Commits

Author SHA1 Message Date
Unknwon
54930c001d Prepare for v0.5.5 2014-10-10 16:22:49 -04:00
Unknwon
41dbb4c148 Hide org member in collar page 2014-10-10 06:15:27 -04:00
Unknwon
85c9f7c5f3 Issue: Show error prompt when add repository to team and it does not exist #533 2014-10-10 05:06:12 -04:00
无闻
c31606daf9 Merge pull request #544 from TonyTsangHK/dev
Add locale zh-HK (Traditional Chinese)
2014-10-10 03:41:39 -04:00
Unknwon
d78abd3561 Mirror fix on admin/orgs paging 2014-10-10 03:28:21 -04:00
Tony Tsang
8c71ab5094 Add locale zh-HK (Traditional Chinese) 2014-10-10 14:17:47 +08:00
Unknwon
79262173a6 Webhook delivery locking & Hide repo for org members if they don't have access 2014-10-09 19:01:22 -04:00
Unknwon
7b03b1df0e Allow custom locale 2014-10-09 18:35:09 -04:00
Unknwon
39931f8e00 Allow mail with self-signed certificates 2014-10-09 18:08:07 -04:00
Unknwon
1aa76bd279 Fix #532, add system notice 2014-10-08 18:29:18 -04:00
无闻
54c9844d66 Merge pull request #539 from Xefir/dev
Fix malformed address
2014-10-08 12:30:59 -04:00
Michel Roux
6705559ce0 Fix malformed address 2014-10-08 18:29:02 +02:00
无闻
8e8dfaf227 Merge pull request #538 from m0sth8/fix-timesince
Add omitted lang
2014-10-08 12:17:07 -04:00
Vyacheslav Bakhmutov
ce7422473a add omitted lang 2014-10-08 12:27:05 +04:00
Unknwon
fc18741cc7 Fix #524 2014-10-07 07:02:53 -04:00
Unknwon
fef09c2de6 Fix badges 2014-10-06 19:35:41 -04:00
Unknwon
1e1f9e7166 Update with macaron 2014-10-06 19:12:52 -04:00
Unknwon
64c68220d2 Fix #264 2014-10-06 17:50:00 -04:00
Unknwon
91e5c24a31 Fix #522 2014-10-06 10:36:32 -04:00
无闻
810ff480b8 Merge pull request #531 from basilfx/dev
Updated Dutch translations
2014-10-05 18:09:34 -04:00
无闻
de65c30770 Merge pull request #530 from chk1/master
Add and translate missing German strings for user page
2014-10-05 18:09:19 -04:00
Bas Stottelaar
bbf5bcdf99 Updated Dutch translations
Fixed some spelling mistakes.

* Number up to 20 are written as words instead of digits.
* Nouns are written without spaces.
* Fixed mixups between informal/formal language.
* Removal of extra spaces in sentences.
2014-10-05 21:03:07 +02:00
unknown
02b53aff0f Add and translate missing German strings for user page 2014-10-05 17:26:32 +02:00
无闻
b694cc88e4 Merge pull request #525 from linquize/tag-sort-reverse
sort tags in descending order by version number
2014-10-05 00:08:24 -04:00
Linquize
67c44b7d27 If git >= 2.0, sort tags in descending order by version number 2014-10-05 11:59:54 +08:00
Unknwon
263d409326 Basic xss prevention 2014-10-04 17:15:22 -04:00
无闻
6a79b76531 Merge pull request #529 from chk1/master
Translate missing entries & add German translation to homepage
2014-10-04 15:56:43 -04:00
unknown
da0fbbadc2 Fix memecache/memcache typo 2014-10-04 21:44:17 +02:00
unknown
1031271224 Add German translation to home page 2014-10-04 21:33:32 +02:00
unknown
8c70bcee99 Translate missing strings and some improvements 2014-10-04 21:32:55 +02:00
无闻
07c8925805 Merge pull request #527 from michaelboke/master
Dutch translations
2014-10-04 15:26:29 -04:00
Michael Boke
29a7d1ce61 updated some strange translated message so they will match their context on the website 2014-10-04 10:32:31 +02:00
Michael Boke
500b8a2a0f updated translations with the latest master version 2014-10-04 10:22:03 +02:00
Michael Boke
ba1270df2d Merge remote-tracking branch 'upstream/master'
Conflicts:
	conf/app.ini
2014-10-03 22:51:07 +02:00
Michael Boke
ba0feadc34 Added dutch translations 2014-10-03 22:43:42 +02:00
Unknwon
405ee14711 Fix SMTP auth logic 2014-10-03 13:12:54 -04:00
无闻
1126522a99 Merge pull request #521 from DerDackel/dev
Added some missing strings under the [action] category to german localization
2014-10-01 10:42:46 -04:00
Sebastian Jackel
1601b27ad3 Added some missing strings under the [action] category to german localization 2014-10-01 14:47:34 +02:00
Unknwon
f03b6be8f9 Work on #516 2014-10-01 07:40:48 -04:00
无闻
3ffa17c49a Merge pull request #519 from silverkorn/dev
Debian's "init.d" - Tentative to fix user's environment variables loading
2014-09-30 21:39:12 -04:00
Danny B
98c719c342 Debian's Init.d workaround for loading user's environment variables with start-stop-daemon command.
Implies 2 running child, so the `stop` command usually needs a `KILL` instead of a `TERM` to close properly so I reduced it to 1 second to get quickly with the `KILL` signal.
2014-09-30 21:30:16 -04:00
Unknwon
2a031c1365 Fix #515 2014-09-30 04:39:53 -04:00
无闻
198567eccb Merge pull request #517 from silverkorn/dev
Added "init.d" service script for Debian-based Linux.
2014-09-29 22:00:31 -04:00
Danny B
f7de6d2b86 Added "init.d" service script for Debian-based Linux.
Compatible with "/etc/default/gogs" configuration file for adding or overwriting values.
Based on "/etc/init.d/skeleton" and tested on Raspbian 2014-06-20 (Debian 7.5 [Wheezy] ARM)

[TO FIX] For some reason, it's necessary to remove the value of RUN_USER from the app.ini configuration file because the following error occurs:
2014/09/28 18:12:53 [setting.go:182 NewConfigContext()] [E] Expect user(git) but current user is:
2014-09-29 21:52:45 -04:00
Unknwon
86eac0842b Fix feeds display issue 2014-09-29 18:58:04 -04:00
Unknwon
a046a31d2b UI: Confirmation box 2014-09-29 18:52:28 -04:00
Unknwon
cd084dacf1 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-09-29 05:38:52 -04:00
Unknwon
ac2055e33c Fix #514 2014-09-29 05:38:46 -04:00
无闻
96f4c9045a Merge pull request #513 from lbeltrame/add-centos-init-script
Add CentOS init script
2014-09-29 05:06:32 -04:00
Luca Beltrame
d95e7065d9 s/USER/GOGS_USER/g 2014-09-29 10:43:51 +02:00
Luca Beltrame
5e48c89c5e Add a CentOS init script 2014-09-29 10:41:29 +02:00
Unknwon
3cfa4a581c Bug: 500 when transfer repository to collaborator 2014-09-29 04:04:48 -04:00
无闻
ce6931a046 Merge pull request #512 from fundon/feature_support_dsa_key
support dsa key format
2014-09-29 00:57:49 -04:00
fundon
eb1e6f8e3e support dsa key format 2014-09-29 12:37:34 +08:00
无闻
263fc76b87 Merge pull request #507 from codeskyblue/dev
update .gobuild.yml inorder to support sqlite for amd64 arch
2014-09-28 18:07:00 -04:00
无闻
c1d047d16e Merge pull request #508 from chadoe/homelink
Fix user HomeLink when using a suburl
2014-09-28 18:05:58 -04:00
无闻
38f71af363 Merge pull request #509 from chadoe/avatarlink
Fix AvatarLink when using a suburl
2014-09-28 18:05:35 -04:00
无闻
ecdbeea3f5 Merge pull request #510 from evolvedlight/master
Fix minor typo
2014-09-28 18:05:16 -04:00
evolvedlight
b7b0ee7df9 Fix minor typo 2014-09-28 22:01:05 +01:00
Martin van Beurden
bb05ef907b Fix AvatarLink when using a suburl and gravatar is disabled or avatars are cached 2014-09-28 14:27:13 +02:00
Martin van Beurden
204952439a Fix user HomeLink when using a suburl 2014-09-28 13:55:58 +02:00
codeskyblue
e2e362f2dc update .gobuild.yml remove start.bat 2014-09-28 16:38:59 +08:00
codeskyblue
26a0888bee Merge branch 'master' into dev 2014-09-28 16:38:19 +08:00
codeskyblue
9ce0bd043c update .gobulid.yml 2014-09-28 16:37:58 +08:00
Unknwon
5e747bc877 Clean old dockerfiles 2014-09-28 03:31:50 -04:00
Unknwon
11af8658cf Simple fix 2014-09-28 01:54:25 -04:00
Unknwon
e6e6aaeacb Delete verbose 2014-09-28 01:45:03 -04:00
Unknwon
e3b78c47e2 Merge branch 'master' of github.com:gogits/gogs
Conflicts:
	public/ng/less/gogs/repository.less
	templates/repo/home.tmpl
2014-09-28 01:44:09 -04:00
Unknwon
49193bebd2 UI: Confirmation box 2014-09-28 01:38:25 -04:00
shengxiang
3598c1435e Update .gobuild.yml 2014-09-28 13:02:17 +08:00
shengxiang
ab59165d2f Create start.bat 2014-09-28 12:45:21 +08:00
shengxiang
092b59a297 Update .gobuild.yml 2014-09-28 12:44:37 +08:00
fuxiaohei
7d48f811f1 add issue router for new issue page ui preview 2014-09-27 19:03:07 +08:00
fuxiaohei
e3a27aeb25 template and ui fix 2014-09-27 17:31:44 +08:00
fuxiaohei
dccc50e9d4 template and ui fix 2014-09-27 17:08:57 +08:00
Unknwon
ad2ab6d214 Add modal to change username
Signed-off-by: Unknwon <joe2010xtmf@163.com>
2014-09-26 22:33:30 -04:00
Unknwon
b8368f98ff Add directory level commit message 2014-09-26 08:55:13 -04:00
无闻
3164354255 Merge pull request #503 from fundon/fix_lastcommit_user_email_link
Fix last commit user email link
2014-09-26 08:35:41 -04:00
fundon
54724c33ec no neet for md5 email 2014-09-26 13:46:51 +08:00
lunnyxiao
d1911658e1 remove debug info 2014-09-26 12:17:46 +08:00
无闻
c8b50975bc Merge pull request #501 from fundon/fix_suburl_undefined
bugfix, suburl defaults to empty string when suburl is undefined
2014-09-25 22:51:31 -04:00
Unknwon
10673417dc Mirror fix on transfer repo 2014-09-25 22:42:31 -04:00
Unknwon
ad52b2d791 Mirror fix on transfer repo 2014-09-25 22:36:07 -04:00
fundon
09c3c4e70c bugfix, suburl defaults to empty string when suburl is undefined 2014-09-26 10:29:57 +08:00
Unknwon
977779cdcf Mirror template bug fix 2014-09-25 20:55:14 -04:00
Unknwon
71e4689d11 Page: User profile 2014-09-25 19:33:39 -04:00
Unknwon
f69761563b Fix bug on transfer repo 2014-09-25 16:36:19 -04:00
无闻
57d48fb6a2 Merge pull request #498 from cedricziel/translations
[TASK] Refine german string for authentification source
2014-09-25 15:11:33 -04:00
fuxiaohei
7c30ae7002 is utils improvement 2014-09-25 21:52:58 +08:00
lunnyxiao
089d934547 add action repousername for transfer 2014-09-25 16:43:14 +08:00
Cedric Ziel
b0f8b1147c [TASK] Refine german string for authentification source 2014-09-25 09:16:43 +02:00
Unknwon
25268577a5 Fix download archive issue 2014-09-24 17:43:33 -04:00
lunnyxiao
612fdb98df bug fixed for download 404 from repo's home page 2014-09-24 21:05:09 +08:00
Unknwon
bd55b78775 Page: Commits and fix #249 2014-09-23 23:18:14 -04:00
Unknwon
5bbeeb0f1b Page: Commits and fix #249 2014-09-23 15:30:04 -04:00
Unknwon
93ee0838eb Page: Repository home page 2014-09-23 13:51:10 -04:00
Unknwon
a1109e6fbc Page: Repository home page 2014-09-23 13:47:54 -04:00
Unknwon
ebb05475ed Fix #495 and cannot view repository by tag 2014-09-23 13:06:25 -04:00
fuxiaohei
a11ed51bbb resize star font size 2014-09-24 00:01:48 +08:00
fuxiaohei
e0493259a6 resize star font size 2014-09-23 23:59:44 +08:00
fuxiaohei
b3f0d25ce5 pull request ui review, change sidebar 2014-09-23 23:48:28 +08:00
fuxiaohei
d750d53422 Merge remote-tracking branch 'origin/dev' into dev 2014-09-23 23:36:25 +08:00
fuxiaohei
8d5a4cc9eb pull request ui review, change sidebar 2014-09-23 23:36:09 +08:00
Unknwon
1476a1a729 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-09-23 10:29:52 -04:00
Unknwon
e3eea745f4 UI fix 2014-09-23 10:29:48 -04:00
fuxiaohei
60c65415dd pull request page ui review, upgrade octicon icons 2014-09-23 22:28:03 +08:00
无闻
b92cac7038 Merge pull request #496 from domnikl/patch-1
fixed typos and English phrases in German translation
2014-09-23 09:56:26 -04:00
fuxiaohei
904f799c1a improve ui details 2014-09-23 21:43:45 +08:00
Dominik Liebler
de2a4f8f83 fixed typos and English phrases
fixed Typo "Hilef"
2014-09-23 13:15:52 +02:00
Unknwon
135d3733b3 Feature: Integrate crypto/tls/generate_cert.go command 2014-09-22 17:30:58 -04:00
Unknwon
3f707b3f32 Add basic submodule support 2014-09-22 17:01:19 -04:00
Unknwon
063aacd436 UI: Use tooltip not alert when copy clone URL 2014-09-22 14:47:47 -04:00
Unknwon
196efecaaa Fix #491 2014-09-22 11:04:46 -04:00
无闻
01e69af2c8 Merge pull request #494 from compressed/gt_2_commits
Increase max commits in payload to 5
2014-09-22 10:29:23 -04:00
Christopher Brickley
25c8d01676 increase max commits in payload to 5 2014-09-22 08:25:39 -04:00
lunnyxiao
7df60af60e submodule support and closed #478 2014-09-22 14:23:36 +08:00
lunnyxiao
79ec08141a Merge branch 'dev' of github.com:gogits/gogs into dev 2014-09-22 10:45:20 +08:00
lunnyxiao
150eef93b2 add submodule basic support & buf fixed #478 2014-09-22 10:43:16 +08:00
Unknwon
1273b3d3a9 Support custom robots.txt 2014-09-21 19:39:10 -04:00
Unknwon
b72d7c201a Mirror bug fix 2014-09-21 12:22:50 -04:00
Unknwon
4a01bb8fa4 Mirror bug fix 2014-09-21 12:19:50 -04:00
无闻
d325b23dbb Merge pull request #492 from chadoe/suburlcookie
Set cookiepath to AppSubUrl
2014-09-21 12:11:40 -04:00
Martin van Beurden
976f1486e0 Set cookiepath to AppSubUrl 2014-09-21 14:25:22 +02:00
无闻
cb0ea46d1e Merge pull request #490 from fanningert/patch-1
Update locale_de-DE.ini
2014-09-20 12:23:36 -04:00
fanningert
052ab30409 Update locale_de-DE.ini 2014-09-20 11:01:05 +02:00
Unknwon
7ba9257a7f Add suburl support 2014-09-19 20:11:34 -04:00
无闻
6a7bd097fe Merge pull request #463 from chadoe/urlroot
Allow Gogs to run from a suburl behind a reverse proxy.
2014-09-19 19:02:40 -04:00
Martin van Beurden
0055cbd365 Allow Gogs to run from a suburl behind a reverse proxy. e.g. http://mydomain.com/gogs/
Conflicts:
	modules/setting/setting.go

Conflicts:
	templates/repo/release/list.tmpl
	templates/user/dashboard/dashboard.tmpl

Conflicts:
	routers/repo/setting.go
2014-09-18 20:50:48 +02:00
无闻
4f74b4e657 Merge pull request #483 from pkgr/dev
Add new distributions on https://packager.io/gh/pkgr/gogs
2014-09-18 12:21:00 -04:00
Cyril Rohr
31d763bc1f Add new distributions on https://packager.io/gh/pkgr/gogs
* ubuntu 12.04
* debian 7
2014-09-18 13:56:44 +00:00
Unknwon
a596388ebf Add success message after transfer repository #481 2014-09-17 14:52:46 -04:00
Unknwon
8a09256941 Mirror fix and fix #481 2014-09-17 14:22:51 -04:00
无闻
c03f5a2c7c Merge pull request #480 from compressed/correct_push_user
clarify name/username/owner/pusher for webhook
2014-09-17 14:13:54 -04:00
Christopher Brickley
f94d7c3f51 clarify name/username/owner/pusher for webhook 2014-09-17 09:20:14 -04:00
lunnyxiao
061a879cea Merge branch 'dev' of github.com:gogits/gogs into dev
Conflicts:
	conf/app.ini
2014-09-17 12:04:18 +08:00
lunnyxiao
ed84adb679 toutf8 improved & add max git diff lines 2014-09-17 12:03:03 +08:00
无闻
9f015b4c73 Merge pull request #479 from quux/dev
French translation
2014-09-16 21:25:57 -04:00
Philippe Barsalou
bc3abb397f typos 2014-09-16 20:58:17 -04:00
Philippe Barsalou
9e10304ab2 started french localization 2014-09-16 20:58:17 -04:00
Unknwon
ae3639868e Quick fix on #476 2014-09-16 20:58:06 -04:00
无闻
d082e821a0 Merge pull request #477 from fanningert/dev
Intial commit for systemd support
2014-09-16 14:21:37 -04:00
Thomas Fanninger
78bd144c1c Intial commit for systemd support 2014-09-16 20:10:21 +02:00
Unknown
ebb4f1b78c Work #475 and #458 2014-09-16 13:34:09 -04:00
Unknwon
62f21ff3ed Work on #476 2014-09-16 11:29:53 -04:00
Unknwon
0d9c41be7d Work on #476 2014-09-16 10:10:33 -04:00
Unknwon
c1ceec45da Fix mirror UI style and work on #475 2014-09-16 08:32:13 -04:00
Unknwon
b162e565b3 Merge branch 'master' of github.com:gogits/gogs into dev 2014-09-16 08:04:29 -04:00
无闻
6516ecaa51 Merge pull request #473 from j100002ben/master
Fix TimeSince arguments error.
2014-09-16 07:35:33 -04:00
无闻
5163d368e3 Merge pull request #474 from tobyzxj/dev
fix user's actions on domain/org/name-of-organization/dashboard
2014-09-16 07:29:03 -04:00
tobyzxj
ad041167f7 fix user's actions on domain/org/name-of-organization/dashboard 2014-09-16 16:20:32 +08:00
Benjamin Peng
cff3ca23a5 Fix TimeSince arguments error. 2014-09-16 15:55:41 +08:00
Unknwon
41386fa91a Fix UI 2014-09-15 22:35:05 -04:00
Unknwon
ea309acdb2 Fix #468 2014-09-15 17:23:58 -04:00
Unknwon
0f037b430a Fix #464 2014-09-15 10:09:17 -04:00
Unknwon
632b1b694d Fix #465 2014-09-15 09:56:12 -04:00
Unknwon
efb68a0a96 Fix UI issue 2014-09-14 19:22:52 -04:00
Unknwon
7027ac9308 Fix #461 2014-09-14 16:43:22 -04:00
Unknwon
b9560374cd UI fix 2014-09-13 22:12:11 -04:00
Unknwon
a5926f2689 add missing style 2014-09-13 15:07:09 -04:00
无闻
f1304bde34 Merge pull request #460 from 4d47/rm-app-logo
Remove APP_LOGO setting
2014-09-13 14:08:19 -04:00
Mathieu Gagnon
3549fb0ea8 Remove APP_LOGO setting 2014-09-13 03:52:51 -04:00
Unknwon
a2cac952a4 Prepare 0.5 release 2014-09-12 21:36:26 -04:00
Unknwon
bba401a5dc Prepare 0.5 release 2014-09-12 19:42:11 -04:00
Unknwon
1b7adf57e9 fix https://github.com/go-xorm/xorm/issues/161 2014-09-12 18:58:24 -04:00
Unknwon
cfed11f092 Bug: Transfer repository doesn't update the count 2014-09-12 18:29:58 -04:00
lunnyxiao
f67c59135f build script fixed 2014-09-12 14:45:38 +08:00
Unknwon
fdc8c34258 Fix clone panel z-index 2014-09-10 11:32:14 -04:00
无闻
18a80b291b Merge pull request #456 from compressed/send_hook_immediately
Deliver hooks immediately after commit
2014-09-10 09:36:12 -04:00
Christopher Brickley
52d15ddec8 deliver hooks immediately after commit 2014-09-10 08:57:11 -04:00
Unknwon
2a3660dae3 Fix #453 2014-09-09 18:19:57 -04:00
无闻
09ca5d125a Merge pull request #455 from pkgr/pkgr-dev
Make Gogs packageable with https://packager.io
2014-09-09 16:53:31 -04:00
Cyril Rohr
27cb01cd5f Move into packager folder 2014-09-09 20:29:39 +00:00
Cyril Rohr
7fe61558f6 Make Gogs packageable with https://packager.io 2014-09-09 18:31:32 +00:00
Unknwon
33659ed9a5 Fix #452 2014-09-09 10:17:35 -04:00
无闻
e004ec08e9 Merge pull request #451 from compressed/hook_task_upd
update specific hook_task, not all
2014-09-09 09:09:22 -04:00
Christopher Brickley
132590fab8 update specific hook_task, not all 2014-09-09 08:37:34 -04:00
lunnyxiao
e21d8a7d35 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-09-08 12:11:48 +08:00
lunnyxiao
d84d6dfdae add showinfo for xorm 2014-09-08 12:11:25 +08:00
无闻
b92384020c Merge pull request #435 from tstorch/translation-update
Small German update
2014-09-07 23:53:59 -04:00
Unknwon
d89e630bc0 Fix test cases 2014-09-07 20:11:13 -04:00
Unknwon
59a7c7c5a5 Remove ldap dep 2014-09-07 20:04:47 -04:00
Unknwon
25d6ae69d1 Remove hg dep 2014-09-07 19:58:01 -04:00
Unknwon
f8977f4847 Organization level webhooks 2014-09-07 19:39:26 -04:00
无闻
e79e4b1580 Merge pull request #442 from compressed/org_hook
Organization-level Webhooks
2014-09-07 19:30:51 -04:00
无闻
40bc130b19 Merge pull request #447 from m0sth8/fix-milestone-render-markdown
Render milestone content as markdown
2014-09-07 19:19:10 -04:00
Unknwon
0ddb1eb769 Finish new install page, almost ready for 0.5 release 2014-09-07 19:02:58 -04:00
Unknwon
ab7206d6b7 Fix #348 2014-09-05 17:28:09 -04:00
Christopher Brickley
f7be61c819 getOrgRepoCtx returns values directly & err 2014-09-05 07:19:34 -04:00
Christopher Brickley
85c35a6b8b add organization-level webhooks 2014-09-05 07:19:34 -04:00
Christopher Brickley
7269b06fd5 HookType is case-sensitive
Update webhook wasn’t showing up because of the wrong case
2014-09-05 07:19:34 -04:00
Christopher Brickley
8d2fe064c5 modify grammar undo -> undone 2014-09-05 07:19:33 -04:00
Vyacheslav Bakhmutov
6498fce04b Render milestone content as markdown 2014-09-05 09:10:58 +07:00
无闻
033a7f0224 Merge pull request #446 from m0sth8/fix-milestone-content-size
Set milestone content field to TEXT orm type
2014-09-04 21:55:17 -04:00
Vyacheslav Bakhmutov
31d8011843 Set milestone content field to TEXT orm type 2014-09-05 08:10:41 +07:00
无闻
d8290c9bac Merge pull request #444 from tstorch/database-cleanup
Code dedoublication in models/models.go
2014-09-04 11:38:35 -04:00
Tristan Storch
bdfdf3cacb Code dedoublication in models/models.go
Just some code dedoublication in models/models.go
2014-09-04 17:19:26 +02:00
Lunny Xiao
8db8771be7 Merge pull request #441 from tstorch/git-setup
Standard git user.name and user.email if not set
2014-09-04 22:55:05 +08:00
Tristan Storch
9fc4ded369 Standard git user.name and user.email if not set
Git user.name and user.email will now be set to the standard values

  - Gogs
  - gogitservice@gmail.com

if user.name is not set or empty.

If user.name is set and user.email not, it will leave it this way.
2014-09-04 12:07:09 +02:00
无闻
881ee6a4df Merge pull request #440 from deringer/dev
Correct loading of font-awesome styles from CDN
2014-09-03 21:40:33 -04:00
Michael Dyrynda
aee46bac01 add rel attribute such that font-awesome icons load correctly 2014-09-04 09:12:51 +09:30
无闻
714de0a3af Merge pull request #437 from tstorch/docker-update
Use variables, when the're there
2014-09-03 14:11:45 -04:00
Tristan Storch
863a4d5bc4 Use variables, when the're there
Why not use the environment variables, when they are there...
2014-09-03 18:44:15 +02:00
无闻
f36f9e07b7 Merge pull request #436 from tstorch/docker-update
docker dev block update
2014-09-03 11:35:59 -04:00
Tristan Storch
7df0794e14 docker dev block update
The dev Dockerfile now works without superfluous go get calls.
At this point the -u option is really not what we want.
2014-09-03 17:12:38 +02:00
Tristan Storch
000b906259 Small German update
Cleaning up a misunderstanding I had.
2014-09-03 16:58:23 +02:00
无闻
87b442433c Merge pull request #432 from deringer/dev
Add handling to branch switcher label to make label more consistent with
2014-09-03 10:33:08 -04:00
无闻
097f1b5759 Merge pull request #426 from m0sth8/fix-milestone-assignee
Take params for milestone and assignee from query instead of path args
2014-09-03 09:02:47 -04:00
Michael Dyrynda
dcb10a41d4 Add handling to branch switcher label to make label more consistent with
GitHub behaviour

Addresses #431
2014-09-03 10:01:32 +09:30
Vyacheslav Bakhmutov
2a7a03e5b3 take params for milestone and assignee from query instead of path args 2014-09-03 00:04:22 +07:00
Unknwon
05a33107c9 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-09-02 13:01:09 -04:00
Unknwon
8b0e815d98 Fix #425 2014-09-02 13:01:02 -04:00
无闻
f19fc230d4 Merge pull request #423 from m0sth8/fix-xcsrf-token
Set headers in js and go files to X-Csrf-Token
2014-09-02 12:30:44 -04:00
Vyacheslav Bakhmutov
9476e58de9 Set headers in js and go files to X-Csrf-Token 2014-09-02 22:48:40 +07:00
无闻
9ddd545473 Merge pull request #421 from arpemedia/dev
Fix grammar error in German translation
2014-09-02 10:49:53 -04:00
Arpemedia
0730ec4087 Fix grammar error in German translation 2014-09-02 13:46:18 +02:00
Unknwon
8826186c30 Merge branch 'master' of github.com:gogits/gogs into dev 2014-09-02 07:18:01 -04:00
无闻
565974f8f7 Merge pull request #420 from gogits/revert-419-master
Revert "Fix a gramma error and translate two additional strings (German ...
2014-09-02 07:15:35 -04:00
无闻
399887cc0e Revert "Fix a gramma error and translate two additional strings (German translation)" 2014-09-02 07:13:13 -04:00
无闻
fd5ea4b79e Merge pull request #419 from arpemedia/master
Fix a gramma error and translate two additional strings (German translation)
2014-09-02 07:13:09 -04:00
Unknwon
830efc90da update docs and mirror bug fix 2014-09-02 07:11:39 -04:00
Arpemedia
8e0aeb4ad5 Fix a gramma error and translate two additional strings 2014-09-02 09:20:39 +02:00
lunnyxiao
c80f0232f1 Merge branch 'master' into dev 2014-09-02 11:59:39 +08:00
lunnyxiao
1240fef0ca bug fixed for migrate and fixed #141 2014-09-02 11:57:06 +08:00
无闻
85f375433d Merge pull request #416 from compressed/compare_commits
Add commit compare functionality
2014-09-01 20:02:34 -07:00
Christopher Brickley
af0741da07 handle initial commit for compareUrl 2014-09-01 19:19:56 -04:00
Christopher Brickley
00a864e693 add commit compare functionality 2014-09-01 14:56:19 -04:00
无闻
d55c5b9e28 Merge pull request #410 from tstorch/docker_mix_match
Docker mix and match setup
2014-09-01 10:53:51 +08:00
无闻
bc67c34bea Merge pull request #409 from tstorch/translation-03
German laguage update
2014-09-01 10:53:18 +08:00
Tristan Storch
d1a2228f1c Docker mix and match setup
Rewrite of the docker setup. Now uses fig to manage containers and container
linkage. The base is a block based mix and match, which will give you the
possibility to easily test all configurations.
2014-08-31 21:00:19 +02:00
Tristan Storch
7b310b1abb German laguage update
What has been done:

  - standardized expressions
  - shorter and clearer
  - minor corrections (orthography)
2014-08-31 19:29:03 +02:00
无闻
2886eb76b6 Merge pull request #408 from fanningert/patch-1
Add new translation keys
2014-09-01 00:50:52 +08:00
fanningert
1858d2066b Add new translation keys 2014-08-31 18:48:24 +02:00
无闻
3e740278bd Merge pull request #407 from fanningert/patch-3
Update locale_de-DE.ini and correct a wrong translation
2014-09-01 00:36:23 +08:00
无闻
9611f29966 Merge pull request #402 from fanningert/patch-2
Add missing dependencies
2014-09-01 00:34:06 +08:00
Unknwon
c5ce33047e Mirror fix and hide missing pages for 0.5 release 2014-09-01 00:33:40 +08:00
fanningert
da8dba53a7 Removed not needed deps
Removed
* github.com/gogits/cache
* github.com/gogits/session
2014-08-31 18:28:59 +02:00
Unknwon
bf5595f9a0 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-09-01 00:16:14 +08:00
无闻
1ed67798ac Merge pull request #379 from compressed/slack
Slack Support
2014-09-01 00:12:58 +08:00
Unknwon
36661f53e6 Update deps 2014-09-01 00:12:37 +08:00
fanningert
801fc536f2 Update locale_de-DE.ini 2014-08-31 18:05:26 +02:00
fanningert
99e009665c Update locale_de-DE.ini 2014-08-31 18:04:15 +02:00
fanningert
72ec3e8da0 Update locale_de-DE.ini 2014-08-31 18:03:28 +02:00
Christopher Brickley
2bce24068d add Slack API webhook support 2014-08-31 12:01:59 -04:00
fanningert
9554ad514e Change "Repositories" to "Repositorys" 2014-08-31 17:59:22 +02:00
fanningert
df3621e050 Update locale_de-DE.ini and correct a wrong translation 2014-08-31 17:30:53 +02:00
无闻
5e6091a30a Merge pull request #405 from fanningert/patch-1
Update german translation with PR #404
2014-08-31 22:10:54 +08:00
fanningert
80447f1168 Update german translation with PR #404 2014-08-31 16:10:02 +02:00
无闻
bc1a578914 Merge pull request #401 from fanningert/patch-1
Update locale_de-DE.ini
2014-08-31 22:06:05 +08:00
fanningert
cc9a84b83a Add missing dependencies 2014-08-31 15:21:56 +02:00
fanningert
c30063eefb Update locale_de-DE.ini 2014-08-31 15:18:29 +02:00
无闻
ae2f4866d0 Merge pull request #400 from deringer/dev
Add missing 'new migration' link
2014-08-31 21:07:14 +08:00
Unknwon
676bd764fa UI: SSH/HTTPS address switch and copy 2014-08-31 21:03:16 +08:00
Michael Dyrynda
1bbf4c9768 Add missing 'new migration' link
Addresses issue #399
2014-08-31 21:06:50 +09:30
Unknwon
7e36bf448d Merge branch 'master' of github.com:gogits/gogs into dev
Conflicts:
	dockerfiles/README.md
2014-08-31 15:11:55 +08:00
无闻
d78008b546 Merge pull request #396 from fanningert/patch-1
Update locale_zh-CN.ini
2014-08-31 11:30:13 +08:00
无闻
1d6df04ecb Merge pull request #397 from fanningert/patch-2
Update locale_en-US.ini
2014-08-31 11:30:02 +08:00
无闻
084dce53ac Merge pull request #398 from fanningert/patch-3
Update locale_de-DE.ini
2014-08-31 11:28:13 +08:00
fanningert
5cdecd74c7 Update locale_de-DE.ini 2014-08-30 22:29:23 +02:00
fanningert
85e01bfe01 Update locale_en-US.ini
Double entry of "config.log_config"
2014-08-30 22:28:43 +02:00
fanningert
73ddf401ee Update locale_zh-CN.ini
Double entry of "config.log_config"
2014-08-30 22:28:03 +02:00
无闻
4c8ef90157 Merge pull request #394 from tstorch/trailing_white_spaces
Removed trailing white spaces
2014-08-30 06:37:04 -07:00
Tristan Storch
69e332f432 Removed trailing white spaces
Removed trailing whitespaces with

```sh
for file in `grep -r " $" * | cut -d : -f 1 | sort | uniq | grep -v " "`; do sed -i 's/[ \t]*$//' $file; done
```

and some handwork.
2014-08-30 15:12:53 +02:00
Unknwon
9bc63bda7d Finish all new admin pages. 2014-08-30 20:49:51 +08:00
无闻
66d51804c9 Merge pull request #391 from fanningert/patch-1
Update locale_en-US.ini
2014-08-30 04:30:35 -07:00
无闻
444032664b Merge pull request #392 from fanningert/patch-2
Update locale_de-DE.ini
2014-08-30 04:30:20 -07:00
fanningert
272d387c0c Update locale_de-DE.ini 2014-08-30 12:48:14 +02:00
fanningert
32760ba49d Update locale_en-US.ini 2014-08-30 12:47:51 +02:00
无闻
08dbf08d39 Merge pull request #386 from fanningert/patch-2
Update locale_de-DE.ini
2014-08-29 05:53:48 -07:00
Unknwon
d2aff9a46a Continue working on new admin pages 2014-08-29 20:50:43 +08:00
fanningert
56b735f67b Update locale_de-DE.ini
Add missing translation keys and add some german translations
2014-08-29 14:25:29 +02:00
Unknwon
904bf1a50b Add migrate repo API 2014-08-29 17:31:53 +08:00
Unknwon
8829174574 Finish new admin users pages 2014-08-29 15:32:52 +08:00
无闻
6558990e3a Merge pull request #384 from fanningert/patch-1
Update locale_de-DE.ini
2014-08-28 20:56:42 -07:00
lunnyxiao
a6ec6def8d Merge branch 'dev' of github.com:gogits/gogs into dev 2014-08-29 11:25:03 +08:00
lunnyxiao
c40e815763 add migrate api 2014-08-29 11:24:37 +08:00
fanningert
c4a33892d3 Update locale_de-DE.ini
Add missing translation of "locale_en-US.ini"
2014-08-28 19:12:30 +02:00
Unknwon
1aec1a2dda Finish new admin dashboard 2014-08-28 22:29:00 +08:00
Unknwon
81287ba022 Mirror issue fix 2014-08-27 22:40:45 +08:00
Unknwon
9baf2b38d0 Bug fix on organization 2014-08-27 16:39:36 +08:00
Unknwon
50de06056b Merge branch 'dev' of github.com:gogits/gogs into dev 2014-08-26 18:11:27 +08:00
Unknwon
74b31566cf Finsih add/remove repo in organization 2014-08-26 18:11:15 +08:00
无闻
66c9c86219 Merge pull request #371 from m0sth8/bufix_migrate_all_branches
Migrate all branches and tags
2014-08-25 19:38:41 -07:00
无闻
ce55807542 Merge pull request #372 from andmarios/dev
Remove newline characters from ssh key before processing it.
2014-08-25 19:13:58 -07:00
Marios Andreopoulos
510d5a5d74 import strings 2014-08-25 21:07:08 +03:00
Marios Andreopoulos
cd0ddcfa01 fix typo 2014-08-25 20:35:23 +03:00
Marios Andreopoulos
3d79f59671 fix wrong variable name 2014-08-25 20:20:44 +03:00
Marios Andreopoulos
b40922f4d4 remove extra comma 2014-08-25 20:07:47 +03:00
Marios Andreopoulos
12639c577f Remove newline characters from ssh key before processing it.
Fixes issue #370: https://github.com/gogits/gogs/issues/370
2014-08-25 18:54:50 +03:00
Vyacheslav Bakhmutov
95a594d75a Migrate all branches and tags 2014-08-25 20:28:14 +07:00
Unknwon
f2c263c54f fix #367 2014-08-25 09:45:39 +08:00
Unknwon
21a1b8e5a3 Finish new edit team page, add member to team 2014-08-24 21:09:05 +08:00
Lunny Xiao
03c6a395aa Merge pull request #365 from choas/patch-1
update dockerfiles README.md
2014-08-24 20:42:50 +08:00
Lars Gregori
1661421a65 update dockerfiles README.md
typo
2014-08-24 12:39:01 +02:00
Unknwon
e325c8499a Fix and set git config 2014-08-23 23:58:56 +08:00
Unknwon
97a373f5e7 Fix #362, update code with upstream 2014-08-23 21:13:55 +08:00
Unknwon
b765229a6d Fix code style 2014-08-23 20:30:29 +08:00
Unknwon
e0a2d23baf Merge branch 'dev' of github.com:gogits/gogs into dev 2014-08-23 20:24:31 +08:00
Unknwon
fa60502a70 Working on organization pages 2014-08-23 20:24:02 +08:00
lunnyxiao
97fb62f51e auto detect text file encode and convert to utf8 2014-08-20 16:34:48 +08:00
Unknwon
a60edbe88c Add/remove member need add/remove access to repositories as well 2014-08-16 16:58:32 +08:00
Unknwon
bba707de36 Finish team list, create new team, join/leave team page 2014-08-16 16:21:17 +08:00
Unknwon
78add502d7 Finish new organization members and invitation page 2014-08-15 23:37:33 +08:00
Unknwon
36b4c57ff1 Finish new organization members and invitation page 2014-08-15 18:29:41 +08:00
无闻
3e32b14ad4 Merge pull request #359 from fanningert/dev
Correct some type issues in the English translation and update the German translation
2014-08-14 15:56:25 -07:00
fanningert
202a29a475 Correct type issue in locale_en-US.ini 2014-08-14 21:56:56 +02:00
fanningert
352d8943e4 German translation updated 2014-08-14 21:54:11 +02:00
fanningert
ccc20f7c70 Correct type issue in locale_en-US.ini 2014-08-14 21:52:01 +02:00
无闻
5fbf27bb07 Merge pull request #358 from fanningert/dev
Correct some type issues in the english locale file
2014-08-14 06:36:31 -07:00
fanningert
d0dd90958a Initial release of german translation 2014-08-14 10:55:07 +02:00
fanningert
ba8b6f5d78 Correct some type issues 2014-08-14 10:53:08 +02:00
fanningert
872cd0d3bd Correct some type issues 2014-08-14 10:51:55 +02:00
Unknwon
5acc948562 Page: /org/:orgname/settings 2014-08-14 14:12:21 +08:00
无闻
2935ee440c Merge pull request #357 from rojaro/patch-1
Update locale_en-US.ini
2014-08-14 09:17:47 +08:00
rojaro
371372d65d Update locale_en-US.ini
Fixed typo
2014-08-13 11:24:24 +02:00
Unknwon
5fbf8531e6 Finish new home page of organization 2014-08-10 20:11:18 -07:00
Unknwon
7af7584d25 Finish new reset password, etc. 2014-08-09 21:02:00 -07:00
Unknwon
5605af973b Feature: Social sign in 2014-08-09 18:01:29 -07:00
Unknwon
78defd238c Page: Manage social accounts 2014-08-09 17:25:02 -07:00
Unknwon
08c6d07aad UI: Bare repository does not have visual link to settings page 2014-08-09 15:50:06 -07:00
Unknwon
9a1d5d2489 Finish new web hook pages 2014-08-09 15:40:10 -07:00
Unknwon
9820b8e134 Finish new hooks list page 2014-08-09 10:29:51 -07:00
lunnyxiao
7c7014262b Merge branch 'dev' of github.com:gogits/gogs into dev 2014-08-08 13:51:43 +08:00
lunnyxiao
57f6ec672a bug fixed 2014-08-08 13:51:02 +08:00
Unknwon
9d5c0c80a4 Mirror fix on #352 2014-08-07 06:45:29 -04:00
无闻
e527c9b330 Merge pull request #352 from DerDackel/ssh-permissions
Ensure correct permissions on .ssh and authorized_keys file
2014-08-07 06:43:58 -04:00
Unknwon
e8c9bb2c66 Finish new collaboration page 2014-08-07 06:40:05 -04:00
Sebastian Jackel
0bfbefc38a Moved defer f.Close() up so there is no chance of returning without closing and handled an error on f.Chmod 2014-08-07 11:06:42 +02:00
Sebastian Jackel
51abaf788c Corrected log message 2014-08-07 10:34:37 +02:00
Sebastian Jackel
be7ce72ebe Make sure, .ssh directory and authorized_keys file are kept at correct permissions 2014-08-07 10:00:57 +02:00
Unknwon
99eeb08419 nowarp fix 2014-08-07 00:15:39 -04:00
Unknwon
a8e05fdf1b Use toolbox 2014-08-06 17:21:24 -04:00
Unknwon
6fc2107529 Add missing less files 2014-08-05 21:18:29 -04:00
Unknwon
fa0a389dc4 Fix bare repo bug 2014-08-05 19:40:01 -04:00
无闻
6f6fda1481 Merge pull request #347 from nuss-justin/dev
Fix wrong selector for AJAX issue creation.
2014-08-04 13:47:43 -04:00
无闻
5f84e8f4ff Merge pull request #346 from nuss-justin/vet
Fix invalid struct tags and remove unreachable code.
2014-08-04 13:46:23 -04:00
Justin Nuß
2cb754b5af Fix wrong selector for AJAX issue creation. 2014-08-04 11:02:29 +02:00
Justin Nuß
8023494a94 Fix invalid struct tags and remove unreachable code. 2014-08-04 10:37:57 +02:00
Unknwon
755eec745f Finish new repo settings page 2014-08-02 13:47:33 -04:00
Unknwon
669552e255 Fix #340 2014-08-01 06:12:14 -04:00
Unknwon
17d2675dd2 Fix #258 2014-08-01 05:20:33 -04:00
Unknwon
b95e78f7e6 Mirro fix on PR #311 2014-08-01 00:24:29 -04:00
无闻
568c9b353e Merge pull request #311 from nuss-justin/issue/281
Fix #281. Add mouse-over precise time and on-click switch listener.
2014-08-01 00:15:06 -04:00
Unknwon
dabf5b057c Finish new migrate page 2014-08-01 00:06:19 -04:00
Unknwon
7bbf644dd5 Convert captcha, cache, csrf as middlewares 2014-07-31 17:25:34 -04:00
Unknwon
3428baa3b5 Mirror fix on template 2014-07-30 10:02:31 -04:00
无闻
78672b9227 Merge pull request #338 from gogits/revert-335-patch-1
Revert "actually use SshPort variable"
2014-07-28 11:23:02 -04:00
无闻
8453ffb7ed Revert "actually use SshPort variable" 2014-07-28 11:22:53 -04:00
无闻
645c194a00 Merge pull request #336 from adelq/responsive-layouts
Avoid using fixed width in CSS for layouts
2014-07-28 06:27:33 -04:00
Adel Qalieh
d4cbbc864a Avoid using fixed width in CSS for layouts 2014-07-27 20:06:43 -04:00
无闻
b1185e121f Merge pull request #335 from taziden/patch-1
actually use SshPort variable
2014-07-27 18:38:07 -04:00
taziden
febaddfd1d actually use SshPort variable
SshPort is defined (SSH_PORT) but the value is not actually used (just compared to default port 22).
2014-07-27 20:32:41 +02:00
Unknwon
9813161411 Reser repo owner to organization when error occurs in repo create page, dashboard news feed page, create organization page 2014-07-26 23:53:16 -04:00
Unknwon
5e81383413 Git installation check, show image in single file view, show short SHA1 instead of 40-length string, complete log module 2014-07-26 18:37:18 -04:00
无闻
02a81ddb62 Merge pull request #332 from acusti/dev
Styling plus a couple small fixes for issue attachments (& misc cleanup)
2014-07-26 13:55:32 -04:00
无闻
27a51f5bcc Merge pull request #331 from nuss-justin/dev
Use :index instead of :issue in UpdateIssueMilestone
2014-07-26 13:54:05 -04:00
Justin Nuß
91480f3791 Merge branch 'dev' of https://github.com/gogits/Gogs into issue/281
Conflicts:
	modules/base/tool.go
2014-07-26 11:23:58 +02:00
Justin Nuß
7de3dd01de Use :index instead of :issue in UpdateIssueMilestone 2014-07-26 11:10:49 +02:00
Unknwon
35c75f06a0 Fix test case 2014-07-26 03:05:56 -04:00
Unknwon
545d320648 Docs fix 2014-07-26 03:02:46 -04:00
Unknwon
5c4bc3c848 Huge updates!!!!! Be careful to merge!!!! 2014-07-26 02:28:04 -04:00
Unknwon
3f38ff6c09 Merge branch 'dev' of github.com:gogits/gogs into dev
Conflicts:
	templates/status/500.tmpl
2014-07-26 00:25:43 -04:00
Unknwon
8dd07c0ddd New UI merge in progress 2014-07-26 00:24:27 -04:00
无闻
76f7ad45e6 Merge pull request #329 from ciarand/feature/update-docs
Update the Docker instructions in the README
2014-07-26 00:21:28 -04:00
无闻
872590d8b5 Merge pull request #330 from ciarand/reword-language-on-error-pages
Reword the language on the error page templates
2014-07-26 00:21:07 -04:00
Ciaran Downey
7921e60f30 Change "an error is occurred" to "has occurred" 2014-07-25 20:51:05 -07:00
Ciaran Downey
0db84e4f63 Update the Docker instructions in the README 2014-07-25 20:13:17 -07:00
无闻
0a739cf9ac Merge pull request #325 from nuss-justin/dev
Remove 'None yet' message when adding first label to issue.
2014-07-25 20:58:31 -04:00
无闻
3e23241f58 Merge pull request #327 from ciarand/dev
Update the Docker build's Go source and version
2014-07-25 19:13:05 -04:00
Andrew Patton
6407caa761 Semicolons for consistency ;); 2014-07-25 17:51:41 -04:00
Andrew Patton
ef8eef7519 Trivial cleanup
using `event.preventDefault` instead of `return false` for being more
explicit
2014-07-25 17:51:18 -04:00
Andrew Patton
71cefc95ab Use console.log instead of breakpoint 2014-07-25 17:50:25 -04:00
Andrew Patton
957361d755 Fix typos 2014-07-25 17:50:03 -04:00
Andrew Patton
cd369b667f Fix “Submitting” state of Close issue input
If .btn-default isn’t removed, .btn-default and .btn-warning styles
conflict
2014-07-25 17:49:51 -04:00
Andrew Patton
ef430ae7ab Small whitespace cleanup 2014-07-25 17:48:26 -04:00
Andrew Patton
a447aecd95 Fix for erroneous Submitting mode on button
Click handler was also attaching to “Select Attachments” button, so
modified selector to grab #issue-reply-btn by ID and submit button
2014-07-25 17:47:01 -04:00
Ciaran Downey
aea2b54c99 Use the official Go source, follow redirects 2014-07-25 12:59:10 -07:00
Ciaran Downey
cf3021ecca Add the set -e option to dockerfiles/build.sh 2014-07-25 12:59:02 -07:00
Andrew Patton
c084a5ba73 Style finesse for “Attachments:” list in issues
Make `#attached-list` attachment labels wrap, make spacing more
consistent, add hover stats to `.attachment-remove` icon, adjust
padding of labels to compensate for `.attachment-remove` icon
2014-07-25 15:35:47 -04:00
无闻
5ed5912ef5 Merge pull request #326 from nuss-justin/feature/keep-text
Save comment/issue drafts in sessionStorage.
2014-07-25 15:05:45 -04:00
Justin Nuß
09cb8c67cb Save comment/issue drafts in sessionStorage. 2014-07-25 20:56:17 +02:00
Justin Nuß
a03a1e87e9 Remove 'None yet' message when adding first label to issue. 2014-07-25 20:15:58 +02:00
无闻
aad91d4b21 Merge pull request #324 from nuss-justin/issue/318
Fix #318. Issues attachments: allow Select Attachments to append files
2014-07-25 13:35:25 -04:00
Justin Nuß
f0da8a68c2 Remove debug comment. 2014-07-25 15:47:42 +02:00
Justin Nuß
12fb42de5a Fix IE bug and show errors. 2014-07-25 11:13:42 +02:00
Justin Nuß
4e2477a1a5 Fix #318. Switch to JS(ON) implementation for issue/comment creation. 2014-07-25 10:47:37 +02:00
Justin Nuß
f7617997ce Ignore EOF error when parsing form. 2014-07-25 10:18:42 +02:00
无闻
204ef41b09 Merge pull request #322 from nuss-justin/issue/321
Fix #321. Allow empty comments as long as there are attachments.
2014-07-25 02:41:22 -04:00
Justin Nuß
dedb156d4a Fix #321. Allow empty comments as long as there are attachments. 2014-07-25 08:01:34 +02:00
无闻
30d7397f97 Merge pull request #314 from nuss-justin/issue/312
Fix #312. Quote file names of attachments.
2014-07-25 01:14:33 -04:00
无闻
0f3414ec39 Merge pull request #315 from nuss-justin/issue/313
Fix #313. Repair broken image extension detection regex.
2014-07-25 01:14:02 -04:00
无闻
2032080d86 Merge pull request #320 from acusti/patch-2
Fix #319 (user not-logged in error)
2014-07-25 01:10:52 -04:00
Andrew Patton
8ccde45c5f Fix #319 (user not-logged in error) 2014-07-24 18:23:46 -04:00
Justin
eafa365453 Fix #313. Repair broken image extension detection regex. 2014-07-24 23:19:21 +02:00
Justin
ad7beb78d0 Fix #312. Quote file names of attachments. 2014-07-24 23:13:35 +02:00
Justin Nuß
835e85b5ce Fix #281. Add mouse-over precise time and on-click switch listener. 2014-07-24 22:31:59 +02:00
无闻
c4eeb803e1 Merge pull request #310 from nuss-justin/issue/303
Fix #303. Specify updated columns explicitly.
2014-07-24 15:26:04 -04:00
Justin Nuß
3e7e9ee289 Fix #303. Specify updated columns explicitly. 2014-07-24 20:07:07 +02:00
无闻
87855d42a0 Merge pull request #309 from nuss-justin/trello/244
[Trello#244] Mention all members of team by mention team name
2014-07-24 13:25:00 -04:00
Justin Nuß
620c0ef297 Merge branch 'dev' of https://github.com/gogits/Gogs into trello/244 2014-07-24 19:15:35 +02:00
Justin Nuß
cbcd08aa17 Mention organisation users when organisation gets mentioned 2014-07-24 19:15:31 +02:00
Unknwon
c20f5dc2ea Merge branch 'dev' of github.com:gogits/gogs into dev 2014-07-24 12:49:43 -04:00
Unknwon
a41a1fe60d Mirror fix 2014-07-24 12:49:40 -04:00
无闻
da0240aacd Merge pull request #307 from nuss-justin/feature/attachments
Feature: Ability to attach files to issues (attachments)
2014-07-24 12:47:55 -04:00
Justin Nuß
9a7349ce64 Change Attachment.Path to TEXT (no maximum size) 2014-07-24 17:02:42 +02:00
Justin Nuß
4d702eb345 Allow disabling uploads 2014-07-24 15:51:40 +02:00
Justin Nuß
9df99681fb Update default config with comments 2014-07-24 15:23:56 +02:00
Justin Nuß
bfe5b86004 Add file upload for attachments 2014-07-24 15:19:59 +02:00
无闻
3db84c8893 Merge pull request #306 from nuss-justin/dev
Fix double decrement of issue counter
2014-07-24 08:21:28 -04:00
Justin Nuß
70b0023b82 Fix double decrement of issue counter 2014-07-24 13:58:39 +02:00
Justin Nuß
43e5de7f83 Show attachments in issues/comments and add preview for images 2014-07-24 13:50:03 +02:00
Justin Nuß
fa1db64ff0 Add files/ directory to .gitignore 2014-07-24 13:49:27 +02:00
Justin Nuß
ef1cbcd761 Allow admins to delete attachments. 2014-07-24 12:39:03 +02:00
Justin Nuß
1129f756c8 Fix missing . (dot) in issue templates 2014-07-24 12:37:26 +02:00
Justin Nuß
967856f36e Merge branch 'dev' into feature/attachments
Conflicts:
	models/issue.go
	routers/repo/issue.go
2014-07-24 12:29:37 +02:00
无闻
a76a948a02 Merge pull request #305 from nuss-justin/feature/commit-issue-fix
Fix #302. Show referencing commits in issue.
2014-07-24 04:25:00 -04:00
Justin Nuß
d43c5895bc Update template and style, only close commit if commit is in same repository 2014-07-24 10:15:05 +02:00
Justin Nuß
3c025b3950 Add delete route for attachments, remove upload buttons from issues/comments 2014-07-24 09:05:15 +02:00
Justin Nuß
34304e6a0c WIP: Allow attachments for issues, not only comments 2014-07-23 21:24:24 +02:00
Justin Nuß
4617bef895 WIP: Allow attachments for comments 2014-07-23 21:15:47 +02:00
Justin Nuß
c850c01007 Update closed issues stats for repository 2014-07-23 13:54:46 +02:00
Justin Nuß
469cbc8813 Update progress of milestones when closing/reopening issues and allow closing of issues in commit messages 2014-07-23 13:48:06 +02:00
无闻
6e9f1c52b1 Merge pull request #301 from nuss-justin/bugfix/milestone-counter
Update milestone issue stats when reopening/closing issue
2014-07-22 16:46:20 -04:00
Justin Nuß
812f71e21b Update milestone issue stats when reopening/closing issue 2014-07-22 22:35:59 +02:00
无闻
94b100ce43 Merge pull request #299 from nuss-justin/issue/216
Fix #216. Change milestones, labels and assigne without reloading the page
2014-07-22 16:24:16 -04:00
无闻
40557a4f79 Merge pull request #298 from nuss-justin/issue/278
Fix issue #278. Fall back to (default) branch for context data, if no branch selected
2014-07-22 16:23:00 -04:00
无闻
8e4debe99d Merge pull request #297 from nuss-justin/issue/288
Fix issue #288. Only show label form if repository collaborator/admin
2014-07-22 16:13:22 -04:00
无闻
dc2e140360 Merge pull request #296 from nuss-justin/dev
Fix issue 280 & unwatch button in Firefox
2014-07-22 16:03:58 -04:00
无闻
5bbd5be0ca Merge pull request #300 from nuss-justin/issue/259
Fix issue #259. Allow links in the repository description
2014-07-22 15:48:05 -04:00
Justin Nuß
0d06c7e5f2 Prevent panic when dividing through zero 2014-07-22 20:57:48 +02:00
Justin Nuß
636a78fed1 Escape tags and quotes in links. 2014-07-22 20:08:04 +02:00
Justin Nuß
e194cf3291 Fix issue #259. Allow links in the repository description 2014-07-22 19:52:37 +02:00
Justin Nuß
ed73af6fa1 Fix #216. Change milestones, labels and assigne without reloading the page 2014-07-22 15:46:15 +02:00
Justin Nuß
267870537d Fix issue #278. Fall back to (default) branch for context data, if no branch selected 2014-07-22 14:46:04 +02:00
Justin Nuß
ccca60a5a1 Fix issue #288. Only show label form if repository collaborator/admin 2014-07-22 14:20:32 +02:00
Justin Nuß
ec26b78d3c Fix issue #280. Update milestone counter when creating an issue 2014-07-22 13:50:34 +02:00
Justin Nuß
18718afb36 Hide watch/unwatch button if not loggedin 2014-07-22 11:57:10 +02:00
Justin Nuß
0b4fcf1224 Fix unwatch button not working in Firefox 2014-07-22 11:56:08 +02:00
无闻
dcb252eff4 Merge pull request #294 from ecnahc515/patch-2
Remove apt-get cleanup from Dockerfile
2014-07-21 23:23:37 -04:00
Chance Zibolski
78103f1df3 Remove apt-get cleanup from Dockerfile
Purging/cleaning packages using apt doesn't actually reduce image size, and only creates additional layers, which doesn't add any benefit to the overall image.
2014-07-21 20:20:35 -07:00
无闻
536f65b8ad Merge pull request #293 from wmark/master
Enable users to upload other key types than RSA (+ ED25519, ECDSA, NTRU, McE)
2014-07-20 21:05:27 -04:00
W-Mark Kubacki
887ad1ec8b Utilize ssh-keygen for checking of keys.
Removes the limitation to RSA and enables us to use all key types
SSH recognizes.
2014-07-20 18:56:07 +02:00
无闻
aab2dbc505 Merge pull request #291 from gima/dev
Make possible for administrators to change user's password (fix proposal...
2014-07-18 01:05:19 -04:00
gima
5a97cc69ed Make possible for administrators to change user's password (fix proposal for #290) 2014-07-18 05:30:57 +03:00
Lunny Xiao
6418caf23a add build script 2014-07-16 09:48:19 +08:00
codeskyblue
9a3e1790a1 update start.sh in order to compatible with supervisor 2014-07-15 10:20:05 +08:00
Unknown
3969d704a0 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-07-12 00:55:35 -04:00
Unknown
0f907301b7 Fix #285 2014-07-12 00:55:19 -04:00
无闻
590f9e599c Merge pull request #284 from compressed/user_name
Only update access usernames where the username is changing
2014-07-11 21:49:50 -04:00
Christopher Brickley
63e47405b2 Only update access usernames where the username is changing #282 2014-07-11 20:57:00 -04:00
fuxiaohei
c127d84777 add organization team-single page 2014-07-07 18:13:42 +08:00
Unknown
63cc14062a Paging function for users and repositories 2014-07-07 04:15:08 -04:00
Unknown
7ffdabb28f Move debug router location 2014-07-06 18:25:07 -04:00
Unknown
9b014d05e4 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-07-06 17:32:39 -04:00
Unknown
097c8e05e6 Able to set timeout for process monitor 2014-07-06 17:32:36 -04:00
无闻
21088a40f5 Merge pull request #275 from nuss-justin/dev
Fix wrong method for profiling routes.
2014-07-05 15:02:31 -04:00
Justin
10f932b952 Fix wrong method for profiling routes. 2014-07-05 17:24:44 +02:00
Unknown
fd5412ec47 Work on #274 2014-07-04 22:43:39 -04:00
Lunny Xiao
baa255e899 remove debug info 2014-07-05 10:37:29 +08:00
Lunny Xiao
3c6da63216 bug fixed 2014-07-05 10:25:45 +08:00
Unknown
aed4271c8d Change martini.Static to custom Static function 2014-07-04 17:26:15 -04:00
Unknown
be8ac7fb75 fix #273 2014-07-04 16:48:36 -04:00
Unknown
7f3015b32b Merge branch 'dev' of github.com:gogits/gogs into dev 2014-07-04 14:44:31 -04:00
Unknown
13b032f829 update name 2014-07-04 14:44:27 -04:00
无闻
ae7f3eed78 Merge pull request #272 from nuss-justin/dev
Add 'pprof' tag for enabling debugging
2014-07-04 14:28:46 -04:00
Justin Nuß
a481672c5c Add 'pprof' tag for enabling debugging 2014-07-04 11:41:43 +02:00
Unknown
0820b24f0b Merge branch 'master' of github.com:gogits/gogs into dev 2014-07-04 01:25:19 -04:00
Unknown
36292060d6 Fix bug that collaborators are able to modify settings of repository 2014-07-04 01:25:06 -04:00
Unknown
cdffdeddc9 Fix bug that collaborators are able to modify settings of repository 2014-07-04 01:23:11 -04:00
Unknown
465dc962b5 Finish create organization team 2014-07-02 16:42:16 -04:00
无闻
3f42cb7c23 Merge pull request #267 from AntonioMeireles/master
fix typos in users' editing template.
2014-06-30 15:22:18 -04:00
António Meireles
3ad20773a2 fix typos in users' editing template. 2014-06-30 20:12:55 +01:00
Unknown
e57aebb316 Add uuid 2014-06-29 16:39:06 -04:00
Unknown
269da8fe7a Merge branch 'master' of github.com:gogits/gogs into dev 2014-06-29 16:32:28 -04:00
Unknown
e4ea5cf598 Finish Teams page 2014-06-29 16:30:41 -04:00
Lunny Xiao
be123588ce clear comments 2014-06-29 22:31:46 +08:00
Unknown
99713e1180 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-06-28 15:43:28 -04:00
Unknown
5dbfe3c26c Finish organization homepage 2014-06-28 15:43:25 -04:00
Lunny Xiao
1c46d68aba bug fixed for message tag 2014-06-28 23:56:41 +08:00
Lunny Xiao
4ce2fa520a Merge branch 'master' into dev 2014-06-28 15:00:38 +08:00
Lunny Xiao
a357cda957 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-06-28 15:00:32 +08:00
Lunny Xiao
54e17c7cca bug fixed #261 2014-06-28 15:00:03 +08:00
Lunny Xiao
86e2627175 Merge branch 'master' of github.com:gogits/gogs
Conflicts:
	models/update.go
	routers/repo/http.go
2014-06-28 14:58:59 +08:00
Lunny Xiao
e5ae41e21f bug fixed #261 2014-06-28 14:55:33 +08:00
Unknown
6e448b0714 Finish delete organization 2014-06-28 00:40:07 -04:00
Unknown
ee9b7f322f Clean code 2014-06-27 23:14:33 -04:00
Unknown
57ac15aa20 Merge branch 'master' of github.com:gogits/gogs into dev 2014-06-27 23:12:55 -04:00
Lunny Xiao
7dbeee94e3 bug fixed #236 2014-06-28 11:06:07 +08:00
fuxiaohei
1d55ecd29c add organization team-create page 2014-06-27 22:04:04 +08:00
fuxiaohei
b5ba2bd268 add organization team-create page 2014-06-27 21:33:49 +08:00
Unknown
19e9104289 Organization settings page 2014-06-27 03:37:01 -04:00
Lunny Xiao
165e3e8f18 path bug fixed 2014-06-26 21:39:27 +08:00
Unknown
32b09681b2 Migrate repository by organization 2014-06-25 05:35:23 -04:00
Unknown
8644c571db Mirror bug fix on create repo action 2014-06-25 05:27:17 -04:00
Unknown
43b33440b5 Work on create organization repo and #257 2014-06-25 05:14:36 -04:00
fuxiaohei
72ba273cc9 select owner when creating repository 2014-06-25 16:03:29 +08:00
Unknown
4cf7a1fca5 Mirror update on create repo page 2014-06-25 03:55:59 -04:00
fuxiaohei
80be060735 select owner when creating repository 2014-06-25 13:08:28 +08:00
Unknown
8e6c254c03 Mirror fix on create repo 2014-06-25 00:53:45 -04:00
Unknown
3624b2a7f1 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-06-25 00:44:59 -04:00
Unknown
e0f9c628c5 Add create organization 2014-06-25 00:44:48 -04:00
fuxiaohei
cc703ee663 select owner when creating repository 2014-06-25 12:22:08 +08:00
Unknown
b2801a2e98 Fix #165 2014-06-24 13:55:47 -04:00
Unknown
ceb415df8a Merge branch 'master' of github.com:gogits/gogs into dev 2014-06-24 09:59:21 -04:00
无闻
63770d93a1 Merge pull request #251 from niphor/master
RepoRootPath must be absolute path
2014-06-24 09:30:16 -04:00
无闻
9bdff5bd97 Merge pull request #253 from eryx/master
Fix #252
2014-06-24 09:26:42 -04:00
Eryx
d5d04a66f3 Fix #252 2014-06-24 16:53:42 +08:00
niphor
29a40c97f3 RepoRootPath must be absolute path 2014-06-24 14:28:47 +08:00
Unknown
98f614a58e Work on #249 issue1 2014-06-23 19:16:09 -04:00
Unknown
47d29a1ee0 Mirror fix on #248 2014-06-23 16:22:34 -04:00
fuxiaohei
fb53cc4fa8 add organization setting page 2014-06-23 19:11:20 +08:00
fuxiaohei
f393dc6520 add organization dashboard page 2014-06-23 12:08:53 +08:00
fuxiaohei
ea507e20d4 add organization create page 2014-06-23 11:40:49 +08:00
Unknown
314193029a Use constants to name template file 2014-06-22 23:11:12 -04:00
Unknown
9c82073091 Merge branch 'dev' of github.com:gogits/gogs into dev 2014-06-22 13:17:47 -04:00
Unknown
9924e65ca1 In progress of name template name constant 2014-06-22 13:14:03 -04:00
fuxiaohei
adda10f4a4 add organization teams page 2014-06-22 21:53:40 +08:00
fuxiaohei
514d7e1922 add organization memebers page 2014-06-22 16:53:46 +08:00
fuxiaohei
bf703ef617 add dashboard context switch button 2014-06-22 14:10:12 +08:00
Unknown
c280415e0b Clean files 2014-06-21 17:57:59 -04:00
Unknown
9d2cef23f2 Fix #165 2014-06-21 00:53:46 -04:00
Unknown
ad5ec45dd6 Fix #165 2014-06-21 00:51:41 -04:00
Unknown
8bfa7ae745 Remove qiniu/log 2014-06-20 01:14:54 -04:00
Unknown
6c8d630bef Add database log adapter 2014-06-20 00:25:23 -04:00
Unknown
f147ad619a Basic process manager 2014-06-19 01:08:03 -04:00
Unknown
8d3276cab0 Fix test cases 2014-06-16 23:19:25 -04:00
Unknown
d952b4200c Add corn rask monitor panel 2014-06-13 13:01:52 -04:00
Unknown
e07674bff1 Support edit release and save as draft 2014-06-12 17:47:23 -04:00
Unknown
fb0972afad Fix #199 2014-06-12 09:35:51 -04:00
Unknown
9961f9a53c Fix #197 2014-06-12 09:10:39 -04:00
Unknown
1161c71ac1 Mirror fix 2014-06-12 07:45:33 -04:00
Unknown
c018b1a88d Merge branch 'master' of github.com:gogits/gogs into dev 2014-06-12 07:44:11 -04:00
codeskyblue
29561acb43 fix gobuld.yml conf missing 2014-06-12 16:58:56 +08:00
无闻
2da9908e29 Merge pull request #243 from tobyzxj/patch-1
Using strings.HasPrefix(...) will cause a misjudgement
2014-06-11 18:50:25 -04:00
toby.zxj
a13a6b14ec Using strings.HasPrefix(...) will misjudgement
`strings.HasPrefix(access.RepoName, uname)` can't handle the situation which like following in access table.

	user_name | repo_name
	----------+-------------
	toby      | toby/blog
	toby      | toby/test
	toby      | tobyzxj/blog
	toby      | tobyzxj/test
2014-06-11 16:54:25 +08:00
Unknown
a3e1383cac Add gogs fix location command 2014-06-10 19:11:53 -04:00
Unknown
f160b4f33c Add tar.gz download button and other mirror updates 2014-06-08 17:53:53 -04:00
Unknown
1f58d6f5d9 Mirror fix on #242 2014-06-08 04:54:52 -04:00
Unknown
a80d8d96fa Merge branch 'dev' of github.com:gogits/gogs into dev 2014-06-08 04:45:38 -04:00
Unknown
302c863cda Fix #242 2014-06-08 04:45:34 -04:00
FuXiaoHei
4fcbf553aa organisation main page ui 2014-06-07 13:27:24 +08:00
无闻
a0318db2f9 Merge pull request #239 from baijum/docker_command
use 'docker.io' command instead of 'docker'
2014-06-06 05:12:56 -04:00
Baiju Muthukadan
c6058e5ea8 locate docker command during running time 2014-06-06 14:22:54 +05:30
Unknown
4f2f3c2857 Code convention 2014-06-05 22:07:35 -04:00
Baiju Muthukadan
925ccc2608 use 'docker.io' command instead of 'docker' 2014-06-05 21:46:46 +05:30
Unknown
11f9d738e8 Fix #237 2014-06-03 21:51:25 -04:00
Unknown
63baf76ab2 Fix #214 2014-06-03 12:51:53 -04:00
Unknown
9c3aa6936a Fix #223 2014-06-03 12:16:44 -04:00
Unknown
32c5fa514c Fix #230 2014-06-02 23:17:21 -04:00
Unknown
eaa7d71fc7 Fix #232 2014-06-02 21:59:56 -04:00
Unknown
e1332c5239 Fix #230 2014-06-01 21:47:48 -04:00
467 changed files with 158108 additions and 12054 deletions

20
.bra.toml Normal file
View File

@@ -0,0 +1,20 @@
[run]
init_cmds = [
["grep", "-rn", "FIXME", "."],
["./gogs", "web"]
]
watch_all = true
watch_dirs = [
"$WORKDIR/conf/locale",
"$WORKDIR/cmd",
"$WORKDIR/models",
"$WORKDIR/modules",
"$WORKDIR/routers"
]
watch_exts = [".go", ".ini"]
build_delay = 1500
cmds = [
["go", "install", "-tags", "sqlite cert"],
["go", "build", "-tags", "sqlite cert"],
["./gogs", "web"]
]

View File

@@ -1,12 +0,0 @@
{
"paths": ["."],
"depth": 2,
"exclude": [],
"include": ["\\.go$", "\\.ini$"],
"command": [
"bash", "-c", "go build && ./gogs web"
],
"env": {
"POWERED_BY": "github.com/shxsun/fswatch"
}
}

11
.gitignore vendored
View File

@@ -7,12 +7,12 @@ data/
.idea/
*.iml
public/img/avatar/
files/
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
dev
# Folders
_obj
@@ -32,6 +32,13 @@ _testmain.go
*.exe
*.exe~
gogs
/gogs
profile/
__pycache__
*.pem
output*
config.codekit
.brackets.json
docker/fig.yml
docker/docker/Dockerfile
docker/docker/init_gogs.sh

View File

@@ -1,11 +1,21 @@
filesets:
includes:
- templates
- conf
- etc
- public
- scripts
- templates
- LICENSE
- README.md
- README_ZH.md
- start.bat
- start.sh
excludes:
- \.git
settings:
build: |
if test "$GOOS" = "windows" -a "$GOARCH" = "386"
then
go install -v
else
go get -v -tags "sqlite redis memcache cert" github.com/gogits/gogs
go install -v -tags "sqlite redis memcache cert"
fi

View File

@@ -2,26 +2,31 @@
path = github.com/gogits/gogs
[deps]
github.com/Unknwon/cae = `commit:a1fa53b`
github.com/Unknwon/com = `commit:019c36f`
github.com/Unknwon/goconfig = `commit:c4e325f`
github.com/codegangsta/cli = `commit:bb91895`
github.com/go-martini/martini = `commit:49411a5`
github.com/go-sql-driver/mysql = `commit:b44cac6`
github.com/go-xorm/core = `commit:267e375`
github.com/go-xorm/xorm = `commit:bd1487b`
github.com/gogits/cache = `commit:f9bb61f`
github.com/gogits/gfm = `commit:40f747a`
github.com/gogits/git = `commit:3d9e771`
github.com/gogits/logs = `commit:0a97a46`
github.com/gogits/oauth2 = `commit:99cbec8`
github.com/gogits/session = `commit:7ab78d4`
github.com/juju2013/goldap = `commit:f4a7f67`
github.com/lib/pq = `commit:529edd9`
github.com/nfnt/resize = `commit:8aee0d9`
github.com/qiniu/log = `commit:891d1cb`
github.com/robfig/cron = `commit:b024fc5`
github.com/beego/memcache = commit:2aea774416
github.com/beego/redigo = commit:856744a0d5
github.com/Unknwon/cae = commit:2e70a1351b
github.com/Unknwon/com = commit:2cbcbc6916
github.com/Unknwon/goconfig = commit:0f8d8dc1c0
github.com/Unknwon/i18n = commit:47baeff8d0
github.com/Unknwon/macaron = commit:4927b78ad9
github.com/codegangsta/cli = commit:7381bc4e62
github.com/go-sql-driver/mysql = commit:8111ee3ec3
github.com/go-xorm/core = commit:750aae0fa5
github.com/go-xorm/xorm = commit:2d8b3135b1
github.com/gogits/gfm = commit:40f747a9c0
github.com/gogits/oauth2 = commit:99cbec870a
github.com/lib/pq = commit:b021d0ef20
github.com/macaron-contrib/cache = commit:204d8e5137
github.com/macaron-contrib/captcha = commit:d37d37eeea
github.com/macaron-contrib/csrf = commit:8e980822b0
github.com/macaron-contrib/i18n = commit:2246f45894
github.com/macaron-contrib/session = commit:42ad41e323
github.com/macaron-contrib/toolbox = commit:57127bcc89
github.com/mattn/go-sqlite3 = commit:a80c27ba33
github.com/nfnt/resize = commit:581d15cb53
github.com/russross/blackfriday = commit:05b8cefd6a
github.com/saintfish/chardet = commit:3af4cd4741
[res]
include = templates|public
include = conf|etc|public|scripts|templates

15
.pkgr.yml Normal file
View File

@@ -0,0 +1,15 @@
targets:
ubuntu-14.04:
ubuntu-12.04:
debian-7:
build_dependencies:
- mercurial
- bzr
dependencies:
- git
before:
- mv packager/Procfile .
- mv packager/.godir .
after:
- mv bin/main gogs
after_install: ./packager/debian/postinst

View File

@@ -2,4 +2,4 @@ language: go
go:
- 1.2
- tip
- 1.3

View File

@@ -1,14 +1,54 @@
# Contributing to Gogs
> Thanks [drone](https://github.com/drone/drone) because this guidelines sheet is forked from its [CONTRIBUTING.md](https://github.com/drone/drone/blob/master/CONTRIBUTING.md).
> This guidelines sheet is forked from [CONTRIBUTING.md](https://github.com/drone/drone/blob/master/CONTRIBUTING.md).
Want to hack on Gogs? Awesome! Here are instructions to get you started. They are probably not perfect, please let us know if anything feels wrong or incomplete.
Gogs is not perfect and it has bugs, or incomplete features for rare cases. You're welcome to tell us or contribute some code. This document describles details about how can you contribute to Gogs project.
## Contribution guidelines
### Pull requests are always welcome
Depends on the situation, you will:
**ALL PULL REQUESTS MUST SEND TO `DEV` BRANCH**
- Find bug, create an issue
- Need more functionality, make a feature request
- Want to contribute code, open a pull request
- Run into issue, need help
### Bug Report
If you find or consider something is a bug, please create a issue on [GitHub](https://github.com/gogits/gogs/issues). To reduce unnecessary time wasting of interacting and waiting with team members, please use following form as template in the first place:
```
- **Bug Description**:
- **Gogs Version**:
- **Git Version**:
- **System Type**:
- **Error Log**:
- **Other information**:
```
Please take a moment to check that an issue on [GitHub](https://github.com/gogits/gogs/issues) doesn't already exist documenting your bug report or improvement proposal. If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common problems and requests.
#### Bug Report Example
- **Bug Description**: Crash when create repository with license|
- **Gogs Version**: `v0.4.9.0901`
- **Git Version**: `1.9.0`
- **System Type**: `Ubuntu 12.04`
- **Error Log**:
```
2014/09/01 07:21:49 [E] nil pointer
```
- **Other information**: Use SQLite3 as database
### Feature Request
There is no standard form of making a feature request, just try to describle the feature as clear as possible because team members may not have experience with the functionality you're talking about.
### Pull Request
Pull requests are always welcome, but note that **ALL PULL REQUESTS MUST SEND TO `DEV` BRANCH**.
We are always thrilled to receive pull requests, and do our best to process them as fast as possible. Not sure if that typo is worth a pull request? Do it! We will appreciate it.
@@ -16,16 +56,16 @@ If your pull request is not accepted on the first try, don't be discouraged! If
We're trying very hard to keep Gogs lean and focused. We don't want it to do everything for everybody. This means that we might decide against incorporating a new feature.
### Ask For Help
Before open any new issue, please check your problem on [Troubleshooting](http://gogs.io/docs/intro/troubleshooting.md) and [FAQs](http://gogs.io/docs/intro/faqs.html) pages.
## Things To Notice
Please take a moment to check that an issue on [GitHub](https://github.com/gogits/gogs/issues) or card on [Trello](https://trello.com/b/uxAoeLUl/gogs-go-git-service) doesn't already exist documenting your bug report or improvement proposal. If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common problems and requests.
### Discuss your design on the mailing list
We recommend discussing your plans [on the mailing list](https://groups.google.com/forum/#!forum/gogits) before starting to code - especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give feedback on your design, and maybe point out if someone else is working on the same thing.
We may close your pull request if not first discussed on the mailing list. We aren't doing this to be jerks. We are doing this to prevent people from spending large amounts of time on changes that may need to be designed or architected in a specific way, or may not align with the vision of the project.
### Create issues...
Any significant improvement should be documented as [a GitHub issue](https://github.com/gogits/gogs/issues) before anybody starts working on it.
### ...but check for existing issues first!
Please take a moment to check that an issue or card on [Trello](https://trello.com/b/uxAoeLUl/gogs-go-git-service) doesn't already exist documenting your bug report or improvement proposal. If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common problems and requests.
We may close your pull request if not first discussed on the mailing list. We aren't doing this to be jerks. We are doing this to prevent people from spending large amounts of time on changes that may need to be designed or architected in a specific way, or may not align with the vision of the project.

View File

@@ -1,16 +1,16 @@
Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest)
Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://travis-ci.org/gogits/gogs.svg?branch=master)](https://travis-ci.org/gogits/gogs)
=====================
Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language.
Gogs(Go Git Service) is a painless self-hosted Git Service written in Go.
![Demo](http://gowalker.org/public/gogs_demo.gif)
![Demo](https://gowalker.org/public/gogs_demo.gif)
##### Current version: 0.4.0 Alpha
##### Current version: 0.5.5 Beta
### NOTICES
- Due to testing purpose, data of [try.gogits.org](http://try.gogits.org) has been reset in **April 14, 2014** and will reset multiple times after. Please do **NOT** put your important data on the site.
- Demo site [try.gogits.org](http://try.gogits.org) is running under `dev` branch.
- Due to testing purpose, data of [try.gogs.io](https://try.gogs.io) has been reset in **June 21, 2014** and will reset multiple times after. Please do **NOT** put your important data on the site.
- Demo site [try.gogs.io](https://try.gogs.io) is running under `dev` branch.
#### Other language version
@@ -18,31 +18,33 @@ Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language
## Purpose
Since we choose to use pure Go implementation of Git manipulation, Gogs certainly supports **ALL platforms** that Go supports, including Linux, Mac OS X, and Windows with **ZERO** dependency.
More importantly, Gogs only needs one binary to setup your own project hosting on the fly!
The goal of this project is to make the easiest, fastest and most painless way to set up a self-hosted Git service. With Go, this can be done in independent binary distribution across **ALL platforms** that Go supports, including Linux, Mac OS X, and Windows.
## Overview
- Please see [Documentation](http://gogs.io/docs/intro/) for project design, known issues, and change log.
- See [Trello Board](https://trello.com/b/uxAoeLUl/gogs-go-git-service) to follow the develop team.
- Try it before anything? Do it [online](http://try.gogits.org/Unknown/gogs) or go down to **Installation -> Install from binary** section!
- Try it before anything? Do it [online](https://try.gogs.io/Unknown/gogs) or go down to **Installation -> Install from binary** section!
- Having troubles? Get help from [Troubleshooting](http://gogs.io/docs/intro/troubleshooting.md).
## Features
- Activity timeline
- SSH/HTTP(S) protocol support
- SMTP/LDAP authentication support
- SMTP/LDAP/reverse proxy authentication support
- Register/delete/rename account
- Create/manage/delete organization with team management
- Create/migrate/mirror/delete/watch/rename/transfer public/private repository
- Repository viewer/release/issue tracker/webhooks
- Repository viewer/release/issue tracker
- Repository and Organization level webhooks
- Add/remove repository collaborators
- Gravatar and cache support
- Mail service(register, issue)
- Administration panel
- Slack webhook integration
- Supports MySQL, PostgreSQL and SQLite3
- Social account login(GitHub, Google, QQ, Weibo)
- Multi-language support(English, Simplified Chinese, Traditional Chinese, Germany, French, Dutch etc.)
## System Requirements
@@ -55,29 +57,25 @@ Make sure you install [Prerequirements](http://gogs.io/docs/installation/) first
There are 5 ways to install Gogs:
- [Install from binary](http://gogs.io/docs/installation/install_from_binary.md): **STRONGLY RECOMMENDED**
- [Install from binary](http://gogs.io/docs/installation/install_from_binary.md)
- [Install from source](http://gogs.io/docs/installation/install_from_source.md)
- [Install from packages](http://gogs.io/docs/installation/install_from_packages.md)
- [Ship with Docker](https://github.com/gogits/gogs/tree/master/dockerfiles)
- [Ship with Docker](https://github.com/gogits/gogs/tree/master/docker)
- [Install with Vagrant](https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs)
## Acknowledgments
- Router and middleware mechanism of [martini](http://martini.codegangsta.io/).
- Router and middleware mechanism of [Macaron](https://github.com/Unknwon/macaron).
- Mail Service, modules design is inspired by [WeTalk](https://github.com/beego/wetalk).
- System Monitor Status is inspired by [GoBlog](https://github.com/fuxiaohei/goblog).
- Usage and modification from [beego](http://beego.me) modules.
- Thanks [lavachen](http://www.lavachen.cn/) and [Rocker](http://weibo.com/rocker1989) for designing Logo.
- Thanks [gobuild.io](http://gobuild.io) for providing binary compile and download service.
- Great thanks to [Docker China](http://www.dockboard.org/) for providing [dockerfiles](https://github.com/gogits/gogs/tree/master/dockerfiles).
## Contributors
The [core team](http://gogs.io/team) of this project. See [contributors page](https://github.com/gogits/gogs/graphs/contributors) for full list of contributors.
[![Clone in Koding](http://learn.koding.com/btn/clone_d.png)][koding]
[koding]: https://koding.com/Teamwork?import=https://github.com/gogits/gogs/archive/master.zip&c=git1
## License
This project is under the MIT License. See the [LICENSE](https://github.com/gogits/gogs/blob/master/LICENSE) file for the full license text.

View File

@@ -1,39 +1,41 @@
Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest)
Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://travis-ci.org/gogits/gogs.svg?branch=master)](https://travis-ci.org/gogits/gogs)
=====================
Gogs(Go Git Service) 是一个 Go 语言编写的自助 Git 托管服务。
Gogs(Go Git Service) 是一个基于 Go 语言的自助 Git 服务。
![Demo](http://gowalker.org/public/gogs_demo.gif)
![Demo](https://gowalker.org/public/gogs_demo.gif)
##### 当前版本0.4.0 Alpha
##### 当前版本0.5.5 Beta
## 开发目的
Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依赖,并且支持 Go 语言支持的 **所有平台**,包括 Linux、Mac OS X 以及 Windows。
更重要的是,您只需要一个可执行文件就能借助 Gogs 快速搭建属于您自己的代码托管服务!
Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自助 Git 服务。使用 Go 语言开发使得 Gogs 能够通过独立的二进制分发,并且支持 Go 语言支持的 **所有平台**,包括 Linux、Mac OS X 以及 Windows。
## 项目概览
- 有关项目设计、已知问题和变更日志,请通过 [使用手册](http://gogs.io/docs/intro/) 查看。
- 您可以到 [Trello Board](https://trello.com/b/uxAoeLUl/gogs-go-git-service) 跟随开发团队的脚步。
- 想要先睹为快?通过 [在线体验](http://try.gogits.org/Unknown/gogs) 或查看 **安装部署 -> 二进制安装** 小节。
- 想要先睹为快?通过 [在线体验](https://try.gogs.io/Unknown/gogs) 或查看 **安装部署 -> 二进制安装** 小节。
- 使用过程中遇到问题?尝试从 [故障排查](http://gogs.io/docs/intro/troubleshooting.md) 页面获取帮助。
## 功能特性
- 活动时间线
- 支持 SSH/HTTP(S) 协议
- 支持 SMTP/LDAP 用户认证
- 注册/删除/重命名用户
- 支持 SMTP/LDAP/反向代理 用户认证
- 注册/删除/重命名 用户
- 创建/管理/删除 组织以及团队管理功能
- 创建/迁移/镜像/删除/关注/重命名/转移 公开/私有 仓库
- 仓库 浏览/发布/缺陷管理/Web 钩子
- 仓库 浏览/发布/工单管理
- 仓库和组织级别 Web 钩子
- 添加/删除 仓库协作者
- Gravatar 以及缓存支持
- 邮件服务注册、Issue
- 管理员面板
- Slack Web 钩子集成
- 支持 MySQL、PostgreSQL 以及 SQLite3 数据库
- 社交帐号登录GitHub、Google、QQ、微博
- 多语言支持(英文、简体中文、繁体中文、德语、法语、荷兰语等等)
## 系统要求
@@ -46,29 +48,25 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依
然后,您可以通过以下 5 种方式来安装 Gogs
- [二进制安装](http://gogs.io/docs/installation/install_from_binary.md): **强烈推荐**
- [二进制安装](http://gogs.io/docs/installation/install_from_binary.md)
- [源码安装](http://gogs.io/docs/installation/install_from_source.md)
- [包管理安装](http://gogs.io/docs/installation/install_from_packages.md)
- [采用 Docker 部署](https://github.com/gogits/gogs/tree/master/dockerfiles)
- [采用 Docker 部署](https://github.com/gogits/gogs/tree/master/docker)
- [通过 Vagrant 安装](https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs)
## 特别鸣谢
- [Macaron](https://github.com/Unknwon/macaron) 的路由与中间件机制。
- [beego](http://beego.me) 模块的使用与修改。
- 基于 [WeTalk](https://github.com/beego/wetalk) 修改的邮件服务和模块设计。
- 基于 [GoBlog](https://github.com/fuxiaohei/goblog) 修改的系统监视状态。
- [beego](http://beego.me) 模块的使用与修改。
- [martini](http://martini.codegangsta.io/) 的路由与中间件机制。
- 感谢 [gobuild.io](http://gobuild.io) 提供二进制编译与下载服务。
- 感谢 [lavachen](http://www.lavachen.cn/) 和 [Rocker](http://weibo.com/rocker1989) 设计的 Logo。
- 感谢 [Docker 中文社区](http://www.dockboard.org/) 提供的 [dockerfiles](https://github.com/gogits/gogs/tree/master/dockerfiles)。
## 贡献成员
本项目的 [开发团队](http://gogs.io/team)。您可以通过查看 [贡献者页面](https://github.com/gogits/gogs/graphs/contributors) 获取完整的贡献者列表。
[![Clone in Koding](http://learn.koding.com/btn/clone_d.png)][koding]
[koding]: https://koding.com/Teamwork?import=https://github.com/gogits/gogs/archive/master.zip&c=git1
## 授权许可
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/gogits/gogs/blob/master/LICENSE) 文件中。

View File

@@ -1,23 +0,0 @@
{
"version": 0,
"gopm": {
"enable": false,
"install": false
},
"go_install": true,
"watch_ext": [],
"dir_structure": {
"watch_all": true,
"controllers": "routers",
"models": "",
"others": [
"modules",
"$GOPATH/src/github.com/gogits/logs",
"$GOPATH/src/github.com/gogits/git"
]
},
"cmd_args": [
"web"
],
"envs": []
}

160
cmd/cert.go Normal file
View File

@@ -0,0 +1,160 @@
// +build cert
// Copyright 2009 The Go Authors. All rights reserved.
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package cmd
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"log"
"math/big"
"net"
"os"
"strings"
"time"
"github.com/codegangsta/cli"
)
var CmdCert = cli.Command{
Name: "cert",
Usage: "Generate self-signed certificate",
Description: `Generate a self-signed X.509 certificate for a TLS server.
Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`,
Action: runCert,
Flags: []cli.Flag{
cli.StringFlag{"host", "", "Comma-separated hostnames and IPs to generate a certificate for", ""},
cli.StringFlag{"ecdsa-curve", "", "ECDSA curve to use to generate a key. Valid values are P224, P256, P384, P521", ""},
cli.IntFlag{"rsa-bits", 2048, "Size of RSA key to generate. Ignored if --ecdsa-curve is set", ""},
cli.StringFlag{"start-date", "", "Creation date formatted as Jan 1 15:04:05 2011", ""},
cli.DurationFlag{"duration", 365 * 24 * time.Hour, "Duration that certificate is valid for", ""},
cli.BoolFlag{"ca", "whether this cert should be its own Certificate Authority", ""},
},
}
func publicKey(priv interface{}) interface{} {
switch k := priv.(type) {
case *rsa.PrivateKey:
return &k.PublicKey
case *ecdsa.PrivateKey:
return &k.PublicKey
default:
return nil
}
}
func pemBlockForKey(priv interface{}) *pem.Block {
switch k := priv.(type) {
case *rsa.PrivateKey:
return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)}
case *ecdsa.PrivateKey:
b, err := x509.MarshalECPrivateKey(k)
if err != nil {
log.Fatal("unable to marshal ECDSA private key: %v", err)
}
return &pem.Block{Type: "EC PRIVATE KEY", Bytes: b}
default:
return nil
}
}
func runCert(ctx *cli.Context) {
if len(ctx.String("host")) == 0 {
log.Fatal("Missing required --host parameter")
}
var priv interface{}
var err error
switch ctx.String("ecdsa-curve") {
case "":
priv, err = rsa.GenerateKey(rand.Reader, ctx.Int("rsa-bits"))
case "P224":
priv, err = ecdsa.GenerateKey(elliptic.P224(), rand.Reader)
case "P256":
priv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
case "P384":
priv, err = ecdsa.GenerateKey(elliptic.P384(), rand.Reader)
case "P521":
priv, err = ecdsa.GenerateKey(elliptic.P521(), rand.Reader)
default:
log.Fatalf("Unrecognized elliptic curve: %q", ctx.String("ecdsa-curve"))
}
if err != nil {
log.Fatalf("Failed to generate private key: %s", err)
}
var notBefore time.Time
if len(ctx.String("start-date")) == 0 {
notBefore = time.Now()
} else {
notBefore, err = time.Parse("Jan 2 15:04:05 2006", ctx.String("start-date"))
if err != nil {
log.Fatalf("Failed to parse creation date: %s", err)
}
}
notAfter := notBefore.Add(ctx.Duration("duration"))
serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
if err != nil {
log.Fatalf("Failed to generate serial number: %s", err)
}
template := x509.Certificate{
SerialNumber: serialNumber,
Subject: pkix.Name{
Organization: []string{"Acme Co"},
},
NotBefore: notBefore,
NotAfter: notAfter,
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
}
hosts := strings.Split(ctx.String("host"), ",")
for _, h := range hosts {
if ip := net.ParseIP(h); ip != nil {
template.IPAddresses = append(template.IPAddresses, ip)
} else {
template.DNSNames = append(template.DNSNames, h)
}
}
if ctx.Bool("ca") {
template.IsCA = true
template.KeyUsage |= x509.KeyUsageCertSign
}
derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, publicKey(priv), priv)
if err != nil {
log.Fatalf("Failed to create certificate: %s", err)
}
certOut, err := os.Create("cert.pem")
if err != nil {
log.Fatalf("Failed to open cert.pem for writing: %s", err)
}
pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes})
certOut.Close()
log.Println("Written cert.pem")
keyOut, err := os.OpenFile("key.pem", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
log.Fatal("failed to open key.pem for writing: %v", err)
}
pem.Encode(keyOut, pemBlockForKey(priv))
keyOut.Close()
log.Println("Written key.pem")
}

34
cmd/cert_stub.go Normal file
View File

@@ -0,0 +1,34 @@
// +build !cert
// Copyright 2009 The Go Authors. All rights reserved.
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
"time"
"github.com/codegangsta/cli"
)
var CmdCert = cli.Command{
Name: "cert",
Usage: "Generate self-signed certificate",
Description: `Generate a self-signed X.509 certificate for a TLS server.
Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`,
Action: runCert,
Flags: []cli.Flag{
cli.StringFlag{"host", "", "Comma-separated hostnames and IPs to generate a certificate for", ""},
cli.StringFlag{"ecdsa-curve", "", "ECDSA curve to use to generate a key. Valid values are P224, P256, P384, P521", ""},
cli.IntFlag{"rsa-bits", 2048, "Size of RSA key to generate. Ignored if --ecdsa-curve is set", ""},
cli.StringFlag{"start-date", "", "Creation date formatted as Jan 1 15:04:05 2011", ""},
cli.DurationFlag{"duration", 365 * 24 * time.Hour, "Duration that certificate is valid for", ""},
cli.BoolFlag{"ca", "whether this cert should be its own Certificate Authority", ""},
},
}
func runCert(ctx *cli.Context) {
fmt.Println("Command cert not available, please use build tags 'cert' to rebuild.")
}

View File

@@ -24,16 +24,18 @@ var CmdDump = cli.Command{
Description: `Dump compresses all related files and database into zip file.
It can be used for backup and capture Gogs server image to send to maintainer`,
Action: runDump,
Flags: []cli.Flag{},
Flags: []cli.Flag{
cli.BoolFlag{"verbose, v", "show process details", ""},
},
}
func runDump(*cli.Context) {
func runDump(ctx *cli.Context) {
setting.NewConfigContext()
models.LoadModelsConfig()
models.SetEngine()
log.Printf("Dumping local repositories...%s", setting.RepoRootPath)
zip.Verbose = false
zip.Verbose = ctx.Bool("verbose")
defer os.Remove("gogs-repo.zip")
if err := zip.PackTo(setting.RepoRootPath, "gogs-repo.zip", true); err != nil {
log.Fatalf("Fail to dump local repositories: %v", err)

View File

@@ -5,10 +5,17 @@
package cmd
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"runtime"
"strings"
"github.com/codegangsta/cli"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/setting"
)
@@ -16,28 +23,159 @@ import (
var CmdFix = cli.Command{
Name: "fix",
Usage: "This command for upgrade from old version",
Description: `Fix provide upgrade from old version`,
Action: runFix,
Subcommands: fixCommands,
Flags: []cli.Flag{},
}
func runFix(k *cli.Context) {
workDir, _ := setting.WorkDir()
newLogger(workDir)
setting.NewConfigContext()
models.LoadModelsConfig()
if models.UseSQLite3 {
os.Chdir(workDir)
}
models.SetEngine()
err := models.Fix()
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Fix successfully!")
}
func runFix(ctx *cli.Context) {
}
var fixCommands = []cli.Command{
{
Name: "location",
Usage: "Change Gogs app location",
Description: `Command location fixes location change of Gogs
gogs fix location <old Gogs path>
`,
Action: runFixLocation,
},
}
// rewriteAuthorizedKeys replaces old Gogs path to the new one.
func rewriteAuthorizedKeys(sshPath, oldPath, newPath string) error {
fr, err := os.Open(sshPath)
if err != nil {
return err
}
defer fr.Close()
tmpPath := sshPath + ".tmp"
fw, err := os.Create(tmpPath)
if err != nil {
return err
}
defer fw.Close()
oldPath = "command=\"" + oldPath + " serv"
newPath = "command=\"" + newPath + " serv"
buf := bufio.NewReader(fr)
for {
line, errRead := buf.ReadString('\n')
line = strings.TrimSpace(line)
if errRead != nil {
if errRead != io.EOF {
return errRead
}
// Reached end of file, if nothing to read then break,
// otherwise handle the last line.
if len(line) == 0 {
break
}
}
// Still finding the line, copy the line that currently read.
if _, err = fw.WriteString(strings.Replace(line, oldPath, newPath, 1) + "\n"); err != nil {
return err
}
if errRead == io.EOF {
break
}
}
if err = os.Remove(sshPath); err != nil {
return err
}
return os.Rename(tmpPath, sshPath)
}
func rewriteUpdateHook(path, appPath string) error {
if runtime.GOOS == "windows" {
rp := strings.NewReplacer("\\", "/")
appPath = "\"" + rp.Replace(appPath) + "\""
} else {
rp := strings.NewReplacer("\\", "/", " ", "\\ ")
appPath = rp.Replace(appPath)
}
if err := ioutil.WriteFile(path, []byte(fmt.Sprintf(models.TPL_UPDATE_HOOK,
setting.ScriptType, appPath)), os.ModePerm); err != nil {
return err
}
return nil
}
func walkDir(rootPath, recPath, appPath string, depth int) error {
depth++
if depth > 3 {
return nil
} else if depth == 3 {
if err := rewriteUpdateHook(path.Join(rootPath, "hooks/update"), appPath); err != nil {
return err
}
}
dir, err := os.Open(rootPath)
if err != nil {
return err
}
defer dir.Close()
fis, err := dir.Readdir(0)
if err != nil {
return err
}
for _, fi := range fis {
if strings.Contains(fi.Name(), ".DS_Store") {
continue
}
relPath := path.Join(recPath, fi.Name())
curPath := path.Join(rootPath, fi.Name())
if fi.IsDir() {
if err = walkDir(curPath, relPath, appPath, depth); err != nil {
return err
}
}
}
return nil
}
func runFixLocation(ctx *cli.Context) {
if len(ctx.Args()) != 1 {
fmt.Println("Incorrect arguments number, expect 1")
os.Exit(2)
}
execPath, _ := setting.ExecPath()
oldPath := ctx.Args().First()
fmt.Printf("Old location: %s\n", oldPath)
fmt.Println("This command should be executed in the new Gogs path")
fmt.Printf("Do you want to change Gogs app path from old location to:\n")
fmt.Printf("-> %s?\n", execPath)
fmt.Print("Press <enter> to continue, use <Ctrl+c> to exit.")
fmt.Scanln()
// Fix in authorized_keys file.
sshPath := path.Join(models.SshPath, "authorized_keys")
fmt.Printf("Fixing pathes in file: %s\n", sshPath)
if err := rewriteAuthorizedKeys(sshPath, oldPath, execPath); err != nil {
fmt.Println(err)
os.Exit(1)
}
// Fix position in gogs-repositories.
setting.NewConfigContext()
fmt.Printf("Fixing pathes in repositories: %s\n", setting.RepoRootPath)
if err := walkDir(setting.RepoRootPath, "", execPath, 0); err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Println("Fix position finished!")
}

View File

@@ -9,14 +9,17 @@ import (
"os"
"os/exec"
"path"
"strconv"
"path/filepath"
"strings"
"time"
"github.com/Unknwon/com"
"github.com/codegangsta/cli"
qlog "github.com/qiniu/log"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
"github.com/gogits/gogs/modules/uuid"
)
var CmdServ = cli.Command{
@@ -27,27 +30,13 @@ var CmdServ = cli.Command{
Flags: []cli.Flag{},
}
func newLogger(logPath string) {
os.MkdirAll(path.Dir(logPath), os.ModePerm)
f, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, os.ModePerm)
if err != nil {
qlog.Fatal(err)
}
qlog.SetOutput(f)
//qlog.SetOutputLevel(qlog.Ldebug)
qlog.Info("Start logging serv...")
}
func setup(logPath string) {
workDir, _ := setting.WorkDir()
newLogger(path.Join(workDir, logPath))
setting.NewConfigContext()
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
models.LoadModelsConfig()
if models.UseSQLite3 {
workDir, _ := setting.WorkDir()
os.Chdir(workDir)
}
@@ -70,45 +59,45 @@ func parseCmd(cmd string) (string, string) {
}
var (
COMMANDS_READONLY = map[string]int{
"git-upload-pack": models.AU_WRITABLE,
"git upload-pack": models.AU_WRITABLE,
"git-upload-archive": models.AU_WRITABLE,
COMMANDS_READONLY = map[string]models.AccessType{
"git-upload-pack": models.WRITABLE,
"git upload-pack": models.WRITABLE,
"git-upload-archive": models.WRITABLE,
}
COMMANDS_WRITE = map[string]int{
"git-receive-pack": models.AU_READABLE,
"git receive-pack": models.AU_READABLE,
COMMANDS_WRITE = map[string]models.AccessType{
"git-receive-pack": models.READABLE,
"git receive-pack": models.READABLE,
}
)
func In(b string, sl map[string]int) bool {
func In(b string, sl map[string]models.AccessType) bool {
_, e := sl[b]
return e
}
func runServ(k *cli.Context) {
setup(path.Join(setting.LogRootPath, "serv.log"))
setup("serv.log")
keys := strings.Split(os.Args[2], "-")
if len(keys) != 2 {
println("Gogs: auth file format error")
qlog.Fatal("Invalid auth file format: %s", os.Args[2])
log.GitLogger.Fatal(2, "Invalid auth file format: %s", os.Args[2])
}
keyId, err := strconv.ParseInt(keys[1], 10, 64)
keyId, err := com.StrTo(keys[1]).Int64()
if err != nil {
println("Gogs: auth file format error")
qlog.Fatalf("Invalid auth file format: %v", err)
log.GitLogger.Fatal(2, "Invalid auth file format: %v", err)
}
user, err := models.GetUserByKeyId(keyId)
if err != nil {
if err == models.ErrUserNotKeyOwner {
println("Gogs: you are not the owner of SSH key")
qlog.Fatalf("Invalid owner of SSH key: %d", keyId)
log.GitLogger.Fatal(2, "Invalid owner of SSH key: %d", keyId)
}
println("Gogs: internal error:", err)
qlog.Fatalf("Fail to get user by key ID(%d): %v", keyId, err)
log.GitLogger.Fatal(2, "Fail to get user by key ID(%d): %v", keyId, err)
}
cmd := os.Getenv("SSH_ORIGINAL_COMMAND")
@@ -122,7 +111,7 @@ func runServ(k *cli.Context) {
rr := strings.SplitN(repoPath, "/", 2)
if len(rr) != 2 {
println("Gogs: unavailable repository", args)
qlog.Fatalf("Unavailable repository: %v", args)
log.GitLogger.Fatal(2, "Unavailable repository: %v", args)
}
repoUserName := rr[0]
repoName := strings.TrimSuffix(rr[1], ".git")
@@ -134,70 +123,96 @@ func runServ(k *cli.Context) {
if err != nil {
if err == models.ErrUserNotExist {
println("Gogs: given repository owner are not registered")
qlog.Fatalf("Unregistered owner: %s", repoUserName)
log.GitLogger.Fatal(2, "Unregistered owner: %s", repoUserName)
}
println("Gogs: internal error:", err)
qlog.Fatalf("Fail to get repository owner(%s): %v", repoUserName, err)
log.GitLogger.Fatal(2, "Fail to get repository owner(%s): %v", repoUserName, err)
}
// Access check.
switch {
case isWrite:
has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.AU_WRITABLE)
has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.WRITABLE)
if err != nil {
println("Gogs: internal error:", err)
qlog.Fatal("Fail to check write access:", err)
log.GitLogger.Fatal(2, "Fail to check write access:", err)
} else if !has {
println("You have no right to write this repository")
qlog.Fatalf("User %s has no right to write repository %s", user.Name, repoPath)
log.GitLogger.Fatal(2, "User %s has no right to write repository %s", user.Name, repoPath)
}
case isRead:
repo, err := models.GetRepositoryByName(repoUser.Id, repoName)
if err != nil {
if err == models.ErrRepoNotExist {
println("Gogs: given repository does not exist")
qlog.Fatalf("Repository does not exist: %s/%s", repoUser.Name, repoName)
log.GitLogger.Fatal(2, "Repository does not exist: %s/%s", repoUser.Name, repoName)
}
println("Gogs: internal error:", err)
qlog.Fatalf("Fail to get repository: %v", err)
log.GitLogger.Fatal(2, "Fail to get repository: %v", err)
}
if !repo.IsPrivate {
break
}
has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.AU_READABLE)
has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.READABLE)
if err != nil {
println("Gogs: internal error:", err)
qlog.Fatal("Fail to check read access:", err)
log.GitLogger.Fatal(2, "Fail to check read access:", err)
} else if !has {
println("You have no right to access this repository")
qlog.Fatalf("User %s has no right to read repository %s", user.Name, repoPath)
log.GitLogger.Fatal(2, "User %s has no right to read repository %s", user.Name, repoPath)
}
default:
println("Unknown command")
return
}
models.SetRepoEnvs(user.Id, user.Name, repoName, repoUserName)
uuid := uuid.NewV4().String()
os.Setenv("uuid", uuid)
gitcmd := exec.Command(verb, repoPath)
var gitcmd *exec.Cmd
verbs := strings.Split(verb, " ")
if len(verbs) == 2 {
gitcmd = exec.Command(verbs[0], verbs[1], repoPath)
} else {
gitcmd = exec.Command(verb, repoPath)
}
gitcmd.Dir = setting.RepoRootPath
gitcmd.Stdout = os.Stdout
gitcmd.Stdin = os.Stdin
gitcmd.Stderr = os.Stderr
if err = gitcmd.Run(); err != nil {
println("Gogs: internal error:", err)
qlog.Fatalf("Fail to execute git command: %v", err)
println("Gogs: internal error:", err.Error())
log.GitLogger.Fatal(2, "Fail to execute git command: %v", err)
}
//refName := os.Getenv("refName")
//oldCommitId := os.Getenv("oldCommitId")
//newCommitId := os.Getenv("newCommitId")
if isWrite {
tasks, err := models.GetUpdateTasksByUuid(uuid)
if err != nil {
log.GitLogger.Fatal(2, "GetUpdateTasksByUuid: %v", err)
}
//qlog.Error("get envs:", refName, oldCommitId, newCommitId)
for _, task := range tasks {
err = models.Update(task.RefName, task.OldCommitId, task.NewCommitId,
user.Name, repoUserName, repoName, user.Id)
if err != nil {
log.GitLogger.Error(2, "Fail to update: %v", err)
}
}
// update
//models.Update(refName, oldCommitId, newCommitId, repoUserName, repoName, user.Id)
if err = models.DelUpdateTasksByUuid(uuid); err != nil {
log.GitLogger.Fatal(2, "DelUpdateTasksByUuid: %v", err)
}
}
// Update key activity.
key, err := models.GetPublicKeyById(keyId)
if err != nil {
log.GitLogger.Fatal(2, "GetPublicKeyById: %v", err)
}
key.Updated = time.Now()
if err = models.UpdatePublicKey(key); err != nil {
log.GitLogger.Fatal(2, "UpdatePublicKey: %v", err)
}
}

View File

@@ -6,14 +6,11 @@ package cmd
import (
"os"
"path"
"strconv"
"github.com/codegangsta/cli"
qlog "github.com/qiniu/log"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/setting"
"github.com/gogits/gogs/modules/log"
)
var CmdUpdate = cli.Command{
@@ -24,35 +21,31 @@ var CmdUpdate = cli.Command{
Flags: []cli.Flag{},
}
func updateEnv(refName, oldCommitId, newCommitId string) {
os.Setenv("refName", refName)
os.Setenv("oldCommitId", oldCommitId)
os.Setenv("newCommitId", newCommitId)
qlog.Info("set envs:", refName, oldCommitId, newCommitId)
}
func runUpdate(c *cli.Context) {
cmd := os.Getenv("SSH_ORIGINAL_COMMAND")
if cmd == "" {
return
}
setup(path.Join(setting.LogRootPath, "update.log"))
setup("update.log")
args := c.Args()
if len(args) != 3 {
qlog.Fatal("received less 3 parameters")
log.GitLogger.Fatal(2, "received less 3 parameters")
} else if args[0] == "" {
qlog.Fatal("refName is empty, shouldn't use")
log.GitLogger.Fatal(2, "refName is empty, shouldn't use")
}
//updateEnv(args[0], args[1], args[2])
uuid := os.Getenv("uuid")
userName := os.Getenv("userName")
userId, _ := strconv.ParseInt(os.Getenv("userId"), 10, 64)
//repoId := os.Getenv("repoId")
repoUserName := os.Getenv("repoUserName")
repoName := os.Getenv("repoName")
task := models.UpdateTask{
Uuid: uuid,
RefName: args[0],
OldCommitId: args[1],
NewCommitId: args[2],
}
models.Update(args[0], args[1], args[2], userName, repoUserName, repoName, userId)
if err := models.AddUpdateTask(&task); err != nil {
log.GitLogger.Fatal(2, err.Error())
}
}

View File

@@ -11,14 +11,23 @@ import (
"net/http"
"os"
"path"
"strings"
"github.com/Unknwon/macaron"
"github.com/codegangsta/cli"
"github.com/go-martini/martini"
"github.com/macaron-contrib/cache"
"github.com/macaron-contrib/captcha"
"github.com/macaron-contrib/csrf"
"github.com/macaron-contrib/i18n"
"github.com/macaron-contrib/session"
"github.com/macaron-contrib/toolbox"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/auth"
"github.com/gogits/gogs/modules/auth/apiv1"
"github.com/gogits/gogs/modules/avatar"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/middleware/binding"
@@ -27,6 +36,7 @@ import (
"github.com/gogits/gogs/routers/admin"
"github.com/gogits/gogs/routers/api/v1"
"github.com/gogits/gogs/routers/dev"
"github.com/gogits/gogs/routers/org"
"github.com/gogits/gogs/routers/repo"
"github.com/gogits/gogs/routers/user"
)
@@ -34,181 +44,310 @@ import (
var CmdWeb = cli.Command{
Name: "web",
Usage: "Start Gogs web server",
Description: `Gogs web server is the only thing you need to run,
Description: `Gogs web server is the only thing you need to run,
and it takes care of all the other things for you`,
Action: runWeb,
Flags: []cli.Flag{},
}
// checkVersion checks if binary matches the version of temolate files.
// checkVersion checks if binary matches the version of templates files.
func checkVersion() {
data, err := ioutil.ReadFile(path.Join(setting.StaticRootPath, "templates/VERSION"))
// Templates.
data, err := ioutil.ReadFile(path.Join(setting.StaticRootPath, "templates/.VERSION"))
if err != nil {
log.Fatal("Fail to read 'templates/VERSION': %v", err)
log.Fatal(4, "Fail to read 'templates/.VERSION': %v", err)
}
if string(data) != setting.AppVer {
log.Fatal("Binary and template file version does not match, did you forget to recompile?")
log.Fatal(4, "Binary and template file version does not match, did you forget to recompile?")
}
// Check dependency version.
macaronVer := git.MustParseVersion(strings.Join(strings.Split(macaron.Version(), ".")[:3], "."))
if macaronVer.LessThan(git.MustParseVersion("0.2.0")) {
log.Fatal(4, "Package macaron version is too old, did you forget to update?(github.com/Unknwon/macaron)")
}
i18nVer := git.MustParseVersion(i18n.Version())
if i18nVer.LessThan(git.MustParseVersion("0.0.2")) {
log.Fatal(4, "Package i18n version is too old, did you forget to update?(github.com/macaron-contrib/i18n)")
}
sessionVer := git.MustParseVersion(session.Version())
if sessionVer.LessThan(git.MustParseVersion("0.0.1")) {
log.Fatal(4, "Package session version is too old, did you forget to update?(github.com/macaron-contrib/session)")
}
}
func newMartini() *martini.ClassicMartini {
r := martini.NewRouter()
m := martini.New()
m.Use(middleware.Logger())
m.Use(martini.Recovery())
m.Use(martini.Static(path.Join(setting.StaticRootPath, "public"),
martini.StaticOptions{SkipLogging: !setting.DisableRouterLog}))
m.MapTo(r, (*martini.Routes)(nil))
m.Action(r.Handle)
return &martini.ClassicMartini{m, r}
// newMacaron initializes Macaron instance.
func newMacaron() *macaron.Macaron {
m := macaron.New()
m.Use(macaron.Logger())
m.Use(macaron.Recovery())
m.Use(macaron.Static(
path.Join(setting.StaticRootPath, "public"),
macaron.StaticOptions{
SkipLogging: !setting.DisableRouterLog,
},
))
// if setting.EnableGzip {
// m.Use(macaron.Gzip())
// }
m.Use(macaron.Renderer(macaron.RenderOptions{
Directory: path.Join(setting.StaticRootPath, "templates"),
Funcs: []template.FuncMap{base.TemplateFuncs},
IndentJSON: macaron.Env != macaron.PROD,
}))
m.Use(i18n.I18n(i18n.Options{
SubURL: setting.AppSubUrl,
Directory: path.Join(setting.ConfRootPath, "locale"),
CustomDirectory: path.Join(setting.CustomPath, "conf/locale"),
Langs: setting.Langs,
Names: setting.Names,
Redirect: true,
}))
m.Use(cache.Cacher(cache.Options{
Adapter: setting.CacheAdapter,
Interval: setting.CacheInternal,
Conn: setting.CacheConn,
}))
m.Use(captcha.Captchaer(captcha.Options{
SubURL: setting.AppSubUrl,
}))
m.Use(session.Sessioner(session.Options{
Provider: setting.SessionProvider,
Config: *setting.SessionConfig,
}))
m.Use(csrf.Generate(csrf.Options{
Secret: setting.SecretKey,
SetCookie: true,
Header: "X-Csrf-Token",
CookiePath: setting.AppSubUrl,
}))
m.Use(toolbox.Toolboxer(m, toolbox.Options{
HealthCheckFuncs: []*toolbox.HealthCheckFuncDesc{
&toolbox.HealthCheckFuncDesc{
Desc: "Database connection",
Func: models.Ping,
},
},
}))
m.Use(middleware.Contexter())
return m
}
func runWeb(*cli.Context) {
routers.GlobalInit()
checkVersion()
m := newMartini()
// Middlewares.
m.Use(middleware.Renderer(middleware.RenderOptions{
Directory: path.Join(setting.StaticRootPath, "templates"),
Funcs: []template.FuncMap{base.TemplateFuncs},
IndentJSON: true,
}))
m.Use(middleware.InitContext())
m := newMacaron()
reqSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true})
ignSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: setting.Service.RequireSignInView})
ignSignInAndCsrf := middleware.Toggle(&middleware.ToggleOptions{DisableCsrf: true})
reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true})
bindIgnErr := binding.BindIgnErr
// Routers.
m.Get("/", ignSignIn, routers.Home)
m.Get("/explore", ignSignIn, routers.Explore)
m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.Install)
m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallPost)
m.Get("/issues", reqSignIn, user.Issues)
m.Get("/pulls", reqSignIn, user.Pulls)
m.Get("/stars", reqSignIn, user.Stars)
m.Group("", func(r *macaron.Router) {
r.Get("/pulls", user.Pulls)
r.Get("/issues", user.Issues)
}, reqSignIn)
m.Group("/api", func(r martini.Router) {
m.Group("/v1", func(r martini.Router) {
// API routers.
m.Group("/api", func(_ *macaron.Router) {
m.Group("/v1", func(r *macaron.Router) {
// Miscellaneous.
r.Post("/markdown", bindIgnErr(apiv1.MarkdownForm{}), v1.Markdown)
r.Post("/markdown/raw", v1.MarkdownRaw)
// Users.
r.Get("/users/search", v1.SearchUser)
m.Group("/users", func(r *macaron.Router) {
r.Get("/search", v1.SearchUsers)
})
r.Any("**", func(ctx *middleware.Context) {
// Repositories.
m.Group("/repos", func(r *macaron.Router) {
r.Get("/search", v1.SearchRepos)
r.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), v1.Migrate)
})
r.Any("/*", func(ctx *middleware.Context) {
ctx.JSON(404, &base.ApiJsonErr{"Not Found", v1.DOC_URL})
})
})
})
avt := avatar.CacheServer("public/img/avatar/", "public/img/avatar_default.jpg")
os.MkdirAll("public/img/avatar/", os.ModePerm)
m.Get("/avatar/:hash", avt.ServeHTTP)
m.Group("/user", func(r martini.Router) {
// User routers.
m.Group("/user", func(r *macaron.Router) {
r.Get("/login", user.SignIn)
r.Post("/login", bindIgnErr(auth.LogInForm{}), user.SignInPost)
r.Post("/login", bindIgnErr(auth.SignInForm{}), user.SignInPost)
r.Get("/login/:name", user.SocialSignIn)
r.Get("/sign_up", user.SignUp)
r.Post("/sign_up", bindIgnErr(auth.RegisterForm{}), user.SignUpPost)
r.Get("/reset_password", user.ResetPasswd)
r.Post("/reset_password", user.ResetPasswdPost)
}, reqSignOut)
m.Group("/user", func(r martini.Router) {
r.Get("/delete", user.Delete)
r.Post("/delete", user.DeletePost)
r.Get("/settings", user.Setting)
r.Post("/settings", bindIgnErr(auth.UpdateProfileForm{}), user.SettingPost)
m.Group("/user/settings", func(r *macaron.Router) {
r.Get("", user.Settings)
r.Post("", bindIgnErr(auth.UpdateProfileForm{}), user.SettingsPost)
r.Get("/password", user.SettingsPassword)
r.Post("/password", bindIgnErr(auth.ChangePasswordForm{}), user.SettingsPasswordPost)
r.Get("/ssh", user.SettingsSSHKeys)
r.Post("/ssh", bindIgnErr(auth.AddSSHKeyForm{}), user.SettingsSSHKeysPost)
r.Get("/social", user.SettingsSocial)
r.Route("/delete", "GET,POST", user.SettingsDelete)
}, reqSignIn)
m.Group("/user", func(r martini.Router) {
r.Get("/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds)
m.Group("/user", func(r *macaron.Router) {
// r.Get("/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds)
r.Any("/activate", user.Activate)
r.Get("/email2user", user.Email2User)
r.Get("/forget_password", user.ForgotPasswd)
r.Post("/forget_password", user.ForgotPasswdPost)
r.Get("/logout", user.SignOut)
})
m.Group("/user/settings", func(r martini.Router) {
r.Get("/social", user.SettingSocial)
r.Get("/password", user.SettingPassword)
r.Post("/password", bindIgnErr(auth.UpdatePasswdForm{}), user.SettingPasswordPost)
r.Any("/ssh", bindIgnErr(auth.AddSSHKeyForm{}), user.SettingSSHKeys)
r.Get("/notification", user.SettingNotification)
r.Get("/security", user.SettingSecurity)
}, reqSignIn)
// FIXME: Legacy
m.Get("/user/:username", ignSignIn, user.Profile)
m.Group("/repo", func(r martini.Router) {
// Gravatar service.
avt := avatar.CacheServer("public/img/avatar/", "public/img/avatar_default.jpg")
os.MkdirAll("public/img/avatar/", os.ModePerm)
m.Get("/avatar/:hash", avt.ServeHTTP)
adminReq := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true, AdminRequire: true})
m.Group("/admin", func(r *macaron.Router) {
m.Get("", adminReq, admin.Dashboard)
r.Get("/config", admin.Config)
r.Get("/monitor", admin.Monitor)
m.Group("/users", func(r *macaron.Router) {
r.Get("", admin.Users)
r.Get("/new", admin.NewUser)
r.Post("/new", bindIgnErr(auth.RegisterForm{}), admin.NewUserPost)
r.Get("/:userid", admin.EditUser)
r.Post("/:userid", bindIgnErr(auth.AdminEditUserForm{}), admin.EditUserPost)
r.Post("/:userid/delete", admin.DeleteUser)
})
m.Group("/orgs", func(r *macaron.Router) {
r.Get("", admin.Organizations)
})
m.Group("/repos", func(r *macaron.Router) {
r.Get("", admin.Repositories)
})
m.Group("/auths", func(r *macaron.Router) {
r.Get("", admin.Authentications)
r.Get("/new", admin.NewAuthSource)
r.Post("/new", bindIgnErr(auth.AuthenticationForm{}), admin.NewAuthSourcePost)
r.Get("/:authid", admin.EditAuthSource)
r.Post("/:authid", bindIgnErr(auth.AuthenticationForm{}), admin.EditAuthSourcePost)
r.Post("/:authid/delete", admin.DeleteAuthSource)
})
m.Group("/notices", func(r *macaron.Router) {
r.Get("", admin.Notices)
r.Get("/:id:int/delete", admin.DeleteNotice)
})
}, adminReq)
m.Get("/:username", ignSignIn, user.Profile)
if macaron.Env == macaron.DEV {
m.Get("/template/*", dev.TemplatePreview)
}
reqTrueOwner := middleware.RequireTrueOwner()
// Organization routers.
m.Group("/org", func(r *macaron.Router) {
r.Get("/create", org.Create)
r.Post("/create", bindIgnErr(auth.CreateOrgForm{}), org.CreatePost)
m.Group("/:org", func(r *macaron.Router) {
r.Get("/dashboard", user.Dashboard)
r.Get("/members", org.Members)
r.Get("/members/action/:action", org.MembersAction)
r.Get("/teams", org.Teams)
r.Get("/teams/:team", org.TeamMembers)
r.Get("/teams/:team/repositories", org.TeamRepositories)
r.Get("/teams/:team/action/:action", org.TeamsAction)
r.Get("/teams/:team/action/repo/:action", org.TeamsRepoAction)
}, middleware.OrgAssignment(true, true))
m.Group("/:org", func(r *macaron.Router) {
r.Get("/teams/new", org.NewTeam)
r.Post("/teams/new", bindIgnErr(auth.CreateTeamForm{}), org.NewTeamPost)
r.Get("/teams/:team/edit", org.EditTeam)
r.Post("/teams/:team/edit", bindIgnErr(auth.CreateTeamForm{}), org.EditTeamPost)
r.Post("/teams/:team/delete", org.DeleteTeam)
m.Group("/settings", func(r *macaron.Router) {
r.Get("", org.Settings)
r.Post("", bindIgnErr(auth.UpdateOrgSettingForm{}), org.SettingsPost)
r.Get("/hooks", org.SettingsHooks)
r.Get("/hooks/new", repo.WebHooksNew)
r.Post("/hooks/gogs/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost)
r.Post("/hooks/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost)
r.Get("/hooks/:id", repo.WebHooksEdit)
r.Post("/hooks/gogs/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost)
r.Post("/hooks/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost)
r.Route("/delete", "GET,POST", org.SettingsDelete)
})
r.Route("/invitations/new", "GET,POST", org.Invitation)
}, middleware.OrgAssignment(true, true, true))
}, reqSignIn)
m.Group("/org", func(r *macaron.Router) {
r.Get("/:org", org.Home)
}, middleware.OrgAssignment(true))
// Repository routers.
m.Group("/repo", func(r *macaron.Router) {
r.Get("/create", repo.Create)
r.Post("/create", bindIgnErr(auth.CreateRepoForm{}), repo.CreatePost)
r.Get("/migrate", repo.Migrate)
r.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), repo.MigratePost)
}, reqSignIn)
adminReq := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true, AdminRequire: true})
m.Get("/admin", adminReq, admin.Dashboard)
m.Group("/admin", func(r martini.Router) {
r.Get("/users", admin.Users)
r.Get("/repos", admin.Repositories)
r.Get("/config", admin.Config)
r.Get("/auths", admin.Auths)
}, adminReq)
m.Group("/admin/users", func(r martini.Router) {
r.Get("/new", admin.NewUser)
r.Post("/new", bindIgnErr(auth.RegisterForm{}), admin.NewUserPost)
r.Get("/:userid", admin.EditUser)
r.Post("/:userid", bindIgnErr(auth.AdminEditUserForm{}), admin.EditUserPost)
r.Get("/:userid/delete", admin.DeleteUser)
}, adminReq)
m.Group("/admin/auths", func(r martini.Router) {
r.Get("/new", admin.NewAuthSource)
r.Post("/new", bindIgnErr(auth.AuthenticationForm{}), admin.NewAuthSourcePost)
r.Get("/:authid", admin.EditAuthSource)
r.Post("/:authid", bindIgnErr(auth.AuthenticationForm{}), admin.EditAuthSourcePost)
r.Get("/:authid/delete", admin.DeleteAuthSource)
}, adminReq)
if martini.Env == martini.Dev {
m.Get("/template/**", dev.TemplatePreview)
}
reqOwner := middleware.RequireOwner()
m.Group("/:username/:reponame", func(r martini.Router) {
r.Get("/settings", repo.Setting)
r.Post("/settings", bindIgnErr(auth.RepoSettingForm{}), repo.SettingPost)
m.Group("/settings", func(r martini.Router) {
r.Get("/collaboration", repo.Collaboration)
r.Post("/collaboration", repo.CollaborationPost)
r.Get("/hooks", repo.WebHooks)
r.Get("/hooks/add", repo.WebHooksAdd)
r.Post("/hooks/add", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksAddPost)
m.Group("/:username/:reponame", func(r *macaron.Router) {
r.Get("/settings", repo.Settings)
r.Post("/settings", bindIgnErr(auth.RepoSettingForm{}), repo.SettingsPost)
m.Group("/settings", func(r *macaron.Router) {
r.Route("/collaboration", "GET,POST", repo.SettingsCollaboration)
r.Get("/hooks", repo.Webhooks)
r.Get("/hooks/new", repo.WebHooksNew)
r.Post("/hooks/gogs/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost)
r.Post("/hooks/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost)
r.Get("/hooks/:id", repo.WebHooksEdit)
r.Post("/hooks/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost)
})
}, reqSignIn, middleware.RepoAssignment(true), reqOwner)
r.Post("/hooks/gogs/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost)
r.Post("/hooks/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost)
m.Group("/:username/:reponame", func(r martini.Router) {
m.Group("/hooks/git", func(r *macaron.Router) {
r.Get("", repo.GitHooks)
r.Get("/:name", repo.GitHooksEdit)
r.Post("/:name", repo.GitHooksEditPost)
}, middleware.GitHookService())
})
}, reqSignIn, middleware.RepoAssignment(true), reqTrueOwner)
m.Group("/:username/:reponame", func(r *macaron.Router) {
r.Get("/action/:action", repo.Action)
m.Group("/issues", func(r martini.Router) {
m.Group("/issues", func(r *macaron.Router) {
r.Get("/new", repo.CreateIssue)
r.Post("/new", bindIgnErr(auth.CreateIssueForm{}), repo.CreateIssuePost)
r.Post("/:index", bindIgnErr(auth.CreateIssueForm{}), repo.UpdateIssue)
r.Post("/:index/label", repo.UpdateIssueLabel)
r.Post("/:index/milestone", repo.UpdateIssueMilestone)
r.Post("/:index/assignee", repo.UpdateAssignee)
r.Get("/:index/attachment/:id", repo.IssueGetAttachment)
r.Post("/labels/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel)
r.Post("/labels/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel)
r.Post("/labels/delete", repo.DeleteLabel)
@@ -221,55 +360,67 @@ func runWeb(*cli.Context) {
})
r.Post("/comment/:action", repo.Comment)
r.Get("/releases/new", repo.ReleasesNew)
r.Get("/releases/new", repo.NewRelease)
r.Get("/releases/edit/:tagname", repo.EditRelease)
}, reqSignIn, middleware.RepoAssignment(true))
m.Group("/:username/:reponame", func(r martini.Router) {
r.Post("/releases/new", bindIgnErr(auth.NewReleaseForm{}), repo.ReleasesNewPost)
m.Group("/:username/:reponame", func(r *macaron.Router) {
r.Post("/releases/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)
r.Post("/releases/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
}, reqSignIn, middleware.RepoAssignment(true, true))
m.Group("/:username/:reponame", func(r martini.Router) {
m.Group("/:username/:reponame", func(r *macaron.Router) {
r.Get("/issues", repo.Issues)
r.Get("/issues/:index", repo.ViewIssue)
r.Get("/pulls", repo.Pulls)
r.Get("/branches", repo.Branches)
r.Get("/archive/*", repo.Download)
r.Get("/issues2/", repo.Issues2)
}, ignSignIn, middleware.RepoAssignment(true))
m.Group("/:username/:reponame", func(r martini.Router) {
r.Get("/src/:branchname", repo.Single)
r.Get("/src/:branchname/**", repo.Single)
r.Get("/raw/:branchname/**", repo.SingleDownload)
m.Group("/:username/:reponame", func(r *macaron.Router) {
r.Get("/src/:branchname", repo.Home)
r.Get("/src/:branchname/*", repo.Home)
r.Get("/raw/:branchname/*", repo.SingleDownload)
r.Get("/commits/:branchname", repo.Commits)
r.Get("/commits/:branchname/search", repo.SearchCommits)
r.Get("/commits/:branchname/**", repo.FileHistory)
r.Get("/commits/:branchname/*", repo.FileHistory)
r.Get("/commit/:branchname", repo.Diff)
r.Get("/commit/:branchname/**", repo.Diff)
r.Get("/commit/:branchname/*", repo.Diff)
r.Get("/releases", repo.Releases)
r.Get("/archive/:branchname/:reponame.zip", repo.ZipDownload)
r.Get("/archive/:branchname/:reponame.tar.gz", repo.TarGzDownload)
r.Get("/compare/:before([a-z0-9]+)...:after([a-z0-9]+)", repo.CompareDiff)
}, ignSignIn, middleware.RepoAssignment(true, true))
m.Group("/:username", func(r martini.Router) {
r.Get("/:reponame", middleware.RepoAssignment(true, true, true), repo.Single)
r.Any("/:reponame/**", repo.Http)
}, ignSignInAndCsrf)
m.Group("/:username", func(r *macaron.Router) {
r.Get("/:reponame", ignSignIn, middleware.RepoAssignment(true, true, true), repo.Home)
r.Any("/:reponame/*", ignSignInAndCsrf, repo.Http)
})
// robots.txt
m.Get("/robots.txt", func(ctx *middleware.Context) {
if setting.HasRobotsTxt {
ctx.ServeFile(path.Join(setting.CustomPath, "robots.txt"))
} else {
ctx.Error(404)
}
})
// Not found handler.
m.NotFound(routers.NotFound)
var err error
listenAddr := fmt.Sprintf("%s:%s", setting.HttpAddr, setting.HttpPort)
log.Info("Listen: %v://%s", setting.Protocol, listenAddr)
log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubUrl)
switch setting.Protocol {
case setting.HTTP:
err = http.ListenAndServe(listenAddr, m)
case setting.HTTPS:
err = http.ListenAndServeTLS(listenAddr, setting.CertFile, setting.KeyFile, m)
default:
log.Fatal("Invalid protocol: %s", setting.Protocol)
log.Fatal(4, "Invalid protocol: %s", setting.Protocol)
}
if err != nil {
log.Fatal("Fail to start server: %v", err)
log.Fatal(4, "Fail to start server: %v", err)
}
}

View File

@@ -1,9 +0,0 @@
## NOTICE
This directory only used for development, and us [go-bindata](https://github.com/jteeuwen/go-bindata) to store in memory for releases.
To apply any change in this directory, install [go-bindata](https://github.com/jteeuwen/go-bindata), and then execute following command in root of source directory:
```
$ go-bindata -ignore="\\.DS_Store|README.md" -o modules/bin/conf.go -pkg="bin" conf/...
```

View File

@@ -1,20 +1,19 @@
; App name that shows on every page title
APP_NAME = Gogs: Go Git Service
APP_LOGO = img/favicon.png
; Change it if you run locally
RUN_USER = git
; Either "dev", "prod" or "test", default is "dev"
RUN_MODE = dev
[repository]
ROOT =
ROOT =
SCRIPT_TYPE = bash
[server]
PROTOCOL = http
DOMAIN = localhost
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
HTTP_ADDR =
HTTP_ADDR =
HTTP_PORT = 3000
SSH_PORT = 22
; Disable CDN even in "prod" mode
@@ -22,12 +21,14 @@ OFFLINE_MODE = false
DISABLE_ROUTER_LOG = false
; Generate steps:
; $ cd path/to/gogs/custom/https
; $ go run $GOROOT/src/pkg/crypto/tls/generate_cert.go -ca=true -duration=8760h0m0s -host=myhost.example.com
; $ ./gogs cert -ca=true -duration=8760h0m0s -host=myhost.example.com
CERT_FILE = custom/https/cert.pem
KEY_FILE = custom/https/key.pem
; Upper level of template and static file path
; default is the path where Gogs is executed
STATIC_ROOT_PATH =
STATIC_ROOT_PATH =
; Application level GZIP support
#ENABLE_GZIP = false
[database]
; Either "mysql", "postgres" or "sqlite3", it's your choice
@@ -51,6 +52,8 @@ SECRET_KEY = !#@FDEWREWR&*(
LOGIN_REMEMBER_DAYS = 7
COOKIE_USERNAME = gogs_awesome
COOKIE_REMEMBER_NAME = gogs_incredible
; Reverse proxy authentication header name of user name
REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER
[service]
ACTIVE_CODE_LIVE_MINUTES = 180
@@ -65,6 +68,16 @@ REQUIRE_SIGNIN_VIEW = false
ENABLE_CACHE_AVATAR = false
; Mail notification
ENABLE_NOTIFY_MAIL = false
; More detail: https://github.com/gogits/gogs/issues/165
ENABLE_REVERSE_PROXY_AUTHENTICATION = false
; Repository Git hooks
ENABLE_GIT_HOOKS = false
[webhook]
; Cron task interval in minutes
TASK_INTERVAL = 1
; Deliver timeout in seconds
DELIVER_TIMEOUT = 5
[mailer]
ENABLED = false
@@ -75,20 +88,20 @@ SUBJECT = %(APP_NAME)s
; Mail server
; Gmail: smtp.gmail.com:587
; QQ: smtp.qq.com:25
HOST =
HOST =
; Mail from address
FROM =
FROM =
; Mailer user name and password
USER =
PASSWD =
USER =
PASSWD =
[oauth]
ENABLED = false
[oauth.github]
ENABLED = false
CLIENT_ID =
CLIENT_SECRET =
CLIENT_ID =
CLIENT_SECRET =
SCOPES = https://api.github.com/user
AUTH_URL = https://github.com/login/oauth/authorize
TOKEN_URL = https://github.com/login/oauth/access_token
@@ -97,16 +110,16 @@ TOKEN_URL = https://github.com/login/oauth/access_token
; https://console.developers.google.com/project
[oauth.google]
ENABLED = false
CLIENT_ID =
CLIENT_SECRET =
CLIENT_ID =
CLIENT_SECRET =
SCOPES = https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
AUTH_URL = https://accounts.google.com/o/oauth2/auth
TOKEN_URL = https://accounts.google.com/o/oauth2/token
[oauth.qq]
ENABLED = false
CLIENT_ID =
CLIENT_SECRET =
CLIENT_ID =
CLIENT_SECRET =
SCOPES = all
; QQ 互联
; AUTH_URL = https://graph.qq.com/oauth2.0/authorize
@@ -115,18 +128,10 @@ SCOPES = all
AUTH_URL = https://open.t.qq.com/cgi-bin/oauth2/authorize
TOKEN_URL = https://open.t.qq.com/cgi-bin/oauth2/access_token
[oauth.twitter]
ENABLED = false
CLIENT_ID =
CLIENT_SECRET =
SCOPES = all
AUTH_URL = https://api.twitter.com/oauth/authorize
TOKEN_URL = https://api.twitter.com/oauth/access_token
[oauth.weibo]
ENABLED = false
CLIENT_ID =
CLIENT_SECRET =
CLIENT_ID =
CLIENT_SECRET =
SCOPES = all
AUTH_URL = https://api.weibo.com/oauth2/authorize
TOKEN_URL = https://api.weibo.com/oauth2/access_token
@@ -137,8 +142,8 @@ ADAPTER = memory
; For "memory" only, GC interval in seconds, default is 60
INTERVAL = 60
; For "redis" and "memcache", connection host address
; redis: ":6039"
; memcache: "127.0.0.1:11211"
; redis: `:6039`
; memcache: `127.0.0.1:11211`
HOST =
[session]
@@ -146,9 +151,9 @@ HOST =
PROVIDER = file
; Provider config options
; memory: not have any config yet
; file: session file path, e.g. "data/sessions"
; redis: config like redis server addr, poolSize, password, e.g. "127.0.0.1:6379,100,astaxie"
; mysql: go-sql-driver/mysql dsn config string, e.g. "root:password@/session_table"
; file: session file path, e.g. `data/sessions`
; redis: config like redis server addr, poolSize, password, e.g. `127.0.0.1:6379,100,gogs`
; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
PROVIDER_CONFIG = data/sessions
; Session cookie name
COOKIE_NAME = i_like_gogits
@@ -170,6 +175,24 @@ SESSION_ID_HASHKEY =
SERVICE = server
DISABLE_GRAVATAR = false
[attachment]
; Whether attachments are enabled. Defaults to `true`
ENABLE = true
; Path for attachments. Defaults to `data/attachments`
PATH = data/attachments
; One or more allowed types, e.g. image/jpeg|image/png
ALLOWED_TYPES = image/jpeg|image/png
; Max size of each file. Defaults to 32MB
MAX_SIZE = 32
; Max number of files per upload. Defaults to 10
MAX_FILES = 10
[time]
; Specifies the format for fully outputed 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 =
[log]
ROOT_PATH =
; Either "console", "file", "conn", "smtp" or "database", default is "console"
@@ -182,12 +205,11 @@ LEVEL = Trace
; For "console" mode only
[log.console]
LEVEL =
LEVEL =
; For "file" mode only
[log.file]
LEVEL =
FILE_NAME = log/gogs.log
LEVEL =
; This enables automated log rotate(switch of following options), default is true
LOG_ROTATE = true
; Max line number of single file, default is 1000000
@@ -201,7 +223,7 @@ MAX_DAYS = 7
; For "conn" mode only
[log.conn]
LEVEL =
LEVEL =
; Reconnect host for every single message, default is false
RECONNECT_ON_MSG = false
; Try to reconnect when connection is lost, default is false
@@ -209,23 +231,32 @@ RECONNECT = false
; Either "tcp", "unix" or "udp", default is "tcp"
PROTOCOL = tcp
; Host address
ADDR =
ADDR =
; For "smtp" mode only
[log.smtp]
LEVEL =
LEVEL =
; Name displayed in mail title, default is "Diagnostic message from serve"
SUBJECT = Diagnostic message from serve
; Mail server
HOST =
HOST =
; Mailer user name and password
USER =
USER =
PASSWD =
; Receivers, can be one or more, e.g. ["1@example.com","2@example.com"]
RECEIVERS =
RECEIVERS =
; For "database" mode only
[log.database]
LEVEL =
DRIVER =
CONN =
LEVEL =
; Either "mysql" or "postgres"
DRIVER =
; Based on xorm, e.g.: root:root@localhost/gogs?charset=utf8
CONN =
[git]
MAX_GITDIFF_LINES = 10000
[i18n]
LANGS = en-US,zh-CN,zh-HK,de-DE,fr-CA,nl-NL
NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands

View File

@@ -59,7 +59,7 @@ _ReSharper*
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in

23
conf/license/BSD license Normal file
View File

@@ -0,0 +1,23 @@
Copyright (c) 2014
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,116 @@
CC0 1.0 Universal
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific
works ("Commons") that the public can reliably and without fear of later
claims of infringement build upon, modify, incorporate in other works, reuse
and redistribute as freely as possible in any form whatsoever and for any
purposes, including without limitation commercial purposes. These owners may
contribute to the Commons to promote the ideal of a free culture and the
further production of creative, cultural and scientific works, or to gain
reputation or greater distribution for their Work in part through the use and
efforts of others.
For these and/or other purposes and motivations, and without any expectation
of additional consideration or compensation, the person associating CC0 with a
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
and publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not limited
to, the following:
i. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or likeness
depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
vii. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
the Waiver for the benefit of each member of the public at large and to the
detriment of Affirmer's heirs and successors, fully intending that such Waiver
shall not be subject to revocation, rescission, cancellation, termination, or
any other legal or equitable action to disrupt the quiet enjoyment of the Work
by the public as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
is so judged Affirmer hereby grants to each affected person a royalty-free,
non transferable, non sublicensable, non exclusive, irrevocable and
unconditional license to exercise Affirmer's Copyright and Related Rights in
the Work (i) in all territories worldwide, (ii) for the maximum duration
provided by applicable law or treaty (including future time extensions), (iii)
in any current or future medium and for any number of copies, and (iv) for any
purpose whatsoever, including without limitation commercial, advertising or
promotional purposes (the "License"). The License shall be deemed effective as
of the date CC0 was applied by Affirmer to the Work. Should any part of the
License for any reason be judged legally invalid or ineffective under
applicable law, such partial invalidity or ineffectiveness shall not
invalidate the remainder of the License, and in such case Affirmer hereby
affirms that he or she will not (i) exercise any of his or her remaining
Copyright and Related Rights in the Work or (ii) assert any associated claims
and causes of action with respect to the Work, in either case contrary to
Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or otherwise,
including without limitation warranties of title, merchantability, fitness
for a particular purpose, non infringement, or the absence of latent or
other defects, accuracy, or the present or absence of errors, whether or not
discoverable, all to the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without limitation
any person's Copyright and Related Rights in the Work. Further, Affirmer
disclaims responsibility for obtaining any necessary consents, permissions
or other rights required for any use of the Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
<http://creativecommons.org/publicdomain/zero/1.0/>

View File

@@ -0,0 +1,203 @@
Eclipse Public License - v 1.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
1. DEFINITIONS
"Contribution" means:
a) in the case of the initial Contributor, the initial code and documentation
distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from and are
distributed by that particular Contributor. A Contribution 'originates'
from a Contributor if it was added to the Program by such Contributor
itself or anyone acting on such Contributor's behalf. Contributions do not
include additions to the Program which: (i) are separate modules of
software distributed in conjunction with the Program under their own
license agreement, and (ii) are not derivative works of the Program.
"Contributor" means any person or entity that distributes the Program.
"Licensed Patents" mean patent claims licensable by a Contributor which are
necessarily infringed by the use or sale of its Contribution alone or when
combined with the Program.
"Program" means the Contributions distributed in accordance with this
Agreement.
"Recipient" means anyone who receives the Program under this Agreement,
including all Contributors.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide, royalty-free copyright license to
reproduce, prepare derivative works of, publicly display, publicly
perform, distribute and sublicense the Contribution of such Contributor,
if any, and such derivative works, in source code and object code form.
b) Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide, royalty-free patent license under
Licensed Patents to make, use, sell, offer to sell, import and otherwise
transfer the Contribution of such Contributor, if any, in source code and
object code form. This patent license shall apply to the combination of
the Contribution and the Program if, at the time the Contribution is
added by the Contributor, such addition of the Contribution causes such
combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Contribution.
No hardware per se is licensed hereunder.
c) Recipient understands that although each Contributor grants the licenses
to its Contributions set forth herein, no assurances are provided by any
Contributor that the Program does not infringe the patent or other
intellectual property rights of any other entity. Each Contributor
disclaims any liability to Recipient for claims brought by any other
entity based on infringement of intellectual property rights or
otherwise. As a condition to exercising the rights and licenses granted
hereunder, each Recipient hereby assumes sole responsibility to secure
any other intellectual property rights needed, if any. For example, if a
third party patent license is required to allow Recipient to distribute
the Program, it is Recipient's responsibility to acquire that license
before distributing the Program.
d) Each Contributor represents that to its knowledge it has sufficient
copyright rights in its Contribution, if any, to grant the copyright
license set forth in this Agreement.
3. REQUIREMENTS
A Contributor may choose to distribute the Program in object code form under
its own license agreement, provided that:
a) it complies with the terms and conditions of this Agreement; and
b) its license agreement:
i) effectively disclaims on behalf of all Contributors all warranties
and conditions, express and implied, including warranties or
conditions of title and non-infringement, and implied warranties or
conditions of merchantability and fitness for a particular purpose;
ii) effectively excludes on behalf of all Contributors all liability for
damages, including direct, indirect, special, incidental and
consequential damages, such as lost profits;
iii) states that any provisions which differ from this Agreement are
offered by that Contributor alone and not by any other party; and
iv) states that source code for the Program is available from such
Contributor, and informs licensees how to obtain it in a reasonable
manner on or through a medium customarily used for software exchange.
When the Program is made available in source code form:
a) it must be made available under this Agreement; and
b) a copy of this Agreement must be included with each copy of the Program.
Contributors may not remove or alter any copyright notices contained
within the Program.
Each Contributor must identify itself as the originator of its Contribution,
if
any, in a manner that reasonably allows subsequent Recipients to identify the
originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities with
respect to end users, business partners and the like. While this license is
intended to facilitate the commercial use of the Program, the Contributor who
includes the Program in a commercial product offering should do so in a manner
which does not create potential liability for other Contributors. Therefore,
if a Contributor includes the Program in a commercial product offering, such
Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
every other Contributor ("Indemnified Contributor") against any losses,
damages and costs (collectively "Losses") arising from claims, lawsuits and
other legal actions brought by a third party against the Indemnified
Contributor to the extent caused by the acts or omissions of such Commercial
Contributor in connection with its distribution of the Program in a commercial
product offering. The obligations in this section do not apply to any claims
or Losses relating to any actual or alleged intellectual property
infringement. In order to qualify, an Indemnified Contributor must:
a) promptly notify the Commercial Contributor in writing of such claim, and
b) allow the Commercial Contributor to control, and cooperate with the
Commercial Contributor in, the defense and any related settlement
negotiations. The Indemnified Contributor may participate in any such claim at
its own expense.
For example, a Contributor might include the Program in a commercial product
offering, Product X. That Contributor is then a Commercial Contributor. If
that Commercial Contributor then makes performance claims, or offers
warranties related to Product X, those performance claims and warranties are
such Commercial Contributor's responsibility alone. Under this section, the
Commercial Contributor would have to defend claims against the other
Contributors related to those performance claims and warranties, and if a
court requires any other Contributor to pay any damages as a result, the
Commercial Contributor must pay those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
Recipient is solely responsible for determining the appropriateness of using
and distributing the Program and assumes all risks associated with its
exercise of rights under this Agreement , including but not limited to the
risks and costs of program errors, compliance with applicable laws, damage to
or loss of data, programs or equipment, and unavailability or interruption of
operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES.
7. GENERAL
If any provision of this Agreement is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of the
remainder of the terms of this Agreement, and without further action by the
parties hereto, such provision shall be reformed to the minimum extent
necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Program itself
(excluding combinations of the Program with other software or hardware)
infringes such Recipient's patent(s), then such Recipient's rights granted
under Section 2(b) shall terminate as of the date such litigation is filed.
All Recipient's rights under this Agreement shall terminate if it fails to
comply with any of the material terms or conditions of this Agreement and does
not cure such failure in a reasonable period of time after becoming aware of
such noncompliance. If all Recipient's rights under this Agreement terminate,
Recipient agrees to cease use and distribution of the Program as soon as
reasonably practicable. However, Recipient's obligations under this Agreement
and any licenses granted by Recipient relating to the Program shall continue
and survive.
Everyone is permitted to copy and distribute copies of this Agreement, but in
order to avoid inconsistency the Agreement is copyrighted and may only be
modified in the following manner. The Agreement Steward reserves the right to
publish new versions (including revisions) of this Agreement from time to
time. No one other than the Agreement Steward has the right to modify this
Agreement. The Eclipse Foundation is the initial Agreement Steward. The
Eclipse Foundation may assign the responsibility to serve as the Agreement
Steward to a suitable separate entity. Each new version of the Agreement will
be given a distinguishing version number. The Program (including
Contributions) may always be distributed subject to the version of the
Agreement under which it was received. In addition, after a new version of the
Agreement is published, Contributor may elect to distribute the Program
(including its Contributions) under the new version. Except as expressly
stated in Sections 2(a) and 2(b) above, Recipient receives no rights or
licenses to the intellectual property of any Contributor under this Agreement,
whether expressly, by implication, estoppel or otherwise. All rights in the
Program not expressly granted under this Agreement are reserved.
This Agreement is governed by the laws of the State of New York and the
intellectual property laws of the United States of America. No party to this
Agreement will bring a legal action under this Agreement more than one year
after the cause of action arose. Each party waives its rights to a jury trial in
any resulting litigation.

674
conf/license/GPL v3 Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

13
conf/license/ISC license Normal file
View File

@@ -0,0 +1,13 @@
Copyright (c) 2014
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

504
conf/license/LGPL v2.1 Normal file
View File

@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
(This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.)
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
{signature of Ty Coon}, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

165
conf/license/LGPL v3 Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -0,0 +1,362 @@
Mozilla Public License, version 2.0
1. Definitions
1.1. "Contributor"
means each individual or legal entity that creates, contributes to the
creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used by a
Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached the
notice in Exhibit A, the Executable Form of such Source Code Form, and
Modifications of such Source Code Form, in each case including portions
thereof.
1.5. "Incompatible With Secondary Licenses"
means
a. that the initial Contributor has attached the notice described in
Exhibit B to the Covered Software; or
b. that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the terms of
a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in a
separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible, whether
at the time of the initial grant or subsequently, any and all of the
rights conveyed by this License.
1.10. "Modifications"
means any of the following:
a. any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered Software; or
b. any new file in Source Code Form that contains any Covered Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the License,
by the making, using, selling, offering for sale, having made, import,
or transfer of either its Contributions or its Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU Lesser
General Public License, Version 2.1, the GNU Affero General Public
License, Version 3.0, or any later versions of those licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that controls, is
controlled by, or is under common control with You. For purposes of this
definition, "control" means (a) the power, direct or indirect, to cause
the direction or management of such entity, whether by contract or
otherwise, or (b) ownership of more than fifty percent (50%) of the
outstanding shares or beneficial ownership of such entity.
2. License Grants and Conditions
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
a. under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
b. under Patent Claims of such Contributor to make, use, sell, offer for
sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
a. for any code that a Contributor has removed from Covered Software; or
b. for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
c. under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights to
grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
Section 2.1.
3. Responsibilities
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
a. such Covered Software must also be made available in Source Code Form,
as described in Section 3.1, and You must inform recipients of the
Executable Form how they can obtain a copy of such Source Code Form by
reasonable means in a timely manner, at a charge no more than the cost
of distribution to the recipient; and
b. You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter the
recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty, or
limitations of liability) contained within the Source Code Form of the
Covered Software, except that You may alter any license notices to the
extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
If it is impossible for You to comply with any of the terms of this License
with respect to some or all of the Covered Software due to statute,
judicial order, or regulation then You must: (a) comply with the terms of
this License to the maximum extent possible; and (b) describe the
limitations and the code they affect. Such description must be placed in a
text file included with all distributions of the Covered Software under
this License. Except to the extent prohibited by statute or regulation,
such description must be sufficiently detailed for a recipient of ordinary
skill to be able to understand it.
5. Termination
5.1. The rights granted under this License will terminate automatically if You
fail to comply with any of its terms. However, if You become compliant,
then the rights granted under this License from a particular Contributor
are reinstated (a) provisionally, unless and until such Contributor
explicitly and finally terminates Your grants, and (b) on an ongoing
basis, if such Contributor fails to notify You of the non-compliance by
some reasonable means prior to 60 days after You have come back into
compliance. Moreover, Your grants from a particular Contributor are
reinstated on an ongoing basis if such Contributor notifies You of the
non-compliance by some reasonable means, this is the first time You have
received notice of non-compliance with this License from such
Contributor, and You become compliant prior to 30 days after Your receipt
of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
license agreements (excluding distributors and resellers) which have been
validly granted by You or Your distributors under this License prior to
termination shall survive termination.
6. Disclaimer of Warranty
Covered Software is provided under this License on an "as is" basis,
without warranty of any kind, either expressed, implied, or statutory,
including, without limitation, warranties that the Covered Software is free
of defects, merchantable, fit for a particular purpose or non-infringing.
The entire risk as to the quality and performance of the Covered Software
is with You. Should any Covered Software prove defective in any respect,
You (not any Contributor) assume the cost of any necessary servicing,
repair, or correction. This disclaimer of warranty constitutes an essential
part of this License. No use of any Covered Software is authorized under
this License except under this disclaimer.
7. Limitation of Liability
Under no circumstances and under no legal theory, whether tort (including
negligence), contract, or otherwise, shall any Contributor, or anyone who
distributes Covered Software as permitted above, be liable to You for any
direct, indirect, special, incidental, or consequential damages of any
character including, without limitation, damages for lost profits, loss of
goodwill, work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses, even if such party shall have been
informed of the possibility of such damages. This limitation of liability
shall not apply to liability for death or personal injury resulting from
such party's negligence to the extent applicable law prohibits such
limitation. Some jurisdictions do not allow the exclusion or limitation of
incidental or consequential damages, so this exclusion and limitation may
not apply to You.
8. Litigation
Any litigation relating to this License may be brought only in the courts
of a jurisdiction where the defendant maintains its principal place of
business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions. Nothing
in this Section shall prevent a party's ability to bring cross-claims or
counter-claims.
9. Miscellaneous
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides that
the language of a contract shall be construed against the drafter shall not
be used to construe this License against a Contributor.
10. Versions of the License
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses If You choose to distribute Source Code Form that is
Incompatible With Secondary Licenses under the terms of this version of
the License, the notice described in Exhibit B of this License must be
attached.
Exhibit A - Source Code Form License Notice
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular file,
then You may include the notice in a location (such as a LICENSE file in a
relevant directory) where a recipient would be likely to look for such a
notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
This Source Code Form is "Incompatible
With Secondary Licenses", as defined by
the Mozilla Public License, v. 2.0.

View File

@@ -0,0 +1,578 @@
app_desc = Ein einfacher, selbst gehosteter Git-Service, geschrieben in Go.
home = Home
dashboard = Dashboard
explore = Erkunden
help = Hilfe
sign_in = Anmelden
social_sign_in = Anmeldung über soziales Konto: zweiter Schritt <small>Konto verknüpfen</small>
sign_out = Abmelden
sign_up = Registrieren
register = Registrieren
website = Webseite
version = Version
page = Seite
template = Vorlage
language = Sprache
username = Benutzername
email = E-Mail
password = Passwort
re_type = Passwort bestätigen
captcha = Captcha
repository = Repository
organization = Organisation
mirror = Spiegel
new_repo = Neues Repository
new_migrate = Neue Migration
new_org = Neue Organisation
manage_org = Organisationen verwalten
admin_panel = Admin-Panel
account_settings = Kontoeinstellungen
settings = Einstellungen
news_feed = News Feed
pull_requests = Pull Requests
issues = Issues
cancel = Abbrechen
[install]
install = Installation
title = Installation für erstmaligen Start
requite_db_desc = Gogs erfordert MySQL, PostgreSQL oder SQLite 3, aber SQLite3 ist in der offiziellen binären Version akiviert.
db_type = Datenbanktyp
host = Host
user = Benutzer
password = Passwort
db_name = Datenbankname
db_helper = Bitte verwenden InnoDB-Engine mit utf8_general_ci Zeichensatz für MySQL.
ssl_mode = SSL-Modus
path = Pfad
sqlite_helper = Der Dateipfad des SQLite3 Datenbank.
general_title = Allgemeine Einstellungen von Gogs
repo_path = Repository Root-Verzeichnispfad
repo_path_helper = Alle Git-Repositorys werden in diesem Verzeichnis gespeichert.
run_user = Ausführender Benutzer
run_user_helper = Der Benutzer muss die Zugriffsberechtigung für das Repository Root-Verzeichnis haben und der ausführende Benutzer von Gogs sein.
domain = Domain
domain_helper = Dies hat Auswirkung auf die SSH clone URLs.
app_url = Anwendungs-URL
app_url_helper = Dies hat Auswirkung auf die HTTP/HTTPS clone URLs und für die E-Mails.
email_title = E-Mail-Service-Einstellungen (optional)
smtp_host = SMTP Host
mailer_user = Sender E-mail
mailer_password = Sender Passwort
notify_title = Benachrichtigungseinstellungen (optional)
register_confirm = Registrierungsbestätigung aktvieren
mail_notify = E-Mail-Benachrichtgung aktivieren
admin_title = Konto-Einstellungen für den Administrator
admin_name = Benutzername
admin_password = Passwort
confirm_password = Passwort bestätigen
admin_email = E-Mail
install_gogs = Gogs installieren
test_git_failed = Fehler beim Test des 'git' Kommandos: %v
sqlite3_not_available = Deine Version unterstüzt nicht SQLite3, bitte downloade dir die offiziele binäre Version von http://gogs.io/docs/installation/install_from_binary.html, NICHT die gobuild Version.
invalid_db_setting = Datenbank-Einstellungen sind nicht korrekt: %v
invalid_repo_path = Repository Root-Verzeichnis ist ungültig: %v
run_user_not_match = Der ausführende Benutzer ist nicht der aktuelle Benutzer: %s -> %s
save_config_failed = Versuche die Konfiguration zu speichern ist fehlgeschlagen: %v
invalid_admin_setting = Admin-Konto Einstellungen sind ungültig: %v
install_success = Herzlich Willkommen! Wir sind froh, dass du dich für Gogs entschieden hast. Hab viel Vergnügen damit.
[home]
uname_holder = Benutzername oder E-Mail
password_holder = Passwort
switch_dashboard_context = Dashboard Kontext wechseln
my_repos = Meine Repositorys
collaborative_repos = Gemeinschaftliche Repositorys
my_orgs = Meine Organisationen
my_mirrors = Meine Spiegel
[explore]
repos = Repositorys
[auth]
create_new_account = Neues Konto erstellen
register_hepler_msg = Du hast schon ein Konto? Jetzt anmelden!
social_register_hepler_msg = Du hast schon ein soziales Konto? Jetzt verknüpfen!
disable_register_prompt = Es tut uns leid, die Registrierung wurde deaktiviert. Bitte wende dich an den Administrator.
disable_register_mail = Es tut uns leid, die Bestätigung der Registrierungs-E-Mail wurde deaktiviert.
remember_me = angemeldet bleiben
forgot_password= Passwort vergessen
forget_password = Passwort vergessen?
sign_up_now = Du willst ein Konto? Jetzt registrieren!
confirmation_mail_sent_prompt = Eine neue Bestätigungs-E-Mail wurde an <b>%s</b> gesendet. Kontrolliere dein Postfach innerhalb der nächsten %d Stunden, um die Registrierung abzuschließen.
sign_in_email = Melde dich mit deiner E-Mail-Adresse an
active_your_account = Aktiviere dein Konto
resent_limit_prompt = Es tut uns leid, du sendest zu häufig Aktivierungs-E-Mails. Bitte warte 3 Minuten.
has_unconfirmed_mail = Hallo %s, du hast eine unbestätigte E-Mail-Adresse (<b>%s</b>). Falls du noch keine Bestätigungs-E-Mail erhalten hast oder eine neue senden musst, klicke auf den unteren Button.
resend_mail = Hier klicken, um deine Aktivierungs-E-Mail erneut zu versenden
email_not_associate = Diese E-Mail-Adresse ist mit keinem Konto verknüpft.
send_reset_mail = Hier klicken, um die E-Mail zum Passwort-zurücksetzen erneut zu versenden
reset_password = Passwort zurücksetzen
invalid_code = Es tut uns leid, der Bestätigungscode ist abgelaufen oder ungültig.
reset_password_helper = Hier klicken, um das Passwort zurückzusetzen
password_too_short = Das Passwort muss mindenstens 6 Zeichen lang sein
[form]
UserName = Benutzername
RepoName = Repository-Name
Email = E-Mail-Adresse
Password = Passwort
Retype = Passwort bestätigen
SSHTitle = SSH-Schlüsselname
HttpsUrl = HTTPS-URL
PayloadUrl = Payload-URL
TeamName = Teamname
AuthName = Authentifizierungsname
AdminEmail = Admin E-mail
require_error = ` darf nicht leer sein.`
alpha_dash_error = ` kann ausschließlich alphanumerische Zeichen und "-_" enthalten.`
alpha_dash_dot_error = ` kann ausschließlich alphanumerische Zeichen und ".-_" enthalten.`
min_size_error = ` muss mindestens %s Zeichen enthalten.`
max_size_error = ` darf höchstens %s Zeichen enthalten.`
email_error = ` ist keine gültige E-Mail-Adresse.`
url_error = ` ist keine gültige URL.`
unknown_error = Unbekannter Fehler:
captcha_incorrect = Captcha stimmt nicht überein.
password_not_match = Die Passwörter stimmen nicht überein.
username_been_taken = Benutzername ist bereits vergeben.
repo_name_been_taken = Repository-Name ist bereits vergeben.
org_name_been_taken = Organisationsname ist bereits vergeben.
team_name_been_taken = Teamname ist bereits vergeben.
email_been_used = E-Mail-Adresse wird bereits verwendet.
ssh_key_been_used = SSH-Schlüsselname wird bereits verwendet.
illegal_username = Benutzername enthält ungültige Zeichen.
illegal_repo_name = Repository-Name enthält ungültige Zeichen.
illegal_org_name = Organisationsname enthält ungültige Zeichen.
illegal_team_name = Teamname enthält ungültige Zeichen.
username_password_incorrect = Benutzername oder Passwort ist nicht korrekt.
enterred_invalid_repo_name = Bitte stelle sicher, dass der eingegeben Repository-Name richtig ist.
enterred_invalid_owner_name = Bitte stelle sicher, dass der eingegeben Besitzername richtig ist.
enterred_invalid_password = Bitte stelle sicher, dass das eingegebene Passwort richtig ist.
user_not_exist = Angegebener Benutzer existiert nicht.
last_org_owner = Der zu entfernende Benutzer ist der letzte Teambesitzer. Es muss einen anderen Besitzer geben.
invalid_ssh_key = Leider sind wir nicht in der Lage, deinen SSH-Schlüssel zu überprüfen: %s
auth_failed = Authentifizierung fehlgeschlagen: %v
still_own_repo = Dein Konto besitzt noch Repositorys. Diese müssen zuerst gelöscht oder übertragen werden.
org_still_own_repo = Diese Organisation besitzt noch Repositorys. Diese müssen zuerst gelöscht oder übertragen werden.
still_own_user = Diese Authentifizierung wird noch von einigen Benutzern genutzt. Entferne diese zuvor und lösche erneut.
[user]
change_avatar = Ändere dein Profilbild auf gravatar.com
join_on = Registriert
repositories = Repositorys
activity = Öffentliche Aktivität
followers = Folgen
starred = Markiert
following = Folgt
[settings]
profile = Profil
password = Passwort
ssh_keys = SSH-Schlüssel
social = Soziale Konten
orgs = Organisationen
delete = Konto löschen
uid = Uid
public_profile = Öffentliches Profil
profile_desc = Deine E-Mail-Adresse ist öffentlich und dient dazu, dir Benachrichtigungen bezüglich deines Kontos und deiner Repositorys zu schicken.
full_name = Vollständiger Name
website = Webseite
location = Standort
update_profile = Profil aktualisieren
update_profile_success = Profil aktualisiert
change_password = Passwort ändern
old_password = Aktuelles Passwort
new_password = Neues Passwort
password_incorrect = Aktuelles Passwort ist nicht korrekt.
change_password_success = Passwort geändert. Du kannst dich jetzt mit dem neuen Passwort anmelden.
manage_ssh_keys = SSH-Schlüssel verwalten
add_key = SSH-Schlüssel hinzufügen
ssh_desc = Dies ist eine Liste aller SSH-Schlüssel, die mit deinem Konto verknüpft sind. Entferne alle Schlüssel, die du nicht kennst.
ssh_helper = <strong>Du brauchst Hilfe?</strong> Hier ist eine Anleitung zum <a href="https://help.github.com/articles/generating-ssh-keys">Erzeugen von SSH-Schlüsseln</a> oder <a href="https://help.github.com/ssh-issues/">Problemlösen einfacher SSH-Probleme</a>.
add_new_key = SSH-Schlüssel hinzufügen
key_name = Schlüsselname
key_content = Inhalt
add_key_success = SSH-Schlüssel hinzugefügt
delete_key = SSH-Schlüssel löschen
add_on = Hinzugefügt am
last_used = Zuletzt verwendet auf
no_activity = Keine neuen Aktivitäten
manage_social = Verknüpfte soziale Konten verwalten
social_desc = Dies ist eine Liste verknüpfter sozialer Konten. Entferne alle Verknüpfungen, die du nicht kennst.
unbind = Verknüpfung entfernen
unbind_success = Die Verknüpfung zum sozialen Konto wurde entfernt.
delete_account = Konto löschen
delete_prompt = Diese Aktion wird dein Konto dauerhaft löschen und kann <strong>NICHT</strong> rückgängig gemacht werden!
confirm_delete_account = Löschen
[repo]
owner = Besitzer
repo_name = Repository-Name
repo_name_helper = Gute Repository-Namen sind kurz, einprägsam und <strong>einzigartig</strong>.
visibility = Sichtbarkeit
visiblity_helper = Dieses Repository ist <span class="label label-red label-radius">Privat</span>
repo_desc = Beschreibung
repo_lang = Sprache
repo_lang_helper = Wähle eine .gitignore Datei
license = Lizenz
license_helper = Wähle eine Lizenz aus
init_readme = Repository mit README.md initialisieren
create_repo = Repository erstellen
default_branch = Standard-Branch
mirror_interval = Spiegel-Intervall (in Stunden)
goget_meta = Go-Get Meta
goget_meta_helper = Dieses Repository wird man mit <span class="label label-blue label-radius">go get</span> klonen können.
need_auth = Authorisierung benötigt
migrate_type = Migrationstyp
migrate_type_helper = Dieses Repository wird ein <span class="label label-blue label-radius">Spiegel</span>
migrate_repo = Repository migrieren
copy_link = Klonen
clone_helper = Du brauchst Hilfe beim Klonen? Hier gibt es <a target="_blank" href="http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository">Hilfe</a>!
unwatch = Beobachtung beenden
watch = Beobachtung
unstar = Markierung aufheben
star = Markierung
fork = Abspaltung
quick_guide = Kurzanleitung
clone_this_repo = Dieses Repository klonen
create_new_repo_command = Erstelle ein neues Repository mittels der Kommandozeile
push_exist_repo = Übertrage ein existierendes Repository von der Kommandozeile
settings = Einstellungen
settings.options = Optionen
settings.collaboration = Zusammenarbeit
settings.hooks = Webhooks
settings.deploy_keys = Deploy-Keys
settings.basic_settings = Grundeinstellungen
settings.danger_zone = Gefahrenzone
settings.site = Offizielle Webseite
settings.update_settings = Aktualisierungseinstellungen
settings.transfer = Besitz übertragen
settings.transfer_desc = Übertrage dieses Repository einem anderen Benutzer oder einer Organisation.
settings.new_owner_has_same_repo = Neuer Eigentümer hat bereits ein Repository mit dem gleichen Namen.
settings.delete = Repository löschen
settings.delete_desc = Wenn dieses Repository gelöscht ist, gibt es keinen Weg zurück. Sei dir sicher!
settings.update_settings_success = Repository-Optionen aktualisiert
settings.transfer_owner = Neuer Besitzer
settings.make_transfer = übertragen
settings.transfer_succeed = Repository-Eigentum wurde erfolgreich übertragen.
settings.confirm_delete = Löschen
settings.add_collaborator = Mitarbeiter hinzufügen
settings.add_collaborator_success = Mitarbeiter hinzugefügt
settings.remove_collaborator_success = Mitarbeiter entfernt
settings.add_webhook = Webhook hinzufügen
settings.hooks_desc = Webhooks erlauben es externe Dienste zu informieren, wenn etwas bestimmtes in deinem Repository passiert. GoGS sendet dann eine POST-Request an alle angegebenen URLs. Erfahre mehr in unserem <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks Guide</a>.
settings.remove_hook_success = Webhook entfernt
settings.add_webhook_desc = GoGS sendet einen <code>POST</code>-Request an die unten stehende URL mit Details aller abonierten Ereignisse. Du kannst auch angeben, welches Datenformat du erhalten willst (JSON, <code>x-www-form-urlencoded</code>, <em>etc</em>). Mehr Informationen findest du im <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks Guide</a>.
settings.payload_url = Payload-URL
settings.content_type = Inhaltstyp
settings.secret = Secret
settings.event_desc = Welche Ereignisse sollen diesen Webhook auslösen?
settings.event_push_only = Nur das <code>push</code>-Ereignis.
settings.active = Aktiv
settings.active_helper = Ereignisdetails werden ausgeliefert, wenn dieser Webhook ausgelöst wird.
settings.add_hook_success = Webhook hinzugefügt
settings.update_webhook = Webhook aktualisieren
settings.update_hook_success = Webhook aktualisiert
settings.delete_webhook = Webhook löschen
settings.recent_deliveries = letzte Zustellungen
settings.hook_type = Hook Typ
settings.add_slack_hook_desc = Add <a href="http://slack.com">Slack</a> integration to your repository.
settings.slack_token = Token
settings.slack_domain = Domain
settings.slack_channel = Channel
[org]
org_name_holder = Name der Organisation
org_name_helper = Gute Namen von Organisationen sind kurz und einprägsam.
org_email_helper = Das E-Mail-Konto der Organisation empfängt alle Benachrichtigungen.
create_org = Organisation erstellen
repo_updated = Aktualisiert
people = Personen
invite_someone = Benutzer einladen
teams = Teams
lower_members = Mitglieder
lower_repositories = Repositorys
create_new_team = Neues Team erstellen
org_desc = Beschreibung
team_name = Teamname
team_desc = Beschreibung
team_name_helper = Verwende diesen Namen, um dich auf dieses Team zu beziehen.
team_desc_helper = Was hat es mit diesem Team auf sich?
team_permission_desc = Welche Berechtigungsstufe soll das Team haben?
settings = Einstellungen
settings.options = Optionen
settings.full_name = Vollständiger Name
settings.website = Webseite
settings.location = Standort
settings.update_settings = Aktualisierungseinstellungen
settings.update_setting_success = Organisationseinstellungen aktualisiert
settings.delete = Organisation löschen
settings.delete_account = Diese Organisation löschen
settings.delete_prompt = Die Organisation wird dauerhaft gelöscht. Dies kann <strong>NICHT</strong> rückgängig gemacht werden!
settings.confirm_delete_account = Löschen
settings.hooks_desc = Füge Webhooks hinzu, die für <strong>alle</strong> Repositorys dieser Organisation ausgelöst werden.
members.public = Öffentlich
members.public_helper = Privat machen
members.private = Privat
members.private_helper = Öffentlich machen
members.owner = Besitzer
members.member = Mitglied
members.conceal = Verbergen
members.remove = Entfernen
members.leave = Verlassen
members.invite_desc = Benutzernamen eingeben, um ihn als neues Mitglied in %s einzuladen:
members.invite_now = Jetzt einladen
teams.join = Beitreten
teams.leave = Verlassen
teams.read_access = Lesezugriff
teams.read_access_helper = Dieses Team wird Repositorys einsehen und klonen können.
teams.write_access = Schreibzugriff
teams.write_access_helper = Dieses Team wird die Repositorys einsehen und in sie hinein pushen können.
teams.admin_access = Adminzugriff
teams.admin_access_helper = Dieses Team wird pull- und push-Rechte für die Repositorys haben und Mitarbeiter einladen können.
teams.no_desc = Dieses Team hat keine Beschreibung
teams.settings = Einstellungen
teams.owners_permission_desc = Besitzer haben vollen Zugriff auf <strong>alle Repositorys</strong> und <strong>Admin Rechte</strong> für diese Organisation.
teams.members = Teammitglieder
teams.update_settings = Einstellungen aktualisieren
teams.delete_team = Dieses Team löschen
teams.add_team_member = Teammitglied hinzufügen
teams.delete_team_success = Team gelöscht
teams.read_permission_desc = Dieses Team erlaubt <strong>Lesezugriff</strong>: Mitglieder können Team-Repositorys einsehen und klonen.
teams.write_permission_desc = Dieses Team erlaubt <strong>Schreibzugriff</strong>: Mitglieder können Team-Repositorys einsehen und hinein pushen.
teams.admin_permission_desc = Diese Team erlaubt <strong>Adminzugriff</strong>: Mitglieder dieses Teams können pullen, pushen und dem Team Mitarbeiter hinzufügen.
teams.repositories = Team-Repositorys
teams.add_team_repository = Team-Repository hinzufügen
teams.remove_repo = Entfernen
[admin]
dashboard = Dashboard
users = Benutzer
organizations = Organisationen
repositories = Repositorys
authentication = Authentifizierung
config = Konfiguration
monitor = Monitoring
prev = zurück
next = vor
dashboard.statistic = Statistik
dashboard.operations = Operationen
dashboard.system_status = System-Monitor-Status
dashboard.statistic_info = GoGS Datenbank hat <b>%d</b> Benutzer, <b>%d</b> Organisationen, <b>%d</b> öffentliche Schlüssel, <b>%d</b> Repositorys, <b>%d</b> Beobachtungen, <b>%d</b> Markierungen, <b>%d</b> Aktionen, <b>%d</b> Zugriffe, <b>%d</b> Issues, <b>%d</b> Kommentare, <b>%d</b> soziale Konten, <b>%d</b> Folgende, <b>%d</b> Spiegel, <b>%d</b> Releases, <b>%d</b> Login-Quellen, <b>%d</b> Webhooks, <b>%d</b> Milestones, <b>%d</b> Labels, <b>%d</b> Hook-Tasks, <b>%d</b> Teams, <b>%d</b> Aktualisierungs-Tasks, <b>%d</b> Anhänge.
dashboard.operation_name = Name der Operation
dashboard.operation_switch = Switch
dashboard.operation_run = Ausführen
dashboard.clean_unbind_oauth = ungebundene OAuths bereinigen
dashboard.delete_inactivate_accounts = inaktive Konten löschen
dashboard.server_uptime = Server-Uptime
dashboard.current_goroutine = Aktuelle Goroutines
dashboard.current_memory_usage = Aktuelle Speichernutzung
dashboard.total_memory_allocated = Zugeteilter Gesamtspeicher
dashboard.memory_obtained = Erhaltener Speicher
dashboard.pointer_lookup_times = Pointer Lookup Times
dashboard.memory_allocate_times = Memory Allocate Times
dashboard.memory_free_times = Memory Free Times
dashboard.current_heap_usage = Aktuelle Heap-Auslastung
dashboard.heap_memory_obtained = erhaltener Heap-Memory
dashboard.heap_memory_idle = unbenutzter Heap-Memory
dashboard.heap_memory_in_use = benutzter Heap-Memory
dashboard.heap_memory_released = freigegebener Heap-Memory
dashboard.heap_objects = Heap-Objekte
dashboard.bootstrap_stack_usage = Bootstrap-Stack-Auslastung
dashboard.stack_memory_obtained = erhaltener Stack-Memory
dashboard.mspan_structures_usage = MSpan-Structures-Auslastung
dashboard.mspan_structures_obtained = erhaltene MSpan-Structures
dashboard.mcache_structures_usage = MCache-Structures-Auslastung
dashboard.mcache_structures_obtained = erhaltene MCache-Structures
dashboard.profiling_bucket_hash_table_obtained = Profiling Bucket Hash Table Obtained
dashboard.gc_metadata_obtained = erhaltene GC-Metadata
dashboard.other_system_allocation_obtained = andere erhaltene System-Allokatoren
dashboard.next_gc_recycle = nächster GC-Zyklus
dashboard.last_gc_time = seit letztem GC-Zyklus
dashboard.total_gc_time = gesammte GC-Zeit
dashboard.total_gc_pause = gesammte GC-Pause
dashboard.last_gc_pause = letzte GC-Pause
dashboard.gc_times = GC-Takt
users.user_manage_panel = Benutzer
users.new_account = Neues Konto erstellen
users.name = Name
users.activated = Aktiviert
users.admin = Admin
users.repos = Repositorys
users.created = Erzeugt
users.edit = Bearbeiten
users.auth_source = Auth-Quelle
users.local = Lokal
users.auth_login_name = Auth-Login-Name
users.update_profile_success = Kontoprofil aktualisiert
users.edit_account = Konto bearbeiten
users.is_activated = Dieses Konto ist aktiviert
users.is_admin = Dieses Konto hat Administratorrechte
users.update_profile = Kontoprofil aktualisieren
users.delete_account = Dieses Konto löschen
users.still_own_repo = Dieses Konto besitzt noch Repositorys. Diese müssen zuerst gelöscht oder übertragen werden.
orgs.org_manage_panel = Organisationenverwaltung
orgs.name = Name
orgs.teams = Teams
orgs.members = Mitglieder
repos.repo_manage_panel = Repositorys
repos.owner = Besitzer
repos.name = Name
repos.private = Privat
repos.watches = Beobachtungen
repos.stars = Markierungen
repos.issues = Issues
auths.auth_manage_panel = Authentifizierung
auths.new = Neue Authentifizierungsquelle hinzufügen
auths.name = Name
auths.type = Typ
auths.enabled = aktiviert
auths.updated = aktualisiert
auths.auth_type = Authentifizierungstyp
auths.auth_name = Authentifizierungsname
auths.domain = Domain
auths.host = Host
auths.port = Port
auths.base_dn = Base DN
auths.attributes = Suchattribute
auths.filter = Suchfilter
auths.ms_ad_sa = Ms Ad SA
auths.smtp_auth = SMTP-Authentifizierungstyp
auths.smtphost = SMTP-Host
auths.smtpport = SMTP-Port
auths.enable_tls = TLS-Verschlüsselung aktivieren
auths.enable_auto_register = Automatische Registrierung aktivieren
auths.tips = Tipps
auths.edit = Authentifizierungseinstellungen bearbeiten
auths.activated = Diese Authentifizierung ist aktiviert
auths.update_success = Authentifizierungseinstellungen aktualisiert
auths.update = Authentifizierungseinstellungen aktualisieren
auths.delete = Authentifizierung löschen
config.server_config = Server-Konfiguration
config.app_name = Anwendungsname
config.app_ver = Anwendungsversion
config.app_url = Anwendungs-URL
config.domain = Domain
config.offline_mode = Offline-Modus
config.disable_router_log = Router-Log deaktivieren
config.run_user = Laufzeit-Benutzer
config.run_mode = Laufzeit-Modus
config.repo_root_path = Repository-Verzeichnis
config.static_file_root_path = Verzeichnis für statische Dateien
config.log_file_root_path = Log-Verzeichnis
config.script_type = Skript-Typ
config.reverse_auth_user = Reverse Authentication User
config.db_config = Datenbankkonfiguration
config.db_type = Typ
config.db_host = Host
config.db_name = Name
config.db_user = Benutzer
config.db_ssl_mode = SSL-Modus
config.db_ssl_mode_helper = (nur für "postgres")
config.db_path = Verzeichnis
config.db_path_helper = (nur für "sqlite3")
config.service_config = Service-Einstellungen
config.register_email_confirm = E-Mail-Bestätigung bei Registrierung
config.disable_register = Registrierung deaktivieren
config.require_sign_in_view = Ansehen erfordert Registrierung
config.mail_notify = E-Mail-Benachrichtigung
config.enable_cache_avatar = Avatar-Cache aktivieren
config.active_code_lives = Aktivierungscode Lebensdauer
config.reset_password_code_lives = Passwortcode Lebensdauer
config.webhook_config = Webhook-Einstellungen
config.task_interval = Task-Intervall
config.deliver_timeout = Zeitlimit für Zustellung
config.mailer_config = Mailer-Einstellungen
config.mailer_enabled = Aktiviert
config.mailer_name = Name
config.mailer_host = Host
config.mailer_user = Benutzer
config.oauth_config = OAuth-Einstellungen
config.oauth_enabled = Aktiviert
config.cache_config = Cache-Einstellungen
config.cache_adapter = Cache-Adapter
config.cache_interval = Cache-Intervall
config.cache_conn = Cache-Anbindung
config.session_config = Session-Einstellungen
config.session_provider = Session-Provider
config.provider_config = Provider-Einstellungen
config.cookie_name = Cookie-Name
config.enable_set_cookie = Cookies einschalten
config.gc_interval_time = GC-Intervallzeit
config.session_life_time = Session-Lebensdauer
config.https_only = nur HTTPS
config.cookie_life_time = Cookie-Lebensdauer
config.session_hash_function = Session-ID-Hashfunktion
config.session_hash_key = Session-ID-Hashschlüssel
config.picture_config = Bildeinstellungen
config.picture_service = Bildservice
config.disable_gravatar = Gravatar deaktivieren
config.log_config = Log-Einstellungen
config.log_mode = Log-Modus
monitor.cron = Cron-Tasks
monitor.name = Name
monitor.schedule = Zeitplan
monitor.next = nächste Ausführung
monitor.previous = letzte Ausführung
monitor.execute_times = Anzahl Ausführungen
monitor.process = Laufende Prozesse
monitor.desc = Beschreibung
monitor.start = Startzeit
monitor.execute_time = Ausführungszeit
[action]
create_repo = hat Repository <a href="%s/%s">%s</a> erstellt
commit_repo = hat nach <a href="%s/%s/src/%s">%s</a> in <a href="%s/%s">%s</a> gepusht
create_issue = hat Issue <a href="%s/%s/issues/%s">%s#%s</a> eröffnet
comment_issue = hat Issue <a href="%s/%s/issues/%s">%s#%s</a> kommentiert
transfer_repo = hat Repository <code>%s</code> transferiert an <a href="/%s%s">%s</a>
[tool]
ago = vor
from_now = ab sofort
now = Jetzt
1s = 1 Sekunde %s
1m = 1 Minute %s
1h = 1 Stunde %s
1d = 1 Tag %s
1w = 1 Woche %s
1mon = 1 Monat %s
1y = 1 Jahr %s
seconds = %d Sekunden %s
minutes = %d Minuten %s
hours = %d Stunden %s
days = %d Tage %s
weeks = %d Wochen %s
months = %d Monate %s
years = %d Jahre %s
raw_seconds = Sekunden
raw_minutes = Minuten

View File

@@ -0,0 +1,645 @@
app_desc = A painless self-hosted Git service written in Go
home = Home
dashboard = Dashboard
explore = Explore
help = Help
sign_in = Sign In
social_sign_in = Social Sign In: 2nd Step <small>associate account</small>
sign_out = Sign Out
sign_up = Sign Up
register = Register
website = Website
version = Version
page = Page
template = Template
language = Language
username = Username
email = E-mail
password = Password
re_type = Re-Type
captcha = Captcha
repository = Repository
organization = Organization
mirror = Mirror
new_repo = New Repository
new_migrate = New Migration
new_org = New Organization
manage_org = Manage Organizations
admin_panel = Admin Panel
account_settings = Account Settings
settings = Settings
news_feed = News Feed
pull_requests = Pull Requests
issues = Issues
cancel = Cancel
[install]
install = Installation
title = Install Steps For First-time Run
requite_db_desc = Gogs requires MySQL, PostgreSQL or SQLite3, but SQLite3 is usually available in the official binary version.
db_type = Database Type
host = Host
user = User
password = Password
db_name = Database Name
db_helper = Please use INNODB engine with utf8_general_ci charset for MySQL.
ssl_mode = SSL Mode
path = Path
sqlite_helper = The file path of SQLite3 database.
general_title = General Settings of Gogs
repo_path = Repository Root Path
repo_path_helper = All Git remote repositories will be saved to this directory.
run_user = Run User
run_user_helper = The user must have access to Repository Root Path and run Gogs.
domain = Domain
domain_helper = This affects SSH clone URLs.
app_url = Application URL
app_url_helper = This affects HTTP/HTTPS clone URL and somewhere in e-mail.
email_title = Email Service Settings(Optional)
smtp_host = SMTP Host
mailer_user = Sender E-mail
mailer_password = Sender Password
notify_title = Notification Settings(Optional)
register_confirm = Enable Register Confirmation
mail_notify = Enable Mail Notification
admin_title = Admin Account Settings
admin_name = Username
admin_password = Password
confirm_password = Confirm Password
admin_email = E-mail
install_gogs = Install Gogs
test_git_failed = Fail to test 'git' command: %v
sqlite3_not_available = Your release version does not support SQLite3, please download the official binary version from http://gogs.io/docs/installation/install_from_binary.html, NOT the gobuild version.
invalid_db_setting = Database setting is not correct: %v
invalid_repo_path = Repository root path is invalid: %v
run_user_not_match = Run user isn't the current user: %s -> %s
save_config_failed = Fail to save configuration: %v
invalid_admin_setting = Admin account setting is invalid: %v
install_success = Welcome! We're glad that you choose Gogs, have fun and take care.
[home]
uname_holder = Username or E-mail
password_holder = Password
switch_dashboard_context = Switch Dashboard Context
my_repos = My Repositories
collaborative_repos = Collaborative Repositories
my_orgs = My Organizations
my_mirrors = My Mirrors
[explore]
repos = Repositories
[auth]
create_new_account = Create New Account
register_hepler_msg = Already have an account? Sign in now!
social_register_hepler_msg = Already have an account? Bind now!
disable_register_prompt = Sorry, registration has been disabled. Please contact the site administrator.
disable_register_mail = Sorry, Register Mail Confirmation has been disabled.
remember_me = Remember Me
forgot_password= Forgot Password
forget_password = Forgot password?
sign_up_now = Need an account? Sign up now.
confirmation_mail_sent_prompt = A new confirmation e-mail has been sent to <b>%s</b>, please check your inbox within the next %d hours to complete your registration.
sign_in_email = Sign in to your e-mail
active_your_account = Activate Your Account
resent_limit_prompt = Sorry, you are sending an activation e-mail too frequently. Please wait 3 minutes.
has_unconfirmed_mail = Hi %s, you have an unconfirmed email address(<b>%s</b>). If you haven't received a confirmation e-mail or need to resend a new one, please click on the button below.
resend_mail = Click here to resend your activation e-mail
email_not_associate = This e-mail address does not associate to any account.
send_reset_mail = Click here to (re)send your password reset e-mail
reset_password = Reset Your Password
invalid_code = Sorry, your confirmation code has expired or not valid.
reset_password_helper = Click here to reset your password
password_too_short = Password length cannot be less then 6.
[form]
UserName = Username
RepoName = Repository name
Email = E-mail address
Password = Password
Retype = Re-type password
SSHTitle = SSH key name
HttpsUrl = HTTPS URL
PayloadUrl = Payload URL
TeamName = Team name
AuthName = Authorization name
AdminEmail = Admin E-mail
require_error = ` cannot be empty.`
alpha_dash_error = ` must be valid alpha or numeric or dash(-_) characters.`
alpha_dash_dot_error = ` must be valid alpha or numeric or dash(-_) or dot characters.`
min_size_error = ` must contain at least %s characters.`
max_size_error = ` must contain at most %s characters.`
email_error = ` is not a valid e-mail address.`
url_error = ` is not a valid URL.`
unknown_error = Unknown error:
captcha_incorrect = Captcha didn't match.
password_not_match = Password and confirm password are not same.
username_been_taken = Username has been already taken.
repo_name_been_taken = Repository name has been already taken.
org_name_been_taken = Organization name has been already taken.
team_name_been_taken = Team name has been already taken.
email_been_used = E-mail address has been already used.
ssh_key_been_used = Public key name has been used.
illegal_username = Your username contains illegal characters.
illegal_repo_name = Repository name contains illegal characters.
illegal_org_name = Organization name contains illegal characters.
illegal_team_name = Team name contains illegal characters.
username_password_incorrect = Username or password is not correct.
enterred_invalid_repo_name = Please make sure you entered repository name is correct.
enterred_invalid_owner_name = Please make sure you entered owner name is correct.
enterred_invalid_password = Please make sure you entered password is correct.
user_not_exist = Given user does not exist.
last_org_owner = The user to remove is the last member in owner team. There must be another owner.
invalid_ssh_key = Sorry, we're not able to verify your SSH key: %s
auth_failed = Authentication failed: %v
still_own_repo = Your account still have ownership of repository, you have to delete or transfer them first.
org_still_own_repo = This organization still have ownership of repository, you have to delete or transfer them first.
still_own_user = This authentication still has used by some users, you should move them and then delete again.
[user]
change_avatar = Change your avatar at gravatar.com
join_on = Joined on
repositories = Repositories
activity = Public Activity
followers = Followers
starred = Starred
following = Following
[settings]
profile = Profile
password = Password
ssh_keys = SSH Keys
social = Social Accounts
orgs = Organizations
delete = Delete Account
uid = Uid
public_profile = Public Profile
profile_desc = Your Email address is public and will be used for any account related notifications, and any web based operations made via the site.
full_name = Full Name
website = Website
location = Location
update_profile = Update Profile
update_profile_success = Your profile has been successfully updated.
change_username = Username Changed
change_username_desc = Username has been changed, do you want to continue? This will affect all links relate to your account.
continue = Continue
cancel = Cancel
change_password = Change Password
old_password = Current Password
new_password = New Password
password_incorrect = Current password is not correct.
change_password_success = Password is changed successfully. You can now sign in via new password.
manage_ssh_keys = Manage SSH Keys
add_key = Add Key
ssh_desc = This is a list of SSH keys associated with your account. Remove any keys that you do not recognize.
ssh_helper = <strong>Need help?</strong> Check out our guide to <a href="https://help.github.com/articles/generating-ssh-keys">generating SSH keys</a> or troubleshoot <a href="https://help.github.com/ssh-issues/">common SSH Problems</a>.
add_new_key = Add SSH Key
key_name = Key Name
key_content = Content
add_key_success = New SSH Key has been added!
delete_key = Delete
add_on = Added on
last_used = Last used on
no_activity = No recent activity
manage_social = Manage Associated Social Accounts
social_desc = This is a list of associated social accounts. Remove any binding that you do not recognize.
unbind = Unbind
unbind_success = Social account has been unbound.
delete_account = Delete Your Account
delete_prompt = The operation will delete your account permanently, and <strong>CANNOT</strong> be undone!
confirm_delete_account = Confirm Deletion
delete_account_title = Account Deletion
delete_account_desc = This account is going to be deleted permanently, do you want to continue?
[repo]
owner = Owner
repo_name = Repository Name
repo_name_helper = Great repository names are short, memorable and <strong>unique</strong>.
visibility = Visibility
visiblity_helper = This repository is <span class="label label-red label-radius">Private</span>
repo_desc = Description
repo_lang = Language
repo_lang_helper = Select a .gitignore file
license = License
license_helper = Select a license file
init_readme = Initialize this repository with a README.md
create_repo = Create Repository
default_branch = Default Branch
mirror_interval = Mirror Interval(hour)
goget_meta = Go-Get Meta
goget_meta_helper = This repository will be <span class="label label-blue label-radius">Go-Getable</span>
need_auth = Need Authorization
migrate_type = Migration Type
migrate_type_helper = This repository will be a <span class="label label-blue label-radius">Mirror</span>
migrate_repo = Migrate Repository
copy_link = Copy
click_to_copy = Copy to clipboard
copied = Copied OK
clone_helper = Need help cloning? Visit <a target="_blank" href="http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository">Help</a>!
unwatch = Unwatch
watch = Watch
unstar = Unstar
star = Star
fork = Fork
no_desc = No Description
quick_guide = Quick Guide
clone_this_repo = Clone this repository
create_new_repo_command = Create a new repository on the command line
push_exist_repo = Push an existing repository from the command line
branch = Branch
tree = Tree
branch_and_tags = Branches & Tags
branches = Branches
tags = Tags
issues = Issues
commits = Commits
releases = Releases
commits.commits = Commits
commits.search = Search commits
commits.find = Find
commits.author = Author
commits.message = Message
commits.date = Date
commits.older = Older
commits.newer = Newer
settings = Settings
settings.options = Options
settings.collaboration = Collaboration
settings.hooks = Webhooks
settings.githooks = Git Hooks
settings.deploy_keys = Deploy Keys
settings.basic_settings = Basic Settings
settings.danger_zone = Danger Zone
settings.site = Official Site
settings.update_settings = Update Settings
settings.change_reponame = Repository Name Changed
settings.change_reponame_desc = Repository name has been changed, do you want to continue? This will affect all links relate to this repository.
settings.transfer = Transfer Ownership
settings.transfer_desc = Transfer this repo to another user or to an organization where you have admin rights.
settings.new_owner_has_same_repo = New owner already has a repository with same name.
settings.delete = Delete This Repository
settings.delete_desc = Once you delete a repository, there is no going back. Please be certain.
settings.transfer_notices = <p>- You will lose access if new owner is a individual user.</p><p>- You will remain access if new owner is an organization and you're one of the owners.</p>
settings.update_settings_success = Repository options has been successfully updated.
settings.transfer_owner = New Owner
settings.make_transfer = Make Transfer
settings.transfer_succeed = Repository ownership has been successfully transferred.
settings.confirm_delete = Confirm Deletion
settings.add_collaborator = Add New Collaborator
settings.add_collaborator_success = New collaborator has been added.
settings.remove_collaborator_success = Collaborator has been removed.
settings.user_is_org_member = User is organization member who cannot be added as a collaborator.
settings.add_webhook = Add Webhook
settings.hooks_desc = Webhooks allow external services to be notified when certain events happen on Gogs. When the specified events happen, we'll send a POST request to each of the URLs you provide. Learn more in our <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks Guide</a>.
settings.githooks_desc = Git Hooks are powered by Git itself, you can edit files of supported hooks in the list below to apply custom operations.
settings.githook_edit_desc = If hook is not active, sample content will be presented. Leave content to be blank will disable this hook.
settings.githook_name = Hook Name
settings.githook_content = Hook Content
settings.update_githook = Update Hook
settings.remove_hook_success = Webhook has been removed.
settings.add_webhook_desc = Well send a <code>POST</code> request to the URL below with details of any subscribed events. You can also specify which data format you'd like to receive (JSON, <code>x-www-form-urlencoded</code>, <em>etc</em>). More information can be found in <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks Guide</a>.
settings.payload_url = Payload URL
settings.content_type = Content Type
settings.secret = Secret
settings.event_desc = Which events would you like to trigger this webhook?
settings.event_push_only = Just the <code>push</code> event.
settings.active = Active
settings.active_helper = We will deliver event details when this hook is triggered.
settings.add_hook_success = New webhook has been added.
settings.update_webhook = Update Webhook
settings.update_hook_success = Webhook has been updated.
settings.delete_webhook = Delete Webhook
settings.recent_deliveries = Recent Deliveries
settings.hook_type = Hook Type
settings.add_slack_hook_desc = Add <a href="http://slack.com">Slack</a> integration to your repository.
settings.slack_token = Token
settings.slack_domain = Domain
settings.slack_channel = Channel
[org]
org_name_holder = Organization Name
org_name_helper = Great organization names are short and memorable.
org_email_helper = Organization's Email receives all notifications and confirmations.
create_org = Create Organization
repo_updated = Updated
people = People
invite_someone = Invite Someone
teams = Teams
lower_members = members
lower_repositories = repositories
create_new_team = Create New Team
org_desc = Description
team_name = Team Name
team_desc = Description
team_name_helper = You'll use this name to mention this team in conversations.
team_desc_helper = What is this team all about?
team_permission_desc = What permission level should this team have?
settings = Settings
settings.options = Options
settings.full_name = Full Name
settings.website = Website
settings.location = Location
settings.update_settings = Update Settings
settings.change_orgname = Organization Name Changed
settings.change_orgname_desc = Organization name has been changed, do you want to continue? This will affect all links relate to this organization.
settings.update_setting_success = Organization setting has been successfully updated.
settings.delete = Delete Organization
settings.delete_account = Delete This Organization
settings.delete_prompt = The operation will delete this organization permanently, and <strong>CANNOT</strong> be undone!
settings.confirm_delete_account = Confirm Deletion
settings.delete_org_title = Organization Deletion
settings.delete_org_desc = This organization is going to be deleted permanently, do you want to continue?
settings.hooks_desc = Add webhooks that will be triggered for <strong>all repositories</strong> under this organization.
members.public = Public
members.public_helper = make private
members.private = Private
members.private_helper = make public
members.owner = Owner
members.member = Member
members.conceal = Conceal
members.remove = Remove
members.leave = Leave
members.invite_desc = Start typing a username to invite a new member to %s:
members.invite_now = Invite Now
teams.join = Join
teams.leave = Leave
teams.read_access = Read Access
teams.read_access_helper = This team will be able to view and clone its repositories.
teams.write_access = Write Access
teams.write_access_helper = This team will be able to read its repositories, as well as push to them.
teams.admin_access = Admin Access
teams.admin_access_helper = This team will be able to push/pull to its repositories, as well as add other collaborators to them.
teams.no_desc = This team has no description
teams.settings = Settings
teams.owners_permission_desc = Owners have full access to <strong>all repositories</strong> and have <strong>admin rights</strong> to the organization.
teams.members = Team Members
teams.update_settings = Update Settings
teams.delete_team = Delete This Team
teams.add_team_member = Add Team Member
teams.delete_team_title = Team Deletion
teams.delete_team_desc = This team is going to be deleted, do you want to continue? Members of this team may lose access to some repositories.
teams.delete_team_success = Given team has been successfully deleted.
teams.read_permission_desc = This team grants <strong>Read</strong> access: members can view and clone the team's repositories.
teams.write_permission_desc = This team grants <strong>Write</strong> access: members can read from and push to the team's repositories.
teams.admin_permission_desc = This team grants <strong>Admin</strong> access: members can read from, push to, and add collaborators to the team's repositories.
teams.repositories = Team Repositories
teams.add_team_repository = Add Team Repository
teams.remove_repo = Remove
teams.add_nonexistent_repo = The repository you're trying to add does not exist, please create it first.
[admin]
dashboard = Dashboard
users = Users
organizations = Organizations
repositories = Repositories
authentication = Authentications
config = Configuration
notices = System Notices
monitor = Monitoring
prev = Prev.
next = Next
dashboard.statistic = Statistic
dashboard.operations = Operations
dashboard.system_status = System Monitor Status
dashboard.statistic_info = Gogs database has <b>%d</b> users, <b>%d</b> organizations, <b>%d</b> public keys, <b>%d</b> repositories, <b>%d</b> watches, <b>%d</b> stars, <b>%d</b> actions, <b>%d</b> accesses, <b>%d</b> issues, <b>%d</b> comments, <b>%d</b> social accounts, <b>%d</b> follows, <b>%d</b> mirrors, <b>%d</b> releases, <b>%d</b> login sources, <b>%d</b> webhooks, <b>%d</b> milestones, <b>%d</b> labels, <b>%d</b> hook tasks, <b>%d</b> teams, <b>%d</b> update tasks, <b>%d</b> attachments.
dashboard.operation_name = Operation Name
dashboard.operation_switch = Switch
dashboard.operation_run = Run
dashboard.clean_unbind_oauth = Clean unbound OAuthes
dashboard.delete_inactivate_accounts = Delete all inactive accounts
dashboard.server_uptime = Server Uptime
dashboard.current_goroutine = Current Goroutines
dashboard.current_memory_usage = Current Memory Usage
dashboard.total_memory_allocated = Total Memory Allocated
dashboard.memory_obtained = Memory Obtained
dashboard.pointer_lookup_times = Pointer Lookup Times
dashboard.memory_allocate_times = Memory Allocate Times
dashboard.memory_free_times = Memory Free Times
dashboard.current_heap_usage = Current Heap Usage
dashboard.heap_memory_obtained = Heap Memory Obtained
dashboard.heap_memory_idle = Heap Memory Idle
dashboard.heap_memory_in_use = Heap Memory In Use
dashboard.heap_memory_released = Heap Memory Released
dashboard.heap_objects = Heap Objects
dashboard.bootstrap_stack_usage = Bootstrap Stack Usage
dashboard.stack_memory_obtained = Stack Memory Obtained
dashboard.mspan_structures_usage = MSpan Structures Usage
dashboard.mspan_structures_obtained = MSpan Structures Obtained
dashboard.mcache_structures_usage = MCache Structures Usage
dashboard.mcache_structures_obtained = MCache Structures Obtained
dashboard.profiling_bucket_hash_table_obtained = Profiling Bucket Hash Table Obtained
dashboard.gc_metadata_obtained = GC Metadada Obtained
dashboard.other_system_allocation_obtained = Other System Allocation Obtained
dashboard.next_gc_recycle = Next GC Recycle
dashboard.last_gc_time = Since Last GC Time
dashboard.total_gc_time = Total GC Pause
dashboard.total_gc_pause = Total GC Pause
dashboard.last_gc_pause = Last GC Pause
dashboard.gc_times = GC Times
users.user_manage_panel = User Manage Panel
users.new_account = Create New Account
users.name = Name
users.activated = Activated
users.admin = Admin
users.repos = Repos
users.created = Created
users.edit = Edit
users.auth_source = Authorization Source
users.local = Local
users.auth_login_name = Authorization Login Name
users.update_profile_success = Account profile has been successfully updated.
users.edit_account = Edit Account
users.is_activated = This account is activated
users.is_admin = This account has administrator permissions
users.update_profile = Update Account Profile
users.delete_account = Delete This Account
users.still_own_repo = This account still have ownership of repository, you have to delete or transfer them first.
orgs.org_manage_panel = Organization Manage Panel
orgs.name = Name
orgs.teams = Teams
orgs.members = Members
repos.repo_manage_panel = Repository Manage Panel
repos.owner = Owner
repos.name = Name
repos.private = Private
repos.watches = Watches
repos.stars = Stars
repos.issues = Issues
auths.auth_manage_panel = Authorization Manage Panel
auths.new = Add New Authorization Source
auths.name = Name
auths.type = Type
auths.enabled = Enabled
auths.updated = Updated
auths.auth_type = Authorization Type
auths.auth_name = Authorization Name
auths.domain = Domain
auths.host = Host
auths.port = Port
auths.base_dn = Base DN
auths.attributes = Search Attributes
auths.filter = Search Filter
auths.ms_ad_sa = Ms Ad SA
auths.smtp_auth = SMTP Authorization Type
auths.smtphost = SMTP Host
auths.smtpport = SMTP Port
auths.enable_tls = Enable TLS Encryption
auths.enable_auto_register = Enable Auto Registration
auths.tips = Tips
auths.edit = Edit Authorization Setting
auths.activated = This authentication has activated
auths.update_success = Authorization setting has been successfully updated.
auths.update = Update Authorization Setting
auths.delete = Delete This Authorization
auths.delete_auth_title = Authorization Deletion
auths.delete_auth_desc = This authorization is going to be deleted, do you want to continue?
config.server_config = Server Configuration
config.app_name = Application Name
config.app_ver = Application Version
config.app_url = Application URL
config.domain = Domain
config.offline_mode = Offline Mode
config.disable_router_log = Disable Router Log
config.run_user = Run User
config.run_mode = Run Mode
config.repo_root_path = Repository Root Path
config.static_file_root_path = Static File Root Path
config.log_file_root_path = Log File Root Path
config.script_type = Script Type
config.reverse_auth_user = Reverse Authentication User
config.db_config = Database Configuration
config.db_type = Type
config.db_host = Host
config.db_name = Name
config.db_user = User
config.db_ssl_mode = SSL Mode
config.db_ssl_mode_helper = (for "postgres" only)
config.db_path = Path
config.db_path_helper = (for "sqlite3" only)
config.service_config = Service Configuration
config.register_email_confirm = Register Email Confirmation
config.disable_register = Disable Registration
config.require_sign_in_view = Require Sign In View
config.mail_notify = Mail Notification
config.enable_cache_avatar = Enable Cache Avatar
config.active_code_lives = Active Code Lives
config.reset_password_code_lives = Reset Password Code Lives
config.webhook_config = Webhook Configuration
config.task_interval = Task Interval
config.deliver_timeout = Deliver Timeout
config.mailer_config = Mailer Configuration
config.mailer_enabled = Enabled
config.mailer_name = Name
config.mailer_host = Host
config.mailer_user = User
config.oauth_config = OAuth Configuration
config.oauth_enabled = Enabled
config.cache_config = Cache Configuration
config.cache_adapter = Cache Adapter
config.cache_interval = Cache Interval
config.cache_conn = Cache Connection
config.session_config = Session Configuration
config.session_provider = Session Provider
config.provider_config = Provider Config
config.cookie_name = Cookie Name
config.enable_set_cookie = Enable Set Cookie
config.gc_interval_time = GC Interval Time
config.session_life_time = Session Life Time
config.https_only = HTTPS Only
config.cookie_life_time = Cookie Life Time
config.session_hash_function = Session ID Hash Function
config.session_hash_key = Session ID Hash Key
config.picture_config = Picture Configuration
config.picture_service = Picture Service
config.disable_gravatar = Disable Gravatar
config.log_config = Log Configuration
config.log_mode = Log Mode
monitor.cron = Cron Tasks
monitor.name = Name
monitor.schedule = Schedule
monitor.next = Next Time
monitor.previous = Previous Time
monitor.execute_times = Execute Times
monitor.process = Running Processes
monitor.desc = Description
monitor.start = Start Time
monitor.execute_time = Execution Time
notices.system_notice_list = System Notices
notices.type = Type
notices.type_1 = Repository
notices.desc = Description
notices.op = Op.
notices.delete_success = System notice has been successfully deleted.
[action]
create_repo = created repository <a href="%s/%s">%s</a>
commit_repo = pushed to <a href="%s/%s/src/%s">%s</a> at <a href="%s/%s">%s</a>
create_issue = opened issue <a href="%s/%s/issues/%s">%s#%s</a>
comment_issue = commented on issue <a href="%s/%s/issues/%s">%s#%s</a>
transfer_repo = transfered repository <code>%s</code> to <a href="/%s%s">%s</a>
[tool]
ago = ago
from_now = from now
now = now
1s = 1 second %s
1m = 1 minute %s
1h = 1 hour %s
1d = 1 day %s
1w = 1 week %s
1mon = 1 month %s
1y = 1 year %s
seconds = %d seconds %s
minutes = %d minutes %s
hours = %d hours %s
days = %d days %s
weeks = %d weeks %s
months = %d months %s
years = %d years %s
raw_seconds = seconds
raw_minutes = minutes

View File

@@ -0,0 +1,516 @@
app_desc = Un service Git écrit en Go auto-hébergé
home = Accueil
dashboard = Tableau de bord
explore = Explorer
help = Aide
sign_in = Connexion
social_sign_in = Authentification via Internet: 2ème étape <small>associé le compte</small>
sign_out = Déconnexion
sign_up = Créer un compte
register = S'inscrire
website = Site web
version = Version
page = Page
template = Gabarit
language = Langage
username = Usager
email = Courriel
password = Mot de passe
re_type = Saisir à nouveau
captcha = Captcha
repository = Dépôt
organization = Organisation
mirror = Mirroir
new_repo = Nouveau dépôt
new_migrate = Nouvelle migration
new_org = Nouvel organisation
manage_org = Gestion des organisations
admin_panel = Gestion
account_settings = Profil usager
settings = Configuration
news_feed = Fil de nouvelles
pull_requests = Demandes de fusion (pull requests)
issues = Suivi de problèmes
cancel = Annuler
[home]
uname_holder = Nom d'usager ou courriel
password_holder = Mot de passe
switch_dashboard_context = Changer de tableau de bord
my_repos = Mes dépôts
collaborative_repos = Dépôts partagés
my_orgs = Mes organisations
my_mirrors = Mes mirroirs
[auth]
create_new_account = Créer un nouveau compte
register_hepler_msg = Déjà inscrits? Connectez-vous maintenant!
social_register_hepler_msg = Déjà inscrits? Branchez-vous!
disable_register_prompt = Désolé, l'auto-inscription n'est pas activée. Contactez l'admnistrateur du site.
disable_register_mail = Désolé, la confirmation d'inscription par courriel est désactivée. Contactez l'administrateur du site.
remember_me = Se souvenir de moi
forgot_password= Mot de passe oublié
forget_password = Mot de passe oublié?
sign_up_now = Besoin d'un compte? Inscrivez-vous maintenant.
confirmation_mail_sent_prompt = Un courriel de confirmation à été envoyé à <b>%s</b>, consultez vos courriels d'ici %d heures pour terminer l'inscription.
sign_in_email = Connexion avec votre courriel
active_your_account = Activez votre compte
resent_limit_prompt = Désolé vous demandez trop souvent un courriel de confirmation. S.v.p. patientez 3 minutes.
has_unconfirmed_mail = Bonjour %s, votre adresse courriel n'est pas vérifiée(<b>%s</b>). Si vous n'avez pas reçu de courriel de confirmation ou si vous avez besoin d'en envoyer un maintenant, appuyez sur le bouton ci-dessous.
resend_mail = Appuyez ici pour envoyer de nouveau un courriel de confirmation.
email_not_associate = Ce courriel ne correspond à aucun compte.
send_reset_mail = Appuyez ici pour (ré)envoyer un courriel pour réinitialiser le mot de passe.
reset_password = Réinitialiser votre mot de passe
invalid_code = Désolé, ce code de confirmation est périmé ou non-valide.
reset_password_helper = Appuyez ici pour réinitialiser votre mot de passe
password_too_short = La longueur du mot de passe doit être d'au moins 6 caractères.
[form]
UserName = Nom d'usager
RepoName = Nom du dépôt
Email = Adresse de courriel
Password = Mot de passe
Retype = Mot de passe (confirmation)
SSHTitle = Nom de la clé SSH
HttpsUrl = URL HTTPS
PayloadUrl = URL cible
TeamName = Nom de l'équipe
AuthName = Nom d'usager
require_error = ` ne peut être vide.`
alpha_dash_error = ` doit être composé de caractères alpha-numériques et/ou d'un tiret(-_).`
alpha_dash_dot_error = ` doit être composé de caractères alpha-numérique, un point(.) et/ou tiret(-_).`
min_size_error = ` doit être composé d'au moins %s caractères.`
max_size_error = ` doit être conposé d'au plus %s caractères.`
email_error = ` n'est pas une adresse de courriel bien formée.`
url_error = ` n'est pas un URL valide.`
unknown_error = Erreur inconnue:
captcha_incorrect = Le captcha ne concorde pas.
password_not_match = Les deux mots de passe diffèrent.
username_been_taken = `Nom d'usager dèjà utilisé.`
repo_name_been_taken = Nom de dépôt déjà utilisé.
org_name_been_taken = Nom d'organisation déjà utilisé.
team_name_been_taken = Nom d'équipe déjà utilisé.
email_been_used = Adresse de courriel déjà utilisée.
ssh_key_been_used = Nom de clé publique déjà utilisé.
illegal_username = Votre nom d'usager contient des caractères interdits.
illegal_repo_name = Le nom du dépôt contient des caractères interdits.
illegal_org_name = Le nom de l'organisation contient des caractères interdits.
illegal_team_name = Le nom de l'équipe contient des caractères interdits.
username_password_incorrect = Nom d'usager ou mot de passe erroné.
enterred_invalid_repo_name = Nom de dépôt inexistant.
enterred_invalid_owner_name = Responsable de dépôt inexistant.
enterred_invalid_password = Mot de passe erroné.
user_not_exist = Nom d'usager inexistant.
last_org_owner = Ceci est le dernier responsable du dépôt. Il doit y avoir obligatoirement au moins un usager responsable.
invalid_ssh_key = Désolé, impossible de vérifier votre clé SSH: %
auth_failed = Erreur d'authentification : %v
still_own_repo = Votre compte est responsable d'au moins un dépôt. Vous devez soit détruire ces dépôts, soit transférer la responsabilité à un autre usager.
org_still_own_repo = Cette organisation est responsable d'au moins un dépôt. Vous devez soit détruire ces dépôts, soit transférer la responsabilité à un autre usager ou organisation.
still_own_user = Cette authentification est utilisée par un usager.
[settings]
profile = Profil
password = Mot de passe
ssh_keys = Clés SSH
social = Comptes Internet
orgs = Organisations
delete = Supprimer votre compte
public_profile = Profil public
profile_desc = Votre adresse de courriel est publique et sera utilisée pour les avis produits par le site.
full_name = Nom complet
website = Site web
location = Endroit
update_profile = Mettre à jour le profil
update_profile_success = Mise à jour du profil réussie.
change_password = Changer le mot de passe
old_password = Mot de passe actuel
new_password = Nouveau mot de passe
password_incorrect = Mot de passe actuel erroné.
change_password_success = Modification du mot de passe effectuée. Vous pouvez dorénavant vous connecter avec le nouveau mot de passe.
manage_ssh_keys = Gestion des clés SSH
add_key = Ajouter une clé
ssh_desc = Voici la liste de clés SSH associées à votre profil. Retirez les clés que vous ne reconnaissez pas.
ssh_helper = <strong>Beson d'aide?</strong> Consultez le guide au <a href="https://help.github.com/articles/generating-ssh-keys">generating SSH keys</a> ou vérifiez <a href="https://help.github.com/ssh-issues/">les problèmes SSH fréquents</a>.
add_new_key = Ajouter une clé SSH
key_name = Nom de la clé
key_content = Contenu
add_key_success = Clé SSH ajoutée!
delete_key = Détruire
add_on = Ajoutée le
last_used = Dernière utilisation le
no_activity = Pas d'activité récente
manage_social = Gestion des comptes Internets associés
social_desc = Ceci est une liste de comptes Internet associés. Retirez les comptes que vous ne reconnaissez pas.
unbind = Désassocier
unbind_success = Compte Internet déassocié.
delete_account = Detruire votre compte
delete_prompt = Cette opération détruira votre compte et <strong>ne pourra être annulée</strong>!
confirm_delete_account = Confirmez la suppression
[repo]
owner = Responsable
repo_name = Nom du dépôt
repo_name_helper = Les bons noms de dépôts sont courts, mémorables et <strong>uniques</strong>.
visibility = Visibilité
visiblity_helper = Ce dépôt est <span class="label label-red label-radius">privé</span>
repo_desc = Description
repo_lang = Langue
repo_lang_helper = Choisir un fichier .gitignore
license = License
license_helper = Choisir un fichier de licence
init_readme = Initialiser le dépôt avec un fichier README.md
create_repo = Créer le dépôt
default_branch = Branche par défaut
mirror_interval = Intervale de synchronisation (heures)
goget_meta = Métadonnées Go-Get
goget_meta_helper = Ce dépôt sera <span class="label label-blue label-radius">Go-Getable</span>
need_auth = Authorisation requise
migrate_type = Type de migration
migrate_type_helper = Ce dépôt sera un <span class="label label-blue label-radius">mirroir</span>
migrate_repo = Migrer le dépôt
copy_link = Copier
clone_helper = Besoin d'aide pour cloner? Obtenez de l' <a target="_blank" href="http://git-scm.com/book/fr/Les-bases-de-Git-Démarrer-un-dépôt-Git">aide</a>!
unwatch = Ne plus suivre
watch = Suivre
unstar = Retirer étoile
star = Étoile
fork = Fork
quick_guide = Guide rapide
clone_this_repo = Cloner ce dépôt
create_new_repo_command = Créer un nouveau dépôt à la ligne de commande
push_exist_repo = Pousser un dépôt existant depuis la ligne de commande
settings = Réglages
settings.options = Réglages de base
settings.collaboration = Collaboration
settings.hooks = Webhooks
settings.deploy_keys = Clé de déploiement
settings.basic_settings = réglages de base
settings.danger_zone = Danger!
settings.site = Site officiel
settings.update_settings = Réglage des mises à jour
settings.transfer = Transférer la responsabilité
settings.transfer_desc = Transférer ce dépôt à un autre usager ou organisation si vous en avez la responsabilité.
settings.delete = Détruire ce dépôt
settings.delete_desc = La destruction est irrémédiable, impossible d'annuler. Soyez sûr de votre décision.
settings.update_settings_success = Réglages modifiés
settings.transfer_owner = Nouveau responsable
settings.make_transfer = Faire le transfert
settings.confirm_delete = Confirmer la destruction
settings.add_collaborator = Ajouter un nouveau collaborateur
settings.add_collaborator_success = Nouveau collaborateur ajouté.
settings.remove_collaborator_success = Collaborateur supprimé.
settings.add_webhook = Ajouter un Webhook
settings.hooks_desc = Les Webhooks permettent à des services externes d'être avertis de certains changements sur Gogs. Lorque qu'un changement se produit, Gogs envoie une requête POST à chacun des URLs spécifiés. Plus d'info disponible sur notre <a target="_blank" href="http://gogs.io/docs/features/webhook.html">guide Webhooks'</a>.
settings.remove_hook_success = Webhook supprimé.
settings.add_webhook_desc = Gogs envoiera un POST à l'URL ci-dessous avec le détail de l'événement souscrit. Vous pouvez aussi spécifier dans quel format vous désirez recevoir les données (JSON,<code>x-www-form-urlencoded</code>, <em>etc</em>). Plus d'info disponible sur notre <a target="_blank" href="http://gogs.io/docs/features/webhook.html">guide Webhooks'</a>.
settings.payload_url = URL cible
settings.content_type = Content Type
settings.secret = Secret
settings.event_desc = Quels changements déclencheront le webhook?
settings.event_push_only = Uniquement les <code>push</code>.
settings.active = Activé
settings.active_helper = Gogs fournira le détail de l'événement lorsque ce webhook sera déclenché.
settings.add_hook_success = Nouveau webhook ajouté.
settings.update_webhook = Mettre à jour le webhook
settings.update_hook_success = Webhook mis à jour.
settings.delete_webhook = Détruire le webhook
settings.recent_deliveries = Livraisons récentes
settings.hook_type = Type de déclencheur
settings.add_slack_hook_desc = Ajouter la compatibilité <a href="http://slack.com">Slack</a> à ce dépôt.
settings.slack_token = Jeton (token)
settings.slack_domain = Domaine
settings.slack_channel = Canal
[org]
org_name_holder = Nom de l'organisation
org_name_helper = Les bons noms d'organisations sont courts, mémorables et uniques
org_email_helper = Le courriel de l'organisation recevra toutes les notifications et les confirmations.
create_org = Créer une organisation
repo_updated = Changement effectué
people = Personne
invite_someone = Inviter quelqu'un
teams = Équipes
lower_members = Membres
lower_repositories = Dépôts
create_new_team = Créer une nouvelle équipe
org_desc = Description
team_name = Nom de l'équipe
team_desc = Description
team_name_helper = Le nom qui sera utilisé pour mentionner cette équipe dans les conversations.
team_desc_helper = Quel est la raison d'être de cette équipe?
team_permission_desc = Quel niveau de permission attribuer à cette équipe?
settings = Réglages
settings.options = Paramètres
settings.full_name = Nom complet
settings.website = Site web
settings.location = Endroit
settings.update_settings = Mettre à jour les paramètres
settings.update_setting_success = Paramètres mis à jour.
settings.delete = Détruire l'organisation
settings.delete_account = Détruire cette organisation
settings.delete_prompt = La destruction de l'organisation est irrémédiable, impossible d'annuler. Soyez sûr de votre décision.
settings.confirm_delete_account = Confirmer la destruction
members.public = Publique
members.public_helper = Rendre privé
members.private = Privé
members.private_helper = Rendre publique
members.owner = Responsable
members.member = Membre
members.conceal = Caché
members.remove = Retirer
members.leave = Quitter
members.invite_desc = Commencez à saisir un nom d'usager pour l'inviter à %s:
members.invite_now = Inviter
teams.join = Rejoindre
teams.leave = Quitter
teams.read_access = Droits de lecture
teams.read_access_helper = Cette équipe pourra voir et cloner ses dépôts.
teams.write_access = Droits d'écriture
teams.write_access_helper = Cette équipe pourra voir et cloner ses dépôts ainsi que pousser vers ceux-ci.
teams.admin_access = Droits de gestion
teams.admin_access_helper = En plus des droits d'écriture, cette équipe pourra gérer les collaborateurs.
teams.no_desc = Cette équipe ne posséde pas de description
teams.settings = Réglages
teams.owners_permission_desc = Les responsables ont accès à <strong>tous</strong> les dépôts et en possédent les droits de gestion.
teams.members = Membre de l'équipe
teams.update_settings = Mettre à jour
teams.delete_team = Détruire cette équipe
teams.add_team_member = Ajouter un membre à l'équipe
teams.delete_team_success = Équipe détruite
teams.read_permission_desc = La participation à cette équipe confère les droits de lecture. Ses membres peuvent voir et cloner ses dépôts.
teams.write_permission_desc = La participation à cette équipe confère les droits d'écriture en plus des droits de lecture. Ses membres peuvent pousser vers les dépôts de l'équipe.
teams.admin_permission_desc = La participation à cette équire confère les droits de gestion. Ses membres peuvent voir, cloner, pousser et gérer les collaborateurs des dépôts.
teams.repositories = Dépôts de l'équipe
teams.add_team_repository = Ajouer un dépôt à l'équipe
teams.remove_repo = Enlever
[admin]
dashboard = Tableau de bord
users = Usagers
organizations = Organisations
repositories = Dépôts
authentication = Sources d'authentifications
config = Configuration
monitor = Monitoring
prev = Préc.
next = Suiv.
dashboard.statistic = Statistiques
dashboard.operations = Opérations
dashboard.system_status = État du monitoring système
dashboard.statistic_info = La BD Gogs compte <b>%d</b> usagers, <b>%d</b> organisations, <b>%d</b> clé SSH, <b>%d</b> dépôts, <b>%d</b> suivis, <b>%d</b> étoiles, <b>%d</b> actions, <b>%d</b> accès, <b>%d</b> tickets, <b>%d</b> commentaires, <b>%d</b> comptes Internet, <b>%d</b> suivis, <b>%d</b> mirroirs, <b>%d</b> publications, <b>%d</b> sources d'authentification, <b>%d</b> webhooks, <b>%d</b> jalons, <b>%d</b> tags, <b>%d</b> tâches hook, <b>%d</b> équipes, <b>%d</b> tâches de mise à jours, <b>%d</b> fichiers joints.
dashboard.operation_name = Nom de l'opération
dashboard.operation_switch = Commande
dashboard.operation_run = Lancer
dashboard.clean_unbind_oauth = Nettoyer les OAuths orphelins
dashboard.delete_inactivate_accounts = Détruire les comptes inactifs
dashboard.server_uptime = Démarré depuis
dashboard.current_goroutine = Nombre de Goroutines
dashboard.current_memory_usage = Usage mémoire actuel
dashboard.total_memory_allocated = Mémoire allouée totale
dashboard.memory_obtained = Memoire obtenue
dashboard.pointer_lookup_times = Accès pointeur
dashboard.memory_allocate_times = Allocation mémoire
dashboard.memory_free_times = Désallocation mémoire
dashboard.current_heap_usage = Taille du heap actuelle
dashboard.heap_memory_obtained = Mémoire heap obtenue
dashboard.heap_memory_idle = Mémoire heap inactive
dashboard.heap_memory_in_use = Mémoire heap utilisée
dashboard.heap_memory_released = Mémoire heap relachée
dashboard.heap_objects = Objets dans le heap
dashboard.bootstrap_stack_usage = Bootstrap Stack Usage
dashboard.stack_memory_obtained = Stack Memory Obtained
dashboard.mspan_structures_usage = MSpan Structures Usage
dashboard.mspan_structures_obtained = MSpan Structures Obtained
dashboard.mcache_structures_usage = MCache Structures Usage
dashboard.mcache_structures_obtained = MCache Structures Obtained
dashboard.profiling_bucket_hash_table_obtained = Profiling Bucket Hash Table Obtained
dashboard.gc_metadata_obtained = GC Metadada Obtained
dashboard.other_system_allocation_obtained = Other System Allocation Obtained
dashboard.next_gc_recycle = Next GC Recycle
dashboard.last_gc_time = Since Last GC Time
dashboard.total_gc_time = Total GC Pause
dashboard.total_gc_pause = Total GC Pause
dashboard.last_gc_pause = Last GC Pause
dashboard.gc_times = GC Times
users.user_manage_panel = Gestion des usager
users.new_account = Creér un nouveau compte
users.name = Nom
users.activated = Activé
users.admin = Gestionnaire
users.repos = Dépôts
users.created = Créé
users.edit = Editer
users.auth_source = Source d'authentification
users.local = Locale
users.auth_login_name = Identifiant d'authentification
users.update_profile_success = Compte crée.
users.edit_account = Éditer compte
users.is_activated = Ce compte est activé
users.is_admin = Ce compte a les droits de gestionnaire
users.update_profile = Mettre à jour le compte
users.delete_account = Détruire ce compte
users.still_own_repo = Ce compte est responsables d'un dépôt. I faut détruire le dépôt ou transférer la responsabilité avant de détruire ce compte.
orgs.org_manage_panel = Gestion des organisations
orgs.name = Nom
orgs.teams = Équipes
orgs.members = Membres
repos.repo_manage_panel = Gestion des dépôts
repos.owner = Responsable
repos.name = Nom
repos.private = Privé
repos.watches = Suivis
repos.stars = Étoiles
repos.issues = Ticket
auths.auth_manage_panel = Gestion des sources d'authentification
auths.new = Ajouter une nouvelle source d'authentification
auths.name = Nom
auths.type = Type
auths.enabled = Activé
auths.updated = Mis à jour
auths.auth_type = Type d'authentification
auths.auth_name = Nom de l'authentification
auths.domain = Domaine
auths.host = Serveur
auths.port = Port
auths.base_dn = DN de base
auths.attributes = Attributs de recherche
auths.filter = Filtre de recherche
auths.ms_ad_sa = Microsoft Active Directory
auths.smtp_auth = Authentification SMTP
auths.smtphost = Serveur SMTP
auths.smtpport = Port SMTP
auths.enable_tls = Chiffrement TLS
auths.enable_auto_register = Activer auto-abonnement
auths.tips = Trucs
auths.edit = Éditer réglages d'authentification
auths.activated = Source d'authentification activée
auths.update_success = Réglages mis à jour.
auths.update = Mettre à jour réglages
auths.delete = Détruire cette source
config.server_config = Configuration du serveur
config.app_name = Nom de l'applicaiton
config.app_ver = Version de l'application
config.app_url = URL de l'application
config.domain = Domaine
config.offline_mode = Mode hors-ligne
config.disable_router_log = Journal du routeur désactivé
config.run_user = Éxécuté en tant que
config.run_mode = Mode de fonctionnement
config.repo_root_path = Dossier contenant les dépôts
config.static_file_root_path = Dossier contenant les fichiers statiques
config.log_file_root_path = Dossier contenant les journaux
config.script_type = Type de script
config.reverse_auth_user = Usager d'authentification inversée
config.db_config = Configuration de la BD
config.db_type = Type
config.db_host = Serveur
config.db_name = Nom
config.db_user = Usager
config.db_ssl_mode = Mode SSL
config.db_ssl_mode_helper = (pour "postgres" seulement)
config.db_path = Path
config.db_path_helper = (pour "sqlite3" seulement)
config.service_config = Configuration du service
config.register_email_confirm = Confirmation d'abonnement par courriel
config.disable_register = Auto-inscription désactivée
config.require_sign_in_view = Connexion requise pour visualiser
config.mail_notify = Notifications par courriel
config.enable_cache_avatar = Cache avatar activée
config.active_code_lives = Jeton d'activation
config.reset_password_code_lives = Jeton de modification mot-de-passe
config.webhook_config = Configuration Webhook
config.task_interval = Intervalle
config.deliver_timeout = Expiration des appels
config.mailer_config = Configuration expédition de courriels
config.mailer_enabled = Activé
config.mailer_name = Nom
config.mailer_host = Serveur
config.mailer_user = Usager
config.oauth_config = Configuration OAuth
config.oauth_enabled = Activé
config.cache_config = Configuration du cache
config.cache_adapter = Mécanisme de cache
config.cache_interval = Intervalle
config.cache_conn = Chaîne de connexion
config.session_config = Configuration des session
config.session_provider = Mécanisme
config.provider_config = Configuration du mécanisme
config.cookie_name = Nom du fichier témoin
config.enable_set_cookie = Fichier témoin actvité
config.gc_interval_time = Intervalle GC
config.session_life_time = Durée de la session
config.https_only = HTTPS exigé
config.cookie_life_time = Expiration du fichier témoin
config.session_hash_function = Fonction de hashage ID de session
config.session_hash_key = Clé de hashage ID de session
config.picture_config = Configuration des avatars
config.picture_service = Service image
config.disable_gravatar = Désactivé Gravatar
config.log_config = Configuration du journal
config.log_mode = Mode de journal
monitor.cron = Cron Tasks
monitor.name = Name
monitor.schedule = Schedule
monitor.next = Next Time
monitor.previous = Previous Time
monitor.execute_times = Execute Times
monitor.process = Running Processes
monitor.desc = Description
monitor.start = Start Time
monitor.execute_time = Execution Time
[action]
create_repo = a créé le dépôt <a href="/%s">%s</a>
commit_repo = a poussé sur <a href="/%s/src/%s">%s</a> à <a href="/%s">%s</a>
create_issue = a ouvert le ticket <a href="/%s/issues/%s">%s#%s</a>
comment_issue = a commenté sur le ticket <a href="/%s/issues/%s">%s#%s</a>
[tool]
ago = auparavant
from_now = depuis
now = maintenant
1s = 1 seconde %s
1m = 1 minute %s
1h = 1 heure %s
1d = 1 jour %s
1w = 1 semaine %s
1mon = 1 mos %s
1y = 1 an %s
seconds = %d secondes %s
minutes = %d minutes %s
hours = %d heures %s
days = %d jours %s
weeks = %d semaines %s
months = %d mois %s
years = %d années %s
raw_seconds = secondes
raw_minutes = minutes

View File

@@ -0,0 +1,585 @@
app_desc = Een pijnloze self-hosted Git-dienst geschreven in Go
home = Home
dashboard = Dashboard
explore = Verkennen
help = Help
sign_in = Inloggen
social_sign_in = Social netwerk inlog: tweede stap <small>account koppelen</small>
sign_out = Afmelden
sign_up = Aanmelden
register = Registreer
website = Website
version = Versie
page = Pagina
template = Template
language = Taal
username = Gebruikersnaam
email = E-mail
password = Wachttwoord
re_type = Verificatie
captcha = Captcha
repository = Repositorie
organization = Organisatie
mirror = Mirror
new_repo = Nieuwe repositorie
new_migrate = Nieuwe migratie
new_org = Nieuwe organisatie
manage_org = Beheer organisaties
admin_panel = Adminpaneel
account_settings = Accountinstellingen
settings = Instellingen
news_feed = Nieuwsfeed
pull_requests = Pull-aanvragen
issues = Issues
cancel = Annuleer
[home]
uname_holder = Gebruikersnaam of e-mail
password_holder = Wachtwoord
switch_dashboard_context = Wissel voorpaginacontext
my_repos = Mijn repositories
collaborative_repos = Gedeelde repositories
my_orgs = Mijn organisaties
my_mirrors = Mijn mirrors
[auth]
create_new_account = Maak nieuw account aan
register_hepler_msg = Heeft u al een account? Meld u nu aan!
social_register_hepler_msg = Heeft u al een account? Koppel nu!
disable_register_prompt = Sorry, registratie is uitgeschakeld. Neem contact op met de beheerder van deze site.
disable_register_mail = Sorry, bevestiging van registratie per e-mail is uitgeschakeld.
remember_me = Onthoud mij
forgot_password = Wachtwoord vergeten
forget_password = Wachtwoord vergeten?
sign_up_now = Een account nodig? Meld u nu aan.
confirmation_mail_sent_prompt = Een bevestigingsemail is gestuurd naar <b>%s</b>, Bevestig u aanvraag binnen %d uren om uw registratie te voltooien.
sign_in_email = Meld u aan met uw e-mailadres
active_your_account = Activeer uw account
resent_limit_prompt = Sorry, u heeft te snel na elkaar een aanvraag gedaan voor een activatie mail. Wacht drie minuten voor uw volgende aanvraag.
has_unconfirmed_mail = Beste %s, u heeft een onbevestigde e-mailadres (<b>%s</b>). Als u nog geen bevestiging per e-mail heeft ontvangen, of u een nieuwe aanvraag wilt doen, klik dan op de onderstaande knop.
resend_mail = Klik hier om uw activatie mail nog een keer te verzenden
send_reset_mail = Klik hier om uw wachtwoord reset mail (nogmaals) te versturen
reset_password = Reset uw wachtwoord
invalid_code = Sorry, uw bevestigingscode is verlopen of niet meer geldig.
reset_password_helper = Klik hier om uw wachtwoord opnieuw in te stellen.
password_too_short = De lengte van uw wachtwoord moet minimaal zes karakters zijn.
email_not_associate = Dit e-mailadres is niet gekoppeld aan een account.
[form]
UserName = Gebruikersnaam
RepoName = Repositorie naam
Email = e-mailadres
Password = Wachtwoord
Retype = Verifieer wachtwoord
SSHTitle = SSH sleutel naam
HttpsUrl = HTTPS URL
PayloadUrl = Payload URL
TeamName = Team naam
AuthName = Autorisatienaam
require_error = kan niet leeg zijn.
alpha_dash_error = moet een valide alfanumeriek of dash(-_) karakter zijn.
alpha_dash_dot_error = moet een valide alfanumeriek, dash(-_) of (.) punt karakter zijn.
min_size_error = moet minimaal %s karakters bevatten.
max_size_error = mag maximaal %s karakters bevatten.
email_error = is niet een valide e-mail adres.
url_error = is niet een valide URL.
unknown_error = Onbekende fout:
captcha_incorrect = Captcha komt niet overeen.
password_not_match = Wachtwoord en verificatie wachtwoord komen niet overeen.
username_been_taken = Gebruikersnaam is al in gebruik.
repo_name_been_taken = Repositorie naam is al in gebruik.
org_name_been_taken = Organisatie naam is al in gebruik.
team_name_been_taken = Team naam is al in gebruik.
email_been_used = e-mailadres is al in gebruik.
ssh_key_been_used = Openbare sleutel naam is al in gebruik.
illegal_username = Gebruikersnaam bevat illegale karakters.
illegal_repo_name = Repositorie naam bevat illegale karakters.
illegal_org_name = Organisatie naam bevat illegale karakters.
illegal_team_name = Team naam bevat illegale karakters.
username_password_incorrect = Gebruikersnaam of wachtwoord is niet correct.
enterred_invalid_repo_name = U heeft een onjuiste repositorie naam ingevoerd.
enterred_invalid_owner_name = U heeft een onjuiste eigenaar ingevoerd.
enterred_invalid_password = U heeft een onjuiste wachtwoord ingevoerd.
user_not_exist = Gegeven gebruiker bestaat niet.
last_org_owner = De gebruiker die u probeert te verwijderen is het enige lid (eigenaar) van dit team. U moet eerst nieuwe lid (eigenaar) aanstellen.
invalid_ssh_key = Sorry, we zijn niet in staat om uw SSH-sleutel te verifiëren: %s
auth_failed = Verificatie mislukt: %v
still_own_repo = Uw account heeft nog een eigendom op een repositorie. U moet deze eerst verwijderen of overdragen.
org_still_own_repo = De organisatie heeft nog eigendomen op repositories. U moet deze eerst verwijderen of overdragen.
still_own_user = Deze authenticatie methode wordt nog gebruikt door sommige gebruikers. U moet hen eerst verplaatsen of verwijderen.
AdminEmail = E-mail beheerder
[settings]
profile = Profiel
password = Wachtwoord
ssh_keys = SSH-sleutels
social = Sociale netwerk-accounts
orgs = Organisaties
delete = Verwijder account
public_profile = Openbaar profiel
profile_desc = Uw e-mailadres is openbaar zichtbaar en zal gebruikt worden gebruikt voor alle account gerlateerde berichtgevingen en web bewerking gemaakt via de website.
full_name = Volledige naam
website = Website
location = Locatie
update_profile = Profile bijwerken
update_profile_success = Uw profiel is succesvol bijgewerkt.
change_password = Verander wachtwoord
old_password = Huidige wachtwoord
new_password = Nieuw wachtwoord
password_incorrect = Huidig wachtwoord is niet correct.
change_password_success = Wachtwoord is succesvol gewijzigd. U kunt nu met uw nieuwe wachtwoord inloggen.
manage_ssh_keys = Beheer SSH sleutels
add_key = Sleutel toevoegen
ssh_desc = Dit is een lijst van alle SSH sleutels die gekoppeld zijn aan uw account. Verwijder alle sleutels die u niet herkent.
ssh_helper = <strong>Hulp nodig?</strong> Bekijk onze help pagina's over <a href="https://help.github.com/articles/generating-ssh-keys">SSH sleutels genereeren</a> of over <a href="https://help.github.com/ssh-issues/">meest voorkomende SSH problemen</a>.
add_new_key = SSH sleutel toevoegen
key_name = Sleutel naam
key_content = Inhoud
add_key_success = Nieuwe SSH sleutel is toegevoegd!
delete_key = Verwijder
add_on = Toegevoegd op
last_used = Laatst gebruikt op
no_activity = Geen recente activiteiten
manage_social = Beheer gekoppelde sociale accounts
social_desc = Dit is een lijst van de bijbehorende sociale accounts koppelingen, Verwijder eventueel koppelingen die u niet herkent.
unbind = Loskoppelen
unbind_success = Sociaal account is ontkoppeld.
delete_account = Verwijder uw account
delete_prompt = Deze handeling zal uw account definitief verwijderen, u kunt dit <strong> NIET </strong> terug draaien!
confirm_delete_account = Bevestig verwijdering
uid = uid
change_username = Username veranderd
change_username_desc = Gebruikersnaam is gewijzigd. Wilt u doorgaan? Dit zal gevolgen hebben voor alle koppelingen die betrekking hebben op uw account.
continue = Doorgaan
cancel = Annuleren
delete_account_title = Account verwijderen
delete_account_desc = Dit account zal permanent worden verwijderd. Wilt u doorgaan?
[repo]
owner = Eigenaar
repo_name = Repositorie naam
repo_name_helper = Een goede repositorie naam is kort, memorabel en <strong>uniek</strong>.
visibility = Zichtbaarheid
visiblity_helper = Deze repositorie is <span class="label label-red label-radius">prive</span>
repo_desc = Omschrijving
repo_lang = Taal
repo_lang_helper = Selecteer een .gitignore bestand
license = Licentie
license_helper = Selecteer een licentie bestand
init_readme = Initialiseer deze repositorie met een README.md
create_repo = Nieuwe Repositorie
default_branch = Standaard branch
mirror_interval = Mirror interval(uur)
goget_meta = Go-Get Meta
goget_meta_helper = Deze repositorie is nu beschikbaar voor <span class="label label-blue label-radius">Go-Get</span>
need_auth = Autorisatie vereist
migrate_type = Migratie type
migrate_type_helper = Deze repositorie zal een <span class="label label-blue label-radius">mirror</span> worden
migrate_repo = Migreer repositorie
clone_helper = Hulp nodig bij het klonen? Kijk dan <a target="_blank" href="http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository">hier</a> voor hulp!
unwatch = Negeren
watch = Volgen
unstar = Ontster
star = Ster
fork = Fork
settings = Instellingen
settings.options = Opties
settings.collaboration = Samenwerking
settings.hooks = Webhooks
settings.deploy_keys = Installeer sleutels
settings.basic_settings = Basis instellingen
settings.danger_zone = Gevaren zone
settings.site = Officiële site
settings.update_settings = Instellingen bewerken
settings.transfer = Eigendom overdragen
settings.transfer_desc = Draag deze repo over aan een andere gebruiker of een organisatie waar u beheerders rechten heeft.
settings.delete = Verwijder deze repositorie
settings.delete_desc = Als u eenmaal een repositorie verwijderd is er geen weg terug. Gelieve zeker te zijn van uw acties.
settings.update_settings_success = Repositorie instellingen zijn succesvol bijgewerkt.
settings.transfer_owner = Nieuwe eigenaar
settings.make_transfer = Maak overdracht
settings.confirm_delete = Bevestig verwijdering
settings.add_collaborator = Nieuwe medewerker toevoegen
settings.add_collaborator_success = medewerker is toegevoegd.
settings.remove_collaborator_success = medewerker is verwijderd.
settings.add_webhook = Webhook toevoegen
settings.hooks_desc = Webhooks maken het mogelijk om externe diensten te waaarschuwen wanneer zich bepaalde gebeurtenissen voordoen op Gogs . Wanneer de opgegeven gebeurtenissen gebeuren , zullen we een POST-aanvraag aan alle URL's die u verstrekt sturen . Lees meer in onze <a target="_blank" href="http://gogs.io/docs/features/webhook.html"> Webhooks gids </a>.
settings.remove_hook_success = Webhook is verwijderd.
settings.add_webhook_desc = We sturen een <code>POST</code> verzoek aan de onderstaande URL met de details van het geplaatste evenementen. U kunt ook aangeven welke data u wilt ontvangen (JSON, <code>x-www-form-urlencoded</code>, <em>etc</em>). U kunt meer informatie vinden in onze <a target="_blank" href="http://gogs.io/docs/features/webhook.html"> webhooks gids</a>.
settings.payload_url = Payload URL
settings.content_type = Content type
settings.secret = Geheim
settings.event_desc = Bij welke gebeurtenissen wilt u dat deze webhook getriggerd wordt?
settings.event_push_only = Alleen bij de <code>push</code> event.
settings.active = Actief
settings.active_helper = We zullen details van de gebeurtenissen af leveren wanneer deze webhook wordt geactiveerd.
settings.add_hook_success = Nieuwe webhook toegevoegd.
settings.update_webhook = Bewerk webhook
settings.update_hook_success = Webhook is bijgewerkt.
settings.delete_webhook = Webhook verwijderen
settings.recent_deliveries = Recente bezorgingen
copy_link = Kopieer
click_to_copy = Kopieer link naar plakbord
copied = Gekopieerd
no_desc = Geen omschrijving
quick_guide = Snelstart gids
clone_this_repo = Kloon deze repositorie
create_new_repo_command = Maak een nieuwe repositorie aan vanaf de console
push_exist_repo = Push een bestaande repositorie vanaf de console
branch = Aftakking
tree = Boom
branch_and_tags = Aftakkingen & labels
branches = Aftakkingen
tags = Labels
issues = Issues
commits = Commits
releases = Publicaties
commits.commits = Commits
commits.search = Zoeken
commits.find = zoek
commits.author = Auteur
commits.message = Bericht
commits.date = Datum
commits.older = Ouder
commits.newer = Nieuwer
settings.change_reponame = Repositorienaam aangepast
settings.change_reponame_desc = De repositorienaam is veranderd. Wilt u doorgaan? Dit zal gevolgen hebben voor alle koppelingen die betrekking hebben op deze repositorie.
settings.new_owner_has_same_repo = De nieuwe eigenaar heeft al een repositorie met deze naam
settings.transfer_notices = <p> - U kan uw toegang verliezen als de nieuwe eigenaar een individuele gebruiker is</p> <p> - . . U zal uw toegang behouden als de nieuwe eigenaar een organisatie is en u één van de eigenaren bent</p>
settings.transfer_succeed = Eigendom repositorie succesvol overgedragen
settings.hook_type = Type hook
settings.add_slack_hook_desc = Voeg een <a href="http://slack.com">Slack</a> integratie toe aan uw repositorie.
settings.slack_token = Slack token
settings.slack_domain = Slack domein
settings.slack_channel = Slack kanaal
[org]
org_name_holder = Organisatienaam
org_name_helper = Een goede organisatienaam is kort en memorabel.
org_email_helper = Alle notificaties en bevestigingen worden op het e-mailadres van de organisatie ontvangen.
create_org = Nieuwe organisatie aanmaken
repo_updated = Geupdate
people = Mensen
invite_someone = Iemand uitnodigen
teams = Teams
lower_members = leden
lower_repositories = repositories
create_new_team = Nieuw team aanmaken
org_desc = Omschrijving
team_name = Teamnaam
team_desc = Omschrijving
team_name_helper = U gebruikt deze naam om dit team te vermelden in conversaties.
team_desc_helper = Waar gaat dit team doen?
team_permission_desc = Welke privileges zou dit team moeten hebben?
settings = Instellingen
settings.options = Opties
settings.full_name = Volledige naam
settings.website = Website
settings.location = Locatie
settings.update_settings = Instellingen bijwerken
settings.update_setting_success = Organisatie instellingen zijn succesvol bijgewerkt.
settings.delete = Verwijder organisatie
settings.delete_account = Verwijder deze organisatie
settings.delete_prompt = Deze actie zal de origanisatie permanent verwijderen. U kunt dit <strong>NIET</strong> terug draaien!
settings.confirm_delete_account = Bevestig verwijdering
members.public = Openbaar
members.public_helper = maak prive
members.private = Prive
members.private_helper = maak openbaar
members.owner = Eigenaar
members.member = Lid
members.conceal = Verbergen
members.remove = Verwijderen
members.leave = Verlaat
members.invite_desc = Begin met het typen van een gebruikersnaam om een nieuw lid aan %s uit te nodigen:
members.invite_now = Nu uitnodigen
teams.join = Lid worden
teams.leave = Vertlaat
teams.read_access = Leestoegang
teams.read_access_helper = Dit team is in staat om zijn repositories te bekijken en te klonen.
teams.write_access = Schrijf toegang
teams.write_access_helper = Dit team is in staat om zijn repositories te bekijken en push aanvragen te verwerken.
teams.admin_access = Beheerder toegang
teams.admin_access_helper = Dit team is in staat om push & pull aanvragen te verwerken en om nieuwe medewerkers toe te voegen.
teams.no_desc = Dit team heeft geen omschrijving
teams.settings = Instellingen
teams.owners_permission_desc = Eigenaren hebben volledige toegang tot <strong>alle repositories</strong> en hebben <strong>beheerder rechten</strong> over de organisatie.
teams.members = Team leden
teams.update_settings = Instellingen bijwerken
teams.delete_team = Verwijder deze team
teams.add_team_member = Nieuwe team lid aanmaken
teams.delete_team_success = Gekozen team is succesvol verwijderd.
teams.read_permission_desc = Dit team heeft <strong>Lees</strong> rechten : leden kunnen repositories lezen en klonen.
teams.write_permission_desc = Dit team heeft <strong>Schrijf</strong> rechten : leden kunnen repositories lezen en push aanvragen verwerken.
teams.admin_permission_desc = Dit team heeft <strong>Beheerders</strong> rechten : leden kunnen repositories lezen en push aanvragen verwerken en medewerkers toevoegen.
teams.repositories = Teamrepositories
teams.add_team_repository = Nieuwe teamrepositorie aanmaken
teams.remove_repo = Verwijder
settings.change_orgname = Organisatie naam veranderd
settings.change_orgname_desc = De naam van de organisatie is veranderd, wilt u doorgaan? Dit zal gevolgen hebben voor alle koppelingen die betrekking hebben op deze organisatie.
settings.delete_org_title = Verwijderen organsiatie
settings.delete_org_desc = Deze organisatie zal permanent worden verwijderd, wilt u doorgaan?
settings.hooks_desc = Een webhook toevoegen die door <strong>alle repositories</strong> in deze organisatie getriggerd kan worden.
teams.delete_team_title = Team verwijderen
teams.delete_team_desc = Dit team zal worden verwijderd. De leden van dit team zullen toegang tot alle repositories van het team verliezen. Wilt u doorgaan?
[admin]
dashboard = Dashboard
users = Gebruikers
organizations = Orgranisaties
repositories = Repositories
authentication = Autenticaties
config = Configuratie
monitor = Bijhouden
prev = Vorige
next = Volgende
dashboard.statistic = Statistieken
dashboard.operations = Bewerkingen
dashboard.system_status = Status Systeemmonitor
dashboard.statistic_info = Gogs database heeft <b>%d</b> gebruikers, <b>%d</b> organisaties, <b>%d</b> openbare sleutels, <b>%d</b> repositories, <b>%d</b> volgers, <b>%d</b> sterren, <b>%d</b> acties, <b>%d</b> participanten, <b>%d</b> issues, <b>%d</b> reacties, <b>%d</b> sociale accounten, <b>%d</b> volgers, <b>%d</b> mirrors, <b>%d</b> publicaties, <b>%d</b> login bronnen, <b>%d</b> webhooks, <b>%d</b> mijlpalen, <b>%d</b> labels, <b>%d</b> hook taken, <b>%d</b> teams, <b>%d</b> bijgewerkte taken, <b>%d</b> bijlagen.
dashboard.operation_name = Bewerking naam
dashboard.operation_switch = Omschakelen
dashboard.operation_run = Uitvoeren
dashboard.clean_unbind_oauth = Clean unbound OAuths
dashboard.delete_inactivate_accounts = Verwijder alle inactieve accounts
dashboard.server_uptime = Uptime server
dashboard.current_goroutine = Huidige Goroutines
dashboard.current_memory_usage = Huidige geheugen gebruik
dashboard.total_memory_allocated = Totaal toegewezen geheugen
dashboard.memory_obtained = Geheugen gebruikt
dashboard.pointer_lookup_times = Pointer Lookup Times
dashboard.memory_allocate_times = Memory Allocate Times
dashboard.memory_free_times = Memory Free Times
dashboard.current_heap_usage = Current Heap Usage
dashboard.heap_memory_obtained = Heap Memory Obtained
dashboard.heap_memory_idle = Heap Memory Idle
dashboard.heap_memory_in_use = Heap Memory In Use
dashboard.heap_memory_released = Heap Memory Released
dashboard.heap_objects = Heap Objects
dashboard.bootstrap_stack_usage = Bootstrap Stack Usage
dashboard.stack_memory_obtained = Stack Memory Obtained
dashboard.mspan_structures_usage = MSpan Structures Usage
dashboard.mspan_structures_obtained = MSpan Structures Obtained
dashboard.mcache_structures_usage = MCache Structures Usage
dashboard.mcache_structures_obtained = MCache Structures Obtained
dashboard.profiling_bucket_hash_table_obtained = Profiling Bucket Hash Table Obtained
dashboard.gc_metadata_obtained = GC Metadada Obtained
dashboard.other_system_allocation_obtained = Other System Allocation Obtained
dashboard.next_gc_recycle = Volgende GC recycle
dashboard.last_gc_time = Sinds vorige GC verwerkingstijd
dashboard.total_gc_time = Totaal GC verwerkingstijd
dashboard.total_gc_pause = Totaal GC verwerkingstijd
dashboard.last_gc_pause = Laatste GC verwerkingstijd
dashboard.gc_times = GC verwerkingen
users.user_manage_panel = Gebruikers beheren
users.new_account = Nieuw account aanmaken
users.name = Naam
users.activated = Geactiveerd
users.admin = Admin
users.repos = Repos
users.created = Aangemaakt
users.edit = Bewerken
users.auth_source = Autorisatiebron
users.local = Lokaal
users.auth_login_name = Autorisatie inlognaam
users.update_profile_success = Profiel is succesvol bijgewerkt.
users.edit_account = Bewerk account
users.is_activated = Dit account is geactiveerd
users.is_admin = Dit account heeft beheerdersrechten
users.update_profile = Account profiel bijwerken
users.delete_account = Dit account verwijderen
users.still_own_repo = Dit account is nog steeds eigendom van een repositorie. U moet deze repositorie eerst verwijderen of overdragen.
orgs.org_manage_panel = Organisaties beheren
orgs.name = Naam
orgs.teams = Teams
orgs.members = Leden
repos.repo_manage_panel = Repositoriebeheerpaneel
repos.owner = Eigenaar
repos.name = Naam
repos.private = Prive
repos.watches = Volgers
repos.stars = Sterren
repos.issues = Issues
auths.auth_manage_panel = Autorisatiebeheerpaneel
auths.new = Nieuwe autorisatiebron
auths.name = Naam
auths.type = Type
auths.enabled = Ingeschakeld
auths.updated = Bijgewerkt
auths.auth_type = Autorisatietype
auths.auth_name = Autorisatienaam
auths.domain = Domein
auths.host = Host
auths.port = Poort
auths.base_dn = Base DN
auths.attributes = Zoek attributen
auths.filter = Zoek filter
auths.ms_ad_sa = Ms Ad SA
auths.smtp_auth = SMTP authenticatietype
auths.smtphost = SMTP host
auths.smtpport = SMTP poort
auths.enable_tls = Activeer TLS-encryptie
auths.enable_auto_register = Activeer automatische registratie
auths.tips = Tips
auths.edit = Bewerk autorisatie-instellingen
auths.activated = Deze autorisatiemethode is geactiveerd
auths.update_success = Autorisatie-instellingen zijn succesvol bijgewerkt.
auths.update = Update autorisatie-instellingen
auths.delete = Verwijder deze autorisatie
config.server_config = Serverconfiguratie
config.app_name = Applicatienaam
config.app_ver = Applicatieversie
config.app_url = Applicatie-URL
config.domain = Domein
config.offline_mode = Offline-modus
config.disable_router_log = Router-log uitschakelen
config.run_user = Uitvoerende gebruiker
config.run_mode = Uitvoer modus
config.repo_root_path = Repositorie basis pad
config.static_file_root_path = Statische bestanden basis pad
config.log_file_root_path = Log bestand basis pad
config.script_type = Script type
config.reverse_auth_user = Reverse Authentication User
config.db_config = Databaseconfiguratie
config.db_type = Type
config.db_host = Host
config.db_name = Naam
config.db_user = Gebruiker
config.db_ssl_mode = SSL modus
config.db_ssl_mode_helper = (alleen voor "postgres")
config.db_path = Path
config.db_path_helper = (alleen voor "sqlite3")
config.service_config = Serviceconfiguratie
config.register_email_confirm = Register Email Confirmation
config.disable_register = Registratie uitgeschakeld
config.require_sign_in_view = Inloggen vereist om te kunnen inzien
config.mail_notify = E-mailnotificaties
config.enable_cache_avatar = Avatar Cache inschakelen
config.active_code_lives = Active Code Lives
config.reset_password_code_lives = Reset Password Code Lives
config.webhook_config = Webhook configuratie
config.task_interval = Taakinterval
config.deliver_timeout = Bezorging verlooptijd
config.mailer_config = Mailerconfiguatie
config.mailer_enabled = Ingeschakeld
config.mailer_name = Naam
config.mailer_host = Host
config.mailer_user = Gebruiker
config.oauth_config = OAuth-configuratie
config.oauth_enabled = Ingeschakeld
config.cache_config = Cache-configuratie
config.cache_adapter = Cache-adapter
config.cache_interval = Cache-interval
config.cache_conn = Cache-connectie
config.session_config = Sessieconfiguratie
config.session_provider = Sessieprovider
config.provider_config = Provider config
config.cookie_name = Cookie naam
config.enable_set_cookie = Set Cookie inschakelen
config.gc_interval_time = GC interval time
config.session_life_time = Sessie duur
config.https_only = Alleen HTTPS
config.cookie_life_time = Cookie duur leeftijd
config.session_hash_function = Sessie ID Hash functie
config.session_hash_key = Sessie ID Hash sleutel
config.picture_config = Foto configuratie
config.picture_service = Foto service
config.disable_gravatar = Gravatar uitschakelen
config.log_config = Logconfiguratie
config.log_mode = Log-modus
monitor.cron = Cron-taken
monitor.name = Naam
monitor.schedule = Planning
monitor.next = Volgende
monitor.previous = Vorige
monitor.execute_times = Aantal keren uitgevoerd
monitor.process = Draaiende processen
monitor.desc = Omschrijving
monitor.start = Starttijd
monitor.execute_time = Uitvoertijd
auths.delete_auth_title = Verwijderings-autorisatie
auths.delete_auth_desc = Deze autorisatiemethode wordt verwijderd. Weet u zeker dat u wilt doorgaan?
[action]
create_repo = repositorie aangemaakt in <a href="%s/%s">%s</a>
commit_repo = push update naar <a href="%s/%s/src/%s">%s</a> in <a href="%s/%s">%s</a
create_issue = opende issue in <a href="%s/%s/issues/%s">%s#%s</a>
comment_issue = reactie op issue <a href="%s/%s/issues/%s">%s#%s</a>
transfer_repo = repositorie verplaatst naar <code>%s</code> naar <a href="/%s%s">%s</a>
[tool]
ago = geleden
from_now = vanaf nu
now = nu
1s = 1 seconde %s
1m = 1 minuut %s
1h = 1 uur %s
1d = 1 dag %s
1w = 1 week %s
1mon = 1 maand %s
1y = 1 jaar %s
seconds = %d seconden %s
minutes = %d minuten %s
hours = %d uur %s
days = %d dagen %s
weeks = %d weken %s
months = %d maanden %s
years = %d jaren %s
raw_seconds = seconden
raw_minutes = minuten
[install]
install = Installatie
title = Installatiestappen voor de eerste keer opstarten
requite_db_desc = Om Gogs te gebruiken is MySQL, PostgreSQL of SQLite3 vereist (SQLite3 is beschikbaar in de officiële versie).
db_type = Database-type
host = Host
user = Gebruikersnaam
password = Wachtwoord
db_name = Database naam
db_helper = Gebruik InnoDB engine met utf8_general_ci karakterset voor MySQL.
ssl_mode = SSL-modus
path = Pad
sqlite_helper = Het pad naar de SQLite3 database.
general_title = Algemene instellingen van Gogs
repo_path = Repositories basis directorie
repo_path_helper = Alle remote Git repositories worden in deze directorie opgeslagen
run_user = Uitvoerende gebruikersnaam
run_user_helper = Deze gebruiker moet toegang hebben tot de git repositorie directorie en moet Gogs kunnen starten
domain = Domein
domain_helper = Dit heeft invloed op de SSH kloon URLs
app_url = Applicatie URL
app_url_helper = Dit heeft invloed op de HTTP/HTTPS kloon urls en de urls die in de email worden gebruikt
email_title = Email service instellingen (Optioneel)
smtp_host = SMTP host
mailer_user = Afzender e-mail / gebruikersnaam
mailer_password = Wachtwoord
notify_title = Notificatie-instelligen (optioneel)
register_confirm = Activeer registratie emails
mail_notify = Activeer e-mailnotificaties
admin_title = Instellingen beheerdersaccount
admin_name = Gebruikersnaam
admin_password = Wachtwoord
confirm_password = Verifieer wachtwoord
admin_email = E-mailadres
install_gogs = Installeer Gogs
test_git_failed = Git test niet gelukt: 'git' commando %v
sqlite3_not_available = SQLite3 wordt niet ondersteund in uw versie. Gelieve de officiële versie downloaden vanaf http://gogs.io/docs/installation/install_from_binary.html, niet de gobuild versie downloaden.
invalid_db_setting = Uw database instellingen zijn niet correct: %v
invalid_repo_path = Repositorie basis pad is niet correct: %v
run_user_not_match = De uitvoerende gebruiker is niet de huidig gebruiker: %s -> %s
save_config_failed = Kan de configuratie niet opslaan: %v
invalid_admin_setting = Uw admin-instellingen zijn niet geldig: %v
install_success = Welkom! Wij zijn veheugd dat u voor Gogs heeft gekozen, veel plezier en tot ziens
[explore]
repos = Repositories
[user]
change_avatar = Verander uw avatar op Gravatar.com
join_on = Aangemeld op
repositories = repositories
activity = Openbare activiteit
followers = Volgers
starred = Sterren
following = Volgt

View File

@@ -0,0 +1,644 @@
app_desc = 基于 Go 语言的自助 Git 服务
home = 首页
dashboard = 控制面板
explore = 探索
help = 帮助
sign_in = 登录
social_sign_in = 社交帐号登录:第 2 步 <small>关联帐号</small>
sign_out = 退出
sign_up = 注册
register = 注册
website = 官方网站
version = 当前版本
page = 页面
template = 模板
language = 语言选项
username = 用户名
email = 邮箱
password = 密码
re_type = 确认密码
captcha = 验证码
repository = 仓库
organization = 组织
mirror = 镜像
new_repo = 创建新的仓库
new_migrate = 迁移外部仓库
new_org = 创建新的组织
manage_org = 管理我的组织
admin_panel = 管理面板
account_settings = 帐户设置
settings = 帐户设置
news_feed = 最新活动
pull_requests = 合并请求
issues = 工单管理
cancel = 取消
[install]
install = 安装页面
title = 首次运行安装程序
requite_db_desc = Gogs 允许后端数据库为 MySQL、PostgreSQL 或 SQLite3但是 SQLite3 一般只有官方二进制发行版才支持。
db_type = 数据库类型
host = 数据库主机
user = 数据库用户
password = 数据库用户密码
db_name = 数据库名称
db_helper = 如果您使用 MySQL请使用 INNODB 引擎以及 utf8_general_ci 字符集。
ssl_mode = SSL 模式
path = 数据库文件路径
sqlite_helper = SQLite3 数据库的文件路径。
general_title = 应用基本设置
repo_path = 仓库根目录
repo_path_helper = 所有 Git 远程仓库都将被存放于该目录。
run_user = 运行系统用户
run_user_helper = 该用户必须具有对仓库根目录和运行 Gogs 的操作权限。
domain = 域名
domain_helper = 该设置影响 SSH 克隆地址。
app_url = 应用 URL
app_url_helper = 该设置影响 HTTP/HTTPS 克隆地址和一些邮箱中的链接。
email_title = 邮件服务设置(可选)
smtp_host = SMTP 主机
mailer_user = 发送邮箱
mailer_password = 发送邮箱密码
notify_title = 通知提醒设置(可选)
register_confirm = 启用注册邮箱确认
mail_notify = 启用邮件通知提醒
admin_title = 管理员帐号设置
admin_name = 管理员用户名
admin_password = 管理员密码
confirm_password = 确认密码
admin_email = 管理员邮箱
install_gogs = 立即安装
test_git_failed = 无法识别 'git' 命令:%v
sqlite3_not_available = 您所使用的发行版不支持 SQLite3请从 http://gogs.io/docs/installation/install_from_binary.html 下载官方二进制发行版,而不是 gobuild 版本。
invalid_db_setting = 数据库设置不正确:%v
invalid_repo_path = 仓库根目录设置不正确:%v
run_user_not_match = 运行系统用户非当前用户:%s -> %s
save_config_failed = 应用配置保存失败:%v
invalid_admin_setting = 管理员帐户设置不正确:%v
install_success = 您好!我们很高兴您选择使用 Gogs祝您使用愉快代码从此无 BUG
[home]
uname_holder = 用户名或邮箱
password_holder = 密码
switch_dashboard_context = 切换控制面板用户
my_repos = 我的仓库
collaborative_repos = 参与协作的仓库
my_orgs = 我的组织
my_mirrors = 我的镜像
[explore]
repos = 探索仓库
[auth]
create_new_account = 创建帐户
register_hepler_msg = 已经注册?立即登录!
social_register_hepler_msg = 已经注册?立即绑定!
disable_register_prompt = 对不起,注册功能已被关闭。请联系网站管理员。
disable_register_mail = 对不起,注册邮箱确认功能已被关闭。
remember_me = 记住登录
forgot_password = 忘记密码
forget_password = 忘记密码?
sign_up_now = 还没帐户?马上注册。
confirmation_mail_sent_prompt = 一封新的确认邮件已经被发送至 <b>%s</b>,请检查您的收件箱并在 %d 小时内完成确认注册操作。
sign_in_email = 登录到您的邮箱
active_your_account = 激活您的帐户
resent_limit_prompt = 对不起,您请求发送激活邮件过于频繁,请等待 3 分钟后再试!
has_unconfirmed_mail = %s 您好,系统检测到您有一封发送至 <b>%s</b> 但未被确认的邮件。如果您未收到激活邮件,或需要重新发送,请单击下方的按钮。
resend_mail = 单击此处重新发送确认邮件
email_not_associate = 您输入的邮箱地址未被关联到任何帐号!
send_reset_mail = 单击此处(重新)发送您的密码重置邮件
reset_password = 重置密码
invalid_code = 对不起,您的确认代码已过期或已失效。
reset_password_helper = 单击此处重置密码
password_too_short = 密码长度不能少于 6 位!
[form]
UserName = 用户名
RepoName = 仓库名称
Email = 邮箱地址
Password = 密码
Retype = 确认密码
SSHTitle = SSH 密钥名称
HttpsUrl = HTTPS URL 地址
PayloadUrl = 推送地址
TeamName = 团队名称
AuthName = 认证名称
AdminEmail = 管理员邮箱
require_error = 不能为空。
alpha_dash_error = 必须为英文字母、阿拉伯数字或横线(-_
alpha_dash_dot_error = 必须为英文字母、阿拉伯数字、横线(-_或点。
min_size_error = 长度最小为 %s 个字符。
max_size_error = 长度最大为 %s 个字符。
email_error = 不是一个有效的邮箱地址。
url_error = 不是一个有效的 URL。
unknown_error = 未知错误:
captcha_incorrect = 验证码未匹配。
password_not_match = 密码与确认密码未匹配。
username_been_taken = 用户名已经被占用。
repo_name_been_taken = 仓库名称已经被占用。
org_name_been_taken = 组织名称已经被占用。
team_name_been_taken = 团队名称已经被占用。
email_been_used = 邮箱地址已经被使用。
ssh_key_been_used = SSH 密钥已经被使用。
illegal_username = 您的用户名包含非法字符。
illegal_repo_name = 仓库名称包含非法字符。
illegal_org_name = 组织名称包含非法字符。
illegal_team_name = 团队名称包含非法字符。
username_password_incorrect = 用户名或密码不正确。
enterred_invalid_repo_name = 请检查您输入的仓库名称是正确。
enterred_invalid_owner_name = 请检查您输入的新所有者用户名是否正确。
enterred_invalid_password = 请检查您输入的密码是否正确。
user_not_exist = 被操作的用户不存在!
last_org_owner = 被移除用户为最后一位管理员。请添加一位新的管理员再进行移除成员操作!
invalid_ssh_key = 很抱歉,我们无法验证您输入的 SSH 密钥:%s
auth_failed = 授权验证失败:%v
still_own_repo = 您的帐户仍然是某些仓库的拥有者,您必须先转移或删除它们才能执行删除帐户操作!
org_still_own_repo = 该组织仍然是某些仓库的拥有者,您必须先转移或删除它们才能执行删除组织操作!
still_own_user = 该授权认证依旧被部分用户使用,请先删除该部分用户后再试!
[user]
change_avatar = 到 gravatar.com 上修改您的头像
join_on = 加入于
repositories = 仓库列表
activity = 公开活动
followers = 关注者
starred = 已点赞
following = 关注中
[settings]
profile = 个人信息
password = 修改密码
ssh_keys = 管理 SSH 密钥
social = 社交帐号绑定
orgs = 管理组织
delete = 删除帐户
uid = 用户 ID
public_profile = 公开信息
profile_desc = 您的邮箱地址将会被公开,并被用于接收帐户的所有提醒和通知。
full_name = 自定义名称
website = 个人网站
location = 所在地区
update_profile = 更新信息
update_profile_success = 您的个人信息更新成功!
change_username = 用户名将被修改
change_username_desc = 用户名被修改,您确定要继续操作吗?这将会影响到所有与您帐户有关的链接。
continue = 继续操作
cancel = 取消操作
change_password = 修改密码
old_password = 当前密码
new_password = 新的密码
password_incorrect = 当前密码不正确!
change_password_success = 密码修改成功!您现在可以使用新的密码登录。
manage_ssh_keys = 管理 SSH 密钥
add_key = 增加密钥
ssh_desc = 以下是与您帐户所关联的 SSH 密钥,如果您发现有陌生的密钥,请立即删除它!
ssh_helper = <strong>需要帮助?</strong> 请查看有关 <a href="https://help.github.com/articles/generating-ssh-keys">如何生成 SSH 密钥</a> 或 <a href="https://help.github.com/ssh-issues/">常见 SSH 问题</a> 寻找答案。
add_new_key = 增加 SSH 密钥
key_name = 密钥名称
key_content = 密钥内容
add_key_success = 新的 SSH 密钥添加成功!
delete_key = 删除
add_on = 增加于
last_used = 上次使用在
no_activity = 没有最近活动
manage_social = 管理关联社交帐户
social_desc = 以下是与您帐户所关联的社交帐号,如果您发现有陌生的关联,请立即解除绑定!
unbind = 解除绑定
unbind_success = 社交帐号解除绑定成功!
delete_account = 删除当前帐户
delete_prompt = 删除操作会永久清除您的帐户信息,并且 <strong>不可恢复</strong>
confirm_delete_account = 确认删除帐户
delete_account_title = 帐户删除操作
delete_account_desc = 该帐户将被永久性删除,您确定要继续操作吗?
[repo]
owner = 拥有者
repo_name = 仓库名称
repo_name_helper = 伟大的仓库名称一般都较短、令人深刻并且 <strong>独一无二</strong> 的。
visibility = 可见性
visiblity_helper = 本仓库将是 <span class="label label-red label-radius">私有的</span>
repo_desc = 仓库描述
repo_lang = 仓库语言
repo_lang_helper = 请选择 .gitignore 文件
license = 授权许可
license_helper = 请选择授权许可文件
init_readme = 使用 README.md 文件初始化仓库
create_repo = 创建仓库
default_branch = 默认分支
mirror_interval = 镜像同步周期(小时)
goget_meta = Go-Get 支持
goget_meta_helper = 本仓库将可以通过 <span class="label label-blue label-radius">Go Get</span> 获取
need_auth = 需要授权验证
migrate_type = 迁移类型
migrate_type_helper = 本仓库将是 <span class="label label-blue label-radius">镜像</span>
migrate_repo = 迁移仓库
copy_link = 复制链接
click_to_copy = 复制到剪切板
copied = 复制成功
clone_helper = 不知道如何操作?访问 <a target="_blank" href="http://git-scm.com/book/zh/Git-基础-取得项目的-Git-仓库">此处</a> 查看帮助!
unwatch = 取消关注
watch = 关注
unstar = 取消点赞
star = 点赞
fork = 派生
no_desc = 暂无描述
quick_guide = 快速帮助
clone_this_repo = 克隆当前仓库
create_new_repo_command = 从命令行创建一个新的仓库
push_exist_repo = 从命令行推送已经创建的仓库
branch = 分支
tree = 目录树
branch_and_tags = 分支与标签
branches = 分支列表
tags = 标签列表
issues = 工单管理
commits = 提交历史
releases = 版本发布
commits.commits = 次代码提交
commits.search = 搜索提交历史
commits.find = 查找
commits.author = 作者
commits.message = 备注
commits.date = 提交日期
commits.older = 更旧的提交
commits.newer = 更新的提交
settings = 仓库设置
settings.options = 基本设置
settings.collaboration = 管理协作者
settings.hooks = 管理 Web 钩子
settings.githooks = 管理 Git 钩子
settings.deploy_keys = 管理部署密钥
settings.basic_settings = 基本设置
settings.danger_zone = 危险操作区
settings.site = 官方网站
settings.update_settings = 更新仓库设置
settings.change_reponame = 仓库名称将被修改
settings.change_reponame_desc = 仓库名称被修改,您确定要继续操作吗?这将会影响到所有与该仓库有关的链接。
settings.transfer = 转移仓库所有权
settings.transfer_desc = 您可以将仓库转移至您拥有管理员权限的帐户或组织。
settings.new_owner_has_same_repo = 新的仓库拥有者已经存在同名仓库!
settings.delete = 删除本仓库
settings.delete_desc = 删除仓库操作不可逆转,请三思而后行。
settings.transfer_notices = <p>- 如果您转移给个人用户,您将对仓库失去所有权限。</p><p>- 如果您转移给您作为拥有者的组织,则可继续保持操作权限。</p>
settings.update_settings_success = 仓库设置更新成功!
settings.transfer_owner = 新拥有者
settings.make_transfer = 确认转移仓库
settings.transfer_succeed = 仓库所有权转移成功!
settings.confirm_delete = 确认删除仓库
settings.add_collaborator = 增加新的协作者
settings.add_collaborator_success = 成功添加新的协作者!
settings.remove_collaborator_success = 被操作的协作者已经被收回权限!
settings.user_is_org_member = 被操作的用户是组织成员,因此无法添加为协作者!
settings.add_webhook = 添加 Web 钩子
settings.hooks_desc = Web 钩子允许您设定在 Gogs 上发生指定事件时对指定 URL 发送 POST 通知。查看 <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks 文档</a> 获取更多信息。
settings.remove_hook_success = Web 钩子删除成功!
settings.add_webhook_desc = 我们会通过 <code>POST</code> 请求将订阅事件信息发送至向指定 URL 地址。您可以设置不同的数据接收方式JSON 或 <code>x-www-form-urlencoded</code>)。 请查阅 <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks 文档</a> 获取更多信息。
settings.githooks_desc = Git 钩子是由 Git 本身提供的功能,以下为 Gogs 所支持的钩子列表。
settings.githook_edit_desc = 如果钩子未启动,则会显示样例文件中的内容。如果想要删除某个钩子,则提交空白文本即可。
settings.githook_name = 钩子名称
settings.githook_content = 钩子文本
settings.update_githook = 更新钩子设置
settings.payload_url = 推送地址
settings.content_type = 数据格式
settings.secret = 密钥文本
settings.event_desc = 请设置您希望触发 Web 钩子的事件:
settings.event_push_only = 只推送 <code>push</code> 事件。
settings.active = 是否激活
settings.active_helper = 当指定事件发生时我们将会触发此 Web 钩子。
settings.add_hook_success = Web 钩子添加成功!
settings.update_webhook = 更新 Web 钩子
settings.update_hook_success = Web 钩子更新成功!
settings.delete_webhook = 删除 Web 钩子
settings.recent_deliveries = 最近推送记录
settings.hook_type = 钩子类型
settings.add_slack_hook_desc = 为您的仓库增加 <a href="http://slack.com">Slack</a> 集成
settings.slack_token = 令牌
settings.slack_domain = 域名
settings.slack_channel = 频道
[org]
org_name_holder = 组织名称
org_name_helper = 伟大的组织都有一个简短而寓意深刻的名字。
org_email_helper = 组织的邮箱用于接收所有通知和确认邮件。
create_org = 创建组织
repo_updated = 最后更新于
people = 组织成员
invite_someone = 邀请他人加入
teams = 组织团队
lower_members = 名成员
lower_repositories = 个仓库
create_new_team = 创建新的团队
org_desc = 组织描述
team_name = 团队名称
team_desc = 团队描述
team_name_helper = 您可以使用该名称来通知改组全体成员。
team_desc_helper = 一句话描述这个团队是做什么的。
team_permission_desc = 请选择该团队所具有的权限等级:
settings = 组织设置
settings.options = 基本设置
settings.full_name = 组织全名
settings.website = 官方网站
settings.location = 所在地区
settings.update_settings = 更新组织设置
settings.change_orgname = 组织名称将被修改
settings.change_orgname_desc = 组织名称被修改,您确定要继续操作吗?这将会影响到所有与该组织有关的链接。
settings.update_setting_success = 组织设置更新成功!
settings.delete = 删除组织
settings.delete_account = 删除当前组织
settings.delete_prompt = 删除操作会永久清除该组织的信息,并且 <strong>不可恢复</strong>
settings.confirm_delete_account = 确认删除组织
settings.delete_org_title = 组织删除操作
settings.delete_org_desc = 该组织将被永久性删除,您确定要继续操作吗?
settings.hooks_desc = 在此处添加的 Web 钩子将会应用到该组织下的 <strong>所有仓库</strong>。
members.public = 公开成员
members.public_helper = 设为私有
members.private = 私有成员
members.private_helper = 设为公开
members.owner = 管理员
members.member = 普通成员
members.conceal = 隐藏身份
members.remove = 移除成员
members.leave = 离开组织
members.invite_desc = 请输入被邀请到组织 %s 的用户名称:
members.invite_now = 立即邀请
teams.join = 加入团队
teams.leave = 离开团队
teams.read_access = 读取权限
teams.read_access_helper = 这个团队将拥有查看和克隆所属仓库的权限。
teams.write_access = 写入权限
teams.write_access_helper = 这个团队将拥有查看、克隆和推送所属仓库的权限。
teams.admin_access = 管理权限
teams.admin_access_helper = 这个团队将拥有查看、克隆、推送和添加其他组织成员到团队的权限。
teams.no_desc = 该团队暂无描述
teams.settings = 团队设置
teams.owners_permission_desc = 管理员团队对 <strong>所有仓库</strong> 具有操作权限,且对组织具有 <strong>管理员权限</strong>。
teams.members = 团队成员
teams.update_settings = 更新团队设置
teams.delete_team = 删除当前团队
teams.add_team_member = 添加团队成员
teams.delete_team_title = 团队删除操作
teams.delete_team_desc = 删除操作会永久清除有关该团队的信息,您确定要继续操作吗?团队成员可能会失去对某些仓库的操作权限。
teams.delete_team_success = 指定团队删除成功!
teams.read_permission_desc = 该团队拥有对所属仓库的 <strong>读取</strong> 权限,团队成员可以进行查看和克隆等只读操作。
teams.write_permission_desc = 该团队拥有对所属仓库的 <strong>读取</strong> 和 <strong>写入</strong> 的权限。
teams.admin_permission_desc = 该团队拥有一定的 <strong>管理</strong> 权限,团队成员可以读取、克隆、推送以及添加其它仓库协作者。
teams.repositories = 团队仓库
teams.add_team_repository = 添加团队仓库
teams.remove_repo = 移除仓库
teams.add_nonexistent_repo = 您尝试添加到团队的仓库不存在,请先创建仓库!
[admin]
dashboard = 控制面板
users = 用户管理
organizations = 组织管理
repositories = 仓库管理
authentication = 授权认证管理
config = 应用配置管理
notices = 系统提示管理
monitor = 应用监控面板
prev = 上一页
next = 下一页
dashboard.statistic = 应用统计数据
dashboard.operations = 管理员操作
dashboard.system_status = 系统监视状态
dashboard.statistic_info = Gogs 数据库统计:<b>%d</b> 位用户,<b>%d</b> 个组织,<b>%d</b> 个公钥,<b>%d</b> 个仓库,<b>%d</b> 个仓库关注,<b>%d</b> 个赞,<b>%d</b> 次行为,<b>%d</b> 条权限记录,<b>%d</b> 张工单,<b>%d</b> 次评论,<b>%d</b> 个社交帐号,<b>%d</b> 个用户关注,<b>%d</b> 个镜像,<b>%d</b> 个版本发布,<b>%d</b> 个登录源,<b>%d</b> 个 Web 钩子,<b>%d</b> 个里程碑,<b>%d</b> 个标签,<b>%d</b> 个钩子任务,<b>%d</b> 个团队,<b>%d</b> 个更新任务,<b>%d</b> 个附件。
dashboard.operation_name = 操作名称
dashboard.operation_switch = 开关
dashboard.operation_run = 执行
dashboard.clean_unbind_oauth = 清理未绑定社交帐号
dashboard.delete_inactivate_accounts = 删除所有未激活帐户
dashboard.server_uptime = 服务运行时间
dashboard.current_goroutine = 当前 Goroutines 数量
dashboard.current_memory_usage = 当前内存使用量
dashboard.total_memory_allocated = 所有被分配的内存
dashboard.memory_obtained = 内存占用量
dashboard.pointer_lookup_times = 指针查找次数
dashboard.memory_allocate_times = 内存分配次数
dashboard.memory_free_times = 内存释放次数
dashboard.current_heap_usage = 当前 Heap 内存使用量
dashboard.heap_memory_obtained = Heap 内存占用量
dashboard.heap_memory_idle = Heap 内存空闲量
dashboard.heap_memory_in_use = 正在使用的 Heap 内存
dashboard.heap_memory_released = 被释放的 Heap 内存
dashboard.heap_objects = Heap 对象数量
dashboard.bootstrap_stack_usage = 启动 Stack 使用量
dashboard.stack_memory_obtained = 被分配的 Stack 内存
dashboard.mspan_structures_usage = MSpan 结构内存使用量
dashboard.mspan_structures_obtained = 被分配的 MSpan 结构内存
dashboard.mcache_structures_usage = MCache 结构内存使用量
dashboard.mcache_structures_obtained = 被分配的 MCache 结构内存
dashboard.profiling_bucket_hash_table_obtained = 被分配的剖析哈希表内存
dashboard.gc_metadata_obtained = 被分配的 GC 元数据内存
dashboard.other_system_allocation_obtained = 其它被分配的系统内存
dashboard.next_gc_recycle = 下次 GC 内存回收量
dashboard.last_gc_time = 距离上次 GC 时间
dashboard.total_gc_time = GC 执行时间总量
dashboard.total_gc_pause = GC 暂停时间总量
dashboard.last_gc_pause = 上次 GC 暂停时间
dashboard.gc_times = GC 执行次数
users.user_manage_panel = 用户管理面板
users.new_account = 创建新的帐户
users.name = 用户名
users.activated = 已激活
users.admin = 管理员
users.repos = 仓库数
users.created = 创建时间
users.edit = 编辑
users.auth_source = 认证源
users.local = 本地
users.auth_login_name = 认证登录名
users.update_profile_success = 该用户信息更新成功!
users.edit_account = 编辑用户信息
users.is_activated = 该用户已被激活
users.is_admin = 该用户具有管理员权限
users.update_profile = 更新用户信息
users.delete_account = 删除该用户
users.still_own_repo = 该帐户仍然是某些仓库的拥有者,您必须先转移或删除它们才能执行删除帐户操作!
orgs.org_manage_panel = 组织管理面板
orgs.name = 组织名称
orgs.teams = 团队数
orgs.members = 成员数
repos.repo_manage_panel = 仓库管理界面
repos.owner = 所有者
repos.name = 仓库名称
repos.private = 私有库
repos.watches = 关注数
repos.stars = 点赞数
repos.issues = 工单数
auths.auth_manage_panel = 授权认证管理面板
auths.new = 添加新的认证源
auths.name = 认证名称
auths.type = 认证类型
auths.enabled = 已启用
auths.updated = 最后更新时间
auths.auth_type = 授权类型
auths.auth_name = 授权名称
auths.domain = 域名
auths.host = 主机地址
auths.port = 主机端口
auths.base_dn = Base DN
auths.attributes = Search Attributes
auths.filter = Search Filter
auths.ms_ad_sa = Ms Ad SA
auths.smtp_auth = SMTP 授权类型
auths.smtphost = SMTP 主机地址
auths.smtpport = SMTP 主机端口
auths.enable_tls = 启用 TLS 加密
auths.enable_auto_register = 允许授权用户自动注册
auths.tips = 帮助提示
auths.edit = 修改授权认证设置
auths.activated = 该授权认证已经启用
auths.update_success = 授权认证设置更新成功!
auths.update = 更新授权认证信息
auths.delete = 删除该授权认证
auths.delete_auth_title = 授权认证删除操作
auths.delete_auth_desc = 该授权认证将被删除,您确定要继续吗?
config.server_config = 服务器配置
config.app_name = 应用名称
config.app_ver = 应用版本
config.app_url = 应用 URL
config.domain = 应用域名
config.offline_mode = 离线模式
config.disable_router_log = 关闭路由日志
config.run_user = 运行用户
config.run_mode = 运行模式
config.repo_root_path = 仓库根目录
config.static_file_root_path = 静态文件根目录
config.log_file_root_path = 日志文件根目录
config.script_type = 脚本类型
config.reverse_auth_user = 反向代理认证
config.db_config = 数据库配置
config.db_type = 数据库类型
config.db_host = 主机地址
config.db_name = 数据库名称
config.db_user = 连接用户
config.db_ssl_mode = SSL 模式
config.db_ssl_mode_helper = (仅限 "postgres" 使用)
config.db_path = 数据库路径
config.db_path_helper = (仅限 "sqlite3" 使用)
config.service_config = 服务配置
config.register_email_confirm = 注册邮件确认
config.disable_register = 关闭注册功能
config.require_sign_in_view = 强制登录浏览
config.mail_notify = 邮件通知提醒
config.enable_cache_avatar = 开启缓存头像
config.active_code_lives = 激活用户链接有效期
config.reset_password_code_lives = 重置密码链接有效期
config.webhook_config = Web 钩子配置
config.task_interval = 任务周期
config.deliver_timeout = 推送超时
config.mailer_config = 邮件配置
config.mailer_enabled = 启用服务
config.mailer_name = 发送者名称
config.mailer_host = 邮件主机地址
config.mailer_user = 发送者帐号
config.oauth_config = 社交帐号配置
config.oauth_enabled = 启用服务
config.cache_config = Cache 配置
config.cache_adapter = Cache 适配器
config.cache_interval = Cache 周期
config.cache_conn = Cache 连接字符串
config.session_config = Session 配置
config.session_provider = Session 提供者
config.provider_config = 提供者配置
config.cookie_name = Cookie 名称
config.enable_set_cookie = 启用设置 Cookie
config.gc_interval_time = GC 周期
config.session_life_time = Session 生命周期
config.https_only = 仅限 HTTPS
config.cookie_life_time = Cookie 生命周期
config.session_hash_function = Session ID 哈希函数
config.session_hash_key = Session ID 哈希健值
config.picture_config = 图片配置
config.picture_service = 图片服务
config.disable_gravatar = 禁用 Gravatar 头像
config.log_config = 日志配置
config.log_mode = 日志模式
monitor.cron = Cron 任务
monitor.name = 任务名称
monitor.schedule = 任务安排
monitor.next = 下次执行时间
monitor.previous = 上次执行时间
monitor.execute_times = 执行次数
monitor.process = 运行中进程
monitor.desc = 进程描述
monitor.start = 开始时间
monitor.execute_time = 已执行时间
notices.system_notice_list = 系统提示管理
notices.type = 提示类型
notices.type_1 = 仓库
notices.desc = 描述
notices.op = 操作
notices.delete_success = 系统提示删除成功!
[action]
create_repo = 创建了仓库 <a href="%s/%s">%s</a>
commit_repo = 推送了 <a href="%s/%s/src/%s">%s</a> 分支的代码到 <a href="%s/%s">%s</a>
create_issue = 创建了工单 <a href="%s/%s/issues/%s">%s#%s</a>
comment_issue = 评论了工单 <a href="%s/%s/issues/%s">%s#%s</a>
transfer_repo = 将仓库 <code>%s</code> 转移至 <a href="/%s%s">%s</a>
[tool]
ago = 之前
from_now = 之后
now = 现在
1s = 1 秒%s
1m = 1 分钟%s
1h = 1 小时%s
1d = 1 天%s
1w = 1 周%s
1mon = 1 月%s
1y = 1 年%s
seconds = %d 秒%s
minutes = %d 分钟%s
hours = %d 小时%s
days = %d 天%s
weeks = %d 周%s
months = %d 月%s
years = %d 年%s
raw_seconds =
raw_minutes = 分钟

View File

@@ -0,0 +1,642 @@
app_desc = 基於 Go 語言的自助 Git 服務
home = 首頁
dashboard = 控制面版
explore = 探索
help = 幫助
sign_in = 登錄
social_sign_in = 社交帳號登錄:第 2 步 <small>關聯帳號</small>
sign_out = 退出
sign_up = 註冊
register = 註冊
website = 官方網站
version = 當前版本
page = 頁面
template = 模版
language = 語言選項
username = 用戶名
email = 郵箱
password = 密碼
re_type = 確認密碼
captcha = 驗證碼
repository = 倉庫
organization = 組織
mirror = 鏡像
new_repo = 創建新的倉庫
new_migrate = 遷移外部倉庫
new_org = 創建新的組織
manage_org = 管理我的組織
admin_panel = 管理面版
account_settings = 帳戶設置
settings = 帳戶設置
news_feed = 最新活動
pull_requests = 合併請求
issues = 問題管理
cancel = 取消
[install]
install = 安裝頁面
title = 首次執行安裝程序
requite_db_desc = Gogs 允許後端數據庫為 MySQL、PostgreSQL 或 SQLite3但是 SQLite3 一般只有官方二進制發行版才支持。
db_type = 數據庫類型
host = 數據庫主機
user = 數據庫用戶
password = 數據庫用戶密碼
db_name = 數據庫名稱
db_helper = 如果您使用 MySQL請使用 INNODB 引擎以及 utf8_general_ci 字符集。
ssl_mode = SSL 模式
path = 數據庫文件路徑
sqlite_helper = SQLite3 數據庫的文件路徑。
general_title = 應用基本設置
repo_path = 倉庫根目錄
repo_path_helper = 所有 Git 遠程倉庫都將被存放於該目錄。
run_user = 執行系統用戶
run_user_helper = 該用戶必須具有對倉庫根目錄和執行 Gogs 的操作權限。
domain = 域名
domain_helper = 該設置影響 SSH 克隆地址。
app_url = 應用 URL
app_url_helper = 該設置影響 HTTP/HTTPS 克隆地址和一些郵箱中的鏈接。
email_title = 郵件服務設置(可選)
smtp_host = SMTP 主機
mailer_user = 發送郵箱
mailer_password = 發送郵箱密碼
notify_title = 通知提醒設置(可選)
register_confirm = 啟用註冊郵箱確認
mail_notify = 啟用郵件通知提醒
admin_title = 管理員帳號設置
admin_name = 管理員用戶名
admin_password = 管理員密碼
confirm_password = 確認密碼
admin_email = 管理員郵箱
install_gogs = 立即安裝
test_git_failed = 無法識別 'git' 命令:%v
sqlite3_not_available = 您所使用的發行版本不支持 SQLite3請從 http://gogs.io/docs/installation/install_from_binary.html 下載官方二進制發行版本,而不是 gobuild 版本。
invalid_db_setting = 數據庫設置不正確:%v
invalid_repo_path = 倉庫根目錄設置不正確:%v
run_user_not_match = 執行系統用戶非當前用戶:%s -> %s
save_config_failed = 應用配置保存失敗:%v
invalid_admin_setting = 管理員帳戶設置不正確:%v
install_success = 您好!我們很高興您選擇使用 Gogs祝您使用愉快代碼從此無 BUG
[home]
uname_holder = 用戶名或郵箱
password_holder = 密碼
switch_dashboard_context = 切換控制面版用戶
my_repos = 我的倉庫
collaborative_repos = 參與協作的倉庫
my_orgs = 我的組織
my_mirrors = 我的鏡像
[explore]
repos = 探索倉庫
[auth]
create_new_account = 創建帳戶
register_hepler_msg = 已經註冊?立即登錄!
social_register_hepler_msg = 已經註冊?立即綁定!
disable_register_prompt = 對不起,註冊功能已被關閉。請聯系網站管理員。
disable_register_mail = 對不起,註冊郵箱確認功能已被關閉。
remember_me = 記住登錄
forgot_password = 忘記密碼
forget_password = 忘記密碼?
sign_up_now = 還沒帳戶?馬上註冊。
confirmation_mail_sent_prompt = 一封新的確認郵件已經被發送至 <b>%s</b>,請檢查您的收件箱並在 %d 小時內完成確認註冊操作。
sign_in_email = 登錄到您的郵箱
active_your_account = 激活您的帳戶
resent_limit_prompt = 對不起,您請求發送激活郵件過於頻繁,請等待 3 分鐘後再試!
has_unconfirmed_mail = %s 您好,系統檢測到您有一封發送至 <b>%s</b> 但未被確認的郵件。如果您未收到激活郵件,或需要重新發送,請單擊下方的按鈕。
resend_mail = 單擊此處重新發送確認郵件
email_not_associate = 您輸入的郵箱地址未被關聯到任何帳號!
send_reset_mail = 單擊此處(重新)發送您的密碼重置郵件
reset_password = 重置密碼
invalid_code = 對不起,您的確認代碼已過期或已失效。
reset_password_helper = 單擊此處重置密碼
password_too_short = 密碼長度不能少於 6 位!
[form]
UserName = 用戶名
RepoName = 倉庫名稱
Email = 郵箱地址
Password = 密碼
Retype = 確認密碼
SSHTitle = SSH 密鑰名稱
HttpsUrl = HTTPS URL 地址
PayloadUrl = 推送地址
TeamName = 團隊名稱
AuthName = 認證名稱
AdminEmail = 管理員郵箱
require_error = 不能為空。
alpha_dash_error = 必須為英文字母、阿拉伯數字或橫線(-_
alpha_dash_dot_error = 必須為英文字母、阿拉伯數字、橫線(-_或點。
min_size_error = 長度最小為 %s 個字符。
max_size_error = 長度最大為 %s 個字符。
email_error = 不是一個有效的郵箱地址。
url_error = 不是一個有效的 URL。
unknown_error = 未知錯誤:
captcha_incorrect = 驗證碼未匹配。
password_not_match = 密碼與確認密碼未匹配。
username_been_taken = 用戶名已經被佔用。
repo_name_been_taken = 倉庫名稱已經被佔用。
org_name_been_taken = 組織名稱已經被佔用。
team_name_been_taken = 團隊名稱已經被佔用。
email_been_used = 郵箱地址已經被使用。
ssh_key_been_used = SSH 密鑰已經被使用。
illegal_username = 您的用戶名包含不合法字符。
illegal_repo_name = 倉庫名稱包含不合法字符。
illegal_org_name = 組織名稱包含不合法字符。
illegal_team_name = 團隊名稱包含不合法字符。
username_password_incorrect = 用戶名或密碼不正確。
enterred_invalid_repo_name = 請檢查您輸入的倉庫名稱是正確。
enterred_invalid_owner_name = 請檢查您輸入的新所有者用戶名是否正確。
enterred_invalid_password = 請檢查您輸入的密碼是否正確。
user_not_exist = 被操作的用戶不存在!
last_org_owner = 被移除用戶為最後一位管理員。請添加一位新的管理員再進行移除成員操作!
invalid_ssh_key = 很抱歉,我們無法驗證您輸入的 SSH 密鑰:%s
auth_failed = 授權驗證失敗:%v
still_own_repo = 您的帳戶仍然是某些倉庫的擁有者,您必須先轉移或刪除它們才能執行刪除帳戶操作!
org_still_own_repo = 該組織仍然是某些倉庫的擁有者,您必須先轉移或刪除它們才能執行刪除組織操作!
still_own_user = 該授權認證依舊被部分用戶使用,請先刪除該部分用戶後再試!
[user]
change_avatar = 到 gravatar.com 上修改您的頭像
join_on = 加入於
repositories = 倉庫列表
activity = 公開活動
followers = 關註者
starred = 已點讚
following = 關註中
[settings]
profile = 個人信息
password = 修改密碼
ssh_keys = 管理 SSH 密鑰
social = 社交帳號綁定
orgs = 管理組織
delete = 刪除帳戶
uid = 用戶 ID
public_profile = 公開信息
profile_desc = 您的郵箱地址將會被公開,並被用於接收帳戶的所有提醒和通知。
full_name = 自定義名稱
website = 個人網站
location = 所在地區
update_profile = 更新信息
update_profile_success = 您的個人信息更新成功!
change_username = 用戶名將被修改
change_username_desc = 用戶名被修改,您確定要繼續操作嗎?這將會影響到所有與您帳戶有關的鏈接。
continue = 繼續操作
cancel = 取消操作
change_password = 修改密碼
old_password = 當前密碼
new_password = 新的密碼
password_incorrect = 當前密碼不正確!
change_password_success = 密碼修改成功!您現在可以使用新的密碼登錄。
manage_ssh_keys = 管理 SSH 密鑰
add_key = 增加密鑰
ssh_desc = 以下是與您帳戶所關聯的 SSH 密鑰,如果您發現有陌生的密鑰,請立即刪除它!
ssh_helper = <strong>需要幫助?</strong> 請查看有關 <a href="https://help.github.com/articles/generating-ssh-keys">如何生成 SSH 密鑰</a> 或 <a href="https://help.github.com/ssh-issues/">常見 SSH 問題</a> 尋找答案。
add_new_key = 增加 SSH 密鑰
key_name = 密鑰名稱
key_content = 密鑰內容
add_key_success = 新的 SSH 密鑰添加成功!
delete_key = 刪除
add_on = 增加於
last_used = 上次使用在
no_activity = 沒有最近活動
manage_social = 管理關聯社交帳戶
social_desc = 以下是與您帳戶所關聯的社交帳號,如果您發現有陌生的關聯,請立即解除綁定!
unbind = 解除綁定
unbind_success = 社交帳號解除綁定成功!
delete_account = 刪除當前帳戶
delete_prompt = 刪除操作會永久清除您的帳戶信息,並且 <strong>不可恢復</strong>
confirm_delete_account = 確認刪除帳戶
delete_account_title = 帳戶刪除操作
delete_account_desc = 該帳戶將被永久性刪除,您確定要繼續操作嗎?
[repo]
owner = 擁有者
repo_name = 倉庫名稱
repo_name_helper = 偉大的倉庫名稱一般都較短、令人深刻並且 <strong>獨一無二</strong> 的。
visibility = 可見度
visiblity_helper = 本倉庫將是 <span class="label label-red label-radius">私有的</span>
repo_desc = 倉庫描述
repo_lang = 倉庫語言
repo_lang_helper = 請選擇 .gitignore 文件
license = 授權許可
license_helper = 請選擇授權許可文件
init_readme = 使用 README.md 文件初始化倉庫
create_repo = 創建倉庫
default_branch = 默認分支
mirror_interval = 鏡像同步周期(小時)
goget_meta = Go-Get 支持
goget_meta_helper = 本倉庫將可以通過 <span class="label label-blue label-radius">Go Get</span> 獲取
need_auth = 需要授權驗證
migrate_type = 遷移類型
migrate_type_helper = 本倉庫將是 <span class="label label-blue label-radius">鏡像</span>
migrate_repo = 遷移倉庫
copy_link = 復製鏈接
click_to_copy = 復製到剪切簿
copied = 復製成功
clone_helper = 不知道如何操作?訪問 <a target="_blank" href="http://git-scm.com/book/zh/Git-基礎-取得項目的-Git-倉庫">此處</a> 查看幫助!
unwatch = 取消關註
watch = 關註
unstar = 取消點讚
star = 點讚
fork = 派生
no_desc = 暫無描述
quick_guide = 快速幫助
clone_this_repo = 克隆當前倉庫
create_new_repo_command = 從命令行創建一個新的倉庫
push_exist_repo = 從命令行推送已經創建的倉庫
branch = 分支
tree = 目錄樹
branch_and_tags = 分支與標籤
branches = 分支列表
tags = 標籤列表
issues = 問題管理
commits = 提交歷史
releases = 版本發佈
commits.commits = 次代碼提交
commits.search = 搜索提交歷史
commits.find = 查找
commits.author = 作者
commits.message = 備註
commits.date = 提交日期
commits.older = 更舊的提交
commits.newer = 更新的提交
settings = 倉庫設置
settings.options = 基本設置
settings.collaboration = 管理協作者
settings.hooks = 管理 Web 鉤子
settings.githooks = 管理 Git 鉤子
settings.deploy_keys = 管理部署密鑰
settings.basic_settings = 基本設置
settings.danger_zone = 危險操作區
settings.site = 官方網站
settings.update_settings = 更新倉庫設置
settings.change_reponame = 倉庫名稱將被修改
settings.change_reponame_desc = 倉庫名稱被修改,您確定要繼續操作嗎?這將會影響到所有與該倉庫有關的鏈接。
settings.transfer = 轉移倉庫所有權
settings.transfer_desc = 您可以將倉庫轉移至您擁有管理員權限的帳戶或組織。
settings.new_owner_has_same_repo = 新的倉庫擁有者已經存在同名倉庫!
settings.delete = 刪除本倉庫
settings.delete_desc = 刪除倉庫操作不可逆轉,請三思而後行。
settings.transfer_notices = <p>- 如果您轉移給個人用戶,您將對倉庫失去所有權限。</p><p>- 如果您轉移給您作為擁有者的組織,則可繼續保持操作權限。</p>
settings.update_settings_success = 倉庫設置更新成功!
settings.transfer_owner = 新擁有者
settings.make_transfer = 確認轉移倉庫
settings.transfer_succeed = 倉庫所有權轉移成功!
settings.confirm_delete = 確認刪除倉庫
settings.add_collaborator = 增加新的協作者
settings.add_collaborator_success = 成功添加新的協作者!
settings.remove_collaborator_success = 被操作的協作者已經被收回權限!
settings.add_webhook = 添加 Web 鉤子
settings.hooks_desc = Web 鉤子允許您設定在 Gogs 上發生指定事件時對指定 URL 發送 POST 通知。查看 <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks 文檔</a> 獲取更多信息。
settings.remove_hook_success = Web 鉤子刪除成功!
settings.add_webhook_desc = 我們會通過 <code>POST</code> 請求將訂閱事件信息發送至向指定 URL 地址。您可以設置不同的數據接收方式JSON 或 <code>x-www-form-urlencoded</code>)。 請查閱 <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks 文檔</a> 獲取更多信息。
settings.githooks_desc = Git 鉤子是由 Git 本身提供的功能,以下為 Gogs 所支持的鉤子列表。
settings.githook_edit_desc = 如果鉤子未啟動,則會顯示樣例文件中的內容。如果想要刪除某個鉤子,則提交空白文本即可。
settings.githook_name = 鉤子名稱
settings.githook_content = 鉤子文本
settings.update_githook = 更新鉤子設置
settings.payload_url = 推送地址
settings.content_type = 數據格式
settings.secret = 密鑰文本
settings.event_desc = 請設置您希望觸發 Web 鉤子的事件:
settings.event_push_only = 只推送 <code>push</code> 事件。
settings.active = 是否激活
settings.active_helper = 當指定事件發生時我們將會觸發此 Web 鉤子。
settings.add_hook_success = Web 鉤子添加成功!
settings.update_webhook = 更新 Web 鉤子
settings.update_hook_success = Web 鉤子更新成功!
settings.delete_webhook = 刪除 Web 鉤子
settings.recent_deliveries = 最近推送記錄
settings.hook_type = 鉤子類型
settings.add_slack_hook_desc = 為您的倉庫增加 <a href="http://slack.com">Slack</a> 集成
settings.slack_token = 令牌
settings.slack_domain = 域名
settings.slack_channel = 頻道
[org]
org_name_holder = 組織名稱
org_name_helper = 偉大的組織都有一個簡短而寓意深刻的名字。
org_email_helper = 組織的郵箱用於接收所有通知和確認郵件。
create_org = 創建組織
repo_updated = 最後更新於
people = 組織成員
invite_someone = 邀請他人加入
teams = 組織團隊
lower_members = 名成員
lower_repositories = 個倉庫
create_new_team = 創建新的團隊
org_desc = 組織描述
team_name = 團隊名稱
team_desc = 團隊描述
team_name_helper = 您可以使用該名稱來通知改組全體成員。
team_desc_helper = 一句話描述這個團隊是做什麼的。
team_permission_desc = 請選擇該團隊所具有的權限等級:
settings = 組織設置
settings.options = 基本設置
settings.full_name = 組織全名
settings.website = 官方網站
settings.location = 所在地區
settings.update_settings = 更新組織設置
settings.change_orgname = 組織名稱將被修改
settings.change_orgname_desc = 組織名稱被修改,您確定要繼續操作嗎?這將會影響到所有與該組織有關的鏈接。
settings.update_setting_success = 組織設置更新成功!
settings.delete = 刪除組織
settings.delete_account = 刪除當前組織
settings.delete_prompt = 刪除操作會永久清除該組織的信息,並且 <strong>不可恢復</strong>
settings.confirm_delete_account = 確認刪除組織
settings.delete_org_title = 組織刪除操作
settings.delete_org_desc = 該組織將被永久性刪除,您確定要繼續操作嗎?
settings.hooks_desc = 在此處添加的 Web 鉤子將會應用到該組織下的 <strong>所有倉庫</strong>。
members.public = 公開成員
members.public_helper = 設為私有
members.private = 私有成員
members.private_helper = 設為公開
members.owner = 管理員
members.member = 普通成員
members.conceal = 隱藏身份
members.remove = 移除成員
members.leave = 離開組織
members.invite_desc = 請輸入被邀請到組織 %s 的用戶名稱:
members.invite_now = 立即邀請
teams.join = 加入團隊
teams.leave = 離開團隊
teams.read_access = 讀取權限
teams.read_access_helper = 這個團隊將擁有查看和克隆所屬倉庫的權限。
teams.write_access = 寫入權限
teams.write_access_helper = 這個團隊將擁有查看、克隆和推送所屬倉庫的權限。
teams.admin_access = 管理權限
teams.admin_access_helper = 這個團隊將擁有查看、克隆、推送和添加其他組織成員到團隊的權限。
teams.no_desc = 該團隊暫無描述
teams.settings = 團隊設置
teams.owners_permission_desc = 管理員團隊對 <strong>所有倉庫</strong> 具有操作權限,且對組織具有 <strong>管理員權限</strong>。
teams.members = 團隊成員
teams.update_settings = 更新團隊設置
teams.delete_team = 刪除當前團隊
teams.add_team_member = 添加團隊成員
teams.delete_team_title = 團隊刪除操作
teams.delete_team_desc = 刪除操作會永久清除有關該團隊的信息,您確定要繼續操作嗎?團隊成員可能會失去對某些倉庫的操作權限。
teams.delete_team_success = 指定團隊刪除成功!
teams.read_permission_desc = 該團隊擁有對所屬倉庫的 <strong>讀取</strong> 權限,團隊成員可以進行查看和克隆等只讀操作。
teams.write_permission_desc = 該團隊擁有對所屬倉庫的 <strong>讀取</strong> 和 <strong>寫入</strong> 的權限。
teams.admin_permission_desc = 該團隊擁有一定的 <strong>管理</strong> 權限,團隊成員可以讀取、克隆、推送以及添加其它倉庫協作者。
teams.repositories = 團隊倉庫
teams.add_team_repository = 添加團隊倉庫
teams.remove_repo = 移除倉庫
[admin]
dashboard = 控制面版
users = 用戶管理
organizations = 組織管理
repositories = 倉庫管理
authentication = 授權認證管理
config = 應用配置管理
notices = 系統提示管理
monitor = 應用監控面版
prev = 上一頁
next = 下一頁
dashboard.statistic = 應用統計數據
dashboard.operations = 管理員操作
dashboard.system_status = 系統監視狀態
dashboard.statistic_info = Gogs 數據庫統計:<b>%d</b> 位用戶,<b>%d</b> 個組織,<b>%d</b> 個公鑰,<b>%d</b> 個倉庫,<b>%d</b> 個倉庫關註,<b>%d</b> 個贊,<b>%d</b> 次行為,<b>%d</b> 條權限記錄,<b>%d</b> 個問題,<b>%d</b> 次評論,<b>%d</b> 個社交帳號,<b>%d</b> 個用戶關註,<b>%d</b> 個鏡像,<b>%d</b> 個版本發佈,<b>%d</b> 個登錄源,<b>%d</b> 個 Web 鉤子,<b>%d</b> 個里程碑,<b>%d</b> 個標籤,<b>%d</b> 個鉤子任務,<b>%d</b> 個團隊,<b>%d</b> 個更新任務,<b>%d</b> 個附件。
dashboard.operation_name = 操作名稱
dashboard.operation_switch = 開關
dashboard.operation_run = 執行
dashboard.clean_unbind_oauth = 清理未綁定社交帳號
dashboard.delete_inactivate_accounts = 刪除所有未激活帳戶
dashboard.server_uptime = 服務執行時間
dashboard.current_goroutine = 當前 Goroutines 數量
dashboard.current_memory_usage = 當前內存使用量
dashboard.total_memory_allocated = 所有被分配的內存
dashboard.memory_obtained = 內存佔用量
dashboard.pointer_lookup_times = 指針查找次數
dashboard.memory_allocate_times = 內存分配次數
dashboard.memory_free_times = 內存釋放次數
dashboard.current_heap_usage = 當前 Heap 內存使用量
dashboard.heap_memory_obtained = Heap 內存佔用量
dashboard.heap_memory_idle = Heap 內存空閒量
dashboard.heap_memory_in_use = 正在使用的 Heap 內存
dashboard.heap_memory_released = 被釋放的 Heap 內存
dashboard.heap_objects = Heap 對象數量
dashboard.bootstrap_stack_usage = 啟動 Stack 使用量
dashboard.stack_memory_obtained = 被分配的 Stack 內存
dashboard.mspan_structures_usage = MSpan 結構內存使用量
dashboard.mspan_structures_obtained = 被分配的 MSpan 結構內存
dashboard.mcache_structures_usage = MCache 結構內存使用量
dashboard.mcache_structures_obtained = 被分配的 MCache 結構內存
dashboard.profiling_bucket_hash_table_obtained = 被分配的剖析哈希表內存
dashboard.gc_metadata_obtained = 被分配的垃圾收集元數據內存
dashboard.other_system_allocation_obtained = 其它被分配的系統內存
dashboard.next_gc_recycle = 下次垃圾收集內存回收量
dashboard.last_gc_time = 距離上次垃圾收集時間
dashboard.total_gc_time = 垃圾收集執行時間總量
dashboard.total_gc_pause = 垃圾收集暫停時間總量
dashboard.last_gc_pause = 上次垃圾收集暫停時間
dashboard.gc_times = 垃圾收集執行次數
users.user_manage_panel = 用戶管理面版
users.new_account = 創建新的帳戶
users.name = 用戶名
users.activated = 已激活
users.admin = 管理員
users.repos = 倉庫數
users.created = 創建時間
users.edit = 編輯
users.auth_source = 認證源
users.local = 本地
users.auth_login_name = 認證登錄名
users.update_profile_success = 該用戶信息更新成功!
users.edit_account = 編輯用戶信息
users.is_activated = 該用戶已被激活
users.is_admin = 該用戶具有管理員權限
users.update_profile = 更新用戶信息
users.delete_account = 刪除該用戶
users.still_own_repo = 該帳戶仍然是某些倉庫的擁有者,您必須先轉移或刪除它們才能執行刪除帳戶操作!
orgs.org_manage_panel = 組織管理面版
orgs.name = 組織名稱
orgs.teams = 團隊數
orgs.members = 成員數
repos.repo_manage_panel = 倉庫管理界面
repos.owner = 所有者
repos.name = 倉庫名稱
repos.private = 私有庫
repos.watches = 關註數
repos.stars = 點讚數
repos.issues = 問題數
auths.auth_manage_panel = 授權認證管理面版
auths.new = 添加新的認證源
auths.name = 認證名稱
auths.type = 認證類型
auths.enabled = 已啟用
auths.updated = 最後更新時間
auths.auth_type = 授權類型
auths.auth_name = 授權名稱
auths.domain = 域名
auths.host = 主機地址
auths.port = 主機端口
auths.base_dn = Base DN
auths.attributes = 搜尋屬性
auths.filter = 搜尋過濾
auths.ms_ad_sa = Ms Ad SA
auths.smtp_auth = SMTP 授權類型
auths.smtphost = SMTP 主機地址
auths.smtpport = SMTP 主機端口
auths.enable_tls = 啟用 TLS 加密
auths.enable_auto_register = 允許授權用戶自動註冊
auths.tips = 幫助提示
auths.edit = 修改授權認證設置
auths.activated = 該授權認證已經啟用
auths.update_success = 授權認證設置更新成功!
auths.update = 更新授權認證信息
auths.delete = 刪除該授權認證
auths.delete_auth_title = 授權認證刪除操作
auths.delete_auth_desc = 該授權認證將被刪除,您確定要繼續嗎?
config.server_config = 服務器配置
config.app_name = 應用名稱
config.app_ver = 應用版本
config.app_url = 應用 URL
config.domain = 應用域名
config.offline_mode = 離線模式
config.disable_router_log = 關閉路由日志
config.run_user = 執行用戶
config.run_mode = 執行模式
config.repo_root_path = 倉庫根目錄
config.static_file_root_path = 靜態文件根目錄
config.log_file_root_path = 日志文件根目錄
config.script_type = 腳本類型
config.reverse_auth_user = 反向代理認證
config.db_config = 數據庫配置
config.db_type = 數據庫類型
config.db_host = 主機地址
config.db_name = 數據庫名稱
config.db_user = 連接用戶
config.db_ssl_mode = SSL 模式
config.db_ssl_mode_helper = (僅限 "postgres" 使用)
config.db_path = 數據庫路徑
config.db_path_helper = (僅限 "sqlite3" 使用)
config.service_config = 服務配置
config.register_email_confirm = 註冊郵件確認
config.disable_register = 關閉註冊功能
config.require_sign_in_view = 強制登錄瀏覽
config.mail_notify = 郵件通知提醒
config.enable_cache_avatar = 開啟緩存頭像
config.active_code_lives = 激活用戶鏈接有效期
config.reset_password_code_lives = 重置密碼鏈接有效期
config.webhook_config = Web 鉤子配置
config.task_interval = 任務周期
config.deliver_timeout = 推送超時
config.mailer_config = 郵件配置
config.mailer_enabled = 啟用服務
config.mailer_name = 發送者名稱
config.mailer_host = 郵件主機地址
config.mailer_user = 發送者帳號
config.oauth_config = 社交帳號配置
config.oauth_enabled = 啟用服務
config.cache_config = Cache 配置
config.cache_adapter = Cache 適配器
config.cache_interval = Cache 周期
config.cache_conn = Cache 連接字符串
config.session_config = Session 配置
config.session_provider = Session 提供者
config.provider_config = 提供者配置
config.cookie_name = Cookie 名稱
config.enable_set_cookie = 啟用設置 Cookie
config.gc_interval_time = 垃圾收集周期
config.session_life_time = Session 生命周期
config.https_only = 僅限 HTTPS
config.cookie_life_time = Cookie 生命周期
config.session_hash_function = Session ID 哈希函數
config.session_hash_key = Session ID 哈希健值
config.picture_config = 圖片配置
config.picture_service = 圖片服務
config.disable_gravatar = 禁用 Gravatar 頭像
config.log_config = 日誌配置
config.log_mode = 日誌模式
monitor.cron = Cron 任務
monitor.name = 任務名稱
monitor.schedule = 任務安排
monitor.next = 下次執行時間
monitor.previous = 上次執行時間
monitor.execute_times = 執行次數
monitor.process = 執行中進程
monitor.desc = 進程描述
monitor.start = 開始時間
monitor.execute_time = 已執行時間
notices.system_notice_list = 系統提示管理
notices.type = 提示類型
notices.type_1 = 倉庫
notices.desc = 描述
notices.op = 操作
notices.delete_success = 系統提示刪除成功!
[action]
create_repo = 創建了倉庫 <a href="%s/%s">%s</a>
commit_repo = 推送了 <a href="%s/%s/src/%s">%s</a> 分支的代碼到 <a href="%s/%s">%s</a>
create_issue = 創建了問題 <a href="%s/%s/issues/%s">%s#%s</a>
comment_issue = 評論了問題 <a href="%s/%s/issues/%s">%s#%s</a>
transfer_repo = 將倉庫 <code>%s</code> 轉移至 <a href="/%s%s">%s</a>
[tool]
ago = 之前
from_now = 之後
now = 現在
1s = 1 秒%s
1m = 1 分鐘%s
1h = 1 小時%s
1d = 1 天%s
1w = 1 周%s
1mon = 1 月%s
1y = 1 年%s
seconds = %d 秒%s
minutes = %d 分鐘%s
hours = %d 小時%s
days = %d 天%s
weeks = %d 周%s
months = %d 月%s
years = %d 年%s
raw_seconds =
raw_minutes = 分鐘

View File

@@ -1,8 +0,0 @@
[program:gogs]
user=git
command = /home/git/gogs/start.sh
directory = /home/git/gogs
autostart = true
stdout_logfile = /var/gogs.log
stderr_logfile = /var/gogs-error.log
environment=HOME="/home/git"

89
docker/README.md Normal file
View File

@@ -0,0 +1,89 @@
Docker
======
TOOLS ARE WRITTEN FOR TESTING AND TO SEE WHAT IT IS!
For this to work you will need the nifty docker tool [fig].
The most simple setup will look like this:
```sh
./assemble_blocks.sh docker_gogs w_db option_db_mysql
fig up
```
That's it. You have GoGS running in docker linked to a MySQL docker container.
Now visit http://localhost:3000/ and give details for the admin account an you're up and running.
How does it work
----------------
`./assemble_blocks.sh` will look in `blocks` for subdirectories.
In the subdirectories there are three relevant files: `Dockerfile`, `config` and `fig`.
`Dockerfile` will be copied to `docker/` (also means last `Dockerfile` wins).
The `config` file contains lines which will in the gogs docker container end up in `$GOGS_PATH/custom/config/app.ini` and by this gogs will be configured.
Here you can define things like the MySQL server for your database block.
The `fig` file will just be added to `fig.yml`, which is used by fig to manage your containers.
This inculdes container linking!
Just have a look at them and it will be clear how to write your own blocks.
Just some things
- all files (`Dockerfile`, `fig` and `config`) are optional
- the gogs block should always be the first block
Currently the blocks are designed that, the blocks that start with `docker` pull in the base docker image.
Then one block starting with `w` defines, what containers should be linked to the gogs container.
For every option in the `w` block you need to add an `option` container.
Example:
```sh
./assemble_blocks.sh docker_gogs w_db_cache option_db_mysql option_cache_redis
```
More sophisticated Example
--------------------------
Her is a more elaborated example
```sh
./assemble_blocks.sh docker_gogs w_db_cache_session option_db_postgresql option_cache_redis option_session_mysql
fig up
```
This will set up four containters and link them proberly. One for each of
- gogs
- database (postgresql)
- cache (redis)
- session (mysql)
WARNING: This will not work at the Moment! MySQL session is broken!
Remark
------
After you execute `assemble_blocks.sh` you should always trigger `fig build` to inculde the the new init script `init_gogs.sh` in the docker image.
If you want to use another GoGS docker file, but keep everything else the same, you can create a block, e.g. `docker_gogs_custom`, with only a `Dockerfile` and call
```sh
./assemble_blocks.sh docker_gogs_custom w_db option_database_mysql
```
This will pull in the `Dockerfile` from `docker_gogs` instead of the one from `docker_gogs`.
`Dockerfile`s for the `master` and `dev` branch are provided as `docker_gogs` and `docker_gogs_dev`
[fig]:http://www.fig.sh/

72
docker/assemble_blocks.sh Executable file
View File

@@ -0,0 +1,72 @@
#!/bin/bash
blocks_dir=blocks
docker_dir=docker
template_dir=templates
docker_file=Dockerfile
gogs_config_file=conf.tmp
gogs_config=config
gogs_init_file=$docker_dir/init_gogs.sh
fig_file=fig.yml
fig_config=fig
gogs_init_template=$template_dir/init_gogs.sh.tpl
if [ "$#" == 0 ]; then
blocks=`ls $blocks_dir`
if [ -z "$blocks" ]; then
echo "No Blocks available in $blocks_dir"
else
echo "Available Blocks:"
for block in $blocks; do
echo " $block"
done
fi
exit 0
fi
for file in $gogs_config_file $fig_file; do
if [ -e $file ]; then
echo "Deleting $file"
rm $file
fi
done
for dir in $@; do
current_dir=$blocks_dir/$dir
if [ ! -d "$current_dir" ]; then
echo "$current_dir is not a directory"
exit 1
fi
if [ -e $current_dir/$docker_file ]; then
echo "Copying $current_dir/$docker_file to $docker_dir/$docker_file"
cp $current_dir/$docker_file $docker_dir/$docker_file
fi
if [ -e $current_dir/$gogs_config ]; then
echo "Adding $current_dir/$gogs_config to $gogs_config_file"
cat $current_dir/$gogs_config >> $gogs_config_file
echo "" >> $gogs_config_file
fi
if [ -e $current_dir/$fig_config ]; then
echo "Adding $current_dir/$fig_config to $fig_file"
cat $current_dir/fig >> $fig_file
echo "" >> $fig_file
fi
done
echo "Creating $gogs_init_file"
sed "/{{ CONFIG }}/{
r $gogs_config_file
d
}" $gogs_init_template > $gogs_init_file
if [ -e $gogs_config_file ]; then
echo "Removing temporary GoGS config"
rm $gogs_config_file
fi

View File

@@ -0,0 +1,52 @@
FROM ubuntu:14.04
# This part is taken from the official docker image --------------------
RUN apt-get update && apt-get install -y \
build-essential ca-certificates curl \
bzr git mercurial \
--no-install-recommends
ENV GOLANG_VERSION 1.3
RUN curl -sSL http://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \
| tar -v -C /usr/src -xz
WORKDIR /usr/src/go
RUN cd src && ./make.bash --no-clean 2>&1
ENV PATH /usr/src/go/bin:$PATH
RUN mkdir -p /go/src
ENV GOPATH /go
ENV PATH /go/bin:$PATH
WORKDIR /go
# ----------------------------------------------------------------------
RUN useradd -m git
ENV GOGS_PATH $GOPATH/src/github.com/gogits/gogs
ENV GOGS_CUSTOM_CONF_PATH $GOGS_PATH/custom/conf
ENV GOGS_CUSTOM_CONF $GOGS_CUSTOM_CONF_PATH/app.ini
RUN go get -u -d github.com/gogits/gogs
# WORKDIR $GOGS_PATH
WORKDIR /go/src/github.com/gogits/gogs
RUN go build github.com/gogits/gogs
RUN chown -R git $GOGS_PATH
ADD init_gogs.sh /tmp/
RUN chown git /tmp/init_gogs.sh
RUN chmod +x /tmp/init_gogs.sh
USER git
ENV HOME /home/git
ENV USER git
ENV PATH $GOGS_PATH:$PATH
RUN git config --global user.name "GoGS"
ENTRYPOINT ["/tmp/init_gogs.sh"]
CMD ["gogs", "web"]

View File

@@ -0,0 +1,53 @@
FROM ubuntu:14.04
# This part is derived from the official docker image ------------------
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -qy \
build-essential ca-certificates curl \
bzr git mercurial \
--no-install-recommends
ENV GOLANG_VERSION 1.3
RUN curl -sSL http://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \
| tar -v -C /usr/src -xz
WORKDIR /usr/src/go
RUN cd src && ./make.bash --no-clean 2>&1
ENV PATH /usr/src/go/bin:$PATH
RUN mkdir -p /go/src
ENV GOPATH /go
ENV PATH /go/bin:$PATH
WORKDIR /go
# ----------------------------------------------------------------------
RUN useradd -m git
ENV GOGS_PATH $GOPATH/src/github.com/gogits/gogs
ENV GOGS_CUSTOM_CONF_PATH $GOGS_PATH/custom/conf
ENV GOGS_CUSTOM_CONF $GOGS_CUSTOM_CONF_PATH/app.ini
RUN git clone -b dev https://github.com/gogits/gogs.git $GOGS_PATH
# WORKDIR $GOGS_PATH
WORKDIR /go/src/github.com/gogits/gogs
RUN go get -d && go build
RUN chown -R git $GOGS_PATH
ADD init_gogs.sh /tmp/
RUN chown git /tmp/init_gogs.sh
RUN chmod +x /tmp/init_gogs.sh
USER git
ENV HOME /home/git
ENV USER git
ENV PATH $GOGS_PATH:$PATH
RUN git config --global user.name "GoGS"
ENTRYPOINT ["/tmp/init_gogs.sh"]
CMD ["gogs", "web"]

View File

@@ -0,0 +1,3 @@
[cache]
DB_TYPE = memcache
HOST = HOST = ${CACHE_1_PORT_11211_TCP_ADDR}:${CACHE_1_PORT_11211_TCP_PORT}

View File

@@ -0,0 +1,2 @@
cache:
image: sylvainlasnier/memcached:latest

View File

@@ -0,0 +1,3 @@
[cache]
DB_TYPE = redis
HOST = ${CACHE_1_PORT_6379_TCP_ADDR}:${CACHE_1_PORT_6379_TCP_PORT}

View File

@@ -0,0 +1,2 @@
cache:
image: redis:latest

View File

@@ -0,0 +1,6 @@
[database]
DB_TYPE = mysql
HOST = ${DB_1_PORT_3306_TCP_ADDR}:${DB_1_PORT_3306_TCP_PORT}
NAME = ${DB_1_ENV_MYSQL_DATABASE}
USER = ${DB_1_ENV_MYSQL_USER}
PASSWD = ${DB_1_ENV_MYSQL_PASSWORD}

View File

@@ -0,0 +1,7 @@
db:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: gogs
MYSQL_USER: gogs
MYSQL_PASSWORD: password

View File

@@ -0,0 +1,6 @@
[database]
DB_TYPE = postgres
HOST = ${DB_1_PORT_5432_TCP_ADDR}:${DB_1_PORT_5432_TCP_PORT}
NAME = ${DB_1_ENV_POSTGRESQL_DB}
USER = ${DB_1_ENV_POSTGRESQL_USER}
PASSWD = ${DB_1_ENV_POSTGRESQL_PASS}

View File

@@ -0,0 +1,6 @@
db:
image: wyaeld/postgres:9.3
environment:
POSTGRESQL_DB: gogs
POSTGRESQL_USER: gogs
POSTGRESQL_PASS: password

View File

@@ -0,0 +1,3 @@
[session]
PROVIDER = mysql
PROVIDER_CONFIG = ${SESSION_1_ENV_MYSQL_USER}:${SESSION_1_ENV_MYSQL_PASSWORD}@SESSION_1_PORT_3306_TCP_PROTO(${SESSION_1_PORT_3306_TCP_ADDR}:${SESSION_1_PORT_3306_TCP_PORT})/${SESSION_1_ENV_MYSQL_DATABASE}

View File

@@ -0,0 +1,7 @@
session:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: gogs_session
MYSQL_USER: gogs
MYSQL_PASSWORD: password

View File

@@ -0,0 +1,6 @@
gogs:
build: docker
links:
- cache
ports:
- "3000:3000"

View File

@@ -0,0 +1,7 @@
gogs:
build: docker
links:
- cache
- session
ports:
- "3000:3000"

6
docker/blocks/w_db/fig Normal file
View File

@@ -0,0 +1,6 @@
gogs:
build: docker
links:
- db
ports:
- "3000:3000"

View File

@@ -0,0 +1,7 @@
gogs:
build: docker
links:
- db
- cache
ports:
- "3000:3000"

View File

@@ -0,0 +1,8 @@
gogs:
build: docker
links:
- db
- cache
- session
ports:
- "3000:3000"

View File

@@ -0,0 +1,7 @@
gogs:
build: docker
links:
- db
- session
ports:
- "3000:3000"

4
docker/blocks/w_none/fig Normal file
View File

@@ -0,0 +1,4 @@
gogs:
build: docker
ports:
- "3000:3000"

View File

@@ -0,0 +1,6 @@
gogs:
build: docker
links:
- session
ports:
- "3000:3000"

View File

@@ -0,0 +1,12 @@
#!/bin/sh
if [ ! -d "$DIRECTORY" ]; then
mkdir -p $GOGS_CUSTOM_CONF_PATH
echo "
{{ CONFIG }}
" >> $GOGS_CUSTOM_CONF
fi
exec "$@"

View File

@@ -1,40 +0,0 @@
### Install Gogs With Docker
Deploying gogs in [Docker](http://www.docker.io/) is just as easy as eating a pie, what you do is just open the `dockerfiles/build.sh` file, replace the configs:
```
DB_TYPE="YOUR_DB_TYPE" # type of database, support 'mysql' and 'postgres'
MEM_TYPE="YOUR_MEM_TYPE" # type of memory database, support 'redis' and 'memcache'
DB_PASSWORD="YOUR_DB_PASSWORD" # The database password.
DB_RUN_NAME="YOUR_DB_RUN_NAME" # The --name option value when run the database image.
MEM_RUN_NAME="YOUR_MEM_RUN_NAME" # The --name option value when run the mem database image.
HOST_PORT="YOUR_HOST_PORT" # The port on host, which will be redirected to the port 3000 inside gogs container.
```
And run:
```
cd dockerfiles
./build.sh
```
The build might take some time, just be paient. After it finishes, you will receive the message:
```
Now we have the MySQL image(running) and gogs image, use the follow command to start gogs service( the content might be different, according to your own configs):
docker run -i -t --link YOUR_DB_RUN_NAME:db --link YOUR_MEM_RUN_NAME:mem -p YOUR_HOST_PORT:3000 gogits/gogs
```
Just follow the message, run:
```
docker run -i -t --link YOUR_DB_RUN_NAME:db --link YOUR_MEM_RUN_NAME:mem -p YOUR_HOST_PORT:3000 gogits/gogs
```
Now we have gogs running! Open the browser and navigate to:
```
http://YOUR_HOST_IP:YOUR_HOST_PORT
```
Let's 'gogs'!
Ouya~

View File

@@ -1,68 +0,0 @@
# Configs of the docker images, you might have specify your own configs here.
DB_TYPE="YOUR_DB_TYPE" # type of database, support 'mysql' and 'postgres'
MEM_TYPE="YOUR_MEM_TYPE" # type of memory database, support 'redis' and 'memcache'
DB_PASSWORD="YOUR_DB_PASSWORD" # The database password.
DB_RUN_NAME="YOUR_DB_RUN_NAME" # The --name option value when run the database image.
MEM_RUN_NAME="YOUR_MEM_RUN_NAME" # The --name option value when run the mem database image.
HOST_PORT="YOUR_HOST_PORT" # The port on host, which will be redirected to the port 3000 inside gogs container.
# apt source, you can select 'nchc'(mirror in Taiwan) or 'aliyun'(best for mainlance China users) according to your network, if you could connect to the official unbunt mirror in a fast speed, just leave it to "".
APT_SOURCE=""
# Replace the database root password in database image Dockerfile.
sed -i "s/THE_DB_PASSWORD/$DB_PASSWORD/g" images/$DB_TYPE/Dockerfile
# Replace the database root password in gogits image deploy.sh file.
sed -i "s/THE_DB_PASSWORD/$DB_PASSWORD/g" images/gogits/deploy.sh
# Replace the apt source in gogits image Dockerfile.
sed -i "s/#$APT_SOURCE#//" images/gogits/Dockerfile
# Uncomment the installation of database lib in gogs Dockerfile
sed -i "s/#$DB_TYPE#//" images/gogits/Dockerfile
# Replace the database type in gogits image deploy.sh file.
sed -i "s/THE_DB_TYPE/$DB_TYPE/g" images/gogits/deploy.sh
if [ $MEM_TYPE != "" ]
then
# Replace the mem configs in deploy.sh
sed -i "s/THE_MEM_TYPE/$MEM_TYPE/g" images/gogits/deploy.sh
# Uncomment the installation of go mem lib
sed -i "s/#$MEM_TYPE#//" images/gogits/Dockerfile
# Add the tags when get gogs
sed -i "s#RUN go get -u -d github.com/gogits/gogs#RUN go get -u -d -tags $MEM_TYPE github.com/gogits/gogs#g" images/gogits/Dockerfile
# Append the tag in gogs build
GOGS_BUILD_LINE=`awk '$0 ~ str{print NR}' str="go build" images/gogits/Dockerfile`
# Append the build tags
sed -i "${GOGS_BUILD_LINE}s/$/ -tags $MEM_TYPE/" images/gogits/Dockerfile
cd images/$MEM_TYPE
docker build -t gogits/$MEM_TYPE .
docker run -d --name $MEM_RUN_NAME gogits/$MEM_TYPE
MEM_LINK=" --link $MEM_RUN_NAME:mem "
cd ../../
fi
# Build the database image
cd images/$DB_TYPE
docker build -t gogits/$DB_TYPE .
#
## Build the gogits image
cd ../gogits
docker build -t gogits/gogs .
#sed -i "s#RUN go get -u -tags $MEM_TYPE github.com/gogits/gogs#RUN go get -u github.com/gogits/gogs#g" Dockerfile
# Remove the appended tags in go build line(if there is any)
sed -i "s/ -tags $MEM_TYPE//" Dockerfile
#
## Run MySQL image with name
docker run -d --name $DB_RUN_NAME gogits/$DB_TYPE
#
## Run gogits image and link it to the database image
echo "Now we have the $DB_TYPE image(running) and gogs image, use the follow command to start gogs service:"
echo -e "\033[33m docker run -i -t --link $DB_RUN_NAME:db $MEM_LINK -p $HOST_PORT:3000 gogits/gogs \033[0m"

View File

@@ -1,32 +0,0 @@
FROM stackbrew/ubuntu:13.10
MAINTAINER Meaglith Ma <genedna@gmail.com> (@genedna)
#aliyun#RUN echo "deb http://mirrors.aliyun.com/ubuntu/ saucy main restricted" > /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-updates main restricted" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy universe" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-updates universe" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy multiverse" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-updates multiverse" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-backports main restricted universe multiverse" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-security main restricted" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-security universe" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-security multiverse" >> /etc/apt/sources.list
#nchc#RUN echo "deb http://free.nchc.org.tw/ubuntu/ saucy main restricted" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy main restricted" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-updates main restricted" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-updates main restricted" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy universe" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy universe" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-updates universe" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-updates universe" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy multiverse" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy multiverse" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-updates multiverse" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-updates multiverse" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-backports main restricted universe multiverse" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-backports main restricted universe multiverse" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-security main restricted" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-security main restricted" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-security universe" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-security universe" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-security multiverse" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-security multiverse" >> /etc/apt/source.list && echo "deb http://extras.ubuntu.com/ubuntu saucy main" >> /etc/apt/source.list && echo "deb-src http://extras.ubuntu.com/ubuntu saucy main" >> /etc/apt/source.list
RUN mkdir -p /go
ENV PATH /usr/local/go/bin:/go/bin:$PATH
ENV GOROOT /usr/local/go
ENV GOPATH /go
RUN apt-get update && apt-get install --yes --force-yes curl git mercurial zip wget ca-certificates build-essential
RUN apt-get install -yq vim sudo
RUN curl -s http://docker.u.qiniudn.com/go1.2.1.src.tar.gz | tar -v -C /usr/local -xz
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
RUN go get -u -d github.com/gogits/gogs
RUN cd $GOPATH/src/github.com/gogits/gogs && git checkout dev && git pull origin dev && go install && go build -tags redis
# Clean all the unused packages
RUN apt-get autoremove -y
RUN apt-get clean all
# Add the deploy script to the docker image and assign execution permission to it.
ADD ./deploy.sh /
RUN chmod +x deploy.sh
EXPOSE 3000
CMD /deploy.sh

View File

@@ -1,60 +0,0 @@
# deploy.sh in gogits image, replace the configs and run gogs
## Replace the database password
DB_TYPE=THE_DB_TYPE
DB_PASSWORD=THE_DB_PASSWORD
DB_ALIAS=DB
MEM_TYPE=THE_MEM_TYPE
DB_TYPE_LINE=`awk '$0 ~ str{print NR}' str="DB_TYPE = mysql" $GOPATH/src/github.com/gogits/gogs/conf/app.ini`
DB_PASSWORD_LINE=`awk '$0 ~ str{print NR+1}' str="USER = root" $GOPATH/src/github.com/gogits/gogs/conf/app.ini`
sed -i "${DB_TYPE_LINE}s/.*$/DB_TYPE = $DB_TYPE/g" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
sed -i "${DB_PASSWORD_LINE}s/.*$/PASSWD = $DB_PASSWORD/g" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
if [ $MEM_TYPE != "" ]
then
MEM_HOST_LINE=`awk '$0 ~ str{print NR+6}' str="ADAPTER = memory" $GOPATH/src/github.com/gogits/gogs/conf/app.ini`
_MEM_ADDR=`echo $MEM_PORT | cut -d '/' -f 3 | cut -d ':' -f 1`
_MEM_PORT=`echo $MEM_PORT | cut -d '/' -f 3 | cut -d ':' -f 2`
# take advantage of memory db for adapter and provider
sed -i "s/ADAPTER = memory/ADAPTER = $MEM_TYPE/g" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
# Comment the memory interval since we don't use 'memory' as adapter
sed -i "s/INTERVAL = 60/;INTERVAL = 60/g" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
case $MEM_TYPE in
"redis")
# Modify the adapter host
sed -i "${MEM_HOST_LINE}s/.*/HOST = $_MEM_ADDR:$_MEM_PORT/" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
sed -i "s/PROVIDER = file/PROVIDER = $MEM_TYPE/g" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
# Modify the provider config
sed -i "s#PROVIDER_CONFIG = data/sessions#PROVIDER_CONFIG = $_MEM_ADDR:$_MEM_PORT#g" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
;;
"memcache")
# Modify the adapter host
sed -i "${MEM_HOST_LINE}s/.*/HOST = $_MEM_ADDR:$_MEM_PORT/" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
;;
esac
fi
## Replace the database address and port
# When using --link in docker run, the database image's info looks like this:
# DB_PORT=tcp://172.17.0.2:3306
# DB_PORT_3306_TCP_PORT=3306
# DB_PORT_3306_TCP_PROTO=tcp
# DB_PORT_3306_TCP_ADDR=172.17.0.2
#sed -i "/HOST = 127.0.0.1:3306/c\HOST = $DB_PORT_3306_TCP_ADDR:$DB_PORT_3306_TCP_PORT" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
sed -i "/HOST = 127.0.0.1:3306/c\HOST = `echo $DB_PORT | cut -d '/' -f 3`" $GOPATH/src/github.com/gogits/gogs/conf/app.ini
cd $GOPATH/src/github.com/gogits/gogs/
# The sudo is a must here, or the go within docker container won't get the current user by os.Getenv("USERNAME")
sudo ./gogs web

View File

@@ -1,24 +0,0 @@
FROM ubuntu
# Set the file maintainer (your name - the file's author)
MAINTAINER Borja Burgos <borja@tutum.co>
# Update the default application repository sources list
RUN apt-get update
# Install Memcached
RUN apt-get install -y memcached
# Port to expose (default: 11211)
EXPOSE 11211
# Default Memcached run command arguments
# Change to limit memory when creating container in Tutum
CMD ["-m", "64"]
# Set the user to run Memcached daemon
USER daemon
# Set the entrypoint to memcached binary
ENTRYPOINT memcached

View File

@@ -1,35 +0,0 @@
#FROM stackbrew/ubuntu:13.10
#FROM stackbrew/ubuntu
FROM stackbrew/ubuntu:saucy
MAINTAINER Meaglith Ma <genedna@gmail.com> (@genedna)
RUN apt-get install -y --force-yes software-properties-common
RUN add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
RUN apt-get --yes --force-yes update
RUN apt-get --yes --force-yes upgrade
ENV MYSQL_PASSWORD THE_DB_PASSWORD
RUN echo "mysql-server mysql-server/root_password password $MYSQL_PASSWORD" | debconf-set-selections
RUN echo "mysql-server mysql-server/root_password_again password $MYSQL_PASSWORD" | debconf-set-selections
RUN apt-get update && apt-get install -y --force-yes mysql-server
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
RUN service mysql restart
RUN echo "mysql -uroot -p$MYSQL_PASSWORD -e 'drop database if exists gogs;'" >> import.sh
RUN echo "mysql -uroot -p$MYSQL_PASSWORD -e 'create database gogs;'" >> import.sh
RUN chmod +x import.sh
RUN apt-get autoremove -y
RUN apt-get clean all
RUN /usr/sbin/mysqld & \
sleep 10s &&\
echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' WITH GRANT OPTION; FLUSH PRIVILEGES" | mysql -p$MYSQL_PASSWORD &&\
./import.sh
EXPOSE 3306
CMD ["/usr/bin/mysqld_safe", "--skip-syslog", "--log-error=/dev/null"]

View File

@@ -1,50 +0,0 @@
FROM ubuntu
MAINTAINER SvenDowideit@docker.com
# Add the PostgreSQL PGP key to verify their Debian packages.
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
# Add PostgreSQL's repository. It contains the most recent stable release
# of PostgreSQL, ``9.3``.
# See http://apt.postgresql.org/pub/repos/apt/README
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
# Update the Ubuntu and PostgreSQL repository indexes
RUN apt-get update
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
# There are some warnings (in red) that show up during the build. You can hide
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
RUN apt-get -y -q install python-software-properties software-properties-common
RUN apt-get -y -q install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
# Note: The official Debian and Ubuntu images automatically ``apt-get clean``
# after each ``apt-get``
# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``
USER postgres
# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and
# then create a database `docker` owned by the ``docker`` role.
# Note: here we use ``&&\`` to run commands one after the other - the ``\``
# allows the RUN command to span multiple lines.
RUN /etc/init.d/postgresql start &&\
psql --command "CREATE USER root WITH SUPERUSER PASSWORD 'THE_DB_PASSWORD';" &&\
createdb -O root gogs
# Adjust PostgreSQL configuration so that remote connections to the
# database are possible.
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
# Expose the PostgreSQL port
EXPOSE 5432
# Add VOLUMEs to allow backup of config, logs and databases
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
# Set the default command to run when starting the container
CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]

View File

@@ -1,10 +0,0 @@
FROM stackbrew/ubuntu:saucy
MAINTAINER Meaglith Ma <genedna@gmail.com> (@genedna), Lance Ju <juzhenatpku@gmail.com> (@crystaldust)
RUN apt-get update && apt-get install -y redis-server
# Usually redis doesn't need a password
#RUN sed -i "s/# requirepass foobared/requirepass THE_REDIS_PASSWORD/g" /etc/redis/redis.conf
EXPOSE 6379
ENTRYPOINT ["/usr/bin/redis-server"]
CMD ["--bind", "0.0.0.0"]

View File

@@ -1,13 +0,0 @@
# Configs
MYSQL_PASSWORD="kuajie8402"
MYSQL_RUN_NAME="gogs_mysql"
typeset -u MYSQL_ALIAS
MYSQL_ALIAS="db"
HOST_PORT="3000"
## Run MySQL image with name
docker run -d --name $MYSQL_RUN_NAME gogs/mysql
#
## Run gogits image and link it to the MySQL image
docker run --link $MYSQL_RUN_NAME:$MYSQL_ALIAS -p $HOST_PORT:3000 gogs/gogits

View File

@@ -4,7 +4,7 @@
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language.
// Gogs(Go Git Service) is a painless self-hosted Git Service written in Go.
package main
import (
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
const APP_VER = "0.4.1.0601 Alpha"
const APP_VER = "0.5.5.1010 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
@@ -31,10 +31,11 @@ func main() {
app.Version = APP_VER
app.Commands = []cli.Command{
cmd.CmdWeb,
// cmd.CmdFix,
cmd.CmdDump,
cmd.CmdServ,
cmd.CmdUpdate,
cmd.CmdFix,
cmd.CmdDump,
cmd.CmdCert,
}
app.Flags = append(app.Flags, []cli.Flag{}...)
app.Run(os.Args)

View File

@@ -11,26 +11,27 @@ import (
"github.com/go-xorm/xorm"
)
// Access types.
type AccessType int
const (
AU_READABLE = iota + 1
AU_WRITABLE
READABLE AccessType = iota + 1
WRITABLE
)
// Access represents the accessibility of user to repository.
type Access struct {
Id int64
UserName string `xorm:"unique(s)"`
RepoName string `xorm:"unique(s)"` // <user name>/<repo name>
Mode int `xorm:"unique(s)"`
Created time.Time `xorm:"created"`
UserName string `xorm:"UNIQUE(s)"`
RepoName string `xorm:"UNIQUE(s)"` // <user name>/<repo name>
Mode AccessType `xorm:"UNIQUE(s)"`
Created time.Time `xorm:"CREATED"`
}
// AddAccess adds new access record.
func AddAccess(access *Access) error {
access.UserName = strings.ToLower(access.UserName)
access.RepoName = strings.ToLower(access.RepoName)
_, err := orm.Insert(access)
_, err := x.Insert(access)
return err
}
@@ -38,13 +39,13 @@ func AddAccess(access *Access) error {
func UpdateAccess(access *Access) error {
access.UserName = strings.ToLower(access.UserName)
access.RepoName = strings.ToLower(access.RepoName)
_, err := orm.Id(access.Id).Update(access)
_, err := x.Id(access.Id).Update(access)
return err
}
// DeleteAccess deletes access record.
func DeleteAccess(access *Access) error {
_, err := orm.Delete(access)
_, err := x.Delete(access)
return err
}
@@ -59,7 +60,7 @@ func UpdateAccessWithSession(sess *xorm.Session, access *Access) error {
// HasAccess returns true if someone can read or write to given repository.
// The repoName should be in format <username>/<reponame>.
func HasAccess(uname, repoName string, mode int) (bool, error) {
func HasAccess(uname, repoName string, mode AccessType) (bool, error) {
if len(repoName) == 0 {
return false, nil
}
@@ -67,7 +68,7 @@ func HasAccess(uname, repoName string, mode int) (bool, error) {
UserName: strings.ToLower(uname),
RepoName: strings.ToLower(repoName),
}
has, err := orm.Get(access)
has, err := x.Get(access)
if err != nil {
return false, err
} else if !has {

View File

@@ -8,38 +8,53 @@ import (
"encoding/json"
"errors"
"fmt"
"path"
"regexp"
"strings"
"time"
"github.com/gogits/git"
qlog "github.com/qiniu/log"
"unicode"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/hooks"
"github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
)
// Operation types of user action.
type ActionType int
const (
OP_CREATE_REPO = iota + 1
OP_DELETE_REPO
OP_STAR_REPO
OP_FOLLOW_REPO
OP_COMMIT_REPO
OP_CREATE_ISSUE
OP_PULL_REQUEST
OP_TRANSFER_REPO
OP_PUSH_TAG
OP_COMMENT_ISSUE
CREATE_REPO ActionType = iota + 1 // 1
DELETE_REPO // 2
STAR_REPO // 3
FOLLOW_REPO // 4
COMMIT_REPO // 5
CREATE_ISSUE // 6
PULL_REQUEST // 7
TRANSFER_REPO // 8
PUSH_TAG // 9
COMMENT_ISSUE // 10
)
var (
ErrNotImplemented = errors.New("Not implemented yet")
)
var (
// Same as Github. See https://help.github.com/articles/closing-issues-via-commit-messages
IssueKeywords = []string{"close", "closes", "closed", "fix", "fixes", "fixed", "resolve", "resolves", "resolved"}
IssueKeywordsPat *regexp.Regexp
)
func init() {
IssueKeywordsPat = regexp.MustCompile(fmt.Sprintf(`(?i)(?:%s) \S+`, strings.Join(IssueKeywords, "|")))
}
// Action represents user operation type and other information to repository.,
// it implemented interface base.Actioner so that can be used in template render.
type Action struct {
Id int64
UserId int64 // Receiver user id.
OpType int
OpType ActionType
ActUserId int64 // Action user id.
ActUserName string // Action user name.
ActEmail string
@@ -53,7 +68,7 @@ type Action struct {
}
func (a Action) GetOpType() int {
return a.OpType
return int(a.OpType)
}
func (a Action) GetActUserName() string {
@@ -72,6 +87,10 @@ func (a Action) GetRepoName() string {
return a.RepoName
}
func (a Action) GetRepoLink() string {
return path.Join(a.RepoUserName, a.RepoName)
}
func (a Action) GetBranch() string {
return a.RefName
}
@@ -80,15 +99,85 @@ func (a Action) GetContent() string {
return a.Content
}
func (a Action) GetCreate() time.Time {
return a.Created
}
func (a Action) GetIssueInfos() []string {
return strings.SplitN(a.Content, "|", 2)
}
func updateIssuesCommit(userId, repoId int64, repoUserName, repoName string, commits []*base.PushCommit) error {
for _, c := range commits {
refs := IssueKeywordsPat.FindAllString(c.Message, -1)
for _, ref := range refs {
ref := ref[strings.IndexByte(ref, byte(' '))+1:]
ref = strings.TrimRightFunc(ref, func(c rune) bool {
return !unicode.IsDigit(c)
})
if len(ref) == 0 {
continue
}
// Add repo name if missing
if ref[0] == '#' {
ref = fmt.Sprintf("%s/%s%s", repoUserName, repoName, ref)
} else if strings.Contains(ref, "/") == false {
// We don't support User#ID syntax yet
// return ErrNotImplemented
continue
}
issue, err := GetIssueByRef(ref)
if err != nil {
return err
}
url := fmt.Sprintf("%s/%s/%s/commit/%s", setting.AppSubUrl, repoUserName, repoName, c.Sha1)
message := fmt.Sprintf(`<a href="%s">%s</a>`, url, c.Message)
if _, err = CreateComment(userId, issue.RepoId, issue.Id, 0, 0, COMMIT, message, nil); err != nil {
return err
}
if issue.RepoId == repoId {
if issue.IsClosed {
continue
}
issue.IsClosed = true
if err = UpdateIssue(issue); err != nil {
return err
}
if err = ChangeMilestoneIssueStats(issue); err != nil {
return err
}
// If commit happened in the referenced repository, it means the issue can be closed.
if _, err = CreateComment(userId, repoId, issue.Id, 0, 0, CLOSE, "", nil); err != nil {
return err
}
}
}
}
return nil
}
// CommitRepoAction adds new action for committing repository.
func CommitRepoAction(userId, repoUserId int64, userName, actEmail string,
repoId int64, repoUserName, repoName string, refFullName string, commit *base.PushCommits) error {
// log.Trace("action.CommitRepoAction(start): %d/%s", userId, repoName)
repoId int64, repoUserName, repoName string, refFullName string, commit *base.PushCommits, oldCommitId string, newCommitId string) error {
opType := OP_COMMIT_REPO
opType := COMMIT_REPO
// Check it's tag push or branch.
if strings.HasPrefix(refFullName, "refs/tags/") {
opType = OP_PUSH_TAG
opType = PUSH_TAG
commit = &base.PushCommits{}
}
@@ -109,6 +198,12 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string,
return errors.New("action.CommitRepoAction(UpdateRepository): " + err.Error())
}
err = updateIssuesCommit(userId, repoId, repoUserName, repoName, commit.Commits)
if err != nil {
log.Debug("action.CommitRepoAction(updateIssuesCommit): ", err)
}
if err = NotifyWatchers(&Action{ActUserId: userId, ActUserName: userName, ActEmail: actEmail,
OpType: opType, Content: string(bs), RepoId: repoId, RepoUserName: repoUserName,
RepoName: repoName, RefName: refName,
@@ -116,7 +211,7 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string,
return errors.New("action.CommitRepoAction(NotifyWatchers): " + err.Error())
}
qlog.Info("action.CommitRepoAction(end): %d/%s", repoUserId, repoName)
//qlog.Info("action.CommitRepoAction(end): %d/%s", repoUserId, repoName)
// New push event hook.
if err := repo.GetOwner(); err != nil {
@@ -125,44 +220,80 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string,
ws, err := GetActiveWebhooksByRepoId(repoId)
if err != nil {
return errors.New("action.CommitRepoAction(GetWebhooksByRepoId): " + err.Error())
} else if len(ws) == 0 {
return errors.New("action.CommitRepoAction(GetActiveWebhooksByRepoId): " + err.Error())
}
// check if repo belongs to org and append additional webhooks
if repo.Owner.IsOrganization() {
// get hooks for org
orgws, err := GetActiveWebhooksByOrgId(repo.OwnerId)
if err != nil {
return errors.New("action.CommitRepoAction(GetActiveWebhooksByOrgId): " + err.Error())
}
ws = append(ws, orgws...)
}
if len(ws) == 0 {
return nil
}
repoLink := fmt.Sprintf("%s%s/%s", setting.AppUrl, repoUserName, repoName)
commits := make([]*hooks.PayloadCommit, len(commit.Commits))
compareUrl := ""
// if not the first commit, set the compareUrl
if !strings.HasPrefix(oldCommitId, "0000000") {
compareUrl = fmt.Sprintf("%s/compare/%s...%s", repoLink, oldCommitId, newCommitId)
}
pusher_email, pusher_name := "", ""
pusher, err := GetUserByName(userName)
if err == nil {
pusher_email = pusher.Email
pusher_name = pusher.GetFullNameFallback()
}
commits := make([]*PayloadCommit, len(commit.Commits))
for i, cmt := range commit.Commits {
commits[i] = &hooks.PayloadCommit{
author_username := ""
author, err := GetUserByEmail(cmt.AuthorEmail)
if err == nil {
author_username = author.Name
}
commits[i] = &PayloadCommit{
Id: cmt.Sha1,
Message: cmt.Message,
Url: fmt.Sprintf("%s/commit/%s", repoLink, cmt.Sha1),
Author: &hooks.PayloadAuthor{
Name: cmt.AuthorName,
Email: cmt.AuthorEmail,
Author: &PayloadAuthor{
Name: cmt.AuthorName,
Email: cmt.AuthorEmail,
UserName: author_username,
},
}
}
p := &hooks.Payload{
p := &Payload{
Ref: refFullName,
Commits: commits,
Repo: &hooks.PayloadRepo{
Repo: &PayloadRepo{
Id: repo.Id,
Name: repo.LowerName,
Url: repoLink,
Description: repo.Description,
Website: repo.Website,
Watchers: repo.NumWatches,
Owner: &hooks.PayloadAuthor{
Name: repoUserName,
Email: actEmail,
Owner: &PayloadAuthor{
Name: repo.Owner.GetFullNameFallback(),
Email: repo.Owner.Email,
UserName: repo.Owner.Name,
},
Private: repo.IsPrivate,
},
Pusher: &hooks.PayloadAuthor{
Name: repo.Owner.LowerName,
Email: repo.Owner.Email,
Pusher: &PayloadAuthor{
Name: pusher_name,
Email: pusher_email,
UserName: userName,
},
Before: oldCommitId,
After: newCommitId,
CompareUrl: compareUrl,
}
for _, w := range ws {
@@ -171,45 +302,87 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string,
continue
}
p.Secret = w.Secret
hooks.AddHookTask(&hooks.HookTask{hooks.HTT_WEBHOOK, w.Url, p, w.ContentType, w.IsSsl})
switch w.HookTaskType {
case SLACK:
{
s, err := GetSlackPayload(p, w.Meta)
if err != nil {
return errors.New("action.GetSlackPayload: " + err.Error())
}
CreateHookTask(&HookTask{
Type: w.HookTaskType,
Url: w.Url,
BasePayload: s,
ContentType: w.ContentType,
IsSsl: w.IsSsl,
})
}
default:
{
p.Secret = w.Secret
CreateHookTask(&HookTask{
Type: w.HookTaskType,
Url: w.Url,
BasePayload: p,
ContentType: w.ContentType,
IsSsl: w.IsSsl,
})
}
}
}
go DeliverHooks()
return nil
}
// NewRepoAction adds new action for creating repository.
func NewRepoAction(user *User, repo *Repository) (err error) {
if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email,
OpType: OP_CREATE_REPO, RepoId: repo.Id, RepoName: repo.Name, IsPrivate: repo.IsPrivate}); err != nil {
log.Error("action.NewRepoAction(notify watchers): %d/%s", user.Id, repo.Name)
func NewRepoAction(u *User, repo *Repository) (err error) {
if err = NotifyWatchers(&Action{ActUserId: u.Id, ActUserName: u.Name, ActEmail: u.Email,
OpType: CREATE_REPO, RepoId: repo.Id, RepoUserName: repo.Owner.Name, RepoName: repo.Name,
IsPrivate: repo.IsPrivate}); err != nil {
log.Error(4, "NotifyWatchers: %d/%s", u.Id, repo.Name)
return err
}
log.Trace("action.NewRepoAction: %s/%s", user.LowerName, repo.LowerName)
log.Trace("action.NewRepoAction: %s/%s", u.Name, repo.Name)
return err
}
// TransferRepoAction adds new action for transfering repository.
func TransferRepoAction(user, newUser *User, repo *Repository) (err error) {
if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email,
OpType: OP_TRANSFER_REPO, RepoId: repo.Id, RepoName: repo.Name, Content: newUser.Name,
IsPrivate: repo.IsPrivate}); err != nil {
log.Error("action.TransferRepoAction(notify watchers): %d/%s", user.Id, repo.Name)
func TransferRepoAction(u, newUser *User, repo *Repository) (err error) {
action := &Action{
ActUserId: u.Id,
ActUserName: u.Name,
ActEmail: u.Email,
OpType: TRANSFER_REPO,
RepoId: repo.Id,
RepoUserName: newUser.Name,
RepoName: repo.Name,
IsPrivate: repo.IsPrivate,
Content: path.Join(repo.Owner.LowerName, repo.LowerName),
}
if err = NotifyWatchers(action); err != nil {
log.Error(4, "NotifyWatchers: %d/%s", u.Id, repo.Name)
return err
}
log.Trace("action.TransferRepoAction: %s/%s", user.LowerName, repo.LowerName)
// Remove watch for organization.
if repo.Owner.IsOrganization() {
if err = WatchRepo(repo.Owner.Id, repo.Id, false); err != nil {
log.Error(4, "WatchRepo", err)
}
}
log.Trace("action.TransferRepoAction: %s/%s", u.Name, repo.Name)
return err
}
// GetFeeds returns action list of given user in given context.
func GetFeeds(userid, offset int64, isProfile bool) ([]*Action, error) {
func GetFeeds(uid, offset int64, isProfile bool) ([]*Action, error) {
actions := make([]*Action, 0, 20)
sess := orm.Limit(20, int(offset)).Desc("id").Where("user_id=?", userid)
sess := x.Limit(20, int(offset)).Desc("id").Where("user_id=?", uid)
if isProfile {
sess.Where("is_private=?", false).And("act_user_id=?", userid)
} else {
sess.And("act_user_id!=?", userid)
sess.And("is_private=?", false).And("act_user_id=?", uid)
}
err := sess.Find(&actions)
return actions, err

64
models/admin.go Normal file
View File

@@ -0,0 +1,64 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
import (
"time"
"github.com/Unknwon/com"
)
type NoticeType int
const (
NOTICE_REPOSITORY NoticeType = iota + 1
)
// Notice represents a system notice for admin.
type Notice struct {
Id int64
Type NoticeType
Description string `xorm:"TEXT"`
Created time.Time `xorm:"CREATED"`
}
// TrStr returns a translation format string.
func (n *Notice) TrStr() string {
return "admin.notices.type_" + com.ToStr(n.Type)
}
// CreateNotice creates new system notice.
func CreateNotice(tp NoticeType, desc string) error {
n := &Notice{
Type: tp,
Description: desc,
}
_, err := x.Insert(n)
return err
}
// CreateRepositoryNotice creates new system notice with type NOTICE_REPOSITORY.
func CreateRepositoryNotice(desc string) error {
return CreateNotice(NOTICE_REPOSITORY, desc)
}
// CountNotices returns number of notices.
func CountNotices() int64 {
count, _ := x.Count(new(Notice))
return count
}
// GetNotices returns given number of notices with offset.
func GetNotices(num, offset int) ([]*Notice, error) {
notices := make([]*Notice, 0, num)
err := x.Limit(num, offset).Desc("id").Find(&notices)
return notices, err
}
// DeleteNotice deletes a system notice by given ID.
func DeleteNotice(id int64) error {
_, err := x.Id(id).Delete(new(Notice))
return err
}

View File

@@ -1,6 +0,0 @@
package models
func Fix() error {
_, err := orm.Exec("alter table repository drop column num_releases")
return err
}

View File

@@ -6,15 +6,18 @@ package models
import (
"bufio"
"fmt"
"io"
"os"
"os/exec"
"strings"
"time"
"github.com/gogits/git"
"github.com/Unknwon/com"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/process"
)
// Diff line types.
@@ -67,7 +70,7 @@ func (diff *Diff) NumFiles() int {
const DIFF_HEAD = "diff --git "
func ParsePatch(cmd *exec.Cmd, reader io.Reader) (*Diff, error) {
func ParsePatch(pid int64, maxlines int, cmd *exec.Cmd, reader io.Reader) (*Diff, error) {
scanner := bufio.NewScanner(reader)
var (
curFile *DiffFile
@@ -76,6 +79,7 @@ func ParsePatch(cmd *exec.Cmd, reader io.Reader) (*Diff, error) {
}
leftLine, rightLine int
isTooLong bool
)
diff := &Diff{Files: make([]*DiffFile, 0)}
@@ -87,18 +91,19 @@ func ParsePatch(cmd *exec.Cmd, reader io.Reader) (*Diff, error) {
continue
}
i = i + 1
// Diff data too large.
if i == 5000 {
log.Warn("Diff data too large")
return &Diff{}, nil
}
if line == "" {
continue
}
i = i + 1
// Diff data too large, we only show the first about maxlines lines
if i == maxlines {
isTooLong = true
log.Warn("Diff data too large")
//return &Diff{}, nil
}
switch {
case line[0] == ' ':
diffLine := &DiffLine{Type: DIFF_LINE_PLAIN, Content: line, LeftIdx: leftLine, RightIdx: rightLine}
@@ -107,6 +112,10 @@ func ParsePatch(cmd *exec.Cmd, reader io.Reader) (*Diff, error) {
curSection.Lines = append(curSection.Lines, diffLine)
continue
case line[0] == '@':
if isTooLong {
return diff, nil
}
curSection = &DiffSection{}
curFile.Sections = append(curFile.Sections, curSection)
ss := strings.Split(line, "@@")
@@ -115,8 +124,8 @@ func ParsePatch(cmd *exec.Cmd, reader io.Reader) (*Diff, error) {
// Parse line number.
ranges := strings.Split(ss[len(ss)-2][1:], " ")
leftLine, _ = base.StrTo(strings.Split(ranges[0], ",")[0][1:]).Int()
rightLine, _ = base.StrTo(strings.Split(ranges[1], ",")[0]).Int()
leftLine, _ = com.StrTo(strings.Split(ranges[0], ",")[0][1:]).Int()
rightLine, _ = com.StrTo(strings.Split(ranges[1], ",")[0]).Int()
continue
case line[0] == '+':
curFile.Addition++
@@ -140,6 +149,10 @@ func ParsePatch(cmd *exec.Cmd, reader io.Reader) (*Diff, error) {
// Get new file.
if strings.HasPrefix(line, DIFF_HEAD) {
if isTooLong {
return diff, nil
}
fs := strings.Split(line[len(DIFF_HEAD):], " ")
a := fs[0]
@@ -168,44 +181,66 @@ func ParsePatch(cmd *exec.Cmd, reader io.Reader) (*Diff, error) {
}
}
// In case process became zombie.
if !cmd.ProcessState.Exited() {
log.Debug("git_diff.ParsePatch: process doesn't exit and now will be killed")
if err := cmd.Process.Kill(); err != nil {
log.Error("git_diff.ParsePatch: fail to kill zombie process: %v", err)
}
}
return diff, nil
}
func GetDiff(repoPath, commitid string) (*Diff, error) {
func GetDiffRange(repoPath, beforeCommitId string, afterCommitId string, maxlines int) (*Diff, error) {
repo, err := git.OpenRepository(repoPath)
if err != nil {
return nil, err
}
commit, err := repo.GetCommit(commitid)
commit, err := repo.GetCommit(afterCommitId)
if err != nil {
return nil, err
}
rd, wr := io.Pipe()
var cmd *exec.Cmd
// First commit of repository.
if commit.ParentCount() == 0 {
cmd = exec.Command("git", "show", commitid)
// if "after" commit given
if beforeCommitId == "" {
// First commit of repository.
if commit.ParentCount() == 0 {
cmd = exec.Command("git", "show", afterCommitId)
} else {
c, _ := commit.Parent(0)
cmd = exec.Command("git", "diff", c.Id.String(), afterCommitId)
}
} else {
c, _ := commit.Parent(0)
cmd = exec.Command("git", "diff", c.Id.String(), commitid)
cmd = exec.Command("git", "diff", beforeCommitId, afterCommitId)
}
cmd.Dir = repoPath
cmd.Stdout = wr
cmd.Stdin = os.Stdin
cmd.Stderr = os.Stderr
done := make(chan error)
go func() {
cmd.Run()
cmd.Start()
done <- cmd.Wait()
wr.Close()
}()
defer rd.Close()
return ParsePatch(cmd, rd)
desc := fmt.Sprintf("GetDiffRange(%s)", repoPath)
pid := process.Add(desc, cmd)
go func() {
// In case process became zombie.
select {
case <-time.After(5 * time.Minute):
if errKill := process.Kill(pid); errKill != nil {
log.Error(4, "git_diff.ParsePatch(Kill): %v", err)
}
<-done
// return "", ErrExecTimeout.Error(), ErrExecTimeout
case err = <-done:
process.Remove(pid)
}
}()
return ParsePatch(pid, maxlines, cmd, rd)
}
func GetDiffCommit(repoPath, commitId string, maxlines int) (*Diff, error) {
return GetDiffRange(repoPath, "", commitId, maxlines)
}

View File

@@ -7,18 +7,26 @@ package models
import (
"bytes"
"errors"
"html/template"
"os"
"strconv"
"strings"
"time"
"github.com/Unknwon/com"
"github.com/go-xorm/xorm"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/log"
)
var (
ErrIssueNotExist = errors.New("Issue does not exist")
ErrLabelNotExist = errors.New("Label does not exist")
ErrMilestoneNotExist = errors.New("Milestone does not exist")
ErrIssueNotExist = errors.New("Issue does not exist")
ErrLabelNotExist = errors.New("Label does not exist")
ErrMilestoneNotExist = errors.New("Milestone does not exist")
ErrWrongIssueCounter = errors.New("Invalid number of issues for this milestone")
ErrAttachmentNotExist = errors.New("Attachment does not exist")
ErrAttachmentNotLinked = errors.New("Attachment does not belong to this issue")
ErrMissingIssueNumber = errors.New("No issue number specified")
)
// Issue represents an issue or pull request of repository.
@@ -64,7 +72,7 @@ func (i *Issue) GetLabels() error {
strIds := strings.Split(strings.TrimSuffix(i.LabelIds[1:], "|"), "|$")
i.Labels = make([]*Label, 0, len(strIds))
for _, strId := range strIds {
id, _ := base.StrTo(strId).Int64()
id, _ := com.StrTo(strId).Int64()
if id > 0 {
l, err := GetLabelById(id)
if err != nil {
@@ -90,9 +98,22 @@ func (i *Issue) GetAssignee() (err error) {
return err
}
func (i *Issue) Attachments() []*Attachment {
a, _ := GetAttachmentsForIssue(i.Id)
return a
}
func (i *Issue) AfterDelete() {
_, err := DeleteAttachmentsByIssue(i.Id, true)
if err != nil {
log.Info("Could not delete files for issue #%d: %s", i.Id, err)
}
}
// CreateIssue creates new issue for repository.
func NewIssue(issue *Issue) (err error) {
sess := orm.NewSession()
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
return err
@@ -108,13 +129,46 @@ func NewIssue(issue *Issue) (err error) {
sess.Rollback()
return err
}
return sess.Commit()
if err = sess.Commit(); err != nil {
return err
}
if issue.MilestoneId > 0 {
// FIXES(280): Update milestone counter.
return ChangeMilestoneAssign(0, issue.MilestoneId, issue)
}
return
}
// GetIssueByRef returns an Issue specified by a GFM reference.
// See https://help.github.com/articles/writing-on-github#references for more information on the syntax.
func GetIssueByRef(ref string) (issue *Issue, err error) {
var issueNumber int64
var repo *Repository
n := strings.IndexByte(ref, byte('#'))
if n == -1 {
return nil, ErrMissingIssueNumber
}
if issueNumber, err = strconv.ParseInt(ref[n+1:], 10, 64); err != nil {
return
}
if repo, err = GetRepositoryByRef(ref[:n]); err != nil {
return
}
return GetIssueByIndex(repo.Id, issueNumber)
}
// GetIssueByIndex returns issue by given index in repository.
func GetIssueByIndex(rid, index int64) (*Issue, error) {
issue := &Issue{RepoId: rid, Index: index}
has, err := orm.Get(issue)
has, err := x.Get(issue)
if err != nil {
return nil, err
} else if !has {
@@ -126,7 +180,7 @@ func GetIssueByIndex(rid, index int64) (*Issue, error) {
// GetIssueById returns an issue by ID.
func GetIssueById(id int64) (*Issue, error) {
issue := &Issue{Id: id}
has, err := orm.Get(issue)
has, err := x.Get(issue)
if err != nil {
return nil, err
} else if !has {
@@ -137,7 +191,7 @@ func GetIssueById(id int64) (*Issue, error) {
// GetIssues returns a list of issues by given conditions.
func GetIssues(uid, rid, pid, mid int64, page int, isClosed bool, labelIds, sortType string) ([]Issue, error) {
sess := orm.Limit(20, (page-1)*20)
sess := x.Limit(20, (page-1)*20)
if rid > 0 {
sess.Where("repo_id=?", rid).And("is_closed=?", isClosed)
@@ -193,13 +247,13 @@ const (
// GetIssuesByLabel returns a list of issues by given label and repository.
func GetIssuesByLabel(repoId int64, label string) ([]*Issue, error) {
issues := make([]*Issue, 0, 10)
err := orm.Where("repo_id=?", repoId).And("label_ids like '%$" + label + "|%'").Find(&issues)
err := x.Where("repo_id=?", repoId).And("label_ids like '%$" + label + "|%'").Find(&issues)
return issues, err
}
// GetIssueCountByPoster returns number of issues of repository by poster.
func GetIssueCountByPoster(uid, rid int64, isClosed bool) int64 {
count, _ := orm.Where("repo_id=?", rid).And("poster_id=?", uid).And("is_closed=?", isClosed).Count(new(Issue))
count, _ := x.Where("repo_id=?", rid).And("poster_id=?", uid).And("is_closed=?", isClosed).Count(new(Issue))
return count
}
@@ -213,9 +267,9 @@ func GetIssueCountByPoster(uid, rid int64, isClosed bool) int64 {
// IssueUser represents an issue-user relation.
type IssueUser struct {
Id int64
Uid int64 // User ID.
Uid int64 `xorm:"INDEX"` // User ID.
IssueId int64
RepoId int64
RepoId int64 `xorm:"INDEX"`
MilestoneId int64
IsRead bool
IsAssigned bool
@@ -241,7 +295,7 @@ func NewIssueUserPairs(rid, iid, oid, pid, aid int64, repoName string) (err erro
isNeedAddPoster = false
}
iu.IsAssigned = iu.Uid == aid
if _, err = orm.Insert(iu); err != nil {
if _, err = x.Insert(iu); err != nil {
return err
}
}
@@ -249,7 +303,7 @@ func NewIssueUserPairs(rid, iid, oid, pid, aid int64, repoName string) (err erro
iu.Uid = pid
iu.IsPoster = true
iu.IsAssigned = iu.Uid == aid
if _, err = orm.Insert(iu); err != nil {
if _, err = x.Insert(iu); err != nil {
return err
}
}
@@ -270,22 +324,25 @@ func PairsContains(ius []*IssueUser, issueId int64) int {
// GetIssueUserPairs returns issue-user pairs by given repository and user.
func GetIssueUserPairs(rid, uid int64, isClosed bool) ([]*IssueUser, error) {
ius := make([]*IssueUser, 0, 10)
err := orm.Where("is_closed=?", isClosed).Find(&ius, &IssueUser{RepoId: rid, Uid: uid})
err := x.Where("is_closed=?", isClosed).Find(&ius, &IssueUser{RepoId: rid, Uid: uid})
return ius, err
}
// GetIssueUserPairsByRepoIds returns issue-user pairs by given repository IDs.
func GetIssueUserPairsByRepoIds(rids []int64, isClosed bool, page int) ([]*IssueUser, error) {
if len(rids) == 0 {
return []*IssueUser{}, nil
}
buf := bytes.NewBufferString("")
for _, rid := range rids {
buf.WriteString("repo_id=")
buf.WriteString(base.ToStr(rid))
buf.WriteString(com.ToStr(rid))
buf.WriteString(" OR ")
}
cond := strings.TrimSuffix(buf.String(), " OR ")
ius := make([]*IssueUser, 0, 10)
sess := orm.Limit(20, (page-1)*20).Where("is_closed=?", isClosed)
sess := x.Limit(20, (page-1)*20).Where("is_closed=?", isClosed)
if len(cond) > 0 {
sess.And(cond)
}
@@ -296,7 +353,7 @@ func GetIssueUserPairsByRepoIds(rids []int64, isClosed bool, page int) ([]*Issue
// GetIssueUserPairsByMode returns issue-user pairs by given repository and user.
func GetIssueUserPairsByMode(uid, rid int64, isClosed bool, page, filterMode int) ([]*IssueUser, error) {
ius := make([]*IssueUser, 0, 10)
sess := orm.Limit(20, (page-1)*20).Where("uid=?", uid).And("is_closed=?", isClosed)
sess := x.Limit(20, (page-1)*20).Where("uid=?", uid).And("is_closed=?", isClosed)
if rid > 0 {
sess.And("repo_id=?", rid)
}
@@ -335,7 +392,7 @@ func GetIssueStats(rid, uid int64, isShowClosed bool, filterMode int) *IssueStat
issue := new(Issue)
tmpSess := &xorm.Session{}
sess := orm.Where("repo_id=?", rid)
sess := x.Where("repo_id=?", rid)
*tmpSess = *sess
stats.OpenCount, _ = tmpSess.And("is_closed=?", false).Count(issue)
*tmpSess = *sess
@@ -347,7 +404,7 @@ func GetIssueStats(rid, uid int64, isShowClosed bool, filterMode int) *IssueStat
}
if filterMode != FM_MENTION {
sess = orm.Where("repo_id=?", rid)
sess = x.Where("repo_id=?", rid)
switch filterMode {
case FM_ASSIGN:
sess.And("assignee_id=?", uid)
@@ -361,16 +418,16 @@ func GetIssueStats(rid, uid int64, isShowClosed bool, filterMode int) *IssueStat
*tmpSess = *sess
stats.ClosedCount, _ = tmpSess.And("is_closed=?", true).Count(issue)
} else {
sess := orm.Where("repo_id=?", rid).And("uid=?", uid).And("is_mentioned=?", true)
sess := x.Where("repo_id=?", rid).And("uid=?", uid).And("is_mentioned=?", true)
*tmpSess = *sess
stats.OpenCount, _ = tmpSess.And("is_closed=?", false).Count(new(IssueUser))
*tmpSess = *sess
stats.ClosedCount, _ = tmpSess.And("is_closed=?", true).Count(new(IssueUser))
}
nofilter:
stats.AssignCount, _ = orm.Where("repo_id=?", rid).And("is_closed=?", isShowClosed).And("assignee_id=?", uid).Count(issue)
stats.CreateCount, _ = orm.Where("repo_id=?", rid).And("is_closed=?", isShowClosed).And("poster_id=?", uid).Count(issue)
stats.MentionCount, _ = orm.Where("repo_id=?", rid).And("uid=?", uid).And("is_closed=?", isShowClosed).And("is_mentioned=?", true).Count(new(IssueUser))
stats.AssignCount, _ = x.Where("repo_id=?", rid).And("is_closed=?", isShowClosed).And("assignee_id=?", uid).Count(issue)
stats.CreateCount, _ = x.Where("repo_id=?", rid).And("is_closed=?", isShowClosed).And("poster_id=?", uid).Count(issue)
stats.MentionCount, _ = x.Where("repo_id=?", rid).And("uid=?", uid).And("is_closed=?", isShowClosed).And("is_mentioned=?", true).Count(new(IssueUser))
return stats
}
@@ -378,28 +435,33 @@ nofilter:
func GetUserIssueStats(uid int64, filterMode int) *IssueStats {
stats := &IssueStats{}
issue := new(Issue)
stats.AssignCount, _ = orm.Where("assignee_id=?", uid).And("is_closed=?", false).Count(issue)
stats.CreateCount, _ = orm.Where("poster_id=?", uid).And("is_closed=?", false).Count(issue)
stats.AssignCount, _ = x.Where("assignee_id=?", uid).And("is_closed=?", false).Count(issue)
stats.CreateCount, _ = x.Where("poster_id=?", uid).And("is_closed=?", false).Count(issue)
return stats
}
// UpdateIssue updates information of issue.
func UpdateIssue(issue *Issue) error {
_, err := orm.Id(issue.Id).AllCols().Update(issue)
_, err := x.Id(issue.Id).AllCols().Update(issue)
if err != nil {
return err
}
return err
}
// UpdateIssueUserByStatus updates issue-user pairs by issue status.
func UpdateIssueUserPairsByStatus(iid int64, isClosed bool) error {
rawSql := "UPDATE `issue_user` SET is_closed = ? WHERE issue_id = ?"
_, err := orm.Exec(rawSql, isClosed, iid)
_, err := x.Exec(rawSql, isClosed, iid)
return err
}
// UpdateIssueUserPairByAssignee updates issue-user pair for assigning.
func UpdateIssueUserPairByAssignee(aid, iid int64) error {
rawSql := "UPDATE `issue_user` SET is_assigned = ? WHERE issue_id = ?"
if _, err := orm.Exec(rawSql, false, iid); err != nil {
if _, err := x.Exec(rawSql, false, iid); err != nil {
return err
}
@@ -408,14 +470,14 @@ func UpdateIssueUserPairByAssignee(aid, iid int64) error {
return nil
}
rawSql = "UPDATE `issue_user` SET is_assigned = true WHERE uid = ? AND issue_id = ?"
_, err := orm.Exec(rawSql, aid, iid)
_, err := x.Exec(rawSql, aid, iid)
return err
}
// UpdateIssueUserPairByRead updates issue-user pair for reading.
func UpdateIssueUserPairByRead(uid, iid int64) error {
rawSql := "UPDATE `issue_user` SET is_read = ? WHERE uid = ? AND issue_id = ?"
_, err := orm.Exec(rawSql, true, uid, iid)
_, err := x.Exec(rawSql, true, uid, iid)
return err
}
@@ -423,16 +485,16 @@ func UpdateIssueUserPairByRead(uid, iid int64) error {
func UpdateIssueUserPairsByMentions(uids []int64, iid int64) error {
for _, uid := range uids {
iu := &IssueUser{Uid: uid, IssueId: iid}
has, err := orm.Get(iu)
has, err := x.Get(iu)
if err != nil {
return err
}
iu.IsMentioned = true
if has {
_, err = orm.Id(iu.Id).AllCols().Update(iu)
_, err = x.Id(iu.Id).AllCols().Update(iu)
} else {
_, err = orm.Insert(iu)
_, err = x.Insert(iu)
}
if err != nil {
return err
@@ -467,7 +529,7 @@ func (m *Label) CalOpenIssues() {
// NewLabel creates new label of repository.
func NewLabel(l *Label) error {
_, err := orm.Insert(l)
_, err := x.Insert(l)
return err
}
@@ -478,7 +540,7 @@ func GetLabelById(id int64) (*Label, error) {
}
l := &Label{Id: id}
has, err := orm.Get(l)
has, err := x.Get(l)
if err != nil {
return nil, err
} else if !has {
@@ -490,19 +552,19 @@ func GetLabelById(id int64) (*Label, error) {
// GetLabels returns a list of labels of given repository ID.
func GetLabels(repoId int64) ([]*Label, error) {
labels := make([]*Label, 0, 10)
err := orm.Where("repo_id=?", repoId).Find(&labels)
err := x.Where("repo_id=?", repoId).Find(&labels)
return labels, err
}
// UpdateLabel updates label information.
func UpdateLabel(l *Label) error {
_, err := orm.Id(l.Id).Update(l)
_, err := x.Id(l.Id).Update(l)
return err
}
// DeleteLabel delete a label of given repository.
func DeleteLabel(repoId int64, strId string) error {
id, _ := base.StrTo(strId).Int64()
id, _ := com.StrTo(strId).Int64()
l, err := GetLabelById(id)
if err != nil {
if err == ErrLabelNotExist {
@@ -516,7 +578,7 @@ func DeleteLabel(repoId int64, strId string) error {
return err
}
sess := orm.NewSession()
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
return err
@@ -550,7 +612,7 @@ type Milestone struct {
RepoId int64 `xorm:"INDEX"`
Index int64
Name string
Content string
Content string `xorm:"TEXT"`
RenderedContent string `xorm:"-"`
IsClosed bool
NumIssues int
@@ -569,7 +631,7 @@ func (m *Milestone) CalOpenIssues() {
// NewMilestone creates new milestone of repository.
func NewMilestone(m *Milestone) (err error) {
sess := orm.NewSession()
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
return err
@@ -591,7 +653,7 @@ func NewMilestone(m *Milestone) (err error) {
// GetMilestoneById returns the milestone by given ID.
func GetMilestoneById(id int64) (*Milestone, error) {
m := &Milestone{Id: id}
has, err := orm.Get(m)
has, err := x.Get(m)
if err != nil {
return nil, err
} else if !has {
@@ -603,7 +665,7 @@ func GetMilestoneById(id int64) (*Milestone, error) {
// GetMilestoneByIndex returns the milestone of given repository and index.
func GetMilestoneByIndex(repoId, idx int64) (*Milestone, error) {
m := &Milestone{RepoId: repoId, Index: idx}
has, err := orm.Get(m)
has, err := x.Get(m)
if err != nil {
return nil, err
} else if !has {
@@ -615,13 +677,13 @@ func GetMilestoneByIndex(repoId, idx int64) (*Milestone, error) {
// GetMilestones returns a list of milestones of given repository and status.
func GetMilestones(repoId int64, isClosed bool) ([]*Milestone, error) {
miles := make([]*Milestone, 0, 10)
err := orm.Where("repo_id=?", repoId).And("is_closed=?", isClosed).Find(&miles)
err := x.Where("repo_id=?", repoId).And("is_closed=?", isClosed).Find(&miles)
return miles, err
}
// UpdateMilestone updates information of given milestone.
func UpdateMilestone(m *Milestone) error {
_, err := orm.Id(m.Id).Update(m)
_, err := x.Id(m.Id).Update(m)
return err
}
@@ -632,7 +694,7 @@ func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) {
return err
}
sess := orm.NewSession()
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
return err
@@ -656,9 +718,35 @@ func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) {
return sess.Commit()
}
// ChangeMilestoneIssueStats updates the open/closed issues counter and progress for the
// milestone associated witht the given issue.
func ChangeMilestoneIssueStats(issue *Issue) error {
if issue.MilestoneId == 0 {
return nil
}
m, err := GetMilestoneById(issue.MilestoneId)
if err != nil {
return err
}
if issue.IsClosed {
m.NumOpenIssues--
m.NumClosedIssues++
} else {
m.NumOpenIssues++
m.NumClosedIssues--
}
m.Completeness = m.NumClosedIssues * 100 / m.NumIssues
return UpdateMilestone(m)
}
// ChangeMilestoneAssign changes assignment of milestone for issue.
func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) {
sess := orm.NewSession()
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
return err
@@ -679,7 +767,8 @@ func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) {
} else {
m.Completeness = 0
}
if _, err = sess.Id(m.Id).Update(m); err != nil {
if _, err = sess.Id(m.Id).Cols("num_issues,num_completeness,num_closed_issues").Update(m); err != nil {
sess.Rollback()
return err
}
@@ -696,12 +785,18 @@ func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) {
if err != nil {
return err
}
m.NumIssues++
if issue.IsClosed {
m.NumClosedIssues++
}
if m.NumIssues == 0 {
return ErrWrongIssueCounter
}
m.Completeness = m.NumClosedIssues * 100 / m.NumIssues
if _, err = sess.Id(m.Id).Update(m); err != nil {
if _, err = sess.Id(m.Id).Cols("num_issues,num_completeness,num_closed_issues").Update(m); err != nil {
sess.Rollback()
return err
}
@@ -712,12 +807,13 @@ func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) {
return err
}
}
return sess.Commit()
}
// DeleteMilestone deletes a milestone.
func DeleteMilestone(m *Milestone) (err error) {
sess := orm.NewSession()
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
return err
@@ -755,67 +851,237 @@ func DeleteMilestone(m *Milestone) (err error) {
// \______ /\____/|__|_| /__|_| /\___ >___| /__|
// \/ \/ \/ \/ \/
// Issue types.
// CommentType defines whether a comment is just a simple comment, an action (like close) or a reference.
type CommentType int
const (
IT_PLAIN = iota // Pure comment.
IT_REOPEN // Issue reopen status change prompt.
IT_CLOSE // Issue close status change prompt.
// Plain comment, can be associated with a commit (CommitId > 0) and a line (Line > 0)
COMMENT CommentType = iota
// Reopen action
REOPEN
// Close action
CLOSE
// Reference from another issue
ISSUE
// Reference from some commit (not part of a pull request)
COMMIT
// Reference from some pull request
PULL
)
// Comment represents a comment in commit and issue page.
type Comment struct {
Id int64
Type int
Type CommentType
PosterId int64
Poster *User `xorm:"-"`
IssueId int64
CommitId int64
Line int64
Content string
Content string `xorm:"TEXT"`
Created time.Time `xorm:"CREATED"`
}
// CreateComment creates comment of issue or commit.
func CreateComment(userId, repoId, issueId, commitId, line int64, cmtType int, content string) error {
sess := orm.NewSession()
func CreateComment(userId, repoId, issueId, commitId, line int64, cmtType CommentType, content string, attachments []int64) (*Comment, error) {
sess := x.NewSession()
defer sess.Close()
if err := sess.Begin(); err != nil {
return err
return nil, err
}
if _, err := sess.Insert(&Comment{PosterId: userId, Type: cmtType, IssueId: issueId,
CommitId: commitId, Line: line, Content: content}); err != nil {
comment := &Comment{PosterId: userId, Type: cmtType, IssueId: issueId,
CommitId: commitId, Line: line, Content: content}
if _, err := sess.Insert(comment); err != nil {
sess.Rollback()
return err
return nil, err
}
// Check comment type.
switch cmtType {
case IT_PLAIN:
case COMMENT:
rawSql := "UPDATE `issue` SET num_comments = num_comments + 1 WHERE id = ?"
if _, err := sess.Exec(rawSql, issueId); err != nil {
sess.Rollback()
return err
return nil, err
}
case IT_REOPEN:
if len(attachments) > 0 {
rawSql = "UPDATE `attachment` SET comment_id = ? WHERE id IN (?)"
astrs := make([]string, 0, len(attachments))
for _, a := range attachments {
astrs = append(astrs, strconv.FormatInt(a, 10))
}
if _, err := sess.Exec(rawSql, comment.Id, strings.Join(astrs, ",")); err != nil {
sess.Rollback()
return nil, err
}
}
case REOPEN:
rawSql := "UPDATE `repository` SET num_closed_issues = num_closed_issues - 1 WHERE id = ?"
if _, err := sess.Exec(rawSql, repoId); err != nil {
sess.Rollback()
return err
return nil, err
}
case IT_CLOSE:
case CLOSE:
rawSql := "UPDATE `repository` SET num_closed_issues = num_closed_issues + 1 WHERE id = ?"
if _, err := sess.Exec(rawSql, repoId); err != nil {
sess.Rollback()
return err
return nil, err
}
}
return sess.Commit()
return comment, sess.Commit()
}
// GetCommentById returns the comment with the given id
func GetCommentById(commentId int64) (*Comment, error) {
c := &Comment{Id: commentId}
_, err := x.Get(c)
return c, err
}
func (c *Comment) ContentHtml() template.HTML {
return template.HTML(c.Content)
}
// GetIssueComments returns list of comment by given issue id.
func GetIssueComments(issueId int64) ([]Comment, error) {
comments := make([]Comment, 0, 10)
err := orm.Asc("created").Find(&comments, &Comment{IssueId: issueId})
err := x.Asc("created").Find(&comments, &Comment{IssueId: issueId})
return comments, err
}
// Attachments returns the attachments for this comment.
func (c *Comment) Attachments() []*Attachment {
a, _ := GetAttachmentsByComment(c.Id)
return a
}
func (c *Comment) AfterDelete() {
_, err := DeleteAttachmentsByComment(c.Id, true)
if err != nil {
log.Info("Could not delete files for comment %d on issue #%d: %s", c.Id, c.IssueId, err)
}
}
type Attachment struct {
Id int64
IssueId int64
CommentId int64
Name string
Path string `xorm:"TEXT"`
Created time.Time `xorm:"CREATED"`
}
// CreateAttachment creates a new attachment inside the database and
func CreateAttachment(issueId, commentId int64, name, path string) (*Attachment, error) {
sess := x.NewSession()
defer sess.Close()
if err := sess.Begin(); err != nil {
return nil, err
}
a := &Attachment{IssueId: issueId, CommentId: commentId, Name: name, Path: path}
if _, err := sess.Insert(a); err != nil {
sess.Rollback()
return nil, err
}
return a, sess.Commit()
}
// Attachment returns the attachment by given ID.
func GetAttachmentById(id int64) (*Attachment, error) {
m := &Attachment{Id: id}
has, err := x.Get(m)
if err != nil {
return nil, err
}
if !has {
return nil, ErrAttachmentNotExist
}
return m, nil
}
func GetAttachmentsForIssue(issueId int64) ([]*Attachment, error) {
attachments := make([]*Attachment, 0, 10)
err := x.Where("issue_id = ?", issueId).And("comment_id = 0").Find(&attachments)
return attachments, err
}
// GetAttachmentsByIssue returns a list of attachments for the given issue
func GetAttachmentsByIssue(issueId int64) ([]*Attachment, error) {
attachments := make([]*Attachment, 0, 10)
err := x.Where("issue_id = ?", issueId).And("comment_id > 0").Find(&attachments)
return attachments, err
}
// GetAttachmentsByComment returns a list of attachments for the given comment
func GetAttachmentsByComment(commentId int64) ([]*Attachment, error) {
attachments := make([]*Attachment, 0, 10)
err := x.Where("comment_id = ?", commentId).Find(&attachments)
return attachments, err
}
// DeleteAttachment deletes the given attachment and optionally the associated file.
func DeleteAttachment(a *Attachment, remove bool) error {
_, err := DeleteAttachments([]*Attachment{a}, remove)
return err
}
// DeleteAttachments deletes the given attachments and optionally the associated files.
func DeleteAttachments(attachments []*Attachment, remove bool) (int, error) {
for i, a := range attachments {
if remove {
if err := os.Remove(a.Path); err != nil {
return i, err
}
}
if _, err := x.Delete(a.Id); err != nil {
return i, err
}
}
return len(attachments), nil
}
// DeleteAttachmentsByIssue deletes all attachments associated with the given issue.
func DeleteAttachmentsByIssue(issueId int64, remove bool) (int, error) {
attachments, err := GetAttachmentsByIssue(issueId)
if err != nil {
return 0, err
}
return DeleteAttachments(attachments, remove)
}
// DeleteAttachmentsByComment deletes all attachments associated with the given comment.
func DeleteAttachmentsByComment(commentId int64, remove bool) (int, error) {
attachments, err := GetAttachmentsByComment(commentId)
if err != nil {
return 0, err
}
return DeleteAttachments(attachments, remove)
}

View File

@@ -1,4 +1,4 @@
// Copyright github.com/juju2013. All rights reserved.
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
@@ -20,12 +20,13 @@ import (
"github.com/gogits/gogs/modules/log"
)
// Login types.
type LoginType int
const (
LT_NOTYPE = iota
LT_PLAIN
LT_LDAP
LT_SMTP
NOTYPE LoginType = iota
PLAIN
LDAP
SMTP
)
var (
@@ -34,9 +35,9 @@ var (
ErrAuthenticationUserUsed = errors.New("Authentication has been used by some users")
)
var LoginTypes = map[int]string{
LT_LDAP: "LDAP",
LT_SMTP: "SMTP",
var LoginTypes = map[LoginType]string{
LDAP: "LDAP",
SMTP: "SMTP",
}
// Ensure structs implmented interface.
@@ -49,7 +50,6 @@ type LDAPConfig struct {
ldap.Ldapsource
}
// implement
func (cfg *LDAPConfig) FromDB(bs []byte) error {
return json.Unmarshal(bs, &cfg.Ldapsource)
}
@@ -65,7 +65,6 @@ type SMTPConfig struct {
TLS bool
}
// implement
func (cfg *SMTPConfig) FromDB(bs []byte) error {
return json.Unmarshal(bs, cfg)
}
@@ -76,13 +75,13 @@ func (cfg *SMTPConfig) ToDB() ([]byte, error) {
type LoginSource struct {
Id int64
Type int
Name string `xorm:"unique"`
IsActived bool `xorm:"not null default false"`
Type LoginType
Name string `xorm:"UNIQUE"`
IsActived bool `xorm:"NOT NULL DEFAULT false"`
Cfg core.Conversion `xorm:"TEXT"`
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
AllowAutoRegister bool `xorm:"not null default false"`
AllowAutoRegister bool `xorm:"NOT NULL DEFAULT false"`
Created time.Time `xorm:"CREATED"`
Updated time.Time `xorm:"UPDATED"`
}
func (source *LoginSource) TypeString() string {
@@ -97,61 +96,59 @@ func (source *LoginSource) SMTP() *SMTPConfig {
return source.Cfg.(*SMTPConfig)
}
// for xorm callback
func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) {
if colName == "type" {
ty := (*val).(int64)
switch ty {
case LT_LDAP:
switch LoginType(ty) {
case LDAP:
source.Cfg = new(LDAPConfig)
case LT_SMTP:
case SMTP:
source.Cfg = new(SMTPConfig)
}
}
}
func CreateSource(source *LoginSource) error {
_, err := x.Insert(source)
return err
}
func GetAuths() ([]*LoginSource, error) {
var auths = make([]*LoginSource, 0)
err := orm.Find(&auths)
var auths = make([]*LoginSource, 0, 5)
err := x.Find(&auths)
return auths, err
}
func GetLoginSourceById(id int64) (*LoginSource, error) {
source := new(LoginSource)
has, err := orm.Id(id).Get(source)
has, err := x.Id(id).Get(source)
if err != nil {
return nil, err
}
if !has {
} else if !has {
return nil, ErrAuthenticationNotExist
}
return source, nil
}
func AddSource(source *LoginSource) error {
_, err := orm.Insert(source)
return err
}
func UpdateSource(source *LoginSource) error {
_, err := orm.Id(source.Id).AllCols().Update(source)
_, err := x.Id(source.Id).AllCols().Update(source)
return err
}
func DelLoginSource(source *LoginSource) error {
cnt, err := orm.Count(&User{LoginSource: source.Id})
cnt, err := x.Count(&User{LoginSource: source.Id})
if err != nil {
return err
}
if cnt > 0 {
return ErrAuthenticationUserUsed
}
_, err = orm.Id(source.Id).Delete(&LoginSource{})
_, err = x.Id(source.Id).Delete(&LoginSource{})
return err
}
// login a user
func LoginUser(uname, passwd string) (*User, error) {
// UserSignIn validates user name and password.
func UserSignIn(uname, passwd string) (*User, error) {
var u *User
if strings.Contains(uname, "@") {
u = &User{Email: uname}
@@ -159,23 +156,18 @@ func LoginUser(uname, passwd string) (*User, error) {
u = &User{LowerName: strings.ToLower(uname)}
}
has, err := orm.Get(u)
has, err := x.Get(u)
if err != nil {
return nil, err
}
if u.LoginType == LT_NOTYPE {
if has {
u.LoginType = LT_PLAIN
}
if u.LoginType == NOTYPE && has {
u.LoginType = PLAIN
}
// for plain login, user must have existed.
if u.LoginType == LT_PLAIN {
if !has {
return nil, ErrUserNotExist
}
// For plain login, user must exist to reach this line.
// Now verify password.
if u.LoginType == PLAIN {
newUser := &User{Passwd: passwd, Salt: u.Salt}
newUser.EncodePasswd()
if u.Passwd != newUser.Passwd {
@@ -185,28 +177,26 @@ func LoginUser(uname, passwd string) (*User, error) {
} else {
if !has {
var sources []LoginSource
if err = orm.UseBool().Find(&sources,
if err = x.UseBool().Find(&sources,
&LoginSource{IsActived: true, AllowAutoRegister: true}); err != nil {
return nil, err
}
for _, source := range sources {
if source.Type == LT_LDAP {
if source.Type == LDAP {
u, err := LoginUserLdapSource(nil, uname, passwd,
source.Id, source.Cfg.(*LDAPConfig), true)
if err == nil {
return u, nil
} else {
log.Warn("Fail to login(%s) by LDAP(%s): %v", uname, source.Name, err)
}
} else if source.Type == LT_SMTP {
log.Warn("Fail to login(%s) by LDAP(%s): %v", uname, source.Name, err)
} else if source.Type == SMTP {
u, err := LoginUserSMTPSource(nil, uname, passwd,
source.Id, source.Cfg.(*SMTPConfig), true)
if err == nil {
return u, nil
} else {
log.Warn("Fail to login(%s) by SMTP(%s): %v", uname, source.Name, err)
}
log.Warn("Fail to login(%s) by SMTP(%s): %v", uname, source.Name, err)
}
}
@@ -214,7 +204,7 @@ func LoginUser(uname, passwd string) (*User, error) {
}
var source LoginSource
hasSource, err := orm.Id(u.LoginSource).Get(&source)
hasSource, err := x.Id(u.LoginSource).Get(&source)
if err != nil {
return nil, err
} else if !hasSource {
@@ -224,10 +214,10 @@ func LoginUser(uname, passwd string) (*User, error) {
}
switch u.LoginType {
case LT_LDAP:
case LDAP:
return LoginUserLdapSource(u, u.LoginName, passwd,
source.Id, source.Cfg.(*LDAPConfig), false)
case LT_SMTP:
case SMTP:
return LoginUserSMTPSource(u, u.LoginName, passwd,
source.Id, source.Cfg.(*SMTPConfig), false)
}
@@ -238,21 +228,21 @@ func LoginUser(uname, passwd string) (*User, error) {
// Query if name/passwd can login against the LDAP direcotry pool
// Create a local user if success
// Return the same LoginUserPlain semantic
func LoginUserLdapSource(user *User, name, passwd string, sourceId int64, cfg *LDAPConfig, autoRegister bool) (*User, error) {
func LoginUserLdapSource(u *User, name, passwd string, sourceId int64, cfg *LDAPConfig, autoRegister bool) (*User, error) {
mail, logged := cfg.Ldapsource.SearchEntry(name, passwd)
if !logged {
// user not in LDAP, do nothing
return nil, ErrUserNotExist
}
if !autoRegister {
return user, nil
return u, nil
}
// fake a local user creation
user = &User{
u = &User{
LowerName: strings.ToLower(name),
Name: strings.ToLower(name),
LoginType: LT_LDAP,
LoginType: LDAP,
LoginSource: sourceId,
LoginName: name,
IsActive: true,
@@ -260,7 +250,8 @@ func LoginUserLdapSource(user *User, name, passwd string, sourceId int64, cfg *L
Email: mail,
}
return RegisterUser(user)
err := CreateUser(u)
return u, err
}
type loginAuth struct {
@@ -320,15 +311,14 @@ func SmtpAuth(host string, port int, a smtp.Auth, useTls bool) error {
return err
}
return nil
} else {
return ErrUnsupportedLoginType
}
return ErrUnsupportedLoginType
}
// Query if name/passwd can login against the LDAP direcotry pool
// Create a local user if success
// Return the same LoginUserPlain semantic
func LoginUserSMTPSource(user *User, name, passwd string, sourceId int64, cfg *SMTPConfig, autoRegister bool) (*User, error) {
func LoginUserSMTPSource(u *User, name, passwd string, sourceId int64, cfg *SMTPConfig, autoRegister bool) (*User, error) {
var auth smtp.Auth
if cfg.Auth == SMTP_PLAIN {
auth = smtp.PlainAuth("", name, passwd, cfg.Host)
@@ -346,7 +336,7 @@ func LoginUserSMTPSource(user *User, name, passwd string, sourceId int64, cfg *S
}
if !autoRegister {
return user, nil
return u, nil
}
var loginName = name
@@ -355,16 +345,16 @@ func LoginUserSMTPSource(user *User, name, passwd string, sourceId int64, cfg *S
loginName = name[:idx]
}
// fake a local user creation
user = &User{
u = &User{
LowerName: strings.ToLower(loginName),
Name: strings.ToLower(loginName),
LoginType: LT_SMTP,
LoginType: SMTP,
LoginSource: sourceId,
LoginName: name,
IsActive: true,
Passwd: passwd,
Email: name,
}
return RegisterUser(user)
err := CreateUser(u)
return u, err
}

View File

@@ -18,7 +18,7 @@ import (
)
var (
orm *xorm.Engine
x *xorm.Engine
tables []interface{}
HasEngine bool
@@ -32,10 +32,12 @@ var (
)
func init() {
tables = append(tables, new(User), new(PublicKey), new(Repository), new(Watch),
new(Action), new(Access), new(Issue), new(Comment), new(Oauth2), new(Follow),
new(Mirror), new(Release), new(LoginSource), new(Webhook), new(IssueUser),
new(Milestone), new(Label))
tables = append(tables, new(User), new(PublicKey), new(Follow), new(Oauth2),
new(Repository), new(Watch), new(Star), new(Action), new(Access),
new(Issue), new(Comment), new(Attachment), new(IssueUser), new(Label), new(Milestone),
new(Mirror), new(Release), new(LoginSource), new(Webhook),
new(UpdateTask), new(HookTask), new(Team), new(OrgUser), new(TeamUser),
new(Notice))
}
func LoadModelsConfig() {
@@ -46,16 +48,19 @@ func LoadModelsConfig() {
DbCfg.Host = setting.Cfg.MustValue("database", "HOST")
DbCfg.Name = setting.Cfg.MustValue("database", "NAME")
DbCfg.User = setting.Cfg.MustValue("database", "USER")
DbCfg.Pwd = setting.Cfg.MustValue("database", "PASSWD")
if len(DbCfg.Pwd) == 0 {
DbCfg.Pwd = setting.Cfg.MustValue("database", "PASSWD")
}
DbCfg.SslMode = setting.Cfg.MustValue("database", "SSL_MODE")
DbCfg.Path = setting.Cfg.MustValue("database", "PATH", "data/gogs.db")
}
func NewTestEngine(x *xorm.Engine) (err error) {
func getEngine() (*xorm.Engine, error) {
cnnstr := ""
switch DbCfg.Type {
case "mysql":
x, err = xorm.NewEngine("mysql", fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8",
DbCfg.User, DbCfg.Pwd, DbCfg.Host, DbCfg.Name))
cnnstr = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8",
DbCfg.User, DbCfg.Pwd, DbCfg.Host, DbCfg.Name)
case "postgres":
var host, port = "127.0.0.1", "5432"
fields := strings.Split(DbCfg.Host, ":")
@@ -65,49 +70,33 @@ func NewTestEngine(x *xorm.Engine) (err error) {
if len(fields) > 1 && len(strings.TrimSpace(fields[1])) > 0 {
port = fields[1]
}
cnnstr := fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s",
cnnstr = fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s",
DbCfg.User, DbCfg.Pwd, host, port, DbCfg.Name, DbCfg.SslMode)
//fmt.Println(cnnstr)
x, err = xorm.NewEngine("postgres", cnnstr)
case "sqlite3":
if !EnableSQLite3 {
return fmt.Errorf("Unknown database type: %s", DbCfg.Type)
return nil, fmt.Errorf("Unknown database type: %s", DbCfg.Type)
}
os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm)
x, err = xorm.NewEngine("sqlite3", DbCfg.Path)
cnnstr = "file:" + DbCfg.Path + "?cache=shared&mode=rwc"
default:
return fmt.Errorf("Unknown database type: %s", DbCfg.Type)
return nil, fmt.Errorf("Unknown database type: %s", DbCfg.Type)
}
return xorm.NewEngine(DbCfg.Type, cnnstr)
}
func NewTestEngine(x *xorm.Engine) (err error) {
x, err = getEngine()
if err != nil {
return fmt.Errorf("models.init(fail to conntect database): %v", err)
return fmt.Errorf("models.init(fail to connect to database): %v", err)
}
return x.Sync(tables...)
}
func SetEngine() (err error) {
switch DbCfg.Type {
case "mysql":
orm, err = xorm.NewEngine("mysql", fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8",
DbCfg.User, DbCfg.Pwd, DbCfg.Host, DbCfg.Name))
case "postgres":
var host, port = "127.0.0.1", "5432"
fields := strings.Split(DbCfg.Host, ":")
if len(fields) > 0 && len(strings.TrimSpace(fields[0])) > 0 {
host = fields[0]
}
if len(fields) > 1 && len(strings.TrimSpace(fields[1])) > 0 {
port = fields[1]
}
orm, err = xorm.NewEngine("postgres", fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s",
DbCfg.User, DbCfg.Pwd, host, port, DbCfg.Name, DbCfg.SslMode))
case "sqlite3":
os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm)
orm, err = xorm.NewEngine("sqlite3", DbCfg.Path)
default:
return fmt.Errorf("Unknown database type: %s", DbCfg.Type)
}
x, err = getEngine()
if err != nil {
return fmt.Errorf("models.init(fail to conntect database): %v", err)
return fmt.Errorf("models.init(fail to connect to database): %v", err)
}
// WARNNING: for serv command, MUST remove the output to os.stdout,
@@ -119,11 +108,13 @@ func SetEngine() (err error) {
if err != nil {
return fmt.Errorf("models.init(fail to create xorm.log): %v", err)
}
orm.Logger = xorm.NewSimpleLogger(f)
x.Logger = xorm.NewSimpleLogger(f)
orm.ShowSQL = true
orm.ShowDebug = true
orm.ShowErr = true
x.ShowSQL = true
x.ShowInfo = true
x.ShowDebug = true
x.ShowErr = true
x.ShowWarn = true
return nil
}
@@ -131,7 +122,7 @@ func NewEngine() (err error) {
if err = SetEngine(); err != nil {
return err
}
if err = orm.Sync(tables...); err != nil {
if err = x.Sync2(tables...); err != nil {
return fmt.Errorf("sync database struct error: %v\n", err)
}
return nil
@@ -139,31 +130,46 @@ func NewEngine() (err error) {
type Statistic struct {
Counter struct {
User, PublicKey, Repo, Watch, Action, Access,
Issue, Comment, Mirror, Oauth, Release,
LoginSource, Webhook, Milestone int64
User, Org, PublicKey,
Repo, Watch, Star, Action, Access,
Issue, Comment, Oauth, Follow,
Mirror, Release, LoginSource, Webhook,
Milestone, Label, HookTask,
Team, UpdateTask, Attachment int64
}
}
func GetStatistic() (stats Statistic) {
stats.Counter.User, _ = orm.Count(new(User))
stats.Counter.PublicKey, _ = orm.Count(new(PublicKey))
stats.Counter.Repo, _ = orm.Count(new(Repository))
stats.Counter.Watch, _ = orm.Count(new(Watch))
stats.Counter.Action, _ = orm.Count(new(Action))
stats.Counter.Access, _ = orm.Count(new(Access))
stats.Counter.Issue, _ = orm.Count(new(Issue))
stats.Counter.Comment, _ = orm.Count(new(Comment))
stats.Counter.Mirror, _ = orm.Count(new(Mirror))
stats.Counter.Oauth, _ = orm.Count(new(Oauth2))
stats.Counter.Release, _ = orm.Count(new(Release))
stats.Counter.LoginSource, _ = orm.Count(new(LoginSource))
stats.Counter.Webhook, _ = orm.Count(new(Webhook))
stats.Counter.Milestone, _ = orm.Count(new(Milestone))
stats.Counter.User = CountUsers()
stats.Counter.Org = CountOrganizations()
stats.Counter.PublicKey, _ = x.Count(new(PublicKey))
stats.Counter.Repo = CountRepositories()
stats.Counter.Watch, _ = x.Count(new(Watch))
stats.Counter.Star, _ = x.Count(new(Star))
stats.Counter.Action, _ = x.Count(new(Action))
stats.Counter.Access, _ = x.Count(new(Access))
stats.Counter.Issue, _ = x.Count(new(Issue))
stats.Counter.Comment, _ = x.Count(new(Comment))
stats.Counter.Oauth, _ = x.Count(new(Oauth2))
stats.Counter.Follow, _ = x.Count(new(Follow))
stats.Counter.Mirror, _ = x.Count(new(Mirror))
stats.Counter.Release, _ = x.Count(new(Release))
stats.Counter.LoginSource, _ = x.Count(new(LoginSource))
stats.Counter.Webhook, _ = x.Count(new(Webhook))
stats.Counter.Milestone, _ = x.Count(new(Milestone))
stats.Counter.Label, _ = x.Count(new(Label))
stats.Counter.HookTask, _ = x.Count(new(HookTask))
stats.Counter.Team, _ = x.Count(new(Team))
stats.Counter.UpdateTask, _ = x.Count(new(UpdateTask))
stats.Counter.Attachment, _ = x.Count(new(Attachment))
return
}
func Ping() error {
return x.Ping()
}
// DumpDatabase dumps all data from database to file system.
func DumpDatabase(filePath string) error {
return orm.DumpAllToFile(filePath)
return x.DumpAllToFile(filePath)
}

View File

@@ -6,18 +6,19 @@ package models
import (
"errors"
"time"
)
// OT: Oauth2 Type
type OauthType int
const (
OT_GITHUB = iota + 1
OT_GOOGLE
OT_TWITTER
OT_QQ
OT_WEIBO
OT_BITBUCKET
OT_OSCHINA
OT_FACEBOOK
GITHUB OauthType = iota + 1
GOOGLE
TWITTER
QQ
WEIBO
BITBUCKET
FACEBOOK
)
var (
@@ -26,27 +27,30 @@ var (
)
type Oauth2 struct {
Id int64
Uid int64 `xorm:"unique(s)"` // userId
User *User `xorm:"-"`
Type int `xorm:"unique(s) unique(oauth)"` // twitter,github,google...
Identity string `xorm:"unique(s) unique(oauth)"` // id..
Token string `xorm:"TEXT not null"`
Id int64
Uid int64 `xorm:"unique(s)"` // userId
User *User `xorm:"-"`
Type int `xorm:"unique(s) unique(oauth)"` // twitter,github,google...
Identity string `xorm:"unique(s) unique(oauth)"` // id..
Token string `xorm:"TEXT not null"`
Created time.Time `xorm:"CREATED"`
Updated time.Time
HasRecentActivity bool `xorm:"-"`
}
func BindUserOauth2(userId, oauthId int64) error {
_, err := orm.Id(oauthId).Update(&Oauth2{Uid: userId})
_, err := x.Id(oauthId).Update(&Oauth2{Uid: userId})
return err
}
func AddOauth2(oa *Oauth2) error {
_, err := orm.Insert(oa)
_, err := x.Insert(oa)
return err
}
func GetOauth2(identity string) (oa *Oauth2, err error) {
oa = &Oauth2{Identity: identity}
isExist, err := orm.Get(oa)
isExist, err := x.Get(oa)
if err != nil {
return
} else if !isExist {
@@ -60,7 +64,7 @@ func GetOauth2(identity string) (oa *Oauth2, err error) {
func GetOauth2ById(id int64) (oa *Oauth2, err error) {
oa = new(Oauth2)
has, err := orm.Id(id).Get(oa)
has, err := x.Id(id).Get(oa)
if err != nil {
return nil, err
} else if !has {
@@ -69,20 +73,34 @@ func GetOauth2ById(id int64) (oa *Oauth2, err error) {
return oa, nil
}
// UpdateOauth2 updates given OAuth2.
func UpdateOauth2(oa *Oauth2) error {
_, err := x.Id(oa.Id).AllCols().Update(oa)
return err
}
// GetOauthByUserId returns list of oauthes that are releated to given user.
func GetOauthByUserId(uid int64) (oas []*Oauth2, err error) {
err = orm.Find(&oas, Oauth2{Uid: uid})
return oas, err
func GetOauthByUserId(uid int64) ([]*Oauth2, error) {
socials := make([]*Oauth2, 0, 5)
err := x.Find(&socials, Oauth2{Uid: uid})
if err != nil {
return nil, err
}
for _, social := range socials {
social.HasRecentActivity = social.Updated.Add(7 * 24 * time.Hour).After(time.Now())
}
return socials, err
}
// DeleteOauth2ById deletes a oauth2 by ID.
func DeleteOauth2ById(id int64) error {
_, err := orm.Delete(&Oauth2{Id: id})
_, err := x.Delete(&Oauth2{Id: id})
return err
}
// CleanUnbindOauth deletes all unbind OAuthes.
func CleanUnbindOauth() error {
_, err := orm.Delete(&Oauth2{Uid: -1})
_, err := x.Delete(&Oauth2{Uid: -1})
return err
}

1085
models/org.go Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -19,9 +19,10 @@ import (
"time"
"github.com/Unknwon/com"
qlog "github.com/qiniu/log"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/process"
"github.com/gogits/gogs/modules/setting"
)
const (
@@ -37,7 +38,7 @@ var (
var sshOpLocker = sync.Mutex{}
var (
sshPath string // SSH directory.
SshPath string // SSH directory.
appPath string // Execution(binary) path.
)
@@ -54,7 +55,7 @@ func exePath() (string, error) {
func homeDir() string {
home, err := com.HomeDir()
if err != nil {
qlog.Fatalln(err)
log.Fatal(4, "Fail to get home directory: %v", err)
}
return home
}
@@ -63,25 +64,28 @@ func init() {
var err error
if appPath, err = exePath(); err != nil {
qlog.Fatalf("publickey.init(fail to get app path): %v\n", err)
log.Fatal(4, "fail to get app path: %v\n", err)
}
appPath = strings.Replace(appPath, "\\", "/", -1)
// Determine and create .ssh path.
sshPath = filepath.Join(homeDir(), ".ssh")
if err = os.MkdirAll(sshPath, os.ModePerm); err != nil {
qlog.Fatalf("publickey.init(fail to create sshPath(%s)): %v\n", sshPath, err)
SshPath = filepath.Join(homeDir(), ".ssh")
if err = os.MkdirAll(SshPath, 0700); err != nil {
log.Fatal(4, "fail to create SshPath(%s): %v\n", SshPath, err)
}
}
// PublicKey represents a SSH key.
type PublicKey struct {
Id int64
OwnerId int64 `xorm:"UNIQUE(s) INDEX NOT NULL"`
Name string `xorm:"UNIQUE(s) NOT NULL"`
Fingerprint string
Content string `xorm:"TEXT NOT NULL"`
Created time.Time `xorm:"CREATED"`
Updated time.Time `xorm:"UPDATED"`
Id int64
OwnerId int64 `xorm:"UNIQUE(s) INDEX NOT NULL"`
Name string `xorm:"UNIQUE(s) NOT NULL"`
Fingerprint string
Content string `xorm:"TEXT NOT NULL"`
Created time.Time `xorm:"CREATED"`
Updated time.Time
HasRecentActivity bool `xorm:"-"`
HasUsed bool `xorm:"-"`
}
// GetAuthorizedString generates and returns formatted public key string for authorized_keys file.
@@ -89,17 +93,92 @@ func (key *PublicKey) GetAuthorizedString() string {
return fmt.Sprintf(_TPL_PUBLICK_KEY, appPath, key.Id, key.Content)
}
var (
MinimumKeySize = map[string]int{
"(ED25519)": 256,
"(ECDSA)": 256,
"(NTRU)": 1087,
"(MCE)": 1702,
"(McE)": 1702,
"(RSA)": 2048,
"(DSA)": 1024,
}
)
// CheckPublicKeyString checks if the given public key string is recognized by SSH.
func CheckPublicKeyString(content string) (bool, error) {
if strings.ContainsAny(content, "\n\r") {
return false, errors.New("Only a single line with a single key please")
}
// write the key to a file…
tmpFile, err := ioutil.TempFile(os.TempDir(), "keytest")
if err != nil {
return false, err
}
tmpPath := tmpFile.Name()
defer os.Remove(tmpPath)
tmpFile.WriteString(content)
tmpFile.Close()
// Check if ssh-keygen recognizes its contents.
stdout, stderr, err := process.Exec("CheckPublicKeyString", "ssh-keygen", "-l", "-f", tmpPath)
if err != nil {
return false, errors.New("ssh-keygen -l -f: " + stderr)
} else if len(stdout) < 2 {
return false, errors.New("ssh-keygen returned not enough output to evaluate the key")
}
// The ssh-keygen in Windows does not print key type, so no need go further.
if setting.IsWindows {
return true, nil
}
sshKeygenOutput := strings.Split(stdout, " ")
if len(sshKeygenOutput) < 4 {
return false, errors.New("Not enough fields returned by ssh-keygen -l -f")
}
// Check if key type and key size match.
keySize, err := com.StrTo(sshKeygenOutput[0]).Int()
if err != nil {
return false, errors.New("Cannot get key size of the given key")
}
keyType := strings.TrimSpace(sshKeygenOutput[len(sshKeygenOutput)-1])
if minimumKeySize := MinimumKeySize[keyType]; minimumKeySize == 0 {
return false, errors.New("Sorry, unrecognized public key type")
} else if keySize < minimumKeySize {
return false, fmt.Errorf("The minimum accepted size of a public key %s is %d", keyType, minimumKeySize)
}
return true, nil
}
// saveAuthorizedKeyFile writes SSH key content to authorized_keys file.
func saveAuthorizedKeyFile(key *PublicKey) error {
sshOpLocker.Lock()
defer sshOpLocker.Unlock()
fpath := filepath.Join(sshPath, "authorized_keys")
fpath := filepath.Join(SshPath, "authorized_keys")
f, err := os.OpenFile(fpath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)
if err != nil {
return err
}
defer f.Close()
finfo, err := f.Stat()
if err != nil {
return err
}
// FIXME: following command does not support in Windows.
if !setting.IsWindows {
if finfo.Mode().Perm() > 0600 {
log.Error(4, "authorized_keys file has unusual permission flags: %s - setting to -rw-------", finfo.Mode().Perm().String())
if err = f.Chmod(0600); err != nil {
return err
}
}
}
_, err = f.WriteString(key.GetAuthorizedString())
return err
@@ -107,7 +186,7 @@ func saveAuthorizedKeyFile(key *PublicKey) error {
// AddPublicKey adds new public key to database and authorized_keys file.
func AddPublicKey(key *PublicKey) (err error) {
has, err := orm.Get(key)
has, err := x.Get(key)
if err != nil {
return err
} else if has {
@@ -121,7 +200,7 @@ func AddPublicKey(key *PublicKey) (err error) {
if err = ioutil.WriteFile(tmpPath, []byte(key.Content), os.ModePerm); err != nil {
return err
}
stdout, stderr, err := com.ExecCmd("ssh-keygen", "-l", "-f", tmpPath)
stdout, stderr, err := process.Exec("AddPublicKey", "ssh-keygen", "-l", "-f", tmpPath)
if err != nil {
return errors.New("ssh-keygen -l -f: " + stderr)
} else if len(stdout) < 2 {
@@ -130,11 +209,11 @@ func AddPublicKey(key *PublicKey) (err error) {
key.Fingerprint = strings.Split(stdout, " ")[1]
// Save SSH key.
if _, err = orm.Insert(key); err != nil {
if _, err = x.Insert(key); err != nil {
return err
} else if err = saveAuthorizedKeyFile(key); err != nil {
// Roll back.
if _, err2 := orm.Delete(key); err2 != nil {
if _, err2 := x.Delete(key); err2 != nil {
return err2
}
return err
@@ -143,11 +222,31 @@ func AddPublicKey(key *PublicKey) (err error) {
return nil
}
// GetPublicKeyById returns public key by given ID.
func GetPublicKeyById(keyId int64) (*PublicKey, error) {
key := new(PublicKey)
has, err := x.Id(keyId).Get(key)
if err != nil {
return nil, err
} else if !has {
return nil, ErrKeyNotExist
}
return key, nil
}
// ListPublicKey returns a list of all public keys that user has.
func ListPublicKey(uid int64) ([]PublicKey, error) {
keys := make([]PublicKey, 0, 5)
err := orm.Find(&keys, &PublicKey{OwnerId: uid})
return keys, err
func ListPublicKey(uid int64) ([]*PublicKey, error) {
keys := make([]*PublicKey, 0, 5)
err := x.Find(&keys, &PublicKey{OwnerId: uid})
if err != nil {
return nil, err
}
for _, key := range keys {
key.HasUsed = key.Updated.After(key.Created)
key.HasRecentActivity = key.Updated.Add(7 * 24 * time.Hour).After(time.Now())
}
return keys, nil
}
// rewriteAuthorizedKeys finds and deletes corresponding line in authorized_keys file.
@@ -161,7 +260,7 @@ func rewriteAuthorizedKeys(key *PublicKey, p, tmpP string) error {
}
defer fr.Close()
fw, err := os.Create(tmpP)
fw, err := os.OpenFile(tmpP, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)
if err != nil {
return err
}
@@ -203,23 +302,27 @@ func rewriteAuthorizedKeys(key *PublicKey, p, tmpP string) error {
return nil
}
// UpdatePublicKey updates given public key.
func UpdatePublicKey(key *PublicKey) error {
_, err := x.Id(key.Id).AllCols().Update(key)
return err
}
// DeletePublicKey deletes SSH key information both in database and authorized_keys file.
func DeletePublicKey(key *PublicKey) error {
has, err := orm.Get(key)
has, err := x.Get(key)
if err != nil {
return err
} else if !has {
return ErrKeyNotExist
}
if _, err = orm.Delete(key); err != nil {
if _, err = x.Delete(key); err != nil {
return err
}
fpath := filepath.Join(sshPath, "authorized_keys")
tmpPath := filepath.Join(sshPath, "authorized_keys.tmp")
log.Trace("publickey.DeletePublicKey(authorized_keys): %s", fpath)
fpath := filepath.Join(SshPath, "authorized_keys")
tmpPath := filepath.Join(SshPath, "authorized_keys.tmp")
if err = rewriteAuthorizedKeys(key, fpath, tmpPath); err != nil {
return err
} else if err = os.Remove(fpath); err != nil {

View File

@@ -6,15 +6,16 @@ package models
import (
"errors"
"sort"
"strings"
"time"
"github.com/Unknwon/com"
"github.com/gogits/git"
"github.com/gogits/gogs/modules/git"
)
var (
ErrReleaseAlreadyExist = errors.New("Release already exist")
ErrReleaseNotExist = errors.New("Release does not exist")
)
// Release represents a release of repository.
@@ -23,21 +24,17 @@ type Release struct {
RepoId int64
PublisherId int64
Publisher *User `xorm:"-"`
Title string
TagName string
LowerTagName string
SHA1 string
Target string
Title string
Sha1 string `xorm:"VARCHAR(40)"`
NumCommits int
NumCommitsBehind int `xorm:"-"`
Note string `xorm:"TEXT"`
IsDraft bool `xorm:"NOT NULL DEFAULT false"`
IsPrerelease bool
Created time.Time `xorm:"created"`
}
// GetReleasesByRepoId returns a list of releases of repository.
func GetReleasesByRepoId(repoId int64) (rels []*Release, err error) {
err = orm.Desc("created").Find(&rels, Release{RepoId: repoId})
return rels, err
Created time.Time `xorm:"CREATED"`
}
// IsReleaseExist returns true if release with given tag name already exists.
@@ -46,7 +43,34 @@ func IsReleaseExist(repoId int64, tagName string) (bool, error) {
return false, nil
}
return orm.Get(&Release{RepoId: repoId, LowerTagName: strings.ToLower(tagName)})
return x.Get(&Release{RepoId: repoId, LowerTagName: strings.ToLower(tagName)})
}
func createTag(gitRepo *git.Repository, rel *Release) error {
// Only actual create when publish.
if !rel.IsDraft {
if !gitRepo.IsTagExist(rel.TagName) {
commit, err := gitRepo.GetCommitOfBranch(rel.Target)
if err != nil {
return err
}
if err = gitRepo.CreateTag(rel.TagName, commit.Id.String()); err != nil {
return err
}
} else {
commit, err := gitRepo.GetCommitOfTag(rel.TagName)
if err != nil {
return err
}
rel.NumCommits, err = commit.CommitsCount()
if err != nil {
return err
}
}
}
return nil
}
// CreateRelease creates a new release of repository.
@@ -58,26 +82,65 @@ func CreateRelease(gitRepo *git.Repository, rel *Release) error {
return ErrReleaseAlreadyExist
}
if !gitRepo.IsTagExist(rel.TagName) {
_, stderr, err := com.ExecCmdDir(gitRepo.Path, "git", "tag", rel.TagName, "-m", rel.Title)
if err != nil {
return err
} else if strings.Contains(stderr, "fatal:") {
return errors.New(stderr)
}
} else {
commit, err := gitRepo.GetCommitOfTag(rel.TagName)
if err != nil {
return err
}
rel.NumCommits, err = commit.CommitsCount()
if err != nil {
return err
}
if err = createTag(gitRepo, rel); err != nil {
return err
}
rel.LowerTagName = strings.ToLower(rel.TagName)
_, err = orm.InsertOne(rel)
_, err = x.InsertOne(rel)
return err
}
// GetRelease returns release by given ID.
func GetRelease(repoId int64, tagName string) (*Release, error) {
isExist, err := IsReleaseExist(repoId, tagName)
if err != nil {
return nil, err
} else if !isExist {
return nil, ErrReleaseNotExist
}
rel := &Release{RepoId: repoId, LowerTagName: strings.ToLower(tagName)}
_, err = x.Get(rel)
return rel, err
}
// GetReleasesByRepoId returns a list of releases of repository.
func GetReleasesByRepoId(repoId int64) (rels []*Release, err error) {
err = x.Desc("created").Find(&rels, Release{RepoId: repoId})
return rels, err
}
type ReleaseSorter struct {
rels []*Release
}
func (rs *ReleaseSorter) Len() int {
return len(rs.rels)
}
func (rs *ReleaseSorter) Less(i, j int) bool {
diffNum := rs.rels[i].NumCommits - rs.rels[j].NumCommits
if diffNum != 0 {
return diffNum > 0
}
return rs.rels[i].Created.After(rs.rels[j].Created)
}
func (rs *ReleaseSorter) Swap(i, j int) {
rs.rels[i], rs.rels[j] = rs.rels[j], rs.rels[i]
}
// SortReleases sorts releases by number of commits and created time.
func SortReleases(rels []*Release) {
sorter := &ReleaseSorter{rels: rels}
sort.Sort(sorter)
}
// UpdateRelease updates information of a release.
func UpdateRelease(gitRepo *git.Repository, rel *Release) (err error) {
if err = createTag(gitRepo, rel); err != nil {
return err
}
_, err = x.Id(rel.Id).AllCols().Update(rel)
return err
}

File diff suppressed because it is too large Load Diff

125
models/slack.go Normal file
View File

@@ -0,0 +1,125 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
import (
"encoding/json"
"errors"
"fmt"
"strings"
)
const (
SLACK_COLOR string = "#dd4b39"
)
type Slack struct {
Domain string `json:"domain"`
Token string `json:"token"`
Channel string `json:"channel"`
}
type SlackPayload struct {
Channel string `json:"channel"`
Text string `json:"text"`
Username string `json:"username"`
IconUrl string `json:"icon_url"`
UnfurlLinks int `json:"unfurl_links"`
LinkNames int `json:"link_names"`
Attachments []SlackAttachment `json:"attachments"`
}
type SlackAttachment struct {
Color string `json:"color"`
Text string `json:"text"`
}
func GetSlackURL(domain string, token string) string {
return fmt.Sprintf(
"https://%s.slack.com/services/hooks/incoming-webhook?token=%s",
domain,
token,
)
}
func (p SlackPayload) GetJSONPayload() ([]byte, error) {
data, err := json.Marshal(p)
if err != nil {
return []byte{}, err
}
return data, nil
}
func GetSlackPayload(p *Payload, meta string) (*SlackPayload, error) {
slack := &Slack{}
slackPayload := &SlackPayload{}
if err := json.Unmarshal([]byte(meta), &slack); err != nil {
return slackPayload, errors.New("GetSlackPayload meta json:" + err.Error())
}
// TODO: handle different payload types: push, new branch, delete branch etc.
// when they are added to gogs. Only handles push now
return getSlackPushPayload(p, slack)
}
func getSlackPushPayload(p *Payload, slack *Slack) (*SlackPayload, error) {
// n new commits
refSplit := strings.Split(p.Ref, "/")
branchName := refSplit[len(refSplit)-1]
var commitString string
if len(p.Commits) == 1 {
commitString = "1 new commit"
if p.CompareUrl != "" {
commitString = SlackLinkFormatter(p.CompareUrl, commitString)
}
} else {
commitString = fmt.Sprintf("%d new commits", len(p.Commits))
if p.CompareUrl != "" {
commitString = SlackLinkFormatter(p.CompareUrl, commitString)
}
}
repoLink := SlackLinkFormatter(p.Repo.Url, p.Repo.Name)
branchLink := SlackLinkFormatter(p.Repo.Url+"/src/"+branchName, branchName)
text := fmt.Sprintf("[%s:%s] %s pushed by %s", repoLink, branchLink, commitString, p.Pusher.Name)
var attachmentText string
// for each commit, generate attachment text
for i, commit := range p.Commits {
attachmentText += fmt.Sprintf("%s: %s - %s", SlackLinkFormatter(commit.Url, commit.Id[:7]), SlackTextFormatter(commit.Message), SlackTextFormatter(commit.Author.Name))
// add linebreak to each commit but the last
if i < len(p.Commits)-1 {
attachmentText += "\n"
}
}
slackAttachments := []SlackAttachment{{Color: SLACK_COLOR, Text: attachmentText}}
return &SlackPayload{
Channel: slack.Channel,
Text: text,
Username: "gogs",
IconUrl: "https://raw.githubusercontent.com/gogits/gogs/master/public/img/favicon.png",
UnfurlLinks: 0,
LinkNames: 0,
Attachments: slackAttachments,
}, nil
}
// see: https://api.slack.com/docs/formatting
func SlackTextFormatter(s string) string {
// take only first line of commit
first := strings.Split(s, "\n")[0]
// replace & < >
first = strings.Replace(first, "&", "&amp;", -1)
first = strings.Replace(first, "<", "&lt;", -1)
first = strings.Replace(first, ">", "&gt;", -1)
return first
}
func SlackLinkFormatter(url string, text string) string {
return fmt.Sprintf("<%s|%s>", url, SlackTextFormatter(text))
}

View File

@@ -6,21 +6,54 @@ package models
import (
"container/list"
"fmt"
"os/exec"
"strings"
qlog "github.com/qiniu/log"
"github.com/gogits/git"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/log"
)
func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName string, userId int64) {
type UpdateTask struct {
Id int64
Uuid string `xorm:"index"`
RefName string
OldCommitId string
NewCommitId string
}
const (
MAX_COMMITS int = 5
)
func AddUpdateTask(task *UpdateTask) error {
_, err := x.Insert(task)
return err
}
func GetUpdateTasksByUuid(uuid string) ([]*UpdateTask, error) {
task := &UpdateTask{
Uuid: uuid,
}
tasks := make([]*UpdateTask, 0)
err := x.Find(&tasks, task)
if err != nil {
return nil, err
}
return tasks, nil
}
func DelUpdateTasksByUuid(uuid string) error {
_, err := x.Delete(&UpdateTask{Uuid: uuid})
return err
}
func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName string, userId int64) error {
isNew := strings.HasPrefix(oldCommitId, "0000000")
if isNew &&
strings.HasPrefix(newCommitId, "0000000") {
qlog.Fatal("old rev and new rev both 000000")
return fmt.Errorf("old rev and new rev both 000000")
}
f := RepoPath(repoUserName, repoName)
@@ -31,19 +64,56 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
isDel := strings.HasPrefix(newCommitId, "0000000")
if isDel {
qlog.Info("del rev", refName, "from", userName+"/"+repoName+".git", "by", userId)
return
log.GitLogger.Info("del rev", refName, "from", userName+"/"+repoName+".git", "by", userId)
return nil
}
repo, err := git.OpenRepository(f)
if err != nil {
qlog.Fatalf("runUpdate.Open repoId: %v", err)
return fmt.Errorf("runUpdate.Open repoId: %v", err)
}
ru, err := GetUserByName(repoUserName)
if err != nil {
return fmt.Errorf("runUpdate.GetUserByName: %v", err)
}
repos, err := GetRepositoryByName(ru.Id, repoName)
if err != nil {
return fmt.Errorf("runUpdate.GetRepositoryByName userId: %v", err)
}
// Push tags.
if strings.HasPrefix(refName, "refs/tags/") {
tagName := git.RefEndName(refName)
tag, err := repo.GetTag(tagName)
if err != nil {
log.GitLogger.Fatal(4, "runUpdate.GetTag: %v", err)
}
var actEmail string
if tag.Tagger != nil {
actEmail = tag.Tagger.Email
} else {
cmt, err := tag.Commit()
if err != nil {
log.GitLogger.Fatal(4, "runUpdate.GetTag Commit: %v", err)
}
actEmail = cmt.Committer.Email
}
commit := &base.PushCommits{}
if err = CommitRepoAction(userId, ru.Id, userName, actEmail,
repos.Id, repoUserName, repoName, refName, commit, oldCommitId, newCommitId); err != nil {
log.GitLogger.Fatal(4, "runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err)
}
return err
}
newCommit, err := repo.GetCommit(newCommitId)
if err != nil {
qlog.Fatalf("runUpdate GetCommit of newCommitId: %v", err)
return
return fmt.Errorf("runUpdate GetCommit of newCommitId: %v", err)
}
var l *list.List
@@ -51,35 +121,25 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
if isNew {
l, err = newCommit.CommitsBefore()
if err != nil {
qlog.Fatalf("Find CommitsBefore erro: %v", err)
return fmt.Errorf("Find CommitsBefore erro: %v", err)
}
} else {
l, err = newCommit.CommitsBeforeUntil(oldCommitId)
if err != nil {
qlog.Fatalf("Find CommitsBeforeUntil erro: %v", err)
return
return fmt.Errorf("Find CommitsBeforeUntil erro: %v", err)
}
}
if err != nil {
qlog.Fatalf("runUpdate.Commit repoId: %v", err)
}
ru, err := GetUserByName(repoUserName)
if err != nil {
qlog.Fatalf("runUpdate.GetUserByName: %v", err)
}
repos, err := GetRepositoryByName(ru.Id, repoName)
if err != nil {
qlog.Fatalf("runUpdate.GetRepositoryByName userId: %v", err)
return fmt.Errorf("runUpdate.Commit repoId: %v", err)
}
// if commits push
commits := make([]*base.PushCommit, 0)
var maxCommits = 3
var actEmail string
for e := l.Front(); e != nil; e = e.Next() {
commit := e.Value.(*git.Commit)
if actEmail == "" {
actEmail = commit.Committer.Email
}
@@ -88,14 +148,15 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
commit.Message(),
commit.Author.Email,
commit.Author.Name})
if len(commits) >= maxCommits {
if len(commits) >= MAX_COMMITS {
break
}
}
//commits = append(commits, []string{lastCommit.Id().String(), lastCommit.Message()})
if err = CommitRepoAction(userId, ru.Id, userName, actEmail,
repos.Id, repoUserName, repoName, refName, &base.PushCommits{l.Len(), commits}); err != nil {
qlog.Fatalf("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err)
repos.Id, repoUserName, repoName, refName, &base.PushCommits{l.Len(), commits}, oldCommitId, newCommitId); err != nil {
return fmt.Errorf("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err)
}
return nil
}

View File

@@ -5,6 +5,7 @@
package models
import (
"container/list"
"crypto/sha256"
"encoding/hex"
"errors"
@@ -14,21 +15,24 @@ import (
"strings"
"time"
"github.com/gogits/git"
"github.com/Unknwon/com"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
)
// User types.
type UserType int
const (
UT_INDIVIDUAL = iota + 1
UT_ORGANIZATION
INDIVIDUAL UserType = iota // Historic reason to make it starts at 0.
ORGANIZATION
)
var (
ErrUserOwnRepos = errors.New("User still have ownership of repositories")
ErrUserHasOrgs = errors.New("User still have membership of organization")
ErrUserAlreadyExist = errors.New("User already exist")
ErrUserNotExist = errors.New("User does not exist")
ErrUserNotKeyOwner = errors.New("User does not the owner of public key")
@@ -42,66 +46,134 @@ var (
// User represents the object of individual and member of organization.
type User struct {
Id int64
LowerName string `xorm:"unique not null"`
Name string `xorm:"unique not null"`
LowerName string `xorm:"UNIQUE NOT NULL"`
Name string `xorm:"UNIQUE NOT NULL"`
FullName string
Email string `xorm:"unique not null"`
Passwd string `xorm:"not null"`
LoginType int
LoginSource int64 `xorm:"not null default 0"`
Email string `xorm:"UNIQUE NOT NULL"`
Passwd string `xorm:"NOT NULL"`
LoginType LoginType
LoginSource int64 `xorm:"NOT NULL DEFAULT 0"`
LoginName string
Type int
Type UserType
Orgs []*User `xorm:"-"`
Repos []*Repository `xorm:"-"`
NumFollowers int
NumFollowings int
NumStars int
NumRepos int
Avatar string `xorm:"varchar(2048) not null"`
AvatarEmail string `xorm:"not null"`
Avatar string `xorm:"VARCHAR(2048) NOT NULL"`
AvatarEmail string `xorm:"NOT NULL"`
Location string
Website string
IsActive bool
IsAdmin bool
Rands string `xorm:"VARCHAR(10)"`
Salt string `xorm:"VARCHAR(10)"`
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
Created time.Time `xorm:"CREATED"`
Updated time.Time `xorm:"UPDATED"`
// For organization.
Description string
NumTeams int
NumMembers int
Teams []*Team `xorm:"-"`
Members []*User `xorm:"-"`
}
// DashboardLink returns the user dashboard page link.
func (u *User) DashboardLink() string {
if u.IsOrganization() {
return setting.AppSubUrl + "/org/" + u.Name + "/dashboard/"
}
return setting.AppSubUrl + "/"
}
// HomeLink returns the user home page link.
func (user *User) HomeLink() string {
return "/user/" + user.Name
func (u *User) HomeLink() string {
return setting.AppSubUrl + "/" + u.Name
}
// AvatarLink returns the user gravatar link.
func (user *User) AvatarLink() string {
// AvatarLink returns user gravatar link.
func (u *User) AvatarLink() string {
if setting.DisableGravatar {
return "/img/avatar_default.jpg"
return setting.AppSubUrl + "/img/avatar_default.jpg"
} else if setting.Service.EnableCacheAvatar {
return "/avatar/" + user.Avatar
return setting.AppSubUrl + "/avatar/" + u.Avatar
}
return "//1.gravatar.com/avatar/" + user.Avatar
return "//1.gravatar.com/avatar/" + u.Avatar
}
// NewGitSig generates and returns the signature of given user.
func (user *User) NewGitSig() *git.Signature {
func (u *User) NewGitSig() *git.Signature {
return &git.Signature{
Name: user.Name,
Email: user.Email,
Name: u.Name,
Email: u.Email,
When: time.Now(),
}
}
// EncodePasswd encodes password to safe format.
func (user *User) EncodePasswd() {
newPasswd := base.PBKDF2([]byte(user.Passwd), []byte(user.Salt), 10000, 50, sha256.New)
user.Passwd = fmt.Sprintf("%x", newPasswd)
func (u *User) EncodePasswd() {
newPasswd := base.PBKDF2([]byte(u.Passwd), []byte(u.Salt), 10000, 50, sha256.New)
u.Passwd = fmt.Sprintf("%x", newPasswd)
}
// Member represents user is member of organization.
type Member struct {
Id int64
OrgId int64 `xorm:"unique(member) index"`
UserId int64 `xorm:"unique(member)"`
// ValidtePassword checks if given password matches the one belongs to the user.
func (u *User) ValidtePassword(passwd string) bool {
newUser := &User{Passwd: passwd, Salt: u.Salt}
newUser.EncodePasswd()
return u.Passwd == newUser.Passwd
}
// IsOrganization returns true if user is actually a organization.
func (u *User) IsOrganization() bool {
return u.Type == ORGANIZATION
}
// IsUserOrgOwner returns true if user is in the owner team of given organization.
func (u *User) IsUserOrgOwner(orgId int64) bool {
return IsOrganizationOwner(orgId, u.Id)
}
// IsPublicMember returns true if user public his/her membership in give organization.
func (u *User) IsPublicMember(orgId int64) bool {
return IsPublicMembership(orgId, u.Id)
}
// GetOrganizationCount returns count of membership of organization of user.
func (u *User) GetOrganizationCount() (int64, error) {
return x.Where("uid=?", u.Id).Count(new(OrgUser))
}
// GetRepositories returns all repositories that user owns, including private repositories.
func (u *User) GetRepositories() (err error) {
u.Repos, err = GetRepositories(u.Id, true)
return err
}
// GetOrganizations returns all organizations that user belongs to.
func (u *User) GetOrganizations() error {
ous, err := GetOrgUsersByUserId(u.Id)
if err != nil {
return err
}
u.Orgs = make([]*User, len(ous))
for i, ou := range ous {
u.Orgs[i], err = GetUserById(ou.OrgId)
if err != nil {
return err
}
}
return nil
}
// GetFullNameFallback returns Full Name if set, otherwise username
func (u *User) GetFullNameFallback() string {
if u.FullName == "" {
return u.Name
}
return u.FullName
}
// IsUserExist checks if given user name exist,
@@ -110,7 +182,7 @@ func IsUserExist(name string) (bool, error) {
if len(name) == 0 {
return false, nil
}
return orm.Get(&User{LowerName: strings.ToLower(name)})
return x.Get(&User{LowerName: strings.ToLower(name)})
}
// IsEmailUsed returns true if the e-mail has been used.
@@ -118,63 +190,76 @@ func IsEmailUsed(email string) (bool, error) {
if len(email) == 0 {
return false, nil
}
return orm.Get(&User{Email: email})
return x.Get(&User{Email: email})
}
// return a user salt token
// GetUserSalt returns a user salt token
func GetUserSalt() string {
return base.GetRandomString(10)
}
// RegisterUser creates record of a new user.
func RegisterUser(user *User) (*User, error) {
if !IsLegalName(user.Name) {
return nil, ErrUserNameIllegal
// CreateUser creates record of a new user.
func CreateUser(u *User) error {
if !IsLegalName(u.Name) {
return ErrUserNameIllegal
}
isExist, err := IsUserExist(user.Name)
isExist, err := IsUserExist(u.Name)
if err != nil {
return nil, err
return err
} else if isExist {
return nil, ErrUserAlreadyExist
return ErrUserAlreadyExist
}
isExist, err = IsEmailUsed(user.Email)
isExist, err = IsEmailUsed(u.Email)
if err != nil {
return nil, err
return err
} else if isExist {
return nil, ErrEmailAlreadyUsed
return ErrEmailAlreadyUsed
}
user.LowerName = strings.ToLower(user.Name)
user.Avatar = base.EncodeMd5(user.Email)
user.AvatarEmail = user.Email
user.Rands = GetUserSalt()
user.Salt = GetUserSalt()
user.EncodePasswd()
if _, err = orm.Insert(user); err != nil {
return nil, err
} else if err = os.MkdirAll(UserPath(user.Name), os.ModePerm); err != nil {
if _, err := orm.Id(user.Id).Delete(&User{}); err != nil {
return nil, errors.New(fmt.Sprintf(
"both create userpath %s and delete table record faild: %v", user.Name, err))
}
return nil, err
u.LowerName = strings.ToLower(u.Name)
u.Avatar = base.EncodeMd5(u.Email)
u.AvatarEmail = u.Email
u.Rands = GetUserSalt()
u.Salt = GetUserSalt()
u.EncodePasswd()
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}
if user.Id == 1 {
user.IsAdmin = true
user.IsActive = true
_, err = orm.Id(user.Id).UseBool().Update(user)
if _, err = sess.Insert(u); err != nil {
sess.Rollback()
return err
} else if err = os.MkdirAll(UserPath(u.Name), os.ModePerm); err != nil {
sess.Rollback()
return err
} else if err = sess.Commit(); err != nil {
return err
}
return user, err
// Auto-set admin for user whose ID is 1.
if u.Id == 1 {
u.IsAdmin = true
u.IsActive = true
_, err = x.Id(u.Id).UseBool().Update(u)
}
return err
}
// CountUsers returns number of users.
func CountUsers() int64 {
count, _ := x.Where("type=0").Count(new(User))
return count
}
// GetUsers returns given number of user objects with offset.
func GetUsers(num, offset int) ([]User, error) {
users := make([]User, 0, num)
err := orm.Limit(num, offset).Asc("id").Find(&users)
func GetUsers(num, offset int) ([]*User, error) {
users := make([]*User, 0, num)
err := x.Limit(num, offset).Where("type=0").Asc("id").Find(&users)
return users, err
}
@@ -190,7 +275,7 @@ func getVerifyUser(code string) (user *User) {
if user, err = GetUserByName(string(b)); user != nil {
return user
}
log.Error("user.getVerifyUser: %v", err)
log.Error(4, "user.getVerifyUser: %v", err)
}
return nil
@@ -203,7 +288,7 @@ func VerifyUserActiveCode(code string) (user *User) {
if user = getVerifyUser(code); user != nil {
// time limit code
prefix := code[:base.TimeLimitCodeLength]
data := base.ToStr(user.Id) + user.Email + user.LowerName + user.Passwd + user.Rands
data := com.ToStr(user.Id) + user.Email + user.LowerName + user.Passwd + user.Rands
if base.VerifyTimeLimitCode(data, minutes, prefix) {
return user
@@ -213,16 +298,20 @@ func VerifyUserActiveCode(code string) (user *User) {
}
// ChangeUserName changes all corresponding setting from old user name to new one.
func ChangeUserName(user *User, newUserName string) (err error) {
func ChangeUserName(u *User, newUserName string) (err error) {
if !IsLegalName(newUserName) {
return ErrUserNameIllegal
}
newUserName = strings.ToLower(newUserName)
// Update accesses of user.
accesses := make([]Access, 0, 10)
if err = orm.Find(&accesses, &Access{UserName: user.LowerName}); err != nil {
if err = x.Find(&accesses, &Access{UserName: u.LowerName}); err != nil {
return err
}
sess := orm.NewSession()
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
return err
@@ -230,36 +319,38 @@ func ChangeUserName(user *User, newUserName string) (err error) {
for i := range accesses {
accesses[i].UserName = newUserName
if strings.HasPrefix(accesses[i].RepoName, user.LowerName+"/") {
accesses[i].RepoName = strings.Replace(accesses[i].RepoName, user.LowerName, newUserName, 1)
if strings.HasPrefix(accesses[i].RepoName, u.LowerName+"/") {
accesses[i].RepoName = strings.Replace(accesses[i].RepoName, u.LowerName, newUserName, 1)
}
if err = UpdateAccessWithSession(sess, &accesses[i]); err != nil {
return err
}
}
repos, err := GetRepositories(user.Id, true)
repos, err := GetRepositories(u.Id, true)
if err != nil {
return err
}
for i := range repos {
accesses = make([]Access, 0, 10)
// Update accesses of user repository.
if err = orm.Find(&accesses, &Access{RepoName: user.LowerName + "/" + repos[i].LowerName}); err != nil {
if err = x.Find(&accesses, &Access{RepoName: u.LowerName + "/" + repos[i].LowerName}); err != nil {
return err
}
for j := range accesses {
accesses[j].UserName = newUserName
accesses[j].RepoName = newUserName + "/" + repos[i].LowerName
if err = UpdateAccessWithSession(sess, &accesses[j]); err != nil {
return err
// if the access is not the user's access (already updated above)
if accesses[j].UserName != u.LowerName {
accesses[j].RepoName = newUserName + "/" + repos[i].LowerName
if err = UpdateAccessWithSession(sess, &accesses[j]); err != nil {
return err
}
}
}
}
// Change user directory name.
if err = os.Rename(UserPath(user.LowerName), UserPath(newUserName)); err != nil {
if err = os.Rename(UserPath(u.LowerName), UserPath(newUserName)); err != nil {
sess.Rollback()
return err
}
@@ -268,60 +359,68 @@ func ChangeUserName(user *User, newUserName string) (err error) {
}
// UpdateUser updates user's information.
func UpdateUser(user *User) (err error) {
user.LowerName = strings.ToLower(user.Name)
func UpdateUser(u *User) error {
u.LowerName = strings.ToLower(u.Name)
if len(user.Location) > 255 {
user.Location = user.Location[:255]
if len(u.Location) > 255 {
u.Location = u.Location[:255]
}
if len(user.Website) > 255 {
user.Website = user.Website[:255]
if len(u.Website) > 255 {
u.Website = u.Website[:255]
}
if len(u.Description) > 255 {
u.Description = u.Description[:255]
}
_, err = orm.Id(user.Id).AllCols().Update(user)
_, err := x.Id(u.Id).AllCols().Update(u)
return err
}
// DeleteUser completely deletes everything of the user.
func DeleteUser(user *User) error {
// TODO: need some kind of mechanism to record failure.
// DeleteUser completely and permanently deletes everything of user.
func DeleteUser(u *User) error {
// Check ownership of repository.
count, err := GetRepositoryCount(user)
count, err := GetRepositoryCount(u)
if err != nil {
return errors.New("modesl.GetRepositories: " + err.Error())
return errors.New("GetRepositoryCount: " + err.Error())
} else if count > 0 {
return ErrUserOwnRepos
}
// Check membership of organization.
count, err = u.GetOrganizationCount()
if err != nil {
return errors.New("modesl.GetRepositories(GetOrganizationCount): " + err.Error())
} else if count > 0 {
return ErrUserHasOrgs
}
// TODO: check issues, other repos' commits
// TODO: roll backable in some point.
// Delete all followers.
if _, err = orm.Delete(&Follow{FollowId: user.Id}); err != nil {
if _, err = x.Delete(&Follow{FollowId: u.Id}); err != nil {
return err
}
// Delete oauth2.
if _, err = orm.Delete(&Oauth2{Uid: user.Id}); err != nil {
if _, err = x.Delete(&Oauth2{Uid: u.Id}); err != nil {
return err
}
// Delete all feeds.
if _, err = orm.Delete(&Action{UserId: user.Id}); err != nil {
if _, err = x.Delete(&Action{UserId: u.Id}); err != nil {
return err
}
// Delete all watches.
if _, err = orm.Delete(&Watch{UserId: user.Id}); err != nil {
if _, err = x.Delete(&Watch{UserId: u.Id}); err != nil {
return err
}
// Delete all accesses.
if _, err = orm.Delete(&Access{UserName: user.LowerName}); err != nil {
if _, err = x.Delete(&Access{UserName: u.LowerName}); err != nil {
return err
}
// Delete all SSH keys.
keys := make([]*PublicKey, 0, 10)
if err = orm.Find(&keys, &PublicKey{OwnerId: user.Id}); err != nil {
if err = x.Find(&keys, &PublicKey{OwnerId: u.Id}); err != nil {
return err
}
for _, key := range keys {
@@ -331,11 +430,17 @@ func DeleteUser(user *User) error {
}
// Delete user directory.
if err = os.RemoveAll(UserPath(user.Name)); err != nil {
if err = os.RemoveAll(UserPath(u.Name)); err != nil {
return err
}
_, err = orm.Delete(user)
_, err = x.Delete(u)
return err
}
// DeleteInactivateUsers deletes all inactivate users.
func DeleteInactivateUsers() error {
_, err := x.Where("is_active=?", false).Delete(new(User))
return err
}
@@ -347,7 +452,7 @@ func UserPath(userName string) string {
func GetUserByKeyId(keyId int64) (*User, error) {
user := new(User)
rawSql := "SELECT a.* FROM `user` AS a, public_key AS b WHERE a.id = b.owner_id AND b.id=?"
has, err := orm.Sql(rawSql, keyId).Get(user)
has, err := x.Sql(rawSql, keyId).Get(user)
if err != nil {
return nil, err
} else if !has {
@@ -356,17 +461,16 @@ func GetUserByKeyId(keyId int64) (*User, error) {
return user, nil
}
// GetUserById returns the user object by given id if exists.
// GetUserById returns the user object by given ID if exists.
func GetUserById(id int64) (*User, error) {
user := new(User)
has, err := orm.Id(id).Get(user)
u := new(User)
has, err := x.Id(id).Get(u)
if err != nil {
return nil, err
}
if !has {
} else if !has {
return nil, ErrUserNotExist
}
return user, nil
return u, nil
}
// GetUserByName returns the user object by given name if exists.
@@ -375,7 +479,7 @@ func GetUserByName(name string) (*User, error) {
return nil, ErrUserNotExist
}
user := &User{LowerName: strings.ToLower(name)}
has, err := orm.Get(user)
has, err := x.Get(user)
if err != nil {
return nil, err
} else if !has {
@@ -410,13 +514,56 @@ func GetUserIdsByNames(names []string) []int64 {
return ids
}
// UserCommit represtns a commit with validation of user.
type UserCommit struct {
UserName string
*git.Commit
}
// ValidateCommitWithEmail chceck if author's e-mail of commit is corresponsind to a user.
func ValidateCommitWithEmail(c *git.Commit) (uname string) {
u, err := GetUserByEmail(c.Author.Email)
if err == nil {
uname = u.Name
}
return uname
}
// ValidateCommitsWithEmails checks if authors' e-mails of commits are corresponding to users.
func ValidateCommitsWithEmails(oldCommits *list.List) *list.List {
emails := map[string]string{}
newCommits := list.New()
e := oldCommits.Front()
for e != nil {
c := e.Value.(*git.Commit)
uname := ""
if v, ok := emails[c.Author.Email]; !ok {
u, err := GetUserByEmail(c.Author.Email)
if err == nil {
uname = u.Name
}
emails[c.Author.Email] = uname
} else {
uname = v
}
newCommits.PushBack(UserCommit{
UserName: uname,
Commit: c,
})
e = e.Next()
}
return newCommits
}
// GetUserByEmail returns the user object by given e-mail if exists.
func GetUserByEmail(email string) (*User, error) {
if len(email) == 0 {
return nil, ErrUserNotExist
}
user := &User{Email: strings.ToLower(email)}
has, err := orm.Get(user)
has, err := x.Get(user)
if err != nil {
return nil, err
} else if !has {
@@ -426,21 +573,21 @@ func GetUserByEmail(email string) (*User, error) {
}
// SearchUserByName returns given number of users whose name contains keyword.
func SearchUserByName(key string, limit int) (us []*User, err error) {
func SearchUserByName(opt SearchOption) (us []*User, err error) {
// Prevent SQL inject.
key = strings.TrimSpace(key)
if len(key) == 0 {
opt.Keyword = strings.TrimSpace(opt.Keyword)
if len(opt.Keyword) == 0 {
return us, nil
}
key = strings.Split(key, " ")[0]
if len(key) == 0 {
opt.Keyword = strings.Split(opt.Keyword, " ")[0]
if len(opt.Keyword) == 0 {
return us, nil
}
key = strings.ToLower(key)
opt.Keyword = strings.ToLower(opt.Keyword)
us = make([]*User, 0, limit)
err = orm.Limit(limit).Where("lower_name like '%" + key + "%'").Find(&us)
us = make([]*User, 0, opt.Limit)
err = x.Limit(opt.Limit).Where("type=0").And("lower_name like '%" + opt.Keyword + "%'").Find(&us)
return us, err
}
@@ -453,32 +600,32 @@ type Follow struct {
// FollowUser marks someone be another's follower.
func FollowUser(userId int64, followId int64) (err error) {
session := orm.NewSession()
defer session.Close()
session.Begin()
sess := x.NewSession()
defer sess.Close()
sess.Begin()
if _, err = session.Insert(&Follow{UserId: userId, FollowId: followId}); err != nil {
session.Rollback()
if _, err = sess.Insert(&Follow{UserId: userId, FollowId: followId}); err != nil {
sess.Rollback()
return err
}
rawSql := "UPDATE `user` SET num_followers = num_followers + 1 WHERE id = ?"
if _, err = session.Exec(rawSql, followId); err != nil {
session.Rollback()
if _, err = sess.Exec(rawSql, followId); err != nil {
sess.Rollback()
return err
}
rawSql = "UPDATE `user` SET num_followings = num_followings + 1 WHERE id = ?"
if _, err = session.Exec(rawSql, userId); err != nil {
session.Rollback()
if _, err = sess.Exec(rawSql, userId); err != nil {
sess.Rollback()
return err
}
return session.Commit()
return sess.Commit()
}
// UnFollowUser unmarks someone be another's follower.
func UnFollowUser(userId int64, unFollowId int64) (err error) {
session := orm.NewSession()
session := x.NewSession()
defer session.Close()
session.Begin()
@@ -500,3 +647,45 @@ func UnFollowUser(userId int64, unFollowId int64) (err error) {
}
return session.Commit()
}
func UpdateMentions(userNames []string, issueId int64) error {
users := make([]*User, 0, len(userNames))
if err := x.Where("name IN (?)", strings.Join(userNames, "\",\"")).OrderBy("name ASC").Find(&users); err != nil {
return err
}
ids := make([]int64, 0, len(userNames))
for _, user := range users {
ids = append(ids, user.Id)
if user.Type == INDIVIDUAL {
continue
}
if user.NumMembers == 0 {
continue
}
tempIds := make([]int64, 0, user.NumMembers)
orgUsers, err := GetOrgUsersByOrgId(user.Id)
if err != nil {
return err
}
for _, orgUser := range orgUsers {
tempIds = append(tempIds, orgUser.Id)
}
ids = append(ids, tempIds...)
}
if err := UpdateIssueUserPairsByMentions(ids, issueId); err != nil {
return err
}
return nil
}

View File

@@ -7,49 +7,71 @@ package models
import (
"encoding/json"
"errors"
"io/ioutil"
"time"
"github.com/gogits/gogs/modules/httplib"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
"github.com/gogits/gogs/modules/uuid"
)
var (
ErrWebhookNotExist = errors.New("Webhook does not exist")
)
// Content types.
type HookContentType int
const (
CT_JSON = iota + 1
CT_FORM
JSON HookContentType = iota + 1
FORM
)
// HookEvent represents events that will delivery hook.
type HookEvent struct {
PushOnly bool `json:"push_only"`
}
// Webhook represents a web hook object.
type Webhook struct {
Id int64
RepoId int64
Url string `xorm:"TEXT"`
ContentType int
Secret string `xorm:"TEXT"`
Events string `xorm:"TEXT"`
*HookEvent `xorm:"-"`
IsSsl bool
IsActive bool
Id int64
RepoId int64
Url string `xorm:"TEXT"`
ContentType HookContentType
Secret string `xorm:"TEXT"`
Events string `xorm:"TEXT"`
*HookEvent `xorm:"-"`
IsSsl bool
IsActive bool
HookTaskType HookTaskType
Meta string `xorm:"TEXT"` // store hook-specific attributes
OrgId int64
}
// GetEvent handles conversion from Events to HookEvent.
func (w *Webhook) GetEvent() {
w.HookEvent = &HookEvent{}
if err := json.Unmarshal([]byte(w.Events), w.HookEvent); err != nil {
log.Error("webhook.GetEvent(%d): %v", w.Id, err)
log.Error(4, "webhook.GetEvent(%d): %v", w.Id, err)
}
}
func (w *Webhook) SaveEvent() error {
func (w *Webhook) GetSlackHook() *Slack {
s := &Slack{}
if err := json.Unmarshal([]byte(w.Meta), s); err != nil {
log.Error(4, "webhook.GetSlackHook(%d): %v", w.Id, err)
}
return s
}
// UpdateEvent handles conversion from HookEvent to Events.
func (w *Webhook) UpdateEvent() error {
data, err := json.Marshal(w.HookEvent)
w.Events = string(data)
return err
}
// HasPushEvent returns true if hook enbaled push event.
func (w *Webhook) HasPushEvent() bool {
if w.PushOnly {
return true
@@ -57,22 +79,16 @@ func (w *Webhook) HasPushEvent() bool {
return false
}
// CreateWebhook creates new webhook.
// CreateWebhook creates a new web hook.
func CreateWebhook(w *Webhook) error {
_, err := orm.Insert(w)
return err
}
// UpdateWebhook updates information of webhook.
func UpdateWebhook(w *Webhook) error {
_, err := orm.AllCols().Update(w)
_, err := x.Insert(w)
return err
}
// GetWebhookById returns webhook by given ID.
func GetWebhookById(hookId int64) (*Webhook, error) {
w := &Webhook{Id: hookId}
has, err := orm.Get(w)
has, err := x.Get(w)
if err != nil {
return nil, err
} else if !has {
@@ -83,18 +99,218 @@ func GetWebhookById(hookId int64) (*Webhook, error) {
// GetActiveWebhooksByRepoId returns all active webhooks of repository.
func GetActiveWebhooksByRepoId(repoId int64) (ws []*Webhook, err error) {
err = orm.Find(&ws, &Webhook{RepoId: repoId, IsActive: true})
err = x.Where("repo_id=?", repoId).And("is_active=?", true).Find(&ws)
return ws, err
}
// GetWebhooksByRepoId returns all webhooks of repository.
func GetWebhooksByRepoId(repoId int64) (ws []*Webhook, err error) {
err = orm.Find(&ws, &Webhook{RepoId: repoId})
err = x.Find(&ws, &Webhook{RepoId: repoId})
return ws, err
}
// UpdateWebhook updates information of webhook.
func UpdateWebhook(w *Webhook) error {
_, err := x.Id(w.Id).AllCols().Update(w)
return err
}
// DeleteWebhook deletes webhook of repository.
func DeleteWebhook(hookId int64) error {
_, err := orm.Delete(&Webhook{Id: hookId})
_, err := x.Delete(&Webhook{Id: hookId})
return err
}
// GetWebhooksByOrgId returns all webhooks for an organization.
func GetWebhooksByOrgId(orgId int64) (ws []*Webhook, err error) {
err = x.Find(&ws, &Webhook{OrgId: orgId})
return ws, err
}
// GetActiveWebhooksByOrgId returns all active webhooks for an organization.
func GetActiveWebhooksByOrgId(orgId int64) (ws []*Webhook, err error) {
err = x.Where("org_id=?", orgId).And("is_active=?", true).Find(&ws)
return ws, err
}
// ___ ___ __ ___________ __
// / | \ ____ ____ | | _\__ ___/____ _____| | __
// / ~ \/ _ \ / _ \| |/ / | | \__ \ / ___/ |/ /
// \ Y ( <_> | <_> ) < | | / __ \_\___ \| <
// \___|_ / \____/ \____/|__|_ \ |____| (____ /____ >__|_ \
// \/ \/ \/ \/ \/
type HookTaskType int
const (
GOGS HookTaskType = iota + 1
SLACK
)
type HookEventType string
const (
PUSH HookEventType = "push"
)
type PayloadAuthor struct {
Name string `json:"name"`
Email string `json:"email"`
UserName string `json:"username"`
}
type PayloadCommit struct {
Id string `json:"id"`
Message string `json:"message"`
Url string `json:"url"`
Author *PayloadAuthor `json:"author"`
}
type PayloadRepo struct {
Id int64 `json:"id"`
Name string `json:"name"`
Url string `json:"url"`
Description string `json:"description"`
Website string `json:"website"`
Watchers int `json:"watchers"`
Owner *PayloadAuthor `json:"owner"`
Private bool `json:"private"`
}
type BasePayload interface {
GetJSONPayload() ([]byte, error)
}
// Payload represents a payload information of hook.
type Payload struct {
Secret string `json:"secret"`
Ref string `json:"ref"`
Commits []*PayloadCommit `json:"commits"`
Repo *PayloadRepo `json:"repository"`
Pusher *PayloadAuthor `json:"pusher"`
Before string `json:"before"`
After string `json:"after"`
CompareUrl string `json:"compare_url"`
}
func (p Payload) GetJSONPayload() ([]byte, error) {
data, err := json.Marshal(p)
if err != nil {
return []byte{}, err
}
return data, nil
}
// HookTask represents a hook task.
type HookTask struct {
Id int64
Uuid string
Type HookTaskType
Url string
BasePayload `xorm:"-"`
PayloadContent string `xorm:"TEXT"`
ContentType HookContentType
EventType HookEventType
IsSsl bool
IsDelivered bool
IsSucceed bool
}
// CreateHookTask creates a new hook task,
// it handles conversion from Payload to PayloadContent.
func CreateHookTask(t *HookTask) error {
data, err := t.BasePayload.GetJSONPayload()
if err != nil {
return err
}
t.Uuid = uuid.NewV4().String()
t.PayloadContent = string(data)
_, err = x.Insert(t)
return err
}
// UpdateHookTask updates information of hook task.
func UpdateHookTask(t *HookTask) error {
_, err := x.Id(t.Id).AllCols().Update(t)
return err
}
var (
// Prevent duplicate deliveries.
// This happens with massive hook tasks cannot finish delivering
// before next shooting starts.
isShooting = false
)
// DeliverHooks checks and delivers undelivered hooks.
// FIXME: maybe can use goroutine to shoot a number of them at same time?
func DeliverHooks() {
if isShooting {
return
}
isShooting = true
defer func() { isShooting = false }()
tasks := make([]*HookTask, 0, 10)
timeout := time.Duration(setting.WebhookDeliverTimeout) * time.Second
x.Where("is_delivered=?", false).Iterate(new(HookTask),
func(idx int, bean interface{}) error {
t := bean.(*HookTask)
req := httplib.Post(t.Url).SetTimeout(timeout, timeout).
Header("X-Gogs-Delivery", t.Uuid).
Header("X-Gogs-Event", string(t.EventType))
switch t.ContentType {
case JSON:
req = req.Header("Content-Type", "application/json").Body(t.PayloadContent)
case FORM:
req.Param("payload", t.PayloadContent)
}
t.IsDelivered = true
// FIXME: record response.
switch t.Type {
case GOGS:
{
if _, err := req.Response(); err != nil {
log.Error(4, "Delivery: %v", err)
} else {
t.IsSucceed = true
}
}
case SLACK:
{
if res, err := req.Response(); err != nil {
log.Error(4, "Delivery: %v", err)
} else {
defer res.Body.Close()
contents, err := ioutil.ReadAll(res.Body)
if err != nil {
log.Error(4, "%s", err)
} else {
if string(contents) != "ok" {
log.Error(4, "slack failed with: %s", string(contents))
} else {
t.IsSucceed = true
}
}
}
}
}
tasks = append(tasks, t)
if t.IsSucceed {
log.Trace("Hook delivered(%s): %s", t.Uuid, t.PayloadContent)
}
return nil
})
// Update hook task status.
for _, t := range tasks {
if err := UpdateHookTask(t); err != nil {
log.Error(4, "UpdateHookTask(%d): %v", t.Id, err)
}
}
}

27
modules/asn1-ber/LICENSE Normal file
View File

@@ -0,0 +1,27 @@
Copyright (c) 2012 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

11
modules/asn1-ber/Makefile Normal file
View File

@@ -0,0 +1,11 @@
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
include $(GOROOT)/src/Make.inc
TARG=github.com/mmitton/asn1-ber
GOFILES=\
ber.go\
include $(GOROOT)/src/Make.pkg

14
modules/asn1-ber/README Normal file
View File

@@ -0,0 +1,14 @@
ASN1 BER Encoding / Decoding Library for the GO programming language.
Required Librarys:
None
Working:
Very basic encoding / decoding needed for LDAP protocol
Tests Implemented:
None
TODO:
Fix all encoding / decoding to conform to ASN1 BER spec
Implement Tests / Benchmarks

492
modules/asn1-ber/ber.go Normal file
View File

@@ -0,0 +1,492 @@
package ber
import (
"bytes"
"fmt"
"io"
"reflect"
)
type Packet struct {
ClassType uint8
TagType uint8
Tag uint8
Value interface{}
ByteValue []byte
Data *bytes.Buffer
Children []*Packet
Description string
}
const (
TagEOC = 0x00
TagBoolean = 0x01
TagInteger = 0x02
TagBitString = 0x03
TagOctetString = 0x04
TagNULL = 0x05
TagObjectIdentifier = 0x06
TagObjectDescriptor = 0x07
TagExternal = 0x08
TagRealFloat = 0x09
TagEnumerated = 0x0a
TagEmbeddedPDV = 0x0b
TagUTF8String = 0x0c
TagRelativeOID = 0x0d
TagSequence = 0x10
TagSet = 0x11
TagNumericString = 0x12
TagPrintableString = 0x13
TagT61String = 0x14
TagVideotexString = 0x15
TagIA5String = 0x16
TagUTCTime = 0x17
TagGeneralizedTime = 0x18
TagGraphicString = 0x19
TagVisibleString = 0x1a
TagGeneralString = 0x1b
TagUniversalString = 0x1c
TagCharacterString = 0x1d
TagBMPString = 0x1e
TagBitmask = 0x1f // xxx11111b
)
var TagMap = map[uint8]string{
TagEOC: "EOC (End-of-Content)",
TagBoolean: "Boolean",
TagInteger: "Integer",
TagBitString: "Bit String",
TagOctetString: "Octet String",
TagNULL: "NULL",
TagObjectIdentifier: "Object Identifier",
TagObjectDescriptor: "Object Descriptor",
TagExternal: "External",
TagRealFloat: "Real (float)",
TagEnumerated: "Enumerated",
TagEmbeddedPDV: "Embedded PDV",
TagUTF8String: "UTF8 String",
TagRelativeOID: "Relative-OID",
TagSequence: "Sequence and Sequence of",
TagSet: "Set and Set OF",
TagNumericString: "Numeric String",
TagPrintableString: "Printable String",
TagT61String: "T61 String",
TagVideotexString: "Videotex String",
TagIA5String: "IA5 String",
TagUTCTime: "UTC Time",
TagGeneralizedTime: "Generalized Time",
TagGraphicString: "Graphic String",
TagVisibleString: "Visible String",
TagGeneralString: "General String",
TagUniversalString: "Universal String",
TagCharacterString: "Character String",
TagBMPString: "BMP String",
}
const (
ClassUniversal = 0 // 00xxxxxxb
ClassApplication = 64 // 01xxxxxxb
ClassContext = 128 // 10xxxxxxb
ClassPrivate = 192 // 11xxxxxxb
ClassBitmask = 192 // 11xxxxxxb
)
var ClassMap = map[uint8]string{
ClassUniversal: "Universal",
ClassApplication: "Application",
ClassContext: "Context",
ClassPrivate: "Private",
}
const (
TypePrimitive = 0 // xx0xxxxxb
TypeConstructed = 32 // xx1xxxxxb
TypeBitmask = 32 // xx1xxxxxb
)
var TypeMap = map[uint8]string{
TypePrimitive: "Primative",
TypeConstructed: "Constructed",
}
var Debug bool = false
func PrintBytes(buf []byte, indent string) {
data_lines := make([]string, (len(buf)/30)+1)
num_lines := make([]string, (len(buf)/30)+1)
for i, b := range buf {
data_lines[i/30] += fmt.Sprintf("%02x ", b)
num_lines[i/30] += fmt.Sprintf("%02d ", (i+1)%100)
}
for i := 0; i < len(data_lines); i++ {
fmt.Print(indent + data_lines[i] + "\n")
fmt.Print(indent + num_lines[i] + "\n\n")
}
}
func PrintPacket(p *Packet) {
printPacket(p, 0, false)
}
func printPacket(p *Packet, indent int, printBytes bool) {
indent_str := ""
for len(indent_str) != indent {
indent_str += " "
}
class_str := ClassMap[p.ClassType]
tagtype_str := TypeMap[p.TagType]
tag_str := fmt.Sprintf("0x%02X", p.Tag)
if p.ClassType == ClassUniversal {
tag_str = TagMap[p.Tag]
}
value := fmt.Sprint(p.Value)
description := ""
if p.Description != "" {
description = p.Description + ": "
}
fmt.Printf("%s%s(%s, %s, %s) Len=%d %q\n", indent_str, description, class_str, tagtype_str, tag_str, p.Data.Len(), value)
if printBytes {
PrintBytes(p.Bytes(), indent_str)
}
for _, child := range p.Children {
printPacket(child, indent+1, printBytes)
}
}
func resizeBuffer(in []byte, new_size uint64) (out []byte) {
out = make([]byte, new_size)
copy(out, in)
return
}
func readBytes(reader io.Reader, buf []byte) error {
idx := 0
buflen := len(buf)
for idx < buflen {
n, err := reader.Read(buf[idx:])
if err != nil {
return err
}
idx += n
}
return nil
}
func ReadPacket(reader io.Reader) (*Packet, error) {
buf := make([]byte, 2)
err := readBytes(reader, buf)
if err != nil {
return nil, err
}
idx := uint64(2)
datalen := uint64(buf[1])
if Debug {
fmt.Printf("Read: datalen = %d len(buf) = %d ", datalen, len(buf))
for _, b := range buf {
fmt.Printf("%02X ", b)
}
fmt.Printf("\n")
}
if datalen&128 != 0 {
a := datalen - 128
idx += a
buf = resizeBuffer(buf, 2+a)
err := readBytes(reader, buf[2:])
if err != nil {
return nil, err
}
datalen = DecodeInteger(buf[2 : 2+a])
if Debug {
fmt.Printf("Read: a = %d idx = %d datalen = %d len(buf) = %d", a, idx, datalen, len(buf))
for _, b := range buf {
fmt.Printf("%02X ", b)
}
fmt.Printf("\n")
}
}
buf = resizeBuffer(buf, idx+datalen)
err = readBytes(reader, buf[idx:])
if err != nil {
return nil, err
}
if Debug {
fmt.Printf("Read: len( buf ) = %d idx=%d datalen=%d idx+datalen=%d\n", len(buf), idx, datalen, idx+datalen)
for _, b := range buf {
fmt.Printf("%02X ", b)
}
}
p := DecodePacket(buf)
return p, nil
}
func DecodeString(data []byte) (ret string) {
for _, c := range data {
ret += fmt.Sprintf("%c", c)
}
return
}
func DecodeInteger(data []byte) (ret uint64) {
for _, i := range data {
ret = ret * 256
ret = ret + uint64(i)
}
return
}
func EncodeInteger(val uint64) []byte {
var out bytes.Buffer
found := false
shift := uint(56)
mask := uint64(0xFF00000000000000)
for mask > 0 {
if !found && (val&mask != 0) {
found = true
}
if found || (shift == 0) {
out.Write([]byte{byte((val & mask) >> shift)})
}
shift -= 8
mask = mask >> 8
}
return out.Bytes()
}
func DecodePacket(data []byte) *Packet {
p, _ := decodePacket(data)
return p
}
func decodePacket(data []byte) (*Packet, []byte) {
if Debug {
fmt.Printf("decodePacket: enter %d\n", len(data))
}
p := new(Packet)
p.ClassType = data[0] & ClassBitmask
p.TagType = data[0] & TypeBitmask
p.Tag = data[0] & TagBitmask
datalen := DecodeInteger(data[1:2])
datapos := uint64(2)
if datalen&128 != 0 {
datalen -= 128
datapos += datalen
datalen = DecodeInteger(data[2 : 2+datalen])
}
p.Data = new(bytes.Buffer)
p.Children = make([]*Packet, 0, 2)
p.Value = nil
value_data := data[datapos : datapos+datalen]
if p.TagType == TypeConstructed {
for len(value_data) != 0 {
var child *Packet
child, value_data = decodePacket(value_data)
p.AppendChild(child)
}
} else if p.ClassType == ClassUniversal {
p.Data.Write(data[datapos : datapos+datalen])
p.ByteValue = value_data
switch p.Tag {
case TagEOC:
case TagBoolean:
val := DecodeInteger(value_data)
p.Value = val != 0
case TagInteger:
p.Value = DecodeInteger(value_data)
case TagBitString:
case TagOctetString:
p.Value = DecodeString(value_data)
case TagNULL:
case TagObjectIdentifier:
case TagObjectDescriptor:
case TagExternal:
case TagRealFloat:
case TagEnumerated:
p.Value = DecodeInteger(value_data)
case TagEmbeddedPDV:
case TagUTF8String:
case TagRelativeOID:
case TagSequence:
case TagSet:
case TagNumericString:
case TagPrintableString:
p.Value = DecodeString(value_data)
case TagT61String:
case TagVideotexString:
case TagIA5String:
case TagUTCTime:
case TagGeneralizedTime:
case TagGraphicString:
case TagVisibleString:
case TagGeneralString:
case TagUniversalString:
case TagCharacterString:
case TagBMPString:
}
} else {
p.Data.Write(data[datapos : datapos+datalen])
}
return p, data[datapos+datalen:]
}
func (p *Packet) DataLength() uint64 {
return uint64(p.Data.Len())
}
func (p *Packet) Bytes() []byte {
var out bytes.Buffer
out.Write([]byte{p.ClassType | p.TagType | p.Tag})
packet_length := EncodeInteger(p.DataLength())
if p.DataLength() > 127 || len(packet_length) > 1 {
out.Write([]byte{byte(len(packet_length) | 128)})
out.Write(packet_length)
} else {
out.Write(packet_length)
}
out.Write(p.Data.Bytes())
return out.Bytes()
}
func (p *Packet) AppendChild(child *Packet) {
p.Data.Write(child.Bytes())
if len(p.Children) == cap(p.Children) {
newChildren := make([]*Packet, cap(p.Children)*2)
copy(newChildren, p.Children)
p.Children = newChildren[0:len(p.Children)]
}
p.Children = p.Children[0 : len(p.Children)+1]
p.Children[len(p.Children)-1] = child
}
func Encode(ClassType, TagType, Tag uint8, Value interface{}, Description string) *Packet {
p := new(Packet)
p.ClassType = ClassType
p.TagType = TagType
p.Tag = Tag
p.Data = new(bytes.Buffer)
p.Children = make([]*Packet, 0, 2)
p.Value = Value
p.Description = Description
if Value != nil {
v := reflect.ValueOf(Value)
if ClassType == ClassUniversal {
switch Tag {
case TagOctetString:
sv, ok := v.Interface().(string)
if ok {
p.Data.Write([]byte(sv))
}
}
}
}
return p
}
func NewSequence(Description string) *Packet {
return Encode(ClassUniversal, TypePrimitive, TagSequence, nil, Description)
}
func NewBoolean(ClassType, TagType, Tag uint8, Value bool, Description string) *Packet {
intValue := 0
if Value {
intValue = 1
}
p := Encode(ClassType, TagType, Tag, nil, Description)
p.Value = Value
p.Data.Write(EncodeInteger(uint64(intValue)))
return p
}
func NewInteger(ClassType, TagType, Tag uint8, Value uint64, Description string) *Packet {
p := Encode(ClassType, TagType, Tag, nil, Description)
p.Value = Value
p.Data.Write(EncodeInteger(Value))
return p
}
func NewString(ClassType, TagType, Tag uint8, Value, Description string) *Packet {
p := Encode(ClassType, TagType, Tag, nil, Description)
p.Value = Value
p.Data.Write([]byte(Value))
return p
}

View File

@@ -5,17 +5,15 @@
package auth
import (
"net/http"
"reflect"
"github.com/Unknwon/macaron"
"github.com/macaron-contrib/i18n"
"github.com/go-martini/martini"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware/binding"
)
type AdminEditUserForm struct {
Email string `form:"email" binding:"Required;Email;MaxSize(50)"`
Passwd string `form:"password"`
Website string `form:"website" binding:"MaxSize(50)"`
Location string `form:"location" binding:"MaxSize(50)"`
Avatar string `form:"avatar" binding:"Required;Email;MaxSize(50)"`
@@ -24,17 +22,6 @@ type AdminEditUserForm struct {
LoginType int `form:"login_type"`
}
func (f *AdminEditUserForm) Name(field string) string {
names := map[string]string{
"Email": "E-mail address",
"Website": "Website",
"Location": "Location",
"Avatar": "Gravatar Email",
}
return names[field]
}
func (f *AdminEditUserForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
func (f *AdminEditUserForm) Validate(ctx *macaron.Context, errs *binding.Errors, l i18n.Locale) {
validate(errs, ctx.Data, f, l)
}

View File

@@ -5,13 +5,12 @@
package apiv1
import (
"net/http"
"reflect"
"github.com/go-martini/martini"
"github.com/Unknwon/macaron"
"github.com/macaron-contrib/i18n"
"github.com/gogits/gogs/modules/auth"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware/binding"
)
@@ -22,17 +21,16 @@ type MarkdownForm struct {
Context string `form:"context"`
}
func (f *MarkdownForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) {
data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validateApiReq(errs, data, f)
func (f *MarkdownForm) Validate(ctx *macaron.Context, errs *binding.Errors, l i18n.Locale) {
validateApiReq(errs, ctx.Data, f, l)
}
func validateApiReq(errs *binding.Errors, data base.TmplData, f interface{}) {
func validateApiReq(errs *binding.Errors, data map[string]interface{}, f interface{}, l i18n.Locale) {
if errs.Count() == 0 {
return
} else if len(errs.Overall) > 0 {
for _, err := range errs.Overall {
log.Error("%s: %v", reflect.TypeOf(f), err)
log.Error(4, "%s: %v", reflect.TypeOf(f), err)
}
return
}
@@ -65,9 +63,9 @@ func validateApiReq(errs *binding.Errors, data base.TmplData, f interface{}) {
case binding.BindingAlphaDashDotError:
data["ErrorMsg"] = fieldName + " must be valid alpha or numeric or dash(-_) or dot characters"
case binding.BindingMinSizeError:
data["ErrorMsg"] = fieldName + " must contain at least " + auth.GetMinMaxSize(field) + " characters"
data["ErrorMsg"] = fieldName + " must contain at least " + auth.GetMinSize(field) + " characters"
case binding.BindingMaxSizeError:
data["ErrorMsg"] = fieldName + " must contain at most " + auth.GetMinMaxSize(field) + " characters"
data["ErrorMsg"] = fieldName + " must contain at most " + auth.GetMaxSize(field) + " characters"
case binding.BindingEmailError:
data["ErrorMsg"] = fieldName + " is not a valid e-mail address"
case binding.BindingUrlError:

View File

@@ -9,76 +9,112 @@ import (
"reflect"
"strings"
"github.com/go-martini/martini"
"github.com/macaron-contrib/i18n"
"github.com/macaron-contrib/session"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware/binding"
"github.com/gogits/gogs/modules/setting"
)
// Web form interface.
type Form interface {
Name(field string) string
}
type RegisterForm struct {
UserName string `form:"username" binding:"Required;AlphaDashDot;MaxSize(30)"`
Email string `form:"email" binding:"Required;Email;MaxSize(50)"`
Password string `form:"passwd" binding:"Required;MinSize(6);MaxSize(30)"`
RetypePasswd string `form:"retypepasswd"`
LoginType string `form:"logintype"`
LoginName string `form:"loginname"`
}
func (f *RegisterForm) Name(field string) string {
names := map[string]string{
"UserName": "Username",
"Email": "E-mail address",
"Password": "Password",
"RetypePasswd": "Re-type password",
// SignedInId returns the id of signed in user.
func SignedInId(header http.Header, sess session.Store) int64 {
if !models.HasEngine {
return 0
}
return names[field]
}
func (f *RegisterForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) {
data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errs, data, f)
}
type LogInForm struct {
UserName string `form:"username" binding:"Required;MaxSize(35)"`
Password string `form:"passwd" binding:"Required;MinSize(6);MaxSize(30)"`
Remember bool `form:"remember"`
}
func (f *LogInForm) Name(field string) string {
names := map[string]string{
"UserName": "Username",
"Password": "Password",
if setting.Service.EnableReverseProxyAuth {
webAuthUser := header.Get(setting.ReverseProxyAuthUser)
if len(webAuthUser) > 0 {
u, err := models.GetUserByName(webAuthUser)
if err != nil {
if err != models.ErrUserNotExist {
log.Error(4, "GetUserByName: %v", err)
}
return 0
}
return u.Id
}
}
return names[field]
uid := sess.Get("uid")
if uid == nil {
return 0
}
if id, ok := uid.(int64); ok {
if _, err := models.GetUserById(id); err != nil {
if err != models.ErrUserNotExist {
log.Error(4, "GetUserById: %v", err)
}
return 0
}
return id
}
return 0
}
func (f *LogInForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) {
data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errs, data, f)
// SignedInUser returns the user object of signed user.
func SignedInUser(header http.Header, sess session.Store) *models.User {
uid := SignedInId(header, sess)
if uid <= 0 {
return nil
}
u, err := models.GetUserById(uid)
if err != nil {
log.Error(4, "GetUserById: %v", err)
return nil
}
return u
}
func GetMinMaxSize(field reflect.StructField) string {
// AssignForm assign form values back to the template data.
func AssignForm(form interface{}, data map[string]interface{}) {
typ := reflect.TypeOf(form)
val := reflect.ValueOf(form)
if typ.Kind() == reflect.Ptr {
typ = typ.Elem()
val = val.Elem()
}
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)
fieldName := field.Tag.Get("form")
// Allow ignored fields in the struct
if fieldName == "-" {
continue
}
data[fieldName] = val.Field(i).Interface()
}
}
func getSize(field reflect.StructField, prefix string) string {
for _, rule := range strings.Split(field.Tag.Get("binding"), ";") {
if strings.HasPrefix(rule, "MinSize(") || strings.HasPrefix(rule, "MaxSize(") {
if strings.HasPrefix(rule, prefix) {
return rule[8 : len(rule)-1]
}
}
return ""
}
func validate(errs *binding.Errors, data base.TmplData, f Form) {
func GetMinSize(field reflect.StructField) string {
return getSize(field, "MinSize(")
}
func GetMaxSize(field reflect.StructField) string {
return getSize(field, "MaxSize(")
}
func validate(errs *binding.Errors, data map[string]interface{}, f interface{}, l i18n.Locale) {
if errs.Count() == 0 {
return
} else if len(errs.Overall) > 0 {
for _, err := range errs.Overall {
log.Error("%s: %v", reflect.TypeOf(f), err)
log.Error(4, "%s: %v", reflect.TypeOf(f), err)
}
return
}
@@ -105,85 +141,26 @@ func validate(errs *binding.Errors, data base.TmplData, f Form) {
if err, ok := errs.Fields[field.Name]; ok {
data["Err_"+field.Name] = true
trName := l.Tr("form." + field.Name)
switch err {
case binding.BindingRequireError:
data["ErrorMsg"] = f.Name(field.Name) + " cannot be empty"
data["ErrorMsg"] = trName + l.Tr("form.require_error")
case binding.BindingAlphaDashError:
data["ErrorMsg"] = f.Name(field.Name) + " must be valid alpha or numeric or dash(-_) characters"
data["ErrorMsg"] = trName + l.Tr("form.alpha_dash_error")
case binding.BindingAlphaDashDotError:
data["ErrorMsg"] = f.Name(field.Name) + " must be valid alpha or numeric or dash(-_) or dot characters"
data["ErrorMsg"] = trName + l.Tr("form.alpha_dash_dot_error")
case binding.BindingMinSizeError:
data["ErrorMsg"] = f.Name(field.Name) + " must contain at least " + GetMinMaxSize(field) + " characters"
data["ErrorMsg"] = trName + l.Tr("form.min_size_error", GetMinSize(field))
case binding.BindingMaxSizeError:
data["ErrorMsg"] = f.Name(field.Name) + " must contain at most " + GetMinMaxSize(field) + " characters"
data["ErrorMsg"] = trName + l.Tr("form.max_size_error", GetMaxSize(field))
case binding.BindingEmailError:
data["ErrorMsg"] = f.Name(field.Name) + " is not a valid e-mail address"
data["ErrorMsg"] = trName + l.Tr("form.email_error")
case binding.BindingUrlError:
data["ErrorMsg"] = f.Name(field.Name) + " is not a valid URL"
data["ErrorMsg"] = trName + l.Tr("form.url_error")
default:
data["ErrorMsg"] = "Unknown error: " + err
data["ErrorMsg"] = l.Tr("form.unknown_error") + " " + err
}
return
}
}
}
// AssignForm assign form values back to the template data.
func AssignForm(form interface{}, data base.TmplData) {
typ := reflect.TypeOf(form)
val := reflect.ValueOf(form)
if typ.Kind() == reflect.Ptr {
typ = typ.Elem()
val = val.Elem()
}
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)
fieldName := field.Tag.Get("form")
// Allow ignored fields in the struct
if fieldName == "-" {
continue
}
data[fieldName] = val.Field(i).Interface()
}
}
type InstallForm struct {
Database string `form:"database" binding:"Required"`
Host string `form:"host"`
User string `form:"user"`
Passwd string `form:"passwd"`
DatabaseName string `form:"database_name"`
SslMode string `form:"ssl_mode"`
DatabasePath string `form:"database_path"`
RepoRootPath string `form:"repo_path"`
RunUser string `form:"run_user"`
Domain string `form:"domain"`
AppUrl string `form:"app_url"`
AdminName string `form:"admin_name" binding:"Required;AlphaDashDot;MaxSize(30)"`
AdminPasswd string `form:"admin_pwd" binding:"Required;MinSize(6);MaxSize(30)"`
AdminEmail string `form:"admin_email" binding:"Required;Email;MaxSize(50)"`
SmtpHost string `form:"smtp_host"`
SmtpEmail string `form:"mailer_user"`
SmtpPasswd string `form:"mailer_pwd"`
RegisterConfirm string `form:"register_confirm"`
MailNotify string `form:"mail_notify"`
}
func (f *InstallForm) Name(field string) string {
names := map[string]string{
"Database": "Database name",
"AdminName": "Admin user name",
"AdminPasswd": "Admin password",
"AdminEmail": "Admin e-maill address",
}
return names[field]
}
func (f *InstallForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
}

View File

@@ -5,12 +5,9 @@
package auth
import (
"net/http"
"reflect"
"github.com/Unknwon/macaron"
"github.com/macaron-contrib/i18n"
"github.com/go-martini/martini"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware/binding"
)
@@ -34,22 +31,6 @@ type AuthenticationForm struct {
AllowAutoRegister bool `form:"allowautoregister"`
}
func (f *AuthenticationForm) Name(field string) string {
names := map[string]string{
"AuthName": "Authentication's name",
"Domain": "Domain name",
"Host": "Host address",
"Port": "Port Number",
"UseSSL": "Use SSL",
"BaseDN": "Base DN",
"Attributes": "Search attributes",
"Filter": "Search filter",
"MsAdSA": "Ms Ad SA",
}
return names[field]
}
func (f *AuthenticationForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
func (f *AuthenticationForm) Validate(ctx *macaron.Context, errs *binding.Errors, l i18n.Locale) {
validate(errs, ctx.Data, f, l)
}

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