Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
my Gitlab repo中的Web访问HTML文件_Html_Git_Gitlab_Web Access - Fatal编程技术网

my Gitlab repo中的Web访问HTML文件

my Gitlab repo中的Web访问HTML文件,html,git,gitlab,web-access,Html,Git,Gitlab,Web Access,我想使用Gitlab来管理web应用程序开发。是否可以从浏览器访问我在Gitlab repo中创建的html文件 目前有ssh/httpurl可访问repo,如: ssh: git@something.some.ca:balbal/web-app.git http: (ht tps://something.some.ca:balbal/web-app.git) 当我从浏览器访问httpshttps时,它将跳入git repo manage UI(比如显示所有提交、分支和详细信息文件) 我

我想使用
Gitlab
来管理web应用程序开发。是否可以从浏览器访问我在Gitlab repo中创建的
html
文件

目前有
ssh/http
url可访问repo,如:

ssh: git@something.some.ca:balbal/web-app.git   
http: (ht tps://something.some.ca:balbal/web-app.git)
当我从浏览器访问https
https
时,它将跳入git repo manage UI(比如显示所有提交、分支和详细信息文件)

我想要的是通过web访问我在repo中创建的特定
html
文件(就像我的repo中名为“www”的文件夹中有一个
index.html
文件)。我想要一些可以在浏览器中键入的URL,它将显示
index.html
内容。
我是否可以设置对这些
html
文件的web访问

到目前为止,Gitlab不支持此功能。对此有一个功能请求:

当前,如果您在Gitlab中查询原始html文件,它会设置某些HTTP头,使其呈现为文本/纯文本:

$ curl -I http://my-gitlab/user/project/raw/dev/doc/_book/index.html
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 20 Apr 2015 13:17:48 GMT
Content-Type: text/plain; charset=utf-8
Connection: keep-alive
Status: 200 OK
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: IE=edge
Content-Disposition: inline; filename="index.html"
Content-Transfer-Encoding: binary
Cache-Control: private
ETag: "b81191c550c47eae1ab4adf72dfd0c92"
Set-Cookie: request_method=HEAD; path=/
X-Request-Id: 04ae0499-2fdf-4f89-82ab-8392a8d6a076
X-Runtime: 0.019857

为了快速调试/测试,您可以使用FireFox插件

到文本/html

避免在公共GitLab上这样做,在您自己的GitLab部署上这样做,GitLab不应该被这样的黑客攻击


另请参见

对于Chrome,可以使用扩展名,例如,并通过更改浏览器中的内容类型来设置呈现HTML的标题。正如Christophe Roussy所提到的,这是一种黑客行为,您应该有充分的理由这样做。

幸运的是,在GitLab 10.1中,HTML文件的在线显示现在得到了官方支持

有关更多详细信息,请参阅

在GitLab 10.1中,我们介绍了由管道为公共项目创建的HTML文件的在线可视化,只需单击工件浏览器视图


您是要在代码中访问索引html,还是要呈现页面?如果你只是想看代码,你可以使用repo页面上raw按钮提供的链接我想在sharanshade上呈现出来我想如果我想呈现出来就需要一个web服务器,对吗?然后问题变成了如何设置web服务器和gitlab repo之间的连接…@ShaRanShadesorry我很忙。经过一些搜索,我认为有可能让github托管您的索引页。这篇文章可能有你想要的。好。。。这在gitlab.com上似乎不起作用:-(