File tree Expand file tree Collapse file tree 6 files changed +14
-5
lines changed Expand file tree Collapse file tree 6 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,8 @@ COOKIE_REMEMBER_NAME = gitea_incredible
173
173
REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER
174
174
; Sets the minimum password length for new Users
175
175
MIN_PASSWORD_LENGTH = 6
176
+ ; True when users are allowed to import local server paths
177
+ IMPORT_LOCAL_PATHS = false
176
178
177
179
[service]
178
180
ACTIVE_CODE_LIVE_MINUTES = 180
Original file line number Diff line number Diff line change @@ -233,6 +233,9 @@ func (u *User) CanEditGitHook() bool {
233
233
234
234
// CanImportLocal returns true if user can migrate repository by local path.
235
235
func (u * User ) CanImportLocal () bool {
236
+ if ! setting .ImportLocalPaths {
237
+ return false
238
+ }
236
239
return u .IsAdmin || u .AllowImportLocal
237
240
}
238
241
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ var (
114
114
CookieRememberName string
115
115
ReverseProxyAuthUser string
116
116
MinPasswordLength int
117
+ ImportLocalPaths bool
117
118
118
119
// Database settings
119
120
UseSQLite3 bool
@@ -712,6 +713,7 @@ please consider changing to GITEA_CUSTOM`)
712
713
CookieRememberName = sec .Key ("COOKIE_REMEMBER_NAME" ).MustString ("gitea_incredible" )
713
714
ReverseProxyAuthUser = sec .Key ("REVERSE_PROXY_AUTHENTICATION_USER" ).MustString ("X-WEBAUTH-USER" )
714
715
MinPasswordLength = sec .Key ("MIN_PASSWORD_LENGTH" ).MustInt (6 )
716
+ ImportLocalPaths = sec .Key ("IMPORT_LOCAL_PATHS" ).MustBool (false )
715
717
716
718
sec = Cfg .Section ("attachment" )
717
719
AttachmentPath = sec .Key ("PATH" ).MustString (path .Join (AppDataPath , "attachments" ))
@@ -897,11 +899,11 @@ func newLogService() {
897
899
898
900
useConsole := false
899
901
for _ , mode := range LogModes {
900
- if mode == "console" {
902
+ if mode == "console" {
901
903
useConsole = true
902
904
}
903
905
}
904
- if ( ! useConsole ) {
906
+ if ! useConsole {
905
907
log .DelLogger ("console" )
906
908
}
907
909
Original file line number Diff line number Diff line change @@ -425,7 +425,8 @@ migrate_type = Migration Type
425
425
migrate_type_helper = This repository will be a <span class="text blue">mirror</span>
426
426
migrate_repo = Migrate Repository
427
427
migrate.clone_address = Clone Address
428
- migrate.clone_address_desc = This can be a HTTP/HTTPS/GIT URL or local server path.
428
+ migrate.clone_address_desc = This can be a HTTP/HTTPS/GIT URL
429
+ migrate.clone_local_path = or local server path
429
430
migrate.permission_denied = You are not allowed to import local repositories.
430
431
migrate.invalid_local_path = Invalid local path, it does not exist or not a directory.
431
432
migrate.failed = Migration failed: %v
Original file line number Diff line number Diff line change @@ -384,7 +384,8 @@ migrate_type=Migratie type
384
384
migrate_type_helper=Deze repository zal een <span class="text blue">kopie</span> zijn
385
385
migrate_repo=Migreer repository
386
386
migrate.clone_address=Kloon adres
387
- migrate.clone_address_desc=Dit kan een HTTP/HTTPS/GIT URL zijn of een lokaal pad.
387
+ migrate.clone_address_desc=Dit kan een HTTP/HTTPS/GIT URL zijn
388
+ migrate.clone_local_path =of een lokaal pad
388
389
migrate.permission_denied=U bent niet gemachtigd om deze lokale repositories te importeren.
389
390
migrate.invalid_local_path=Ongeldig lokaal pad, het pad bestaat niet of het is geen map.
390
391
migrate.failed=Migratie is mislukt: %v
Original file line number Diff line number Diff line change 12
12
<div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
13
13
<label for="clone_addr">{{.i18n.Tr "repo.migrate.clone_address"}}</label>
14
14
<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
15
- <span class="help">{{.i18n.Tr "repo.migrate.clone_address_desc"}}</span>
15
+ <span class="help">{{.i18n.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.i18n.Tr "repo.migrate.clone_local_path"}}{{end}} </span>
16
16
</div>
17
17
<div class="ui accordion optional field">
18
18
<div class="title {{if .Err_Auth}}text red active{{end}}">
You can’t perform that action at this time.
0 commit comments