Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
75e78f10
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
75e78f10
编写于
3月 08, 2017
作者:
N
Nick Thomas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The GitLab Pages external-http and external-https arguments can be specified multiple times
上级
d34300e3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
20 deletion
+25
-20
config/gitlab.yml.example
config/gitlab.yml.example
+2
-2
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+2
-2
doc/administration/pages/index.md
doc/administration/pages/index.md
+16
-11
features/steps/project/pages.rb
features/steps/project/pages.rb
+3
-3
lib/support/init.d/gitlab.default.example
lib/support/init.d/gitlab.default.example
+2
-2
未找到文件。
config/gitlab.yml.example
浏览文件 @
75e78f10
...
...
@@ -157,8 +157,8 @@ production: &base
host: example.com
port: 80 # Set to 443 if you serve the pages with HTTPS
https: false # Set to true if you serve the pages with HTTPS
# external_http:
"1.1.1.1:80"
# If defined, enables custom domain support in GitLab Pages
# external_https:
"1.1.1.1:443"
# If defined, enables custom domain and certificate support in GitLab Pages
# external_http:
["1.1.1.1:80", "[2001::1]:80"]
# If defined, enables custom domain support in GitLab Pages
# external_https:
["1.1.1.1:443", "[2001::1]:443"]
# If defined, enables custom domain and certificate support in GitLab Pages
## Mattermost
## For enabling Add to Mattermost button
...
...
config/initializers/1_settings.rb
浏览文件 @
75e78f10
...
...
@@ -278,8 +278,8 @@ Settings.pages['host'] ||= "example.com"
Settings
.
pages
[
'port'
]
||=
Settings
.
pages
.
https
?
443
:
80
Settings
.
pages
[
'protocol'
]
||=
Settings
.
pages
.
https
?
"https"
:
"http"
Settings
.
pages
[
'url'
]
||=
Settings
.
send
(
:build_pages_url
)
Settings
.
pages
[
'external_http'
]
||=
false
if
Settings
.
pages
[
'external_http'
].
nil
?
Settings
.
pages
[
'external_https'
]
||=
false
if
Settings
.
pages
[
'external_https'
].
nil
?
Settings
.
pages
[
'external_http'
]
||=
false
unless
Settings
.
pages
[
'external_http'
].
present
?
Settings
.
pages
[
'external_https'
]
||=
false
unless
Settings
.
pages
[
'external_https'
].
present
?
#
# Git LFS
...
...
doc/administration/pages/index.md
浏览文件 @
75e78f10
...
...
@@ -26,9 +26,9 @@ it works.
---
In the case of
[
custom domains
](
#custom-domains
)
(
but
not
[
wildcard domains
](
#wildcard-domains
)
), the Pages daemon needs to listen on
ports
`80`
and/or
`443`
. For that reason, there is some flexibility in the way
In the case of
[
custom domains
](
#custom-domains
)
(
but
not
[
wildcard domains
](
#wildcard-domains
)
), the Pages daemon needs to listen on
ports
`80`
and/or
`443`
. For that reason, there is some flexibility in the way
which you can set it up:
1.
Run the Pages daemon in the same server as GitLab, listening on a secondary IP.
...
...
@@ -65,11 +65,13 @@ you need to add a [wildcard DNS A record][wiki-wildcard-dns] pointing to the
host that GitLab runs. For example, an entry would look like this:
```
*.example.io. 1800 IN A 1.1.1.1
*.example.io. 1800 IN A 1.1.1.1
*.example.io. 1800 IN AAAA 2001::1
```
where
`example.io`
is the domain under which GitLab Pages will be served
and
`1.1.1.1`
is the IP address of your GitLab instance.
and
`1.1.1.1`
is the IPv4 address of your GitLab instance and
`2001::1`
is the
IPv6 address. If you don't have IPv6, you can omit the AAAA record.
> **Note:**
You should not use the GitLab domain to serve user pages. For more information
...
...
@@ -141,7 +143,8 @@ outside world.
In addition to the wildcard domains, you can also have the option to configure
GitLab Pages to work with custom domains. Again, there are two options here:
support custom domains with and without TLS certificates. The easiest setup is
that without TLS certificates.
that without TLS certificates. In either case, you'll need a secondary IP. If
you have IPv6 as well as IPv4 addresses, you can use them both.
### Custom domains
...
...
@@ -163,11 +166,12 @@ world. Custom domains are supported, but no TLS.
pages_external_url "http://example.io"
nginx['listen_addresses'] = ['1.1.1.1']
pages_nginx['enable'] = false
gitlab_pages['external_http'] =
'1.1.1.2:80'
gitlab_pages['external_http'] =
['1.1.1.2:80', '[2001::2]:80']
```
where `1.1.1.1` is the primary IP address that GitLab is listening to and
`1.1.1.2` the secondary IP where the GitLab Pages daemon listens to.
`1.1.1.2` and `2001::2` are the secondary IPs the GitLab Pages daemon
listens on. If you don't have IPv6, you can omit the IPv6 address.
1.
[
Reconfigure GitLab
][
reconfigure
]
...
...
@@ -194,12 +198,13 @@ world. Custom domains and TLS are supported.
pages_nginx['enable'] = false
gitlab_pages['cert'] = "/etc/gitlab/ssl/example.io.crt"
gitlab_pages['cert_key'] = "/etc/gitlab/ssl/example.io.key"
gitlab_pages['external_http'] =
'1.1.1.2:80'
gitlab_pages['external_https'] =
'1.1.1.2:443'
gitlab_pages['external_http'] =
['1.1.1.2:80', '[2001::2]:80']
gitlab_pages['external_https'] =
['1.1.1.2:443', '[2001::2]:443']
```
where `1.1.1.1` is the primary IP address that GitLab is listening to and
`1.1.1.2` the secondary IP where the GitLab Pages daemon listens to.
`1.1.1.2` and `2001::2` are the secondary IPs where the GitLab Pages daemon
listens on. If you don't have IPv6, you can omit the IPv6 address.
1.
[
Reconfigure GitLab
][
reconfigure
]
...
...
features/steps/project/pages.rb
浏览文件 @
75e78f10
...
...
@@ -53,13 +53,13 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps
end
step
'pages are exposed on external HTTP address'
do
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:external_http
).
and_return
(
'1.1.1.1:80'
)
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:external_http
).
and_return
(
[
'1.1.1.1:80'
]
)
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:external_https
).
and_return
(
nil
)
end
step
'pages are exposed on external HTTPS address'
do
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:external_http
).
and_return
(
'1.1.1.1:80'
)
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:external_https
).
and_return
(
'1.1.1.1:443'
)
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:external_http
).
and_return
(
[
'1.1.1.1:80'
]
)
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:external_https
).
and_return
(
[
'1.1.1.1:443'
]
)
end
step
'I should be able to add a New Domain'
do
...
...
lib/support/init.d/gitlab.default.example
浏览文件 @
75e78f10
...
...
@@ -56,14 +56,14 @@ gitlab_workhorse_log="$app_root/log/gitlab-workhorse.log"
# The value of -listen-http must be set to `gitlab.yml > pages > external_http`
# as well. For example:
#
# -listen-http 1.1.1.1:80
# -listen-http 1.1.1.1:80
-listen-http [2001::1]:80
#
# To enable HTTPS support for custom domains add the `-listen-https`,
# `-root-cert` and `-root-key` directives in `gitlab_pages_options` below.
# The value of -listen-https must be set to `gitlab.yml > pages > external_https`
# as well. For example:
#
# -listen-https 1.1.1.1:443 -root-cert /path/to/example.com.crt -root-key /path/to/example.com.key
# -listen-https 1.1.1.1:443 -
listen-http [2001::1]:443 -
root-cert /path/to/example.com.crt -root-key /path/to/example.com.key
#
# The -pages-domain must be specified the same as in `gitlab.yml > pages > host`.
# Set `gitlab_pages_enabled=true` if you want to enable the Pages feature.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录