summaryrefslogtreecommitdiffstats
path: root/models/repo/pushmirror.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-09-16 18:03:02 +0200
committerGitHub <noreply@github.com>2023-09-16 16:03:02 +0000
commitc766140dad3408048ad843d0e7b4ab5d9f5777c6 (patch)
tree49cd37606ae0cb252cd16264c111c3cf5b00088d /models/repo/pushmirror.go
parent5e039b05801a2ceeb29b23c657110af02834b57e (diff)
downloadgitea-c766140dad3408048ad843d0e7b4ab5d9f5777c6.tar.gz
gitea-c766140dad3408048ad843d0e7b4ab5d9f5777c6.zip
Add `RemoteAddress` to mirrors (#26952)
This PR adds a new field `RemoteAddress` to both mirror types which contains the sanitized remote address for easier (database) access to that information. Will be used in the audit PR if merged.
Diffstat (limited to 'models/repo/pushmirror.go')
-rw-r--r--models/repo/pushmirror.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/models/repo/pushmirror.go b/models/repo/pushmirror.go
index 3edbcceb9b..73c1384444 100644
--- a/models/repo/pushmirror.go
+++ b/models/repo/pushmirror.go
@@ -20,10 +20,11 @@ var ErrPushMirrorNotExist = util.NewNotExistErrorf("PushMirror does not exist")
// PushMirror represents mirror information of a repository.
type PushMirror struct {
- ID int64 `xorm:"pk autoincr"`
- RepoID int64 `xorm:"INDEX"`
- Repo *Repository `xorm:"-"`
- RemoteName string
+ ID int64 `xorm:"pk autoincr"`
+ RepoID int64 `xorm:"INDEX"`
+ Repo *Repository `xorm:"-"`
+ RemoteName string
+ RemoteAddress string `xorm:"VARCHAR(2048)"`
SyncOnCommit bool `xorm:"NOT NULL DEFAULT true"`
Interval time.Duration
@@ -31,6 +32,7 @@ type PushMirror struct {
LastUpdateUnix timeutil.TimeStamp `xorm:"INDEX last_update"`
LastError string `xorm:"text"`
}
+
type PushMirrorOptions struct {
ID int64
RepoID int64