Below you will find pages that utilize the taxonomy term “C”
April 10, 2025
Piece 2: Signup System(Login 3)
Piece 2: Signup System(Login 3)
Components
- HAProxy: Acts as the reverse proxy, listening on “/signup” and forwarding requests to the .c2 backend.
- .c2 Backend: A separate C-based backend (distinct from the .c login backend) handling signup logic.
- Redis: Stores signup tracking (select 5) and user data (select 0).
Target
- Allow users to self-sign up for an account with privacy as the highest priority, assigning them level 0 and a 30-day TTL, while preventing bot abuse and ensuring unique usernames.
Requirements (Your Inputs)
- Endpoint: HAProxy listens on “/signup”, accessible to anyone for self-signup.
- Backend: Requests are redirected to .c2 (you labeled it .c2 to distinguish it from the login .c backend).
- IP Limiting: Track
user/ip
in Redis “select 5” with a TTL of 3600s. If an IP has successfully signed up within 3600s, redirect to an HTML page saying “Your IP has already registered. Multi-register is not allowed.” - Username Rules: Allow signup if the username:
- Starts with a-zA-Z.
- Contains only a-zA-Z0-9.
- Is more than 8 characters.
- Doesn’t already exist.
- Return a generic “signup failed” error for any failure (no specific reasons like “username exists”).
- New User Settings: Set TTL to 30 days and level to 0 (no extra privileges).
- Storage: Save new users to “select 0” (you confirmed this as the user database).
- Privacy: No email or phone verification—users re-sign up if they lose passwords.
- Atomicity: Lock username insertion to prevent simultaneous duplicates (you agreed it’s unlikely but worth doing).
- IP Blocking Logic: 1 signup per IP in 3600s isn’t strict—users should wait if they need another account.
- CAPTCHA: No Google CAPTCHA; add a self-hosted CAPTCHA replacement for bot protection (you requested this for signup, login, and admin).
- TTL Expiry: If a new user’s TTL (30 days) expires, delete the account completely, allowing username reuse.
- Username as Key: Use
username
as the key in Redis (e.g., for GET/SET or HGET/HSET).
Conceptual Solutions (My Suggestions Integrated with Your Decisions)
Flow:
April 7, 2025
C code for CAPTCHA (Login 3)
C code for CAPTCHA (Login 3)
Building a Self-Hosted CAPTCHA System with HAProxy
After preparing the HAProxy server and the authentication Lua verification script, I needed to develop a PNG generator and user authentication mechanism to complete my self-hosted CAPTCHA server. I decided to use C for the core functionality due to its performance and control over system resources..
The Authentication Flow
My authentication logic follows these key steps:
April 1, 2025
Time is Basic Elements to ALL
Because of we need to sync the timer of linux server.. The system provided service is too active to try to connect unknow server, so, write a C prog to do it..
|
|
You can use ‘-h/–help’ to print the help info.