feat(infra): Docker-compose configuration and environment-specific security guards for Beta deployment to Test environment (#56)

This pull request introduces the dedicated containerized infrastructure and configuration for deploying NexusReader's beta version in the Test environment.

### Summary of Changes

1. **Docker Infrastructure & Secrets**:
   - **`docker-compose.test.yml`**: Configured dedicated database and auxiliary services (PostgreSQL 17, Qdrant, Neo4j) on isolated, non-standard ports to ensure zero conflict with the existing server configurations.
   - **`.env.test.template`**: Provided an environment variable template showing required setups, including mandatory database passwords, API keys, and admin custom passwords.
   - **`.gitignore`**: Excluded local `.env` files to prevent accidental commits of production or staging secrets.

2. **Database Hardening**:
   - Configured Neo4j with basic authentication (`IDriver` instantiation uses basic auth when credentials are provided in configuration).
   - Configured PostgreSQL to use mandatory authentication.
   - Configured the admin seeder (`DbInitializer.cs`) to dynamically use `NEXUS_ADMIN_PASSWORD` from environment variables, falling back to a default password in local Development only.

3. **Feature-Flagged Restrictions**:
   - **`appsettings.Test.json`**: Implemented `Features:AllowRegistration` and `Features:AllowPasswordReset` flags set to `false`.
   - **Middleware Enforcement (`Program.cs`)**: Intercepts requests to `/identity/register` and `/identity/forgotPassword` (and their MVC/form variations) and rejects them with a `403 Forbidden` response in restricted environments.
   - **OAuth Provisioning Guard (`Program.cs`)**: Blocks new account provisioning via Google OAuth callback by checking the `Features:AllowRegistration` configuration, redirecting users to the login page with a descriptive error.
   - **UI Protection (`Login.razor`, `Register.razor`)**: Conditionally hides registration/password reset links and intercepts manual navigation attempts to `/account/register` by redirecting to login with a warning.

---------

Co-authored-by: Marek Jasiński <jasins.marek@gmail.com>
Reviewed-on: #56
Co-authored-by: Antigravity <antigravity@google.com>
Co-committed-by: Antigravity <antigravity@google.com>
This commit was merged in pull request #56.
This commit is contained in:
2026-06-01 17:17:45 +00:00
committed by Marek Jaisński
parent 72905aa119
commit 711480f8f6
54 changed files with 4181 additions and 282 deletions
@@ -190,4 +190,157 @@
to { transform: rotate(360deg); }
}
/* Mobile Styles */
.nexus-mobile-topbar {
display: none;
}
@media (max-width: 768px) {
.nexus-mobile-topbar {
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
top: 0;
left: 0;
right: 0;
height: 60px;
background: rgba(18, 18, 18, 0.85);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
padding: 0 1.25rem;
z-index: 150;
}
.hamburger-btn {
background: transparent;
border: none;
color: #e0e0e0;
cursor: pointer;
padding: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
transition: background-color 0.2s;
min-height: 48px;
min-width: 48px;
touch-action: manipulation;
}
.hamburger-btn:hover {
background: rgba(255, 255, 255, 0.05);
}
.mobile-logo {
display: flex;
align-items: center;
gap: 0.5rem;
}
.pulsing-logo {
animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
0%, 100% {
filter: drop-shadow(0 0 5px rgba(0, 255, 153, 0.4));
opacity: 0.8;
}
50% {
filter: drop-shadow(0 0 12px rgba(0, 255, 153, 0.8));
opacity: 1;
}
}
.mobile-user-pill {
display: flex;
align-items: center;
}
.user-avatar-mini {
width: 32px;
height: 32px;
background: linear-gradient(135deg, var(--nexus-neon) 0%, #0099ff 100%);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.85rem;
font-weight: 700;
color: #121212;
box-shadow: 0 0 10px rgba(0, 255, 153, 0.2);
}
.mobile-sidebar-backdrop {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
z-index: 190;
animation: fade-in 0.2s ease-out;
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
::deep .hub-sidebar {
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: 280px;
height: 100%;
background: #141414;
z-index: 200;
transform: translateX(-100%);
will-change: transform;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: none;
}
.mobile-menu-open ::deep .hub-sidebar {
transform: translateX(0);
box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}
.hub-container {
flex-direction: column;
}
.hub-main {
margin-top: 60px;
width: 100%;
height: calc(100vh - 60px);
}
.hub-content {
padding: 1.25rem;
}
::deep .sidebar-header {
padding: 1.5rem 1.25rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
::deep .sidebar-nav {
padding: 1rem 0;
}
::deep .nav-item {
padding: 0.9rem 1.25rem;
font-size: 0.95rem;
min-height: 48px; /* Touch target */
}
::deep .sidebar-footer {
padding: 1rem 1.25rem;
}
}