Skip to content

Commit 9aa1b21

Browse files
feat: Added Gitlab Authentication method (#319)
Co-authored-by: Aleksei Apaseev <aleksei.apaseev@espressif.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
1 parent 5101eed commit 9aa1b21

File tree

8 files changed

+582
-3
lines changed

8 files changed

+582
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Supported authentication methods:
1414
* Static list of users
1515
* Google Sign-In (incl. Google for Work / GApps for domain) (documented [here](https://github.com/cesanta/docker_auth/blob/master/examples/reference.yml))
1616
* [Github Sign-In](docs/auth-methods.md#github)
17+
* Gitlab Sign-In
1718
* LDAP bind ([demo](https://github.com/kwk/docker-registry-setup))
1819
* MongoDB user collection
1920
* MySQL/MariaDB, PostgreSQL, SQLite database table
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!doctype html>
2+
3+
<html>
4+
<head>
5+
<meta charset="utf-8">
6+
<title>Docker Registry Authentication</title>
7+
<style>
8+
body {
9+
color: #000;
10+
background: #fff;
11+
font-family: sans-serif;
12+
padding: 4em 4em;
13+
}
14+
a { color: #000; }
15+
#panel p { text-align:center; }
16+
#login-with-gitlab code {
17+
font-size: 1.4em;
18+
}
19+
#revoke-access {
20+
color: #666;
21+
font-size: 0.8em;
22+
text-decoration: none;
23+
}
24+
#revoke-access:hover {
25+
text-decoration: underline;
26+
}
27+
</style>
28+
</head>
29+
30+
<body>
31+
<div id="panel">
32+
<p>
33+
<a id="gitlab-icon" href="{{.GitlabWebUri}}/oauth/authorize?client_id={{.ClientId}}&redirect_uri={{.RedirectUri}}&response_type=code&state=&scope=read_user">
34+
<img src="https://about.gitlab.com/images/press/logo/png/gitlab-logo-gray-stacked-rgb.png" width="155px" height="155px"></img>
35+
</a>
36+
</p>
37+
<p>
38+
<a id="revoke-access" href="{{.GitlabWebUri}}/-/profile/applications">Revoke access</a>
39+
</p>
40+
</div>
41+
</body>
42+
</html>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!doctype html>
2+
3+
<html>
4+
<head>
5+
<meta charset="utf-8">
6+
<title>Docker Registry Authentication</title>
7+
<style>
8+
body {
9+
color: #000;
10+
background: #fff;
11+
font-family: sans-serif;
12+
padding: 4em 4em;
13+
}
14+
hr {
15+
border: none;
16+
border-top: 1px solid #ccc;
17+
}
18+
.message code {
19+
font-size: 1.4em;
20+
background: #ccc;
21+
border-radius: 0.5em;
22+
padding: 0.25em 0.5em;
23+
margin: 0 0.25em 0 0.25em;
24+
}
25+
.command {
26+
font-size: 2em;
27+
line-height: 2em;
28+
color: #222;
29+
background: #fafafa;
30+
padding: 1em 1em 1.2em 1em;
31+
margin: 1em 0;
32+
border-radius: 0.5em;
33+
text-shadow: 0px 1px 0px #fff;
34+
}
35+
.command span {
36+
user-select: none;
37+
-moz-user-select: none;
38+
-webkit-user-select: none;
39+
-ms-user-select: none;
40+
}
41+
</style>
42+
</head>
43+
<body>
44+
<p class="message">
45+
You are successfully authenticated to the Docker Registry.
46+
Use the following username and password to login into the registry:
47+
</p>
48+
<hr>
49+
<pre class="command"><span>$ </span>docker login -u {{.Username}} -p {{.Password}} {{if .RegistryUrl}}{{.RegistryUrl}}{{else}}docker.example.com{{end}}</pre>
50+
</body>
51+
</html>

0 commit comments

Comments
 (0)