mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-20 08:34:12 +02:00
#1984 Better mirror repo management
This commit is contained in:
1 parent
1cbd4c01fb
commit
120cd4e471
16 files changed
+128
-60
No files matched your search
@@ -17,7 +17,7 @@ github.com/go-sql-driver/mysql = commit:d512f20
|
||||
github.com/go-xorm/core = commit:acb6f00
|
||||
github.com/go-xorm/xorm = commit:a8fba4d
|
||||
github.com/gogits/chardet = commit:2404f77725
|
||||
github.com/gogits/git-shell = commit:de77627
|
||||
github.com/gogits/git-shell =
|
||||
github.com/gogits/go-gogs-client = commit:4b541fa
|
||||
github.com/issue9/identicon = commit:f8c0d2c
|
||||
github.com/klauspost/compress = commit:bcd0709
|
||||
|
||||
@@ -5,7 +5,7 @@ Gogs - Go Git Service [
|
||||
|
||||
##### Current version: 0.7.34 Beta
|
||||
##### Current version: 0.7.35 Beta
|
||||
|
||||
| Web | UI | Preview |
|
||||
|:-------------:|:-------:|:-------:|
|
||||
|
||||
@@ -352,6 +352,8 @@ auto_init = Initialize this repository with selected files and template
|
||||
create_repo = Create Repository
|
||||
default_branch = Default Branch
|
||||
mirror_interval = Mirror Interval (hour)
|
||||
mirror_address = Mirror Address
|
||||
mirror_address_desc = Please include necessary user credentials in the address.
|
||||
watchers = Watchers
|
||||
stargazers = Stargazers
|
||||
forks = Forks
|
||||
@@ -369,6 +371,7 @@ migrate.permission_denied = You are not allowed to import local repositories.
|
||||
migrate.invalid_local_path = Invalid local path, it does not exist or not a directory.
|
||||
migrate.failed = Migration failed: %v
|
||||
|
||||
mirror_from = mirror from
|
||||
forked_from = forked from
|
||||
fork_from_self = You cannot fork a repository you already own!
|
||||
copy_link = Copy
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.7.34.1208 Beta"
|
||||
const APP_VER = "0.7.35.1208 Beta"
|
||||
|
||||
func init() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
|
||||
+87
-39
@@ -301,6 +301,10 @@ func (repo *Repository) RepoPath() string {
|
||||
return repo.repoPath(x)
|
||||
}
|
||||
|
||||
func (repo *Repository) GitConfigPath() string {
|
||||
return filepath.Join(repo.RepoPath(), "config")
|
||||
}
|
||||
|
||||
func (repo *Repository) RepoLink() string {
|
||||
return setting.AppSubUrl + "/" + repo.MustOwner().Name + "/" + repo.Name
|
||||
}
|
||||
@@ -345,7 +349,7 @@ func (repo *Repository) LocalCopyPath() string {
|
||||
|
||||
func updateLocalCopy(repoPath, localPath string) error {
|
||||
if !com.IsExist(localPath) {
|
||||
if err := git.Clone(repoPath, localPath); err != nil {
|
||||
if err := git.Clone(repoPath, localPath, git.CloneRepoOptions{}); err != nil {
|
||||
return fmt.Errorf("Clone: %v", err)
|
||||
}
|
||||
} else {
|
||||
@@ -484,6 +488,8 @@ type Mirror struct {
|
||||
Interval int // Hour.
|
||||
Updated time.Time `xorm:"UPDATED"`
|
||||
NextUpdate time.Time
|
||||
|
||||
address string `xorm:"-"`
|
||||
}
|
||||
|
||||
func (m *Mirror) AfterSet(colName string, _ xorm.Cell) {
|
||||
@@ -497,6 +503,61 @@ func (m *Mirror) AfterSet(colName string, _ xorm.Cell) {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Mirror) readAddress() {
|
||||
if len(m.address) > 0 {
|
||||
return
|
||||
}
|
||||
|
||||
cfg, err := ini.Load(m.Repo.GitConfigPath())
|
||||
if err != nil {
|
||||
log.Error(4, "Load: %v", err)
|
||||
return
|
||||
}
|
||||
m.address = cfg.Section("remote \"origin\"").Key("url").Value()
|
||||
}
|
||||
|
||||
// HandleCloneUserCredentials replaces user credentials from HTTP/HTTPS URL
|
||||
// with placeholder <credentials>.
|
||||
// It will fail for any other forms of clone addresses.
|
||||
func HandleCloneUserCredentials(url string, mosaics bool) string {
|
||||
i := strings.Index(url, "@")
|
||||
if i == -1 {
|
||||
return url
|
||||
}
|
||||
start := strings.Index(url, "://")
|
||||
if start == -1 {
|
||||
return url
|
||||
}
|
||||
if mosaics {
|
||||
return url[:start+3] + "<credentials>" + url[i:]
|
||||
}
|
||||
return url[:start+3] + url[i+1:]
|
||||
}
|
||||
|
||||
// Address returns mirror address from Git repository config without credentials.
|
||||
func (m *Mirror) Address() string {
|
||||
m.readAddress()
|
||||
return HandleCloneUserCredentials(m.address, false)
|
||||
}
|
||||
|
||||
// FullAddress returns mirror address from Git repository config.
|
||||
func (m *Mirror) FullAddress() string {
|
||||
m.readAddress()
|
||||
return m.address
|
||||
}
|
||||
|
||||
// SaveAddress writes new address to Git repository config.
|
||||
func (m *Mirror) SaveAddress(addr string) error {
|
||||
configPath := m.Repo.GitConfigPath()
|
||||
cfg, err := ini.Load(configPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Load: %v", err)
|
||||
}
|
||||
|
||||
cfg.Section("remote \"origin\"").Key("url").SetValue(addr)
|
||||
return cfg.SaveToIndent(configPath, "\t")
|
||||
}
|
||||
|
||||
func getMirror(e Engine, repoId int64) (*Mirror, error) {
|
||||
m := &Mirror{RepoID: repoId}
|
||||
has, err := e.Get(m)
|
||||
@@ -527,25 +588,6 @@ func createUpdateHook(repoPath string) error {
|
||||
fmt.Sprintf(_TPL_UPDATE_HOOK, setting.ScriptType, "\""+setting.AppPath+"\"", setting.CustomConf))
|
||||
}
|
||||
|
||||
// MirrorRepository creates a mirror repository from source.
|
||||
func MirrorRepository(repoId int64, userName, repoName, repoPath, url string) error {
|
||||
_, stderr, err := process.ExecTimeout(10*time.Minute,
|
||||
fmt.Sprintf("MirrorRepository: %s/%s", userName, repoName),
|
||||
"git", "clone", "--mirror", url, repoPath)
|
||||
if err != nil {
|
||||
return errors.New("git clone --mirror: " + stderr)
|
||||
}
|
||||
|
||||
if _, err = x.InsertOne(&Mirror{
|
||||
RepoID: repoId,
|
||||
Interval: 24,
|
||||
NextUpdate: time.Now().Add(24 * time.Hour),
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MigrateRepoOptions struct {
|
||||
Name string
|
||||
Description string
|
||||
@@ -582,29 +624,35 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
|
||||
repo.NumWatches = 1
|
||||
}
|
||||
|
||||
repo.IsBare = false
|
||||
if opts.IsMirror {
|
||||
if err = MirrorRepository(repo.ID, u.Name, repo.Name, repoPath, opts.RemoteAddr); err != nil {
|
||||
return repo, err
|
||||
}
|
||||
repo.IsMirror = true
|
||||
return repo, UpdateRepository(repo, false)
|
||||
} else {
|
||||
os.RemoveAll(repoPath)
|
||||
os.RemoveAll(repoPath)
|
||||
if err = git.Clone(opts.RemoteAddr, repoPath, git.CloneRepoOptions{
|
||||
Mirror: true,
|
||||
Quiet: true,
|
||||
Timeout: 10 * time.Minute,
|
||||
}); err != nil {
|
||||
return repo, fmt.Errorf("Clone: %v", err)
|
||||
}
|
||||
|
||||
// FIXME: this command could for both migrate and mirror
|
||||
_, stderr, err := process.ExecTimeout(10*time.Minute,
|
||||
fmt.Sprintf("MigrateRepository: %s", repoPath),
|
||||
"git", "clone", "--mirror", "--bare", "--quiet", opts.RemoteAddr, repoPath)
|
||||
if err != nil {
|
||||
return repo, fmt.Errorf("git clone --mirror --bare --quiet: %v", stderr)
|
||||
} else if err = createUpdateHook(repoPath); err != nil {
|
||||
return repo, fmt.Errorf("create update hook: %v", err)
|
||||
if opts.IsMirror {
|
||||
if _, err = x.InsertOne(&Mirror{
|
||||
RepoID: repo.ID,
|
||||
Interval: 24,
|
||||
NextUpdate: time.Now().Add(24 * time.Hour),
|
||||
}); err != nil {
|
||||
return repo, fmt.Errorf("InsertOne: %v", err)
|
||||
}
|
||||
|
||||
repo.IsMirror = true
|
||||
return repo, UpdateRepository(repo, false)
|
||||
}
|
||||
|
||||
if err = createUpdateHook(repoPath); err != nil {
|
||||
return repo, fmt.Errorf("createUpdateHook: %v", err)
|
||||
}
|
||||
|
||||
// Clean up mirror info which prevents "push --all".
|
||||
configPath := filepath.Join(repoPath, "/config")
|
||||
// This also removes possible user credentials.
|
||||
configPath := repo.GitConfigPath()
|
||||
cfg, err := ini.Load(configPath)
|
||||
if err != nil {
|
||||
return repo, fmt.Errorf("open config file: %v", err)
|
||||
@@ -615,7 +663,7 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
|
||||
}
|
||||
|
||||
// Check if repository is empty.
|
||||
_, stderr, err = com.ExecCmdDir(repoPath, "git", "log", "-1")
|
||||
_, stderr, err := com.ExecCmdDir(repoPath, "git", "log", "-1")
|
||||
if err != nil {
|
||||
if strings.Contains(stderr, "fatal: bad default revision 'HEAD'") {
|
||||
repo.IsBare = true
|
||||
|
||||
@@ -69,6 +69,9 @@ func (f MigrateRepoForm) ParseRemoteAddr(user *models.User) (string, error) {
|
||||
}
|
||||
if len(f.AuthUsername)+len(f.AuthPassword) > 0 {
|
||||
u.User = url.UserPassword(f.AuthUsername, f.AuthPassword)
|
||||
} else {
|
||||
// Fake user name and password to prevent prompt and fail quick.
|
||||
u.User = url.UserPassword("fake_user", "")
|
||||
}
|
||||
remoteAddr = u.String()
|
||||
} else if !user.CanImportLocal() {
|
||||
@@ -81,12 +84,13 @@ func (f MigrateRepoForm) ParseRemoteAddr(user *models.User) (string, error) {
|
||||
}
|
||||
|
||||
type RepoSettingForm struct {
|
||||
RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"`
|
||||
Description string `binding:"MaxSize(255)"`
|
||||
Website string `binding:"Url;MaxSize(100)"`
|
||||
Branch string
|
||||
Interval int
|
||||
Private bool
|
||||
RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"`
|
||||
Description string `binding:"MaxSize(255)"`
|
||||
Website string `binding:"Url;MaxSize(100)"`
|
||||
Branch string
|
||||
Interval int
|
||||
MirrorAddress string
|
||||
Private bool
|
||||
|
||||
// Advanced settings
|
||||
EnableWiki bool
|
||||
|
||||
@@ -4359,12 +4359,12 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_de-DE.ini", size: 50411, mode: os.FileMode(493), modTime: time.Unix(1449482924, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_de-DE.ini", size: 50411, mode: os.FileMode(493), modTime: time.Unix(1449533063, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\x7d\xfd\x72\xdc\x46\xae\xef\xff\x7c\x0a\xc6\x5b\x2e\x27\x55\xf2\xa4\x92\x9c\xfb\x51\xa9\x38\xb9\x8a\x1d\x7f\x9c\x63\x59\x3a\x96\xb2\x7b\xf7\xa6\x5c\x13\x6a\x48\x8d\x78\x3c\x43\xce\x92\x1c\xcb\xda\xad\x7d\x83\xfb\x00\xf7\xf9\xee\x93\x5c\xe0\x07\xa0\x1b\x4d\x72\x24\x7b\xcf\xd6\xf5\x1f\x16\xa7\x1b\xfd\x8d\x46\x03\x68\x00\x5d\xec\x76\xcb\xb2\xea\x57\xf9\x93\xfc\x38\xdf\x15\x75\xb3\xa9\xfa\x3e\xef\xab\xcd\xd5\xe3\xeb\xb6\x1f\xaa\x32\x7f\x51\x0f\xf4\xbb\xfb\x50\xaf\xaa\x2c\xbb\x6e\xb7\x15\x81\xbe\xa4\x3f\x59\x59\xf4\xd7\x97\x6d\xd1\x95\x94\xf0\xcc\xbe\xb3\xea\xe3\x6e\xd3\x76\x0c\xf4\x8b\x7c\x65\xd7\xd5\x66\xc7\x65\xe8\x4f\xd6\xd7\xeb\x66\x59\x37\xf4\xf3\x9c\xbe\xf2\x57\x8d\xa4\xb4\xfb\xc1\x92\x4e\xf7\x83\xa4\xed\x77\x96\xf4\xeb\x2e\xeb\xaa\x75\x4d\xbd\xe9\x28\xe9\xad\x7e\x66\x37\xd5\x65\x5f\x0f\xdc\xd2\x9f\xe4\x2b\xfb\x50\x75\x7d\xdd\x72\xed\x7f\x94\xaf\x6c\x57\xac\x19\xe0\x8c\xfe\x64\x43\xb5\xdd\x6d\x0a\x14\xb8\xd0\xcf\x6c\x53\x34\xeb\xbd\xc0\xbc\xd6\xcf\x6c\xd5\x55\x94\xb5\x6c\xaa\x1b\x4a\x7d\x8a\x1f\x8b\xc5\x22\xdb\xd3\x24\x2c\x77\x5d\x7b\x55\x6f\xaa\x65\xd1\x94\xcb\xad\x0c\xf3\x57\x4a\xcf\x35\x3d\xa7\xf4\x9c\xd3\x31\x84\xaa\xa4\xa1\x2e\x8b\x5e\xc7\x41\x73\x49\x23\x2f\xfa\x0c\x55\x35\xc5\xd6\x4a\xf3\x67\x56\x6d\x8b\x7a\xc3\xb3\xc6\x7f\xa9\xdf\x7d\x7f\xd3\x62\x6a\xcf\xf4\x93\xe6\x60\x39\xdc\xee\x2a\x4c\xc1\xe3\x0b\xfa\xca\x56\xc5\x6e\x58\x5d\x17\xdc\x4d\xf9\xca\x08\x68\xd7\xd2\x5c\xb4\xdd\x2d\xe0\xec\x47\xd6\x76\xeb\xa2\xa9\xff\x5a\x0c\x32\x3f\xa7\xee\x67\xb6\xad\xbb\xae\xe5\xa9\x3d\xc1\x47\x46\x23\x5f\x72\x3d\x94\xf2\x86\x26\xc1\xd5\xc2\x39\xdb\x7a\xdd\xc9\x2c\x72\xe6\x09\x7e\x71\x2d\x9c\x77\xd5\x76\xef\x35\xe3\x39\x7f\x8e\x8a\x52\x27\x34\x37\x6d\xbf\x68\x68\xde\x35\xf7\x04\x3f\x12\x80\x3e\x2b\xca\x2d\xcd\xe4\xae\x68\x2a\x9e\xa2\x63\xfe\x45\xf3\x42\xbf\xb2\x62\xb5\x6a\xf7\xcd\xb0\xec\xab\x61\xa8\x9b\x35\xcf\xf5\xb1\x24\xe5\xe7\x9a\x94\xb9\xbc\x90\x76\xdb\xee\xc3\x6a\x52\xfa\x9f\xe9\x67\x7e\x26\x3f\x25\xcf\x15\x42\x66\x28\xc9\x23\xe9\x97\x57\x55\x55\xca\x58\xfa\xfc\x39\x7d\x67\xbb\xfd\x66\x43\xb3\xf6\x97\x7d\xd5\x0f\x5c\xe8\x8c\x7e\xd3\xf8\xe5\x77\x56\xf7\x3d\x7d\x50\xf2\x2b\x7c\x64\xb4\x74\xcd\x0a\x83\x79\x8a\x8f\x2c\xfb\xad\xaf\x8a\x6e\x75\xfd\x2e\x93\xbf\xe8\x2b\x7f\x30\xea\x1d\x5a\x54\xc6\x23\xc5\x21\x69\xc1\x1a\xc8\x56\x6d\xc9\x3f\x9e\xd2\x1f\xaa\xba\x6e\xfa\xa1\xd8\x6c\xde\x65\xfa\xc1\x60\xf2\x25\x0b\x30\xd4\x03\x66\x41\x13\xf3\xf3\xa1\xda\xf5\xbc\x82\xf9\xf3\xba\xeb\x87\xc7\x43\x4d\xb8\xfa\x76\xdf\x64\x65\xbb\x7a\x4f\xbb\x80\x77\x34\x5a\x7e\x75\x95\xd3\x64\x3d\xa2\x7d\xd0\xed\x9b\x86\xa6\x27\x7f\xd1\xd2\x94\x51\x33\x35\xb5\xff\x0c\xd0\x47\xf9\x6e\x53\x15\x3d\x81\x54\x45\x99\xff\x50\xe4\x43\xd1\xad\xab\xe1\xc9\x83\xe5\x25\xed\xbe\xf7\x0f\xf2\xeb\xae\xba\x7a\xf2\xe0\x61\xff\xe0\xc7\x17\x7b\x2a\xb6\xa9\x9b\xaa\xff\xe1\xeb\xe2\xc7\x7c\x55\x50\x0e\x4d\xe3\x6d\x7e\x59\x5d\xf1\x66\xa3\xb6\x72\xc2\xf2\x66\xcd\x1b\xed\x76\xb8\xe6\x06\x09\x13\xe8\xa3\xcf\x79\xa7\x7f\x91\xf1\x02\x10\x25\x58\x96\x97\x46\xd5\xd0\x21\x24\x77\xb4\x00\x27\xb7\xe7\xff\xfe\xfa\x28\x3f\x23\xd2\xb6\xee\x2a\x7c\xd3\x7f\x54\xe2\xbb\x9c\x46\x7b\x51\x3f\xfb\x79\x91\x51\x59\x9b\x90\x67\xc5\x50\x5c\x72\xdf\xc3\xea\x73\xa6\x6c\xc2\x90\x87\xad\xc8\xc4\x12\x84\xb1\x1f\x92\x65\x99\xdb\xc8\x54\x87\xee\xfe\x50\xc7\x1b\x26\x01\x94\x1e\x66\xf6\x4c\xe6\x8c\xaa\xca\x5f\xbd\x79\x73\xfa\xec\xe7\xbc\x6a\xd6\x34\x33\xf9\x4d\x3d\x5c\xe7\xfb\xe1\xea\xbf\x2f\xd7\x55\x53\x75\xc5\x66\xb9\xaa\x79\x52\x3a\x42\xd8\x9c\x66\x49\x86\xb8\xc8\xfa\x7e\x43\x14\x0a\x58\x70\x7e\xfe\x3a\x3f\x61\x4c\xd8\x15\xc3\x35\x3a\x32\x5c\x67\xfd\x5f\x36\x3c\x51\xa1\xc1\x8b\xeb\x2a\xc7\x66\x00\x50\x7b\x35\x9e\x97\xbc\xd4\xbe\x2e\xb2\xaa\xeb\x96\x44\x40\x87\x5b\x9e\x66\xad\xf3\x10\xb4\x54\x47\xd8\xde\xb4\x03\x2d\x63\x8e\x72\x52\x45\xdd\x7c\x28\x36\x75\x49\x93\x1d\x27\x24\x2d\x8b\xc4\xb2\xa5\x75\xe3\xd2\x84\x99\xed\x0d\x86\x5a\xac\x88\xfe\xf7\xf9\x83\xc5\x03\x10\xdc\x07\x8f\x1f\x2c\xb2\xa6\x5d\x0a\x95\x60\xd2\x5c\xd6\x7d\x71\x49\x64\x5a\x8e\x8d\xce\xa8\xde\x9f\x19\x7f\xa4\x2b\x0a\x91\x27\x10\x3c\xb7\x7c\x14\xe1\x04\x60\xe4\x2a\x88\x5e\x83\xd8\x28\x99\xf1\x63\x37\x9a\x14\xd6\x57\xc8\x52\x48\x98\x8c\x39\xb3\x05\x33\xec\x3a\xde\xed\x36\xf5\x4a\x9a\x7e\x21\x79\x11\xd1\xf8\x60\xd6\x49\xf1\x70\x40\x14\xcb\x73\xe8\x42\xbd\x66\xb2\x95\x27\x74\x1e\xe5\xaf\x2b\xda\x39\xd7\xfb\xb5\x1c\x4e\x9b\x76\x5f\x7e\x01\x82\x62\x2b\x17\xe9\x49\xfe\xb6\xa5\x0e\x03\x3b\x02\x40\x6c\xe2\x98\x08\x03\xf3\x02\x5d\xb5\x6d\x07\x9e\x38\x2d\x56\xd3\xf2\xdc\xd4\x94\x49\x23\xed\x8b\x0f\x44\x16\x87\x56\xb6\x64\x49\x5b\x6e\xc5\x15\x13\x05\xdb\xd3\x81\x2e\xdb\x82\xe8\x88\x6c\x0d\x4b\x4b\x71\x10\x50\xdb\x3d\xed\xa6\x6b\xaa\x8c\x27\x9e\x19\x12\xaa\x72\xae\x9f\x18\x12\xd5\x83\x5d\x4e\x3b\xb7\xa5\xc3\x93\x17\xfa\x19\x3e\xf4\xb7\xaf\x9f\x7a\x55\x5c\x5d\x51\xaf\x7a\xda\x15\x2f\xf3\xd5\xa6\xa5\x2d\xf5\xeb\xdb\xd7\x3d\x6f\x98\xeb\xe5\xae\xed\xc0\x88\x50\xd6\x19\x7d\x86\x34\x37\xd1\x0c\xd1\xec\xb7\x97\xf4\xeb\xe6\xba\x26\x42\x8d\x69\xe7\x12\xcc\x24\x51\x2Line truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\x7d\xfd\x72\xdc\x46\xae\xef\xff\x7c\x0a\xc6\x5b\x2e\x27\x55\xf2\xa4\x92\x9c\xfb\x51\xa9\x38\xb9\x8a\x1d\x7f\x9c\x63\x59\x3a\x96\xb2\x7b\xf7\xa6\x5c\x13\x6a\x48\x8d\x78\x3c\x43\xce\x92\x1c\xcb\xda\xad\x7d\x83\xfb\x00\xf7\xf9\xee\x93\x5c\xe0\x07\xa0\x1b\x4d\x72\x24\x7b\xcf\xd6\xf5\x1f\x16\xa7\x1b\xfd\x8d\x46\x03\x68\x00\x5d\xec\x76\xcb\xb2\xea\x57\xf9\x93\xfc\x38\xdf\x15\x75\xb3\xa9\xfa\x3e\xef\xab\xcd\xd5\xe3\xeb\xb6\x1f\xaa\x32\x7f\x51\x0f\xf4\xbb\xfb\x50\xaf\xaa\x2c\xbb\x6e\xb7\x15\x81\xbe\xa4\x3f\x59\x59\xf4\xd7\x97\x6d\xd1\x95\x94\xf0\xcc\xbe\xb3\xea\xe3\x6e\xd3\x76\x0c\xf4\x8b\x7c\x65\xd7\xd5\x66\xc7\x65\xe8\x4f\xd6\xd7\xeb\x66\x59\x37\xf4\xf3\x9c\xbe\xf2\x57\x8d\xa4\xb4\xfb\xc1\x92\x4e\xf7\x83\xa4\xed\x77\x96\xf4\xeb\x2e\xeb\xaa\x75\x4d\xbd\xe9\x28\xe9\xad\x7e\x66\x37\xd5\x65\x5f\x0f\xdc\xd2\x9f\xe4\x2b\xfb\x50\x75\x7d\xdd\x72\xed\x7f\x94\xaf\x6c\x57\xac\x19\xe0\x8c\xfe\x64\x43\xb5\xdd\x6d\x0a\x14\xb8\xd0\xcf\x6c\x53\x34\xeb\xbd\xc0\xbc\xd6\xcf\x6c\xd5\x55\x94\xb5\x6c\xaa\x1b\x4a\x7d\x8a\x1f\x8b\xc5\x22\xdb\xd3\x24\x2c\x77\x5d\x7b\x55\x6f\xaa\x65\xd1\x94\xcb\xad\x0c\xf3\x57\x4a\xcf\x35\x3d\xa7\xf4\x9c\xd3\x31\x84\xaa\xa4\xa1\x2e\x8b\x5e\xc7\x41\x73\x49\x23\x2f\xfa\x0c\x55\x35\xc5\xd6\x4a\xf3\x67\x56\x6d\x8b\x7a\xc3\xb3\xc6\x7f\xa9\xdf\x7d\x7f\xd3\x62\x6a\xcf\xf4\x93\xe6\x60\x39\xdc\xee\x2a\x4c\xc1\xe3\x0b\xfa\xca\x56\xc5\x6e\x58\x5d\x17\xdc\x4d\xf9\xca\x08\x68\xd7\xd2\x5c\xb4\xdd\x2d\xe0\xec\x47\xd6\x76\xeb\xa2\xa9\xff\x5a\x0c\x32\x3f\xa7\xee\x67\xb6\xad\xbb\xae\xe5\xa9\x3d\xc1\x47\x46\x23\x5f\x72\x3d\x94\xf2\x86\x26\xc1\xd5\xc2\x39\xdb\x7a\xdd\xc9\x2c\x72\xe6\x09\x7e\x71\x2d\x9c\x77\xd5\x76\xef\x35\xe3\x39\x7f\x8e\x8a\x52\x27\x34\x37\x6d\xbf\x68\x68\xde\x35\xf7\x04\x3f\x12\x80\x3e\x2b\xca\x2d\xcd\xe4\xae\x68\x2a\x9e\xa2\x63\xfe\x45\xf3\x42\xbf\xb2\x62\xb5\x6a\xf7\xcd\xb0\xec\xab\x61\xa8\x9b\x35\xcf\xf5\xb1\x24\xe5\xe7\x9a\x94\xb9\xbc\x90\x76\xdb\xee\xc3\x6a\x52\xfa\x9f\xe9\x67\x7e\x26\x3f\x25\xcf\x15\x42\x66\x28\xc9\x23\xe9\x97\x57\x55\x55\xca\x58\xfa\xfc\x39\x7d\x67\xbb\xfd\x66\x43\xb3\xf6\x97\x7d\xd5\x0f\x5c\xe8\x8c\x7e\xd3\xf8\xe5\x77\x56\xf7\x3d\x7d\x50\xf2\x2b\x7c\x64\xb4\x74\xcd\x0a\x83\x79\x8a\x8f\x2c\xfb\xad\xaf\x8a\x6e\x75\xfd\x2e\x93\xbf\xe8\x2b\x7f\x30\xea\x1d\x5a\x54\xc6\x23\xc5\x21\x69\xc1\x1a\xc8\x56\x6d\xc9\x3f\x9e\xd2\x1f\xaa\xba\x6e\xfa\xa1\xd8\x6c\xde\x65\xfa\xc1\x60\xf2\x25\x0b\x30\xd4\x03\x66\x41\x13\xf3\xf3\xa1\xda\xf5\xbc\x82\xf9\xf3\xba\xeb\x87\xc7\x43\x4d\xb8\xfa\x76\xdf\x64\x65\xbb\x7a\x4f\xbb\x80\x77\x34\x5a\x7e\x75\x95\xd3\x64\x3d\xa2\x7d\xd0\xed\x9b\x86\xa6\x27\x7f\xd1\xd2\x94\x51\x33\x35\xb5\xff\x0c\xd0\x47\xf9\x6e\x53\x15\x3d\x81\x54\x45\x99\xff\x50\xe4\x43\xd1\xad\xab\xe1\xc9\x83\xe5\x25\xed\xbe\xf7\x0f\xf2\xeb\xae\xba\x7a\xf2\xe0\x61\xff\xe0\xc7\x17\x7b\x2a\xb6\xa9\x9b\xaa\xff\xe1\xeb\xe2\xc7\x7c\x55\x50\x0e\x4d\xe3\x6d\x7e\x59\x5d\xf1\x66\xa3\xb6\x72\xc2\xf2\x66\xcd\x1b\xed\x76\xb8\xe6\x06\x09\x13\xe8\xa3\xcf\x79\xa7\x7f\x91\xf1\x02\x10\x25\x58\x96\x97\x46\xd5\xd0\x21\x24\x77\xb4\x00\x27\xb7\xe7\xff\xfe\xfa\x28\x3f\x23\xd2\xb6\xee\x2a\x7c\xd3\x7f\x54\xe2\xbb\x9c\x46\x7b\x51\x3f\xfb\x79\x91\x51\x59\x9b\x90\x67\xc5\x50\x5c\x72\xdf\xc3\xea\x73\xa6\x6c\xc2\x90\x87\xad\xc8\xc4\x12\x84\xb1\x1f\x92\x65\x99\xdb\xc8\x54\x87\xee\xfe\x50\xc7\x1b\x26\x01\x94\x1e\x66\xf6\x4c\xe6\x8c\xaa\xca\x5f\xbd\x79\x73\xfa\xec\xe7\xbc\x6a\xd6\x34\x33\xf9\x4d\x3d\x5c\xe7\xfb\xe1\xea\xbf\x2f\xd7\x55\x53\x75\xc5\x66\xb9\xaa\x79\x52\x3a\x42\xd8\x9c\x66\x49\x86\xb8\xc8\xfa\x7e\x43\x14\x0a\x58\x70\x7e\xfe\x3a\x3f\x61\x4c\xd8\x15\xc3\x35\x3a\x32\x5c\x67\xfd\x5f\x36\x3c\x51\xa1\xc1\x8b\xeb\x2a\xc7\x66\x00\x50\x7b\x35\x9e\x97\xbc\xd4\xbe\x2e\xb2\xaa\xeb\x96\x44\x40\x87\x5b\x9e\x66\xad\xf3\x10\xb4\x54\x47\xd8\xde\xb4\x03\x2d\x63\x8e\x72\x52\x45\xdd\x7c\x28\x36\x75\x49\x93\x1d\x27\x24\x2d\x8b\xc4\xb2\xa5\x75\xe3\xd2\x84\x99\xed\x0d\x86\x5a\xac\x88\xfe\xf7\xf9\x83\xc5\x03\x10\xdc\x07\x8f\x1f\x2c\xb2\xa6\x5d\x0a\x95\x60\xd2\x5c\xd6\x7d\x71\x49\x64\x5a\x8e\x8d\xce\xa8\xde\x9f\x19\x7f\xa4\x2b\x0a\x91\x27\x10\x3c\xb7\x7c\x14\xe1\x04\x60\xe4\x2a\x88\x5e\x83\xd8\x28\x99\xf1\x63\x37\x9a\x14\xd6\x57\xc8\x52\x48\x98\x8c\x39\xb3\x05\x33\xec\x3a\xde\xed\x36\xf5\x4a\x9a\x7e\x21\x79\x11\xd1\xf8\x60\xd6\x49\xf1\x70\x40\x14\xcb\x73\xe8\x42\xbd\x66\xb2\x95\x27\x74\x1e\xe5\xaf\x2b\xda\x39\xd7\xfb\xb5\x1c\x4e\x9b\x76\x5f\x7e\x01\x82\x62\x2b\x17\xe9\x49\xfe\xb6\xa5\x0e\x03\x3b\x02\x40\x6c\xe2\x98\x08\x03\xf3\x02\x5d\xb5\x6d\x07\x9e\x38\x2d\x56\xd3\xf2\xdc\xd4\x94\x49\x23\xed\x8b\x0f\x44\x16\x87\x56\xb6\x64\x49\x5b\x6e\xc5\x15\x13\x05\xdb\xd3\x81\x2e\xdb\x82\xe8\x88\x6c\x0d\x4b\x4b\x71\x10\x50\xdb\x3d\xed\xa6\x6b\xaa\x8c\x27\x9e\x19\x12\xaa\x72\xae\x9f\x18\x12\xd5\x83\x5d\x4e\x3b\xb7\xa5\xc3\x93\x17\xfa\x19\x3e\xf4\xb7\xaf\x9f\x7a\x55\x5c\x5d\x51\xaf\x7a\xda\x15\x2f\xf3\xd5\xa6\xa5\x2d\xf5\xeb\xdb\xd7\x3d\x6f\x98\xeb\xe5\xae\xed\xc0\x88\x50\xd6\x19\x7d\x86\x34\x37\xd1\x0c\xd1\xec\xb7\x97\xf4\xeb\xe6\xba\x26\x42\x8d\x69\xe7\x12\xcc\x24\x51\x2Line truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 47539, mode: os.FileMode(420), modTime: time.Unix(1449464702, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 47677, mode: os.FileMode(420), modTime: time.Unix(1449621711, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
@@ -4399,7 +4399,7 @@ func confLocaleLocale_esEsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_es-ES.ini", size: 51578, mode: os.FileMode(493), modTime: time.Unix(1449482922, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_es-ES.ini", size: 51578, mode: os.FileMode(493), modTime: time.Unix(1449533063, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
|
||||
ctx.Handle(500, "AutoSignIn", err)
|
||||
return
|
||||
} else if succeed {
|
||||
log.Trace("Auto-login succeed: %s", ctx.Session.Get("uname"))
|
||||
ctx.Redirect(setting.AppSubUrl + ctx.Req.RequestURI)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@ func RepoAssignment(args ...bool) macaron.Handler {
|
||||
return
|
||||
}
|
||||
ctx.Data["MirrorInterval"] = ctx.Repo.Mirror.Interval
|
||||
ctx.Data["Mirror"] = ctx.Repo.Mirror
|
||||
}
|
||||
|
||||
ctx.Repo.Repository = repo
|
||||
|
||||
@@ -234,7 +234,7 @@ func Migrate(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
log.Error(4, "DeleteRepository: %v", errDelete)
|
||||
}
|
||||
}
|
||||
ctx.APIError(500, "MigrateRepository", err)
|
||||
ctx.APIError(500, "MigrateRepository", models.HandleCloneUserCredentials(err.Error(), true))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -41,7 +41,8 @@ func checkRunMode() {
|
||||
macaron.Env = macaron.PROD
|
||||
macaron.ColorLog = false
|
||||
setting.ProdMode = true
|
||||
git.Debug = false
|
||||
default:
|
||||
git.Debug = true
|
||||
}
|
||||
log.Info("Run Mode: %s", strings.Title(macaron.Env))
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
RemoteAddr: remoteAddr,
|
||||
})
|
||||
if err == nil {
|
||||
log.Trace("Repository migrated[%d]: %s/%s", repo.ID, ctxUser.Name, form.RepoName)
|
||||
log.Trace("Repository migrated [%d]: %s/%s", repo.ID, ctxUser.Name, form.RepoName)
|
||||
ctx.Redirect(setting.AppSubUrl + "/" + ctxUser.Name + "/" + form.RepoName)
|
||||
return
|
||||
}
|
||||
@@ -206,11 +206,11 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
if strings.Contains(err.Error(), "Authentication failed") ||
|
||||
strings.Contains(err.Error(), "could not read Username") {
|
||||
ctx.Data["Err_Auth"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("form.auth_failed", strings.Replace(err.Error(), ":"+form.AuthPassword+"@", ":<password>@", 1)), MIGRATE, &form)
|
||||
ctx.RenderWithErr(ctx.Tr("form.auth_failed", models.HandleCloneUserCredentials(err.Error(), true)), MIGRATE, &form)
|
||||
return
|
||||
} else if strings.Contains(err.Error(), "fatal:") {
|
||||
ctx.Data["Err_CloneAddr"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.migrate.failed", strings.Replace(err.Error(), ":"+form.AuthPassword+"@", ":<password>@", 1)), MIGRATE, &form)
|
||||
ctx.RenderWithErr(ctx.Tr("repo.migrate.failed", models.HandleCloneUserCredentials(err.Error(), true)), MIGRATE, &form)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -109,9 +109,14 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||
ctx.Repo.Mirror.Interval = form.Interval
|
||||
ctx.Repo.Mirror.NextUpdate = time.Now().Add(time.Duration(form.Interval) * time.Hour)
|
||||
if err := models.UpdateMirror(ctx.Repo.Mirror); err != nil {
|
||||
log.Error(4, "UpdateMirror: %v", err)
|
||||
ctx.Handle(500, "UpdateMirror", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
if err := ctx.Repo.Mirror.SaveAddress(form.MirrorAddress); err != nil {
|
||||
ctx.Handle(500, "SaveAddress", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ctx.Flash.Success(ctx.Tr("repo.settings.update_settings_success"))
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
0.7.34.1208 Beta
|
||||
0.7.35.1208 Beta
|
||||
@@ -8,7 +8,7 @@
|
||||
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
|
||||
<div class="divider"> / </div>
|
||||
<a href="{{$.RepoLink}}">{{.Name}}</a>
|
||||
{{if .IsMirror}}<div class="ui label">{{$.i18n.Tr "mirror"}}</div>{{end}}
|
||||
{{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" href="{{$.MirrorAddress}}">{{$.Mirror.Address}}</a></div>{{end}}
|
||||
{{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.RepoLink}}">{{SubStr .BaseRepo.RepoLink 1 -1}}</a></div>{{end}}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -55,6 +55,11 @@
|
||||
<label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
|
||||
<input id="interval" name="interval" type="number" value="{{.MirrorInterval}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="mirror_address">{{.i18n.Tr "repo.mirror_address"}}</label>
|
||||
<input id="mirror_address" name="mirror_address" value="{{.Mirror.FullAddress}}">
|
||||
<p class="help">{{.i18n.Tr "repo.mirror_address_desc"}}</p>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
Reference in new issue
Block a user