Forráskód Böngészése

admin/config: display repository related settings (#3816)

Unknwon 7 éve
szülő
commit
1083c0cd9a

+ 57 - 57
conf/app.ini

@@ -9,6 +9,63 @@ RUN_USER = git
 ; Either "dev", "prod" or "test"
 RUN_MODE = dev
 
+[server]
+PROTOCOL = http
+DOMAIN = localhost
+ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
+HTTP_ADDR = 0.0.0.0
+HTTP_PORT = 3000
+; Permission for unix socket
+UNIX_SOCKET_PERMISSION = 666
+; Local (DMZ) URL for Gogs workers (such as SSH update) accessing web service.
+; In most cases you do not need to change the default value.
+; Alter it only if your SSH server node is not the same as HTTP node.
+LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
+; Disable SSH feature when not available
+DISABLE_SSH = false
+; Whether use builtin SSH server or not.
+START_SSH_SERVER = false
+; Domain name to be exposed in SSH clone URL
+SSH_DOMAIN = %(DOMAIN)s
+; Port number to be exposed in SSH clone URL
+SSH_PORT = 22
+; Network interface builtin SSH server listens on
+SSH_LISTEN_HOST = 0.0.0.0
+; Port number builtin SSH server listens on
+SSH_LISTEN_PORT = %(SSH_PORT)s
+; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
+SSH_ROOT_PATH =
+; Choose the ciphers to support for SSH connections
+SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128
+; Directory to create temporary files when test publick key using ssh-keygen,
+; default is system temporary directory.
+SSH_KEY_TEST_PATH =
+; Path to ssh-keygen, default is 'ssh-keygen' and let shell find out which one to call.
+SSH_KEYGEN_PATH = ssh-keygen
+; Indicate whether to check minimum key size with corresponding type
+MINIMUM_KEY_SIZE_CHECK = false
+; Disable CDN even in "prod" mode
+OFFLINE_MODE = false
+DISABLE_ROUTER_LOG = false
+; Generate steps:
+; $ ./gogs cert -ca=true -duration=8760h0m0s -host=myhost.example.com
+;
+; Or from a .pfx file exported from the Windows certificate store (do
+; not forget to export the private key):
+; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys
+; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes
+CERT_FILE = custom/https/cert.pem
+KEY_FILE = custom/https/key.pem
+; Upper level of template and static file path
+; default is the path where Gogs is executed
+STATIC_ROOT_PATH =
+; Default path for App data
+APP_DATA_PATH = data
+; Application level GZIP support
+ENABLE_GZIP = false
+; Landing page for non-logged users, can be "home" or "explore"
+LANDING_PAGE = home
+
 [repository]
 ; Root path for storing repositories's data, default is "~/<username>/gogs-repositories"
 ROOT =
@@ -67,63 +124,6 @@ CUSTOM_URL_SCHEMES =
 ; Separate extensions with a comma. To render files w/o extension as markdown, just put a comma
 FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd
 
-[server]
-PROTOCOL = http
-DOMAIN = localhost
-ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
-HTTP_ADDR = 0.0.0.0
-HTTP_PORT = 3000
-; Permission for unix socket
-UNIX_SOCKET_PERMISSION = 666
-; Local (DMZ) URL for Gogs workers (such as SSH update) accessing web service.
-; In most cases you do not need to change the default value.
-; Alter it only if your SSH server node is not the same as HTTP node.
-LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
-; Disable SSH feature when not available
-DISABLE_SSH = false
-; Whether use builtin SSH server or not.
-START_SSH_SERVER = false
-; Domain name to be exposed in SSH clone URL
-SSH_DOMAIN = %(DOMAIN)s
-; Port number to be exposed in SSH clone URL
-SSH_PORT = 22
-; Network interface builtin SSH server listens on
-SSH_LISTEN_HOST = 0.0.0.0
-; Port number builtin SSH server listens on
-SSH_LISTEN_PORT = %(SSH_PORT)s
-; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
-SSH_ROOT_PATH =
-; Choose the ciphers to support for SSH connections
-SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128
-; Directory to create temporary files when test publick key using ssh-keygen,
-; default is system temporary directory.
-SSH_KEY_TEST_PATH =
-; Path to ssh-keygen, default is 'ssh-keygen' and let shell find out which one to call.
-SSH_KEYGEN_PATH = ssh-keygen
-; Indicate whether to check minimum key size with corresponding type
-MINIMUM_KEY_SIZE_CHECK = false
-; Disable CDN even in "prod" mode
-OFFLINE_MODE = false
-DISABLE_ROUTER_LOG = false
-; Generate steps:
-; $ ./gogs cert -ca=true -duration=8760h0m0s -host=myhost.example.com
-;
-; Or from a .pfx file exported from the Windows certificate store (do
-; not forget to export the private key):
-; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys
-; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes
-CERT_FILE = custom/https/cert.pem
-KEY_FILE = custom/https/key.pem
-; Upper level of template and static file path
-; default is the path where Gogs is executed
-STATIC_ROOT_PATH =
-; Default path for App data
-APP_DATA_PATH = data
-; Application level GZIP support
-ENABLE_GZIP = false
-; Landing page for non-logged users, can be "home" or "explore"
-LANDING_PAGE = home
-
 [http]
 ; Value for Access-Control-Allow-Origin header, default is not to present
 ACCESS_CONTROL_ALLOW_ORIGIN = 

+ 10 - 2
conf/locale/locale_en-US.ini

@@ -1072,10 +1072,8 @@ config.disable_router_log = Disable Router Log
 config.run_user = Run User
 config.run_mode = Run Mode
 config.git_version = Git Version
-config.repo_root_path = Repository Root Path
 config.static_file_root_path = Static File Root Path
 config.log_file_root_path = Log File Root Path
-config.script_type = Script Type
 config.reverse_auth_user = Reverse Authentication User
 
 config.ssh_config = SSH Configuration
@@ -1090,6 +1088,16 @@ config.ssh_keygen_path = Keygen ('ssh-keygen') Path
 config.ssh_minimum_key_size_check = Minimum Key Size Check
 config.ssh_minimum_key_sizes = Minimum Key Sizes
 
+config.repo_config = Repository Configuration
+config.repo_root_path = Repository Root Path
+config.script_type = Script Type
+config.repo_force_private = Force Private
+config.max_creation_limit = Max Creation Limit
+config.preferred_licenses = Preferred Licenses
+config.disable_http_git = Disable HTTP Git
+config.enable_local_path_migration = Enable Local Path Migration
+config.commits_fetch_concurrency = Commits Fetch Concurrency
+
 config.db_config = Database Configuration
 config.db_type = Type
 config.db_host = Host

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
modules/bindata/bindata.go


+ 1 - 0
modules/template/template.go

@@ -91,6 +91,7 @@ func NewFuncMap() []template.FuncMap {
 			}
 			return str[start:end]
 		},
+		"Join":              strings.Join,
 		"EllipsisString":    base.EllipsisString,
 		"DiffTypeToStr":     DiffTypeToStr,
 		"DiffLineTypeToStr": DiffLineTypeToStr,

+ 5 - 3
routers/admin/admin.go

@@ -199,15 +199,16 @@ func Config(ctx *context.Context) {
 	ctx.Data["DisableRouterLog"] = setting.DisableRouterLog
 	ctx.Data["RunUser"] = setting.RunUser
 	ctx.Data["RunMode"] = strings.Title(macaron.Env)
-	ctx.Data["GitVersion"] = setting.Git.Version
-	ctx.Data["RepoRootPath"] = setting.RepoRootPath
 	ctx.Data["StaticRootPath"] = setting.StaticRootPath
 	ctx.Data["LogRootPath"] = setting.LogRootPath
-	ctx.Data["ScriptType"] = setting.ScriptType
 	ctx.Data["ReverseProxyAuthUser"] = setting.ReverseProxyAuthUser
 
 	ctx.Data["SSH"] = setting.SSH
 
+	ctx.Data["RepoRootPath"] = setting.RepoRootPath
+	ctx.Data["ScriptType"] = setting.ScriptType
+	ctx.Data["Repository"] = setting.Repository
+
 	ctx.Data["Service"] = setting.Service
 	ctx.Data["DbCfg"] = models.DbCfg
 	ctx.Data["Webhook"] = setting.Webhook
@@ -227,6 +228,7 @@ func Config(ctx *context.Context) {
 	ctx.Data["DisableGravatar"] = setting.DisableGravatar
 	ctx.Data["EnableFederatedAvatar"] = setting.EnableFederatedAvatar
 
+	ctx.Data["GitVersion"] = setting.Git.Version
 	ctx.Data["Git"] = setting.Git
 
 	type logger struct {

+ 27 - 10
templates/admin/config.tmpl

@@ -32,19 +32,10 @@
 
 						<div class="ui divider"></div>
 
-						<dt>{{.i18n.Tr "admin.config.git_version"}}</dt>
-						<dd>{{.GitVersion}}</dd>
-
-						<div class="ui divider"></div>
-
-						<dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt>
-						<dd>{{.RepoRootPath}}</dd>
 						<dt>{{.i18n.Tr "admin.config.static_file_root_path"}}</dt>
 						<dd>{{.StaticRootPath}}</dd>
 						<dt>{{.i18n.Tr "admin.config.log_file_root_path"}}</dt>
 						<dd>{{.LogRootPath}}</dd>
-						<dt>{{.i18n.Tr "admin.config.script_type"}}</dt>
-						<dd>{{.ScriptType}}</dd>
 						<dt>{{.i18n.Tr "admin.config.reverse_auth_user"}}</dt>
 						<dd>{{.ReverseProxyAuthUser}}</dd>
 					</dl>
@@ -85,6 +76,30 @@
 					</dl>
 				</div>
 
+				<h4 class="ui top attached header">
+					{{.i18n.Tr "admin.config.repo_config"}}
+				</h4>
+				<div class="ui attached table segment">
+					<dl class="dl-horizontal admin-dl-horizontal">
+						<dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt>
+						<dd>{{.RepoRootPath}}</dd>
+						<dt>{{.i18n.Tr "admin.config.script_type"}}</dt>
+						<dd><code>{{.ScriptType}}</code></dd>
+						<dt>{{.i18n.Tr "admin.config.repo_force_private"}}</dt>
+						<dd><i class="fa fa{{if .Repository.ForcePrivate}}-check{{end}}-square-o"></i></dd>
+						<dt>{{.i18n.Tr "admin.config.max_creation_limit"}}</dt>
+						<dd><code>{{.Repository.MaxCreationLimit}}</code></dd>
+						<dt>{{.i18n.Tr "admin.config.preferred_licenses"}}</dt>
+						<dd><code>{{Join .Repository.PreferredLicenses ", "}}</code></dd>
+						<dt>{{.i18n.Tr "admin.config.disable_http_git"}}</dt>
+						<dd><i class="fa fa{{if .Repository.DisableHTTPGit}}-check{{end}}-square-o"></i></dd>
+						<dt>{{.i18n.Tr "admin.config.enable_local_path_migration"}}</dt>
+						<dd><i class="fa fa{{if .Repository.EnableLocalPathMigration}}-check{{end}}-square-o"></i></dd>
+						<dt>{{.i18n.Tr "admin.config.commits_fetch_concurrency"}}</dt>
+						<dd><code>{{.Repository.CommitsFetchConcurrency}}</code></dd>
+					</dl>
+				</div>
+
 				<h4 class="ui top attached header">
 					{{.i18n.Tr "admin.config.db_config"}}
 				</h4>
@@ -231,6 +246,8 @@
 				</h4>
 				<div class="ui attached table segment">
 					<dl class="dl-horizontal admin-dl-horizontal">
+						<dt>{{.i18n.Tr "admin.config.git_version"}}</dt>
+						<dd>{{.GitVersion}}</dd>
 						<dt>{{.i18n.Tr "admin.config.git_disable_diff_highlight"}}</dt>
 						<dd><i class="fa fa{{if .Git.DisableDiffHighlight}}-check{{end}}-square-o"></i></dd>
 						<dt>{{.i18n.Tr "admin.config.git_max_diff_lines"}}</dt>
@@ -266,7 +283,7 @@
 							<dt>{{$.i18n.Tr "admin.config.log_mode"}}</dt>
 							<dd>{{.Mode}}</dd>
 							<dt>{{$.i18n.Tr "admin.config.log_config"}}</dt>
-							<dd><code>{{.Config}}</code></dd>
+							<dd><pre><code>{{.Config}}</code></pre></dd>
 						{{end}}
 					</dl>
 				</div>

+ 7 - 4
templates/base/head.tmpl

@@ -3,9 +3,11 @@
 <head data-suburl="{{AppSubUrl}}">
 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
-	<meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}Gogs{{end}}" />
-	<meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}Gogs is a painless self-hosted Git service{{end}}" />
-	<meta name="keywords" content="go, git, self-hosted, gogs">
+	{{if not .PageIsAdmin}}
+		<meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}Gogs{{end}}" />
+		<meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}Gogs is a painless self-hosted Git service{{end}}" />
+		<meta name="keywords" content="go, git, self-hosted, gogs">
+	{{end}}
 	<meta name="referrer" content="no-referrer" />
 	<meta name="_csrf" content="{{.CsrfToken}}" />
 	<meta name="_suburl" content="{{AppSubUrl}}" />
@@ -15,7 +17,8 @@
 	{{end}}
 	
 	<!-- Open Graph Tags -->
-	{{if .PageIsUserProfile}}
+	{{if .PageIsAdmin}}
+	{{else if .PageIsUserProfile}}
 		<meta property="og:url" content="{{.Owner.HTMLURL}}" />
 		<meta property="og:type" content="profile" />
 		<meta property="og:title" content="{{.Owner.Name}}{{if .Owner.FullName}} ({{.Owner.FullName}}){{end}}">

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott