{{template "repo/clone_buttons" .}}
+ {{template "repo/clone_script" .}}
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
index 91a15f19e2e35..21affddc623e2 100644
--- a/templates/repo/wiki/view.tmpl
+++ b/templates/repo/wiki/view.tmpl
@@ -31,6 +31,7 @@
{{template "repo/clone_buttons" .}}
+ {{template "repo/clone_script" .}}
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index c0dd50a7b9e18..daec38044f9f0 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -8774,6 +8774,233 @@
}
}
},
+ "/repos/{owner}/{repo}/push_mirrors": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get all push mirrors of the repository",
+ "operationId": "repoListPushMirrors",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/PushMirrorList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ },
+ "post": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "add a push mirror to the repository",
+ "operationId": "repoAddPushMirror",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "body",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/CreatePushMirrorOption"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "$ref": "#/responses/PushMirror"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/push_mirrors-sync": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Sync all push mirrored repository",
+ "operationId": "repoPushMirrorSync",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo to sync",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo to sync",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/empty"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/push_mirrors/{name}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get push mirror of the repository by remoteName",
+ "operationId": "repoGetPushMirrorByRemoteName",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "remote name of push mirror",
+ "name": "name",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/PushMirror"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ },
+ "delete": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "deletes a push mirror from a repository by remoteName",
+ "operationId": "repoDeletePushMirror",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "remote name of the pushMirror",
+ "name": "name",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/raw/{filepath}": {
"get": {
"produces": [
@@ -14441,6 +14668,29 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "CreatePushMirrorOption": {
+ "type": "object",
+ "title": "CreatePushMirrorOption represents need information to create a push mirror of a repository.",
+ "properties": {
+ "interval": {
+ "type": "string",
+ "x-go-name": "Interval"
+ },
+ "remote_address": {
+ "type": "string",
+ "x-go-name": "RemoteAddress"
+ },
+ "remote_password": {
+ "type": "string",
+ "x-go-name": "RemotePassword"
+ },
+ "remote_username": {
+ "type": "string",
+ "x-go-name": "RemoteUsername"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"CreateReleaseOption": {
"description": "CreateReleaseOption options when creating a release",
"type": "object",
@@ -17516,6 +17766,41 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "PushMirror": {
+ "description": "PushMirror represents information of a push mirror",
+ "type": "object",
+ "properties": {
+ "created": {
+ "type": "string",
+ "x-go-name": "CreatedUnix"
+ },
+ "interval": {
+ "type": "string",
+ "x-go-name": "Interval"
+ },
+ "last_error": {
+ "type": "string",
+ "x-go-name": "LastError"
+ },
+ "last_update": {
+ "type": "string",
+ "x-go-name": "LastUpdateUnix"
+ },
+ "remote_address": {
+ "type": "string",
+ "x-go-name": "RemoteAddress"
+ },
+ "remote_name": {
+ "type": "string",
+ "x-go-name": "RemoteName"
+ },
+ "repo_name": {
+ "type": "string",
+ "x-go-name": "RepoName"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"Reaction": {
"description": "Reaction contain one reaction",
"type": "object",
@@ -19293,6 +19578,21 @@
}
}
},
+ "PushMirror": {
+ "description": "PushMirror",
+ "schema": {
+ "$ref": "#/definitions/PushMirror"
+ }
+ },
+ "PushMirrorList": {
+ "description": "PushMirrorList",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PushMirror"
+ }
+ }
+ },
"Reaction": {
"description": "Reaction",
"schema": {
@@ -19572,7 +19872,7 @@
"parameterBodies": {
"description": "parameterBodies",
"schema": {
- "$ref": "#/definitions/CreateWikiPageOptions"
+ "$ref": "#/definitions/CreatePushMirrorOption"
}
},
"redirect": {
diff --git a/templates/user/overview/header.tmpl b/templates/user/overview/header.tmpl
index 8f9ad1d6ccfba..edd4375e08c39 100644
--- a/templates/user/overview/header.tmpl
+++ b/templates/user/overview/header.tmpl
@@ -1,14 +1,22 @@