Spaces:
Running
Running
Upload 7 files
Browse files- Dockerfile +2 -0
- sign_in.html +132 -0
- start.sh +5 -1
Dockerfile
CHANGED
|
@@ -50,6 +50,7 @@ RUN useradd -m -u 1000 user && \
|
|
| 50 |
|
| 51 |
# Set up Nginx directories and permissions
|
| 52 |
RUN mkdir -p /var/www/html/game && \
|
|
|
|
| 53 |
chown -R user:user /var/www/html && \
|
| 54 |
chown -R user:user /var/log/nginx && \
|
| 55 |
chown -R user:user /var/lib/nginx && \
|
|
@@ -63,6 +64,7 @@ USER user
|
|
| 63 |
COPY --chown=user:user nginx.conf /etc/nginx/nginx.conf
|
| 64 |
COPY --chown=user:user oauth2-proxy.cfg .
|
| 65 |
COPY --chown=user:user start.sh .
|
|
|
|
| 66 |
|
| 67 |
RUN chmod +x start.sh
|
| 68 |
|
|
|
|
| 50 |
|
| 51 |
# Set up Nginx directories and permissions
|
| 52 |
RUN mkdir -p /var/www/html/game && \
|
| 53 |
+
mkdir -p /var/www/html/theme && \
|
| 54 |
chown -R user:user /var/www/html && \
|
| 55 |
chown -R user:user /var/log/nginx && \
|
| 56 |
chown -R user:user /var/lib/nginx && \
|
|
|
|
| 64 |
COPY --chown=user:user nginx.conf /etc/nginx/nginx.conf
|
| 65 |
COPY --chown=user:user oauth2-proxy.cfg .
|
| 66 |
COPY --chown=user:user start.sh .
|
| 67 |
+
COPY --chown=user:user sign_in.html /var/www/html/theme/sign_in.html
|
| 68 |
|
| 69 |
RUN chmod +x start.sh
|
| 70 |
|
sign_in.html
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>Sign In - VPS Linux</title>
|
| 7 |
+
<style>
|
| 8 |
+
:root {
|
| 9 |
+
--bg-color: #0a0a0a;
|
| 10 |
+
--card-bg: #111111;
|
| 11 |
+
--text-color: #ffffff;
|
| 12 |
+
--accent-color: #ff4d4d; /* Reddish accent similar to OpenClaw logo */
|
| 13 |
+
--border-color: #333;
|
| 14 |
+
--button-bg: #222;
|
| 15 |
+
--button-hover: #333;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
body {
|
| 19 |
+
background-color: var(--bg-color);
|
| 20 |
+
color: var(--text-color);
|
| 21 |
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
| 22 |
+
display: flex;
|
| 23 |
+
align-items: center;
|
| 24 |
+
justify-content: center;
|
| 25 |
+
height: 100vh;
|
| 26 |
+
margin: 0;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.login-container {
|
| 30 |
+
background-color: var(--card-bg);
|
| 31 |
+
border: 1px solid var(--border-color);
|
| 32 |
+
border-radius: 12px;
|
| 33 |
+
padding: 40px;
|
| 34 |
+
width: 100%;
|
| 35 |
+
max-width: 360px;
|
| 36 |
+
text-align: center;
|
| 37 |
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.logo {
|
| 41 |
+
width: 64px;
|
| 42 |
+
height: 64px;
|
| 43 |
+
margin-bottom: 24px;
|
| 44 |
+
/* Placeholder for a generic bot icon */
|
| 45 |
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ff4d4d"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7V5.73C9.4 5.39 9 4.74 9 4a2 2 0 0 1 2-2M4.5 11a5.5 5.5 0 0 0 5.5 5.5 5.5 5.5 0 0 0 5.5-5.5H11v2h2v-2h2.5z"/></svg>');
|
| 46 |
+
background-repeat: no-repeat;
|
| 47 |
+
background-position: center;
|
| 48 |
+
display: inline-block;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
h1 {
|
| 52 |
+
font-size: 24px;
|
| 53 |
+
font-weight: 600;
|
| 54 |
+
margin-bottom: 8px;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
p {
|
| 58 |
+
color: #888;
|
| 59 |
+
margin-bottom: 32px;
|
| 60 |
+
font-size: 14px;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
.btn {
|
| 64 |
+
display: block;
|
| 65 |
+
width: 100%;
|
| 66 |
+
padding: 12px;
|
| 67 |
+
margin-bottom: 12px;
|
| 68 |
+
border-radius: 6px;
|
| 69 |
+
border: 1px solid var(--border-color);
|
| 70 |
+
background-color: var(--button-bg);
|
| 71 |
+
color: var(--text-color);
|
| 72 |
+
font-size: 14px;
|
| 73 |
+
font-weight: 500;
|
| 74 |
+
cursor: pointer;
|
| 75 |
+
text-decoration: none;
|
| 76 |
+
transition: background-color 0.2s, transform 0.1s;
|
| 77 |
+
box-sizing: border-box;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
.btn:hover {
|
| 81 |
+
background-color: var(--button-hover);
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.btn:active {
|
| 85 |
+
transform: scale(0.98);
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
.btn-github {
|
| 89 |
+
display: flex;
|
| 90 |
+
align-items: center;
|
| 91 |
+
justify-content: center;
|
| 92 |
+
gap: 10px;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
.btn-google {
|
| 96 |
+
display: flex;
|
| 97 |
+
align-items: center;
|
| 98 |
+
justify-content: center;
|
| 99 |
+
gap: 10px;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
.footer {
|
| 103 |
+
margin-top: 32px;
|
| 104 |
+
font-size: 12px;
|
| 105 |
+
color: #444;
|
| 106 |
+
}
|
| 107 |
+
</style>
|
| 108 |
+
</head>
|
| 109 |
+
<body>
|
| 110 |
+
<div class="login-container">
|
| 111 |
+
<div class="logo"></div>
|
| 112 |
+
<h1>Welcome Back</h1>
|
| 113 |
+
<p>Sign in to access your VPS Linux environment</p>
|
| 114 |
+
|
| 115 |
+
<!-- OAuth2 Proxy automatically injects the sign-in URL here,
|
| 116 |
+
but since we are customizing the page, we need to point to the start endpoint.
|
| 117 |
+
The default template uses a form or simple links. -->
|
| 118 |
+
|
| 119 |
+
<!-- Assuming we configured GitHub -->
|
| 120 |
+
<form method="GET" action="/oauth2/start">
|
| 121 |
+
<input type="hidden" name="rd" value="/">
|
| 122 |
+
<button type="submit" class="btn btn-github">
|
| 123 |
+
Sign in with Provider
|
| 124 |
+
</button>
|
| 125 |
+
</form>
|
| 126 |
+
|
| 127 |
+
<div class="footer">
|
| 128 |
+
Powered by OAuth2 Proxy
|
| 129 |
+
</div>
|
| 130 |
+
</div>
|
| 131 |
+
</body>
|
| 132 |
+
</html>
|
start.sh
CHANGED
|
@@ -92,7 +92,11 @@ CMD="oauth2-proxy \
|
|
| 92 |
--email-domain=* \
|
| 93 |
--upstream=http://127.0.0.1:7681 \
|
| 94 |
--http-address=127.0.0.1:4180 \
|
| 95 |
-
--authenticated-emails-file=$AUTH_FILE
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
# 如果有 GitHub Users,追加参数
|
| 98 |
if [ -n "$GITHUB_USERS" ]; then
|
|
|
|
| 92 |
--email-domain=* \
|
| 93 |
--upstream=http://127.0.0.1:7681 \
|
| 94 |
--http-address=127.0.0.1:4180 \
|
| 95 |
+
--authenticated-emails-file=$AUTH_FILE \
|
| 96 |
+
--custom-sign-in-logo="-" \
|
| 97 |
+
--banner="-" \
|
| 98 |
+
--footer="-" \
|
| 99 |
+
--custom-templates-dir=/var/www/html/theme"
|
| 100 |
|
| 101 |
# 如果有 GitHub Users,追加参数
|
| 102 |
if [ -n "$GITHUB_USERS" ]; then
|