Skip to content

Commit e851f00

Browse files
committed
Merge branch 'master' into issue-4173-alternative-fix
2 parents 0b219ce + eaf9ded commit e851f00

File tree

302 files changed

+12849
-4952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+12849
-4952
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ included in the next released version.
102102
Generally, the go build tools are installed as-needed in the `Makefile`.
103103
An exception are the tools to build the CSS and images.
104104

105-
- To build CSS: Install [Node.js](https://nodejs.org/en/download/package-manager)
105+
- To build CSS: Install [Node.js](https://nodejs.org/en/download/package-manager) at version 8.0 or above
106106
with `npm` and then run `npm install` and `make generate-stylesheets`.
107107
- To build Images: ImageMagick, inkscape and zopflipng binaries must be
108108
available in your `PATH` to run `make generate-images`.

Gopkg.lock

Lines changed: 29 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ ignored = ["google.golang.org/appengine*"]
1515
name = "code.gitea.io/sdk"
1616

1717
[[constraint]]
18-
# branch = "master"
19-
revision = "c74e08f039e56cef576e4336382b2a2d12d9e026"
18+
revision = "05d86ea8f6e30456949f612cf68cf4a27ce8c9c5"
2019
name = "github.com/blevesearch/bleve"
21-
#Not targetting v0.7.0 since standard where use only just after this tag
2220

2321
[[constraint]]
2422
revision = "12dd70caea0268ac0d6c2707d0611ef601e7c64e"
@@ -97,8 +95,8 @@ ignored = ["google.golang.org/appengine*"]
9795
version = "1.31.1"
9896

9997
[[constraint]]
100-
name = "gopkg.in/ldap.v2"
101-
version = "2.4.1"
98+
name = "gopkg.in/ldap.v3"
99+
version = "3.0.1"
102100

103101
[[constraint]]
104102
name = "gopkg.in/macaron.v1"
@@ -108,11 +106,6 @@ ignored = ["google.golang.org/appengine*"]
108106
name = "gopkg.in/testfixtures.v2"
109107
version = "2.0.0"
110108

111-
[[override]]
112-
name = "github.com/boltdb/bolt"
113-
revision = "ccd680d8c1a0179ac3d68f692b01e1a1589cbfc7"
114-
source = "github.com/go-gitea/bolt"
115-
116109
[[override]]
117110
branch = "master"
118111
name = "golang.org/x/oauth2"

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ Lanre Adelowo <[email protected]> (@adelowo)
2626
Konrad Langenberg <[email protected]> (@kolaente)
2727
He-Long Zhang <[email protected]> (@BetaCat0)
2828
Andrew Thornton <[email protected]> (@zeripath)
29+
John Olheiser <[email protected]> (@jolheiser)

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ IMPORT := code.gitea.io/gitea
44
GO ?= go
55
SED_INPLACE := sed -i
66

7+
export PATH := $($(GO) env GOPATH)/bin:$(PATH)
8+
79
ifeq ($(OS), Windows_NT)
810
EXECUTABLE := gitea.exe
911
else
@@ -365,10 +367,14 @@ stylesheets-check: generate-stylesheets
365367

366368
.PHONY: generate-stylesheets
367369
generate-stylesheets:
370+
@hash npx > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
371+
echo "Please install npm version 5.2+"; \
372+
exit 1; \
373+
fi;
368374
$(eval BROWSERS := "> 2%, last 2 firefox versions, last 2 safari versions")
369-
node_modules/.bin/lessc --clean-css public/less/index.less public/css/index.css
370-
$(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),node_modules/.bin/lessc --clean-css public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
371-
$(foreach file, $(wildcard public/css/*),node_modules/.bin/postcss --use autoprefixer --autoprefixer.browsers $(BROWSERS) -o $(file) $(file);)
375+
npx lessc --clean-css public/less/index.less public/css/index.css
376+
$(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),npx lessc --clean-css public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
377+
$(foreach file, $(wildcard public/css/*),npx postcss --use autoprefixer --autoprefixer.browsers $(BROWSERS) -o $(file) $(file);)
372378

373379
.PHONY: swagger-ui
374380
swagger-ui:

custom/conf/app.ini.sample

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ MAX_FILES = 5
6969
; List of prefixes used in Pull Request title to mark them as Work In Progress
7070
WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP]
7171

72+
[repository.issue]
73+
; List of reasons why a Pull Request or Issue can be locked
74+
LOCK_REASONS=Too heated,Off-topic,Resolved,Spam
75+
7276
[ui]
7377
; Number of repositories that are displayed on one explore page
7478
EXPLORE_PAGING_NUM = 20
@@ -351,6 +355,11 @@ DEFAULT_KEEP_EMAIL_PRIVATE = false
351355
; Default value for AllowCreateOrganization
352356
; Every new user will have rights set to create organizations depending on this setting
353357
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
358+
; Either "public", "limited" or "private", default is "public"
359+
; Limited is for signed user only
360+
; Private is only for member of the organization
361+
; Public is for everyone
362+
DEFAULT_ORG_VISIBILITY = public
354363
; Default value for EnableDependencies
355364
; Repositories will use dependencies by default depending on this setting
356365
DEFAULT_ENABLE_DEPENDENCIES = true

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
7171
- `WORK_IN_PROGRESS_PREFIXES`: **WIP:,\[WIP\]**: List of prefixes used in Pull Request
7272
title to mark them as Work In Progress
7373

74+
### Repository - Issue (`repository.issue`)
75+
- `LOCK_REASONS`: **Too heated,Off-topic,Resolved,Spam**: A list of reasons why a Pull Request or Issue can be locked
76+
7477
## UI (`ui`)
7578

7679
- `EXPLORE_PAGING_NUM`: **20**: Number of repositories that are shown in one explore page.
@@ -147,7 +150,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
147150
- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.
148151
- `LOG_SQL`: **true**: Log the executed SQL.
149152
- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed.
150-
- `DB_RETRY_BACKOFF`: **3s*: time.Duration to wait before trying another ORM init / DB connect attempt, if failure occured.
153+
- `DB_RETRY_BACKOFF`: **3s**: time.Duration to wait before trying another ORM init / DB connect attempt, if failure occured.
151154

152155
## Indexer (`indexer`)
153156

@@ -203,12 +206,13 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
203206
- `CAPTCHA_TYPE`: **image**: \[image, recaptcha\]
204207
- `RECAPTCHA_SECRET`: **""**: Go to https://www.google.com/recaptcha/admin to get a secret for recaptcha.
205208
- `RECAPTCHA_SITEKEY`: **""**: Go to https://www.google.com/recaptcha/admin to get a sitekey for recaptcha.
206-
- `DEFAULT_ENABLE_DEPENDENCIES`: **true** Enable this to have dependencies enabled by default.
207-
- `ENABLE_USER_HEATMAP`: **true** Enable this to display the heatmap on users profiles.
209+
- `DEFAULT_ENABLE_DEPENDENCIES`: **true**: Enable this to have dependencies enabled by default.
210+
- `ENABLE_USER_HEATMAP`: **true**: Enable this to display the heatmap on users profiles.
208211
- `EMAIL_DOMAIN_WHITELIST`: **\<empty\>**: If non-empty, list of domain names that can only be used to register
209212
on this instance.
210213
- `SHOW_REGISTRATION_BUTTON`: **! DISABLE\_REGISTRATION**: Show Registration Button
211-
- `AUTO_WATCH_NEW_REPOS`: **true** Enable this to let all organisation users watch new repos when they are created
214+
- `AUTO_WATCH_NEW_REPOS`: **true**: Enable this to let all organisation users watch new repos when they are created
215+
- `DEFAULT_ORG_VISIBILITY`: **public**: Set default visibility mode for organisations, either "public", "limited" or "private".
212216

213217
## Webhook (`webhook`)
214218

docs/content/doc/advanced/hacking-on-gitea.en-us.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ make vet lint misspell-check
138138

139139
### Updating the stylesheets
140140

141+
To generate the stylsheets, you will need [Node.js](https://nodejs.org/) at version 8.0 or above.
142+
141143
At present we use [less](http://lesscss.org/) and [postcss](https://postcss.org) to generate our stylesheets. Do
142144
**not** edit the files in `public/css/` directly as they are generated from
143145
`lessc` from the files in `public/less/`.

docs/content/doc/features/comparison.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ _Symbols used in table:_
8181
| Related issues ||||||||
8282
| Confidential issues ||||||||
8383
| Comment reactions ||||||||
84-
| Lock Discussion | |||||||
84+
| Lock Discussion | |||||||
8585
| Batch issue handling ||||||||
8686
| Issue Boards ||||||||
8787
| Create new branches from issues ||||||||

integrations/pull_create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ func testPullCreate(t *testing.T, session *TestSession, user, repo, branch, titl
1818
req := NewRequest(t, "GET", path.Join(user, repo))
1919
resp := session.MakeRequest(t, req, http.StatusOK)
2020

21-
// Click the little green button to create a pull
21+
// Click the PR button to create a pull
2222
htmlDoc := NewHTMLParser(t, resp.Body)
23-
link, exists := htmlDoc.doc.Find("button.ui.green.tiny.compact.button").Parent().Attr("href")
23+
link, exists := htmlDoc.doc.Find("#new-pull-request").Parent().Attr("href")
2424
assert.True(t, exists, "The template has changed")
2525
if branch != "master" {
2626
link = strings.Replace(link, ":master", ":"+branch, 1)

integrations/release_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestCreateReleasePaging(t *testing.T) {
112112

113113
checkLatestReleaseAndCount(t, session, "/user2/repo1", "v0.0.12", i18n.Tr("en", "repo.release.draft"), 10)
114114

115-
// Check that user3 does not see draft and still see 10 latest releases
116-
session2 := loginUser(t, "user3")
115+
// Check that user4 does not see draft and still see 10 latest releases
116+
session2 := loginUser(t, "user4")
117117
checkLatestReleaseAndCount(t, session2, "/user2/repo1", "v0.0.11", i18n.Tr("en", "repo.release.stable"), 10)
118118
}

integrations/repo_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func TestViewRepoWithSymlinks(t *testing.T) {
104104
func TestViewAsRepoAdmin(t *testing.T) {
105105
for user, expectedNoDescription := range map[string]bool{
106106
"user2": true,
107-
"user3": false,
107+
"user4": false,
108108
} {
109109
prepareTestEnv(t)
110110

integrations/setting_test.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestSettingShowUserEmailExplore(t *testing.T) {
2525
htmlDoc := NewHTMLParser(t, resp.Body)
2626
assert.Contains(t,
2727
htmlDoc.doc.Find(".ui.user.list").Text(),
28-
"user2@example.com",
28+
"user4@example.com",
2929
)
3030

3131
setting.UI.ShowUserEmail = false
@@ -35,7 +35,7 @@ func TestSettingShowUserEmailExplore(t *testing.T) {
3535
htmlDoc = NewHTMLParser(t, resp.Body)
3636
assert.NotContains(t,
3737
htmlDoc.doc.Find(".ui.user.list").Text(),
38-
"user2@example.com",
38+
"user4@example.com",
3939
)
4040

4141
setting.UI.ShowUserEmail = showUserEmail
@@ -61,12 +61,23 @@ func TestSettingShowUserEmailProfile(t *testing.T) {
6161
req = NewRequest(t, "GET", "/user2")
6262
resp = session.MakeRequest(t, req, http.StatusOK)
6363
htmlDoc = NewHTMLParser(t, resp.Body)
64-
assert.NotContains(t,
64+
// Should contain since this user owns the profile page
65+
assert.Contains(t,
6566
htmlDoc.doc.Find(".user.profile").Text(),
6667
6768
)
6869

6970
setting.UI.ShowUserEmail = showUserEmail
71+
72+
session = loginUser(t, "user4")
73+
req = NewRequest(t, "GET", "/user2")
74+
resp = session.MakeRequest(t, req, http.StatusOK)
75+
htmlDoc = NewHTMLParser(t, resp.Body)
76+
assert.NotContains(t,
77+
htmlDoc.doc.Find(".user.profile").Text(),
78+
79+
)
80+
7081
}
7182

7283
func TestSettingLandingPage(t *testing.T) {

0 commit comments

Comments
 (0)