fix(build): render Nextcloud login page via askama, not include_str!(OUT_DIR)

The SvelteKit migration gated build.rs's static-dist/OUT_DIR generation
behind OXICLOUD_RUST_ASSETS=1 (early return), but login_v2_handler.rs
still embedded the page with
`include_str!(concat!(env!("OUT_DIR"), "/nextcloud-login.html"))`. With
OXICLOUD_RUST_ASSETS unset (the default), that file is never written to
OUT_DIR, so a clean `cargo build` failed to compile. (#489)

Migrate the page off include_str! to an askama template
(templates/nextcloud/login.html), mirroring the existing
DrivePickerTemplate in the same handler. This drops the only
compile-time dependency on the legacy build.rs pipeline, so the
OXICLOUD_RUST_ASSETS=1 CI workaround is no longer needed and is removed
from ci.yml, load-smoke.yml and load-nightly.yml.

Also fix the second failure on #489: with OXICLOUD_RUST_ASSETS=1 the
release pipeline panicked in copy_dir_recursive because `static/locales`
is now a symlink to frontend/static/locales. entry.file_type() reports
the link itself (not its target), so the symlinked directory was routed
to fs::copy and failed with "the source path is neither a regular file
nor a symlink to a regular file". Classify entries with fs::metadata,
which follows symlinks, so symlinked directories are traversed.

static/nextcloud-login.html is removed (its content moved into the
template; no other consumer) and dropped from build.rs HTML_INCLUDE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CNCEMN6fC2xSmxqCVbstkd
This commit is contained in:
Claude
2026-06-19 17:13:49 +00:00
parent ddfc481616
commit 6023bca2e8
6 changed files with 38 additions and 31 deletions
-71
View File
@@ -1,71 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grant Access - OxiCloud</title>
<link rel="icon" type="image/svg+xml" href="/logo/logo-plain.svg">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/css/views/auth.css">
</head>
<body>
<div class="auth-container">
<div class="auth-panel">
<div class="auth-logo">
<div class="auth-logo-icon">
<svg viewBox="0 0 500 500">
<path d="M345 310c32 0 58-26 58-58s-26-58-58-58c-6.2 0-12 0.9-17.5 2.7C318 166 289 143 255 143c-34.3 0-63.1 22.6-73 53.7C176.9 195.7 171 195 165 195c-32 0-58 26-58 58s26 58 58 58h180z" fill="#fff"/>
</svg>
</div>
<div class="auth-logo-text">OxiCloud</div>
</div>
<h1 class="auth-title">Grant Access</h1>
<p class="auth-subtitle">
A Nextcloud client is requesting access to your account.
</p>
<form class="auth-form" method="POST" id="login-flow-form">
<div class="auth-input-group">
<label class="auth-label" for="user">Username</label>
<input
type="text"
id="user"
name="user"
class="auth-input"
placeholder="Enter your username"
required
autocomplete="username"
autofocus
>
</div>
<div class="auth-input-group">
<label class="auth-label" for="password">Password</label>
<input
type="password"
id="password"
name="password"
class="auth-input"
placeholder="Enter your password"
required
autocomplete="current-password"
>
</div>
<button type="submit" class="auth-button" id="password-submit">Grant Access</button>
</form>
<!-- OIDC/SSO login — shown only when OIDC is enabled -->
<div id="oidc-section" class="hidden">
<div class="auth-divider"><span>or</span></div>
<button type="button" id="oidc-button" class="auth-button auth-button-sso">
Sign in with SSO
</button>
</div>
</div>
</div>
<script src="/js/views/nextcloud/login.js"></script>
</body>
</html>