forked from Gitlink/gitea-1156
Merge branch 'dev' of github.com:gogits/gogs into dev
This commit is contained in:
commit
79ec08141a
|
@ -2,5 +2,4 @@ language: go
|
|||
|
||||
go:
|
||||
- 1.2
|
||||
- 1.3
|
||||
- tip
|
||||
- 1.3
|
|
@ -5,7 +5,7 @@ Gogs(Go Git Service) is a painless self-hosted Git Service written in Go.
|
|||
|
||||
![Demo](https://gowalker.org/public/gogs_demo.gif)
|
||||
|
||||
##### Current version: 0.5.2 Beta
|
||||
##### Current version: 0.5.3 Beta
|
||||
|
||||
### NOTICES
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ Gogs(Go Git Service) 是一个基于 Go 语言的自助 Git 服务。
|
|||
|
||||
![Demo](https://gowalker.org/public/gogs_demo.gif)
|
||||
|
||||
##### 当前版本:0.5.2 Beta
|
||||
##### 当前版本:0.5.3 Beta
|
||||
|
||||
## 开发目的
|
||||
|
||||
|
|
16
cmd/web.go
16
cmd/web.go
|
@ -97,9 +97,10 @@ func newMacaron() *macaron.Macaron {
|
|||
Config: *setting.SessionConfig,
|
||||
}))
|
||||
m.Use(csrf.Generate(csrf.Options{
|
||||
Secret: setting.SecretKey,
|
||||
SetCookie: true,
|
||||
Header: "X-Csrf-Token",
|
||||
Secret: setting.SecretKey,
|
||||
SetCookie: true,
|
||||
Header: "X-Csrf-Token",
|
||||
CookiePath: setting.AppSubUrl,
|
||||
}))
|
||||
m.Use(toolbox.Toolboxer(m, toolbox.Options{
|
||||
HealthCheckFuncs: []*toolbox.HealthCheckFuncDesc{
|
||||
|
@ -363,6 +364,15 @@ func runWeb(*cli.Context) {
|
|||
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)
|
||||
|
||||
|
|
|
@ -38,6 +38,50 @@ 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
|
||||
|
@ -47,6 +91,9 @@ collaborative_repos = Gemeinschaftliche Repositorys
|
|||
my_orgs = Meine Organisationen
|
||||
my_mirrors = Meine Spiegel
|
||||
|
||||
[explore]
|
||||
repos = Repositories
|
||||
|
||||
[auth]
|
||||
create_new_account = Neues Konto erstellen
|
||||
register_hepler_msg = Du hast schon ein Konto? Jetzt anmelden!
|
||||
|
@ -81,6 +128,7 @@ 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.`
|
||||
|
@ -125,6 +173,7 @@ 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.
|
||||
|
@ -178,7 +227,6 @@ create_repo = Repository erstellen
|
|||
default_branch = Standard-Branch
|
||||
mirror_interval = Spiegel-Intervall (in Stunden)
|
||||
goget_meta = Go-Get Meta
|
||||
goget_meta_helper = This repository will be <span class="label label-blue label-radius">Go-Getable</span>
|
||||
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
|
||||
|
@ -210,11 +258,13 @@ 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öschet 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
|
||||
|
@ -271,6 +321,7 @@ 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 = Add webhooks that will be triggered for <strong>all repositories</strong> under this organization.
|
||||
|
||||
members.public = Öffentlich
|
||||
members.public_helper = Privat machen
|
||||
|
@ -515,3 +566,16 @@ months = %d Monate %s
|
|||
years = %d Jahre %s
|
||||
raw_seconds = Sekunden
|
||||
raw_minutes = Minuten
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
2
gogs.go
2
gogs.go
|
@ -17,7 +17,7 @@ import (
|
|||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.5.3.0919 Beta"
|
||||
const APP_VER = "0.5.3.0921 Beta"
|
||||
|
||||
func init() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
|
|
|
@ -48,7 +48,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
|
|||
if strings.HasSuffix(ctx.Req.RequestURI, "watch") {
|
||||
return
|
||||
}
|
||||
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI))
|
||||
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
|
||||
ctx.Redirect(setting.AppSubUrl + "/user/login")
|
||||
return
|
||||
} else if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm {
|
||||
|
|
|
@ -298,7 +298,7 @@ func RequireTrueOwner() macaron.Handler {
|
|||
return func(ctx *Context) {
|
||||
if !ctx.Repo.IsTrueOwner && !ctx.Repo.IsAdmin {
|
||||
if !ctx.IsSigned {
|
||||
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI))
|
||||
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
|
||||
ctx.Redirect(setting.AppSubUrl + "/user/login")
|
||||
return
|
||||
}
|
||||
|
|
|
@ -108,6 +108,7 @@ var (
|
|||
ProdMode bool
|
||||
RunUser string
|
||||
IsWindows bool
|
||||
HasRobotsTxt bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -260,6 +261,8 @@ func NewConfigContext() {
|
|||
|
||||
Langs = Cfg.MustValueArray("i18n", "LANGS", ",")
|
||||
Names = Cfg.MustValueArray("i18n", "NAMES", ",")
|
||||
|
||||
HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt"))
|
||||
}
|
||||
|
||||
var Service struct {
|
||||
|
@ -380,6 +383,7 @@ func newSessionService() {
|
|||
SessionConfig = new(session.Config)
|
||||
SessionConfig.ProviderConfig = strings.Trim(Cfg.MustValue("session", "PROVIDER_CONFIG"), "\" ")
|
||||
SessionConfig.CookieName = Cfg.MustValue("session", "COOKIE_NAME", "i_like_gogits")
|
||||
SessionConfig.CookiePath = AppSubUrl
|
||||
SessionConfig.Secure = Cfg.MustBool("session", "COOKIE_SECURE")
|
||||
SessionConfig.EnableSetCookie = Cfg.MustBool("session", "ENABLE_SET_COOKIE", true)
|
||||
SessionConfig.Gclifetime = Cfg.MustInt64("session", "GC_INTERVAL_TIME", 86400)
|
||||
|
|
|
@ -54,7 +54,7 @@ func Issues(ctx *middleware.Context) {
|
|||
isShowClosed := ctx.Query("state") == "closed"
|
||||
|
||||
if viewType != "all" && !ctx.IsSigned {
|
||||
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI))
|
||||
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
|
||||
ctx.Redirect(setting.AppSubUrl + "/user/login")
|
||||
return
|
||||
}
|
||||
|
|
|
@ -52,8 +52,8 @@ func SignIn(ctx *middleware.Context) {
|
|||
defer func() {
|
||||
if !isSucceed {
|
||||
log.Trace("auto-login cookie cleared: %s", uname)
|
||||
ctx.SetCookie(setting.CookieUserName, "", -1)
|
||||
ctx.SetCookie(setting.CookieRememberName, "", -1)
|
||||
ctx.SetCookie(setting.CookieUserName, "", -1, setting.AppSubUrl)
|
||||
ctx.SetCookie(setting.CookieRememberName, "", -1, setting.AppSubUrl)
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
@ -77,7 +77,7 @@ func SignIn(ctx *middleware.Context) {
|
|||
ctx.Session.Set("uid", u.Id)
|
||||
ctx.Session.Set("uname", u.Name)
|
||||
if redirectTo, _ := url.QueryUnescape(ctx.GetCookie("redirect_to")); len(redirectTo) > 0 {
|
||||
ctx.SetCookie("redirect_to", "", -1)
|
||||
ctx.SetCookie("redirect_to", "", -1, setting.AppSubUrl)
|
||||
ctx.Redirect(redirectTo)
|
||||
return
|
||||
}
|
||||
|
@ -113,9 +113,9 @@ func SignInPost(ctx *middleware.Context, form auth.SignInForm) {
|
|||
|
||||
if form.Remember {
|
||||
days := 86400 * setting.LogInRememberDays
|
||||
ctx.SetCookie(setting.CookieUserName, u.Name, days)
|
||||
ctx.SetCookie(setting.CookieUserName, u.Name, days, setting.AppSubUrl)
|
||||
ctx.SetSuperSecureCookie(base.EncodeMd5(u.Rands+u.Passwd),
|
||||
setting.CookieRememberName, u.Name, days)
|
||||
setting.CookieRememberName, u.Name, days, setting.AppSubUrl)
|
||||
}
|
||||
|
||||
// Bind with social account.
|
||||
|
@ -135,7 +135,7 @@ func SignInPost(ctx *middleware.Context, form auth.SignInForm) {
|
|||
ctx.Session.Set("uid", u.Id)
|
||||
ctx.Session.Set("uname", u.Name)
|
||||
if redirectTo, _ := url.QueryUnescape(ctx.GetCookie("redirect_to")); len(redirectTo) > 0 {
|
||||
ctx.SetCookie("redirect_to", "", -1)
|
||||
ctx.SetCookie("redirect_to", "", -1, setting.AppSubUrl)
|
||||
ctx.Redirect(redirectTo)
|
||||
return
|
||||
}
|
||||
|
@ -149,8 +149,8 @@ func SignOut(ctx *middleware.Context) {
|
|||
ctx.Session.Delete("socialId")
|
||||
ctx.Session.Delete("socialName")
|
||||
ctx.Session.Delete("socialEmail")
|
||||
ctx.SetCookie(setting.CookieUserName, "", -1)
|
||||
ctx.SetCookie(setting.CookieRememberName, "", -1)
|
||||
ctx.SetCookie(setting.CookieUserName, "", -1, setting.AppSubUrl)
|
||||
ctx.SetCookie(setting.CookieRememberName, "", -1, setting.AppSubUrl)
|
||||
ctx.Redirect(setting.AppSubUrl + "/")
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.5.3.0919 Beta
|
||||
0.5.3.0921 Beta
|
Loading…
Reference in New Issue