summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-30 22:53:32 +0300
committerPaul Buetow <paul@buetow.org>2026-06-30 22:53:32 +0300
commit0cdec770db80c5b0fbe0bf076daddc12aa8aa0ae (patch)
tree90fc203f6ffb69f12e720803942362425ef98c53
parent651f762278d05f78ff78152d9616c17010aad6b2 (diff)
No-DB build: remove the registration UI completely (build-aware)
In a no-database (guest-mode) build registration is non-functional (yc_register's body is #ifdef DATABASE), so the password field, the 'Register' link and register.html are misleading. Remove them for the no-DB build while keeping the full login page for a future DB build: - html/index.html: restored to the full login (password field + Register link) - used by a DB build. - html/index_guest.html: new guest login page - no password field, no Register link, a 'guest mode, no password needed' note. - Dockerfile (no-DB build): serve index_guest.html as httpd.startsite, and drop register.html and yc_register.so from the image (the module preload scans the dir, so a missing .so is simply not loaded; an on-demand get_module for the register event fails gracefully -> no-op). Verified: start page is index_guest.html (no password/register); register.html -> 'Page not found'; yc_register.so absent from the image; normal login + multi-user chat still work.
-rw-r--r--ychat/Dockerfile9
-rw-r--r--ychat/html/index.html2
-rw-r--r--ychat/html/index_guest.html33
3 files changed, 42 insertions, 2 deletions
diff --git a/ychat/Dockerfile b/ychat/Dockerfile
index 43e9d7f..9b5eb48 100644
--- a/ychat/Dockerfile
+++ b/ychat/Dockerfile
@@ -60,6 +60,11 @@ COPY --from=builder /build/ychat/mods/ /app/mods/
# registered user, but we also physically omit it from the revival image
# so the RCE primitive is absent, not merely unreachable.
RUN rm -f /app/mods/commands/yc_exec.so
+# This is a no-database (guest-mode) build: registration is non-functional
+# (yc_register's body is #ifdef DATABASE), so drop the dead register form and
+# the register module from the image, and serve the guest login page
+# (index_guest.html - no password field, no register link) as the start page.
+RUN rm -f /app/html/register.html /app/mods/html/yc_register.so
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
COPY etc/ychat.conf /app/etc/ychat.conf
@@ -76,4 +81,6 @@ ENTRYPOINT ["/app/docker-entrypoint.sh"]
# s_ret.find(salt) returns npos and the subsequent substr/append corrupts
# the heap and segfaults on login). The 32-char random id is enough for a
# revival guest chat.
-CMD ["/app/bin/ychat", "-o", "chat.session.md5hash", "false"] \ No newline at end of file
+# httpd.startsite=index_guest.html: the no-DB guest login page (no password
+# field, no register link) - registration isn't possible without a database.
+CMD ["/app/bin/ychat", "-o", "chat.session.md5hash", "false", "-o", "httpd.startsite", "index_guest.html"] \ No newline at end of file
diff --git a/ychat/html/index.html b/ychat/html/index.html
index 46194cc..7d1f763 100644
--- a/ychat/html/index.html
+++ b/ychat/html/index.html
@@ -29,7 +29,7 @@
<input type="submit" value="login" accesskey="s" />
</form>
<div>
- You may log in without a password using any (unregistered) nick.
+ <a class="fancy" href="register.html">Register</a> a new nick If you don't want to register you may login without a password using an unregistered nick.
</div>
<div class="footer">
<span class="signature">yChat is OpenSource - get it at <a class="fancy" target="_blank" href="http://www.yChat.org">http://www.yChat.org</a></span>
diff --git a/ychat/html/index_guest.html b/ychat/html/index_guest.html
new file mode 100644
index 0000000..6009a3d
--- /dev/null
+++ b/ychat/html/index_guest.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>%%ychat.version%%</title>
+ <link rel=stylesheet href="style.css" type="text/css" />
+</head>
+<body>
+<h1>%%ychat.version%%</h1>
+<div>%%INFO%%</div>
+<form action="frameset.html" method="POST">
+ <input type="hidden" name="event" value="login" />
+ <div>Enter your nick:</div>
+ <div>
+ <input class="text" type="text" name="nick" value="%%nick%%" maxlength="%%chat.maxlength.username%%" accesskey="n" />
+ </div>
+ <br />
+ <div>Enter your room:</div>
+ <div>
+ <input class="text" type="text" name="room" value="%%chat.defaultroom%%" maxlength="%%chat.maxlength.roomname%%" accesskey="r" />
+ </div>
+ <br />
+ <input type="hidden" name="end" value="end" />
+ <input type="submit" value="login" accesskey="s" />
+ </form>
+ <div>
+ This chat runs in guest mode (no account database). Just enter any nick above to log in - no password is needed.
+ </div>
+ <div class="footer">
+ <span class="signature">yChat is OpenSource - get it at <a class="fancy" target="_blank" href="http://www.yChat.org">http://www.yChat.org</a></span>
+ </div>
+</body>
+</html> \ No newline at end of file