Skip to content

Commit 2efac57

Browse files
authored
Merge pull request #108 from mpsonntag/unlisted
Unlisted supported, dav removal, live cherry-picks LGTM
2 parents 1619dc1 + a059c78 commit 2efac57

Some content is hidden

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

45 files changed

+569
-810
lines changed

.github/ISSUE_TEMPLATE/security.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ about: Report security vulnerability for this project
77
<!--
88
99
Please create a dummy issue with high-level description of the security vulnerability,
10-
then report details to Achilleas Koutsou <[email protected]> privately, thank you!
10+
then report details to the G-Node team at <[email protected]>, thank you!
1111
1212
-->

conf/locale/locale_en-US.ini

+4-2
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,10 @@ delete_account_desc = This account is going to be deleted permanently, do you wa
404404
owner = Owner
405405
repo_name = Repository Name
406406
repo_name_helper = Will be used to define the URL (path) of the repository. It must be one word (no spaces) and can contain letters (a-z, A-Z), numbers (0-9), dash (-), underscore (_), or dot (.) characters. Repository names should be short, unique and specific (do not use a generic name like "dataset", "plos_paper", etc).
407-
visibility = Private
408-
visiblity_helper = Accessible only to owner and assigned collaborators
407+
visibility = Visibility
408+
unlisted = Unlisted
409+
visiblity_helper = This repository is <span class="ui red text">Private</span>; accessible only to owner and assigned collaborators
410+
unlisted_helper = This repository is <span class="ui red text">Unlisted</span>
409411
visiblity_helper_forced = New repositories are private by default. You can change the state later.
410412
visiblity_fork_helper = (Change of this value will affect all forks)
411413
license_warn = Before making this public: Have you added a LICENSE file?

internal/assets/conf/conf_gen.go

+31-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/assets/public/public_gen.go

+142-96
Large diffs are not rendered by default.

internal/assets/templates/templates_gen.go

+91-91
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/cmd/serv.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func runServ(c *cli.Context) error {
293293

294294
// GIN specific: code altered from upstream, this function requires a review
295295
func runGit(cmd []string, requestMode db.AccessMode, user *db.User, owner *db.User,
296-
repo *db.Repository) error {
296+
repo *db.Repository) {
297297
log.Info("Running %q", cmd)
298298
gitCmd := exec.Command(cmd[0], cmd[1:]...)
299299
if requestMode == db.AccessModeWrite {
@@ -313,8 +313,6 @@ func runGit(cmd []string, requestMode db.AccessMode, user *db.User, owner *db.Us
313313
if err := gitCmd.Run(); err != nil {
314314
fail("Internal error", "Failed to execute git command: %v", err)
315315
}
316-
317-
return nil
318316
}
319317

320318
// Make sure git-annex-shell does not make "bad" changes (refactored from repo)

internal/cmd/web.go

-9
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"github.com/G-Node/gogs/internal/assets/templates"
3535
"github.com/G-Node/gogs/internal/conf"
3636
"github.com/G-Node/gogs/internal/context"
37-
"github.com/G-Node/gogs/internal/dav"
3837
"github.com/G-Node/gogs/internal/db"
3938
"github.com/G-Node/gogs/internal/form"
4039
"github.com/G-Node/gogs/internal/osutil"
@@ -47,7 +46,6 @@ import (
4746
"github.com/G-Node/gogs/internal/route/repo"
4847
"github.com/G-Node/gogs/internal/route/user"
4948
"github.com/G-Node/gogs/internal/template"
50-
"golang.org/x/net/webdav"
5149
)
5250

5351
var Web = cli.Command{
@@ -155,11 +153,6 @@ func newMacaron() *macaron.Macaron {
155153
},
156154
}))
157155

158-
// GIN specifc code: Webdav handler todo: implement
159-
h := &webdav.Handler{FileSystem: &dav.GinFS{BasePath: conf.Repository.Root}, LockSystem: webdav.NewMemLS(),
160-
Logger: dav.Logger}
161-
m.Map(h)
162-
163156
return m
164157
}
165158

@@ -422,8 +415,6 @@ func runWeb(c *cli.Context) error {
422415
m.Combo("/fork/:repoid").Get(repo.Fork).
423416
Post(bindIgnErr(form.CreateRepo{}), repo.ForkPost)
424417
}, reqSignIn)
425-
m.Any("/:username/:reponame/_dav/*", dav.DavMiddle(), dav.Dav) // GIN specific code
426-
m.Any("/:username/:reponame/_dav", dav.DavMiddle(), dav.Dav) // GIN specific code
427418

428419
m.Group("/:username/:reponame", func() {
429420
m.Group("/settings", func() {

internal/conf/conf.go

-2
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,6 @@ func Init(customConf string) error {
403403
return errors.Wrap(err, "mapping [doi] section")
404404
} else if err = File.Section("cliconfig").MapTo(&CLIConfig); err != nil {
405405
return errors.Wrap(err, "mapping [cliconfig] section")
406-
} else if err = File.Section("dav").MapTo(&WebDav); err != nil {
407-
return errors.Wrap(err, "mapping [dav] section")
408406
}
409407

410408
HasRobotsTxt = osutil.IsFile(filepath.Join(CustomDir(), "robots.txt"))

internal/conf/static.go

-6
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,6 @@ var (
378378
CLIConfig struct {
379379
RSAHostKey string
380380
}
381-
382-
WebDav struct {
383-
On bool
384-
Logged bool
385-
AuthRealm string
386-
}
387381
)
388382

389383
type ServerOpts struct {

0 commit comments

Comments
 (0)