summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--custom/conf/app.example.ini2
-rw-r--r--docs/content/doc/advanced/config-cheat-sheet.en-us.md2
-rw-r--r--options/locale/locale_en-US.ini1
-rw-r--r--routers/web/user/home.go1
-rw-r--r--services/cron/tasks_basic.go4
-rw-r--r--templates/repo/migrate/options.tmpl11
-rw-r--r--templates/user/dashboard/repolist.tmpl2
7 files changed, 12 insertions, 11 deletions
diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini
index 9a50564769..5814c0d69d 100644
--- a/custom/conf/app.example.ini
+++ b/custom/conf/app.example.ini
@@ -2091,7 +2091,7 @@ PATH =
;[mirror]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Enables the mirror functionality. Set to **false** to disable all mirrors.
+;; Enables the mirror functionality. Set to **false** to disable all mirrors. Pre-existing mirrors remain valid but won't be updated; may be converted to regular repo.
;ENABLED = true
;; Disable the creation of **new** pull mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
;DISABLE_NEW_PULL = false
diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md
index 2dae3526f9..edd23012fb 100644
--- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md
+++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md
@@ -1095,7 +1095,7 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
## Mirror (`mirror`)
-- `ENABLED`: **true**: Enables the mirror functionality. Set to **false** to disable all mirrors.
+- `ENABLED`: **true**: Enables the mirror functionality. Set to **false** to disable all mirrors. Pre-existing mirrors remain valid but won't be updated; may be converted to regular repo.
- `DISABLE_NEW_PULL`: **false**: Disable the creation of **new** pull mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
- `DISABLE_NEW_PUSH`: **false**: Disable the creation of **new** push mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
- `DEFAULT_INTERVAL`: **8h**: Default interval between each check
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 66dad56fd0..5dfe929009 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -930,7 +930,6 @@ need_auth = Authorization
migrate_options = Migration Options
migrate_service = Migration Service
migrate_options_mirror_helper = This repository will be a <span class="text blue">mirror</span>
-migrate_options_mirror_disabled = Your site administrator has disabled new mirrors.
migrate_options_lfs = Migrate LFS files
migrate_options_lfs_endpoint.label = LFS Endpoint
migrate_options_lfs_endpoint.description = Migration will attempt to use your Git remote to <a target="_blank" rel="noopener noreferrer" href="%s">determine the LFS server</a>. You can also specify a custom endpoint if the repository LFS data is stored somewhere else.
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index 2a802053fb..455761d039 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -78,6 +78,7 @@ func Dashboard(ctx *context.Context) {
ctx.Data["PageIsNews"] = true
cnt, _ := organization.GetOrganizationCount(ctx, ctxUser)
ctx.Data["UserOrgsCount"] = cnt
+ ctx.Data["MirrorsEnabled"] = setting.Mirror.Enabled
var uid int64
if ctxUser != nil {
diff --git a/services/cron/tasks_basic.go b/services/cron/tasks_basic.go
index 6f3fcb42c3..39fda34ea2 100644
--- a/services/cron/tasks_basic.go
+++ b/services/cron/tasks_basic.go
@@ -155,7 +155,9 @@ func registerCleanupPackages() {
}
func initBasicTasks() {
- registerUpdateMirrorTask()
+ if setting.Mirror.Enabled {
+ registerUpdateMirrorTask()
+ }
registerRepoHealthCheck()
registerCheckRepoStats()
registerArchiveCleanup()
diff --git a/templates/repo/migrate/options.tmpl b/templates/repo/migrate/options.tmpl
index 8aefaf68f1..bb2a6ed77f 100644
--- a/templates/repo/migrate/options.tmpl
+++ b/templates/repo/migrate/options.tmpl
@@ -1,15 +1,12 @@
+{{if not .DisableNewPullMirrors}}
<div class="inline field">
<label>{{.i18n.Tr "repo.migrate_options"}}</label>
<div class="ui checkbox">
- {{if .DisableNewPullMirrors}}
- <input id="mirror" name="mirror" type="checkbox" readonly>
- <label>{{.i18n.Tr "repo.migrate_options_mirror_disabled"}}</label>
- {{else}}
- <input id="mirror" name="mirror" type="checkbox" {{if .mirror}} checked{{end}}>
- <label>{{.i18n.Tr "repo.migrate_options_mirror_helper" | Safe}}</label>
- {{end}}
+ <input id="mirror" name="mirror" type="checkbox" {{if .mirror}} checked{{end}}>
+ <label>{{.i18n.Tr "repo.migrate_options_mirror_helper" | Safe}}</label>
</div>
</div>
+{{end}}
{{if .LFSActive}}
<div class="inline field">
<label></label>
diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl
index 41230d3287..b2f936402d 100644
--- a/templates/user/dashboard/repolist.tmpl
+++ b/templates/user/dashboard/repolist.tmpl
@@ -109,10 +109,12 @@
{{.i18n.Tr "forks"}}
<div v-show="reposFilter === 'forks'" class="ui circular mini grey label">${repoTypeCount}</div>
</a>
+ {{if .MirrorsEnabled}}
<a class="item" :class="{active: reposFilter === 'mirrors'}" @click="changeReposFilter('mirrors')">
{{.i18n.Tr "mirrors"}}
<div v-show="reposFilter === 'mirrors'" class="ui circular mini grey label">${repoTypeCount}</div>
</a>
+ {{end}}
<a class="item" :class="{active: reposFilter === 'collaborative'}" @click="changeReposFilter('collaborative')">
{{.i18n.Tr "collaborative"}}
<div v-show="reposFilter === 'collaborative'" class="ui circular mini grey label">${repoTypeCount}</div>