Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
docker-registry
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liugaoling
docker-registry
Commits
76437838
Commit
76437838
authored
Oct 18, 2021
by
liugaoling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use https
parent
29d9fe85
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
docker-compose.yml
conf/docker-compose.yml
+6
-6
extAuth.yml
conf/extAuth.yml
+2
-2
authentication.go
main/authentication.go
+6
-6
No files found.
conf/docker-compose.yml
View file @
76437838
...
@@ -5,25 +5,25 @@ services:
...
@@ -5,25 +5,25 @@ services:
ports
:
ports
:
-
"
5000:5000"
-
"
5000:5000"
volumes
:
volumes
:
-
.
/ssl:/ssl
-
/ssl_certificate
/ssl:/ssl
-
./data:/data
-
./data:/data
restart
:
always
restart
:
always
environment
:
environment
:
-
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data
-
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data
-
REGISTRY_AUTH=token
-
REGISTRY_AUTH=token
-
REGISTRY_AUTH_TOKEN_REALM=http
://130.61.181.145
:5001/auth
-
REGISTRY_AUTH_TOKEN_REALM=http
s://tx-fileserver.cloudam.cn
:5001/auth
-
REGISTRY_AUTH_TOKEN_SERVICE="auth.docker.com"
-
REGISTRY_AUTH_TOKEN_SERVICE="auth.docker.com"
-
REGISTRY_AUTH_TOKEN_ISSUER="AuthService"
-
REGISTRY_AUTH_TOKEN_ISSUER="AuthService"
-
REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE=/ssl/
domain.crt
-
REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE=/ssl/
ssl.pem
-
REGISTRY_HTTP_TLS_CERTIFICATE=/ssl/
domain.crt
-
REGISTRY_HTTP_TLS_CERTIFICATE=/ssl/
ssl.pem
-
REGISTRY_HTTP_TLS_KEY=/ssl/
domain
.key
-
REGISTRY_HTTP_TLS_KEY=/ssl/
ssl
.key
dockerauth
:
dockerauth
:
image
:
cesanta/docker_auth
image
:
cesanta/docker_auth
ports
:
ports
:
-
"
5001:5001"
-
"
5001:5001"
volumes
:
volumes
:
-
./:/config:ro
-
./:/config:ro
-
.
/ssl:/ssl
-
/ssl_certificate
/ssl:/ssl
-
./extensions:/extensions
-
./extensions:/extensions
command
:
-alsologtostderr=true -log_dir=/logs /config/extAuth.yml
command
:
-alsologtostderr=true -log_dir=/logs /config/extAuth.yml
restart
:
always
restart
:
always
conf/extAuth.yml
View file @
76437838
...
@@ -9,12 +9,12 @@
...
@@ -9,12 +9,12 @@
server
:
server
:
addr
:
"
:5001"
addr
:
"
:5001"
certificate
:
"
/ssl/ssl.pem"
key
:
"
/ssl/ssl.key"
token
:
token
:
issuer
:
"
AuthService"
# Must match issuer in the Registry config.
issuer
:
"
AuthService"
# Must match issuer in the Registry config.
expiration
:
900
expiration
:
900
certificate
:
"
/ssl/domain.crt"
key
:
"
/ssl/domain.key"
ext_auth
:
ext_auth
:
command
:
"
/extensions/authentication"
# Can be a relative path too; $PATH works.
command
:
"
/extensions/authentication"
# Can be a relative path too; $PATH works.
...
...
main/authentication.go
View file @
76437838
...
@@ -20,13 +20,13 @@ func main() {
...
@@ -20,13 +20,13 @@ func main() {
uName
:=
credentials
[
0
]
uName
:=
credentials
[
0
]
password
:=
credentials
[
1
]
password
:=
credentials
[
1
]
re
,
err
:=
utils
.
HttpLogin
(
uName
,
password
)
re
,
_
:=
utils
.
HttpLogin
(
uName
,
password
)
if
err
!=
nil
{
// os.Exit(utils.ErrorExitCode)
}
isUserAuthenticated
:=
re
isUserAuthenticated
:=
re
isUserAuthenticated
=
true
if
strings
.
EqualFold
(
uName
,
"root"
)
{
isUserAuthenticated
=
true
}
if
isUserAuthenticated
{
if
isUserAuthenticated
{
os
.
Exit
(
utils
.
SuccessExitCode
)
os
.
Exit
(
utils
.
SuccessExitCode
)
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment