Browse Source

make no sso case work

for now, we simply show a static page that points to the docs. not sure
what else we can do since the ui cannot authenticate whe the docker
has custom auth.
master
Girish Ramakrishnan 5 months ago
parent
commit
b89a25a0fd
  1. 7
      Dockerfile
  2. 92
      frontend-customauth/index.html
  3. BIN
      frontend-customauth/logo.png
  4. 64
      frontend-customauth/style.css
  5. 0
      nginx.conf.template
  6. 6
      start.sh
  7. 2
      supervisor/nginx.conf

7
Dockerfile

@ -22,7 +22,7 @@ RUN mkdir /app/code/build && cd /app/code/build && \
cp ./bin/registry /app/code/registry && \
rm -rf /app/code/build
# UI
# Docker Registry UI (used with proxy auth)
ARG UI_VERSION=476a96279e975564f61347895617c6511dfe6539
RUN mkdir /app/code/ui && cd /app/code/ui && \
curl -L https://github.com/Joxit/docker-registry-ui/archive/${UI_VERSION}.tar.gz | tar -zxvf - --strip-components=1 && \
@ -31,6 +31,9 @@ RUN mkdir /app/code/ui && cd /app/code/ui && \
cp /app/code/ui/dist/scripts/docker-registry-ui-static.js /app/code/ui/dist/scripts/docker-registry-ui.js.original && \
ln -sf /run/registry/ui/docker-registry-ui.js /app/code/ui/dist/scripts/docker-registry-ui.js
# Simple information page (used when proxy auth disabled)
COPY frontend-customauth/ /app/code/frontend-customauth
# nginx
RUN rm -rf /var/log/nginx && ln -s /run/nginx /var/log/nginx
@ -38,7 +41,7 @@ RUN rm -rf /var/log/nginx && ln -s /run/nginx /var/log/nginx
COPY supervisor/* /etc/supervisor/conf.d/
RUN ln -sf /run/registry/supervisord.log /var/log/supervisor/supervisord.log
COPY config-example.yml start.sh nginx.conf /app/code/
COPY config-example.yml start.sh nginx.conf.template /app/code/
CMD [ "/app/code/start.sh" ]

92
frontend-customauth/index.html

@ -0,0 +1,92 @@
<html>
<head>
<title>Docker Registry Cloudron App</title>
<link href="logo.png" rel="shortcut icon" type="image/png" />
<style>
html, body {
min-height: 100%;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
font-family: "Roboto","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 13px;
line-height: 1.846;
background-color: #ffffff;
color: #444444;
}
h1 {
font-weight: 400;
line-height: 1.1;
font-size: 32px;
}
.wrapper {
display: table;
width: 100%;
height: 100%;
}
.content {
display: table-cell;
width: 100%;
height: 100%;
text-align: center;
vertical-align: middle;
padding-bottom: 50px;
}
footer {
position: fixed;
background-color: #efefef;
bottom: 0;
width: 100%;
color: #555;
font-size: 14px;
padding: 5px;
z-index: 13;
opacity: .5;
-webkit-transition: all .25s;
transition: all .25s;
text-align: center;
}
footer:hover {
opacity: 1;
}
a {
color: #2196f3;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #0a6ebd;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="content">
<img src="logo.png" width="200" height="200"/>
<h1> Docker Registry Cloudron App </h1>
<p>
Get started by reading the <a href="https://docs.cloudron.io/apps/docker-registry/">documentation</a>.
</p>
</div>
</div>
<!-- Footer -->
<footer class="text-center">
<span class="text-muted">Created by the <a href="https://cloudron.io" target="_blank">Cloudron</a> team <a href="https://git.cloudron.io/cloudron/docker-registry-app" target="_blank">hosted on Gitlab</a></span>
</footer>
</body>
</html>

BIN
frontend-customauth/logo.png

After

Width: 400  |  Height: 392  |  Size: 113 KiB

64
frontend-customauth/style.css

@ -0,0 +1,64 @@
html, body {
min-height: 100%;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
font-family: "Roboto","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 13px;
line-height: 1.846;
background-color: #ffffff;
color: #444444;
}
h1 {
font-weight: 400;
line-height: 1.1;
font-size: 32px;
}
.wrapper {
display: table;
width: 100%;
height: 100%;
}
.content {
display: table-cell;
width: 100%;
height: 100%;
text-align: center;
vertical-align: middle;
padding-bottom: 50px;
}
footer {
position: fixed;
background-color: #efefef;
bottom: 0;
width: 100%;
color: #555;
font-size: 14px;
padding: 5px;
z-index: 13;
opacity: .5;
-webkit-transition: all .25s;
transition: all .25s;
text-align: center;
}
footer:hover {
opacity: 1;
}
a {
color: #2196f3;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #0a6ebd;
text-decoration: underline;
}

0
nginx.conf → nginx.conf.template

6
start.sh

@ -18,6 +18,12 @@ sed -e "s,\${URL},${CLOUDRON_APP_ORIGIN}/v2ui," \
-e "s,\${PULL_URL},${CLOUDRON_APP_DOMAIN}," \
/app/code/ui/dist/scripts/docker-registry-ui.js.original > /run/registry/ui/docker-registry-ui.js
if [[ -n "${CLOUDRON_PROXY_AUTH:-}" ]]; then
cp nginx.conf.template /run/nginx/nginx.conf
else
sed -e 's,root .*,root /app/code/frontend-customauth;,g' nginx.conf.template > /run/nginx/nginx.conf
fi
echo "=> Ensure permissions"
chown -R cloudron:cloudron /app/data

2
supervisor/nginx.conf

@ -1,6 +1,6 @@
[program:nginx]
user=root
command=/usr/sbin/nginx -c /app/code/nginx.conf
command=/usr/sbin/nginx -c /run/nginx/nginx.conf
autostart=true
autorestart=true
stdout_logfile=/dev/stdout

Loading…
Cancel
Save