diff --git a/.github/workflows/deploy-dev.yaml b/.github/workflows/deploy-dev.yaml index ce6eb53..a71d488 100644 --- a/.github/workflows/deploy-dev.yaml +++ b/.github/workflows/deploy-dev.yaml @@ -86,9 +86,6 @@ jobs: ls -la public/web-vault/ | head -20 - name: Apply web vault overrides (vaultwarden.css) - env: - # Optional: control build-time UI tweaks (defaults to hiding signup unless explicitly set to "false") - DISABLE_USER_REGISTRATION: ${{ vars.DISABLE_USER_REGISTRATION_DEV }} run: | bash scripts/apply-web-vault-overrides.sh public/web-vault diff --git a/.github/workflows/push-cloudflare.yaml b/.github/workflows/push-cloudflare.yaml index b1fd6d2..4a5af6f 100644 --- a/.github/workflows/push-cloudflare.yaml +++ b/.github/workflows/push-cloudflare.yaml @@ -96,9 +96,6 @@ jobs: ls -la public/web-vault/ | head -20 - name: Apply web vault overrides (vaultwarden.css) - env: - # Optional: control build-time UI tweaks (defaults to hiding signup unless explicitly set to "false") - DISABLE_USER_REGISTRATION: ${{ vars.DISABLE_USER_REGISTRATION }} run: | bash scripts/apply-web-vault-overrides.sh public/web-vault diff --git a/README.md b/README.md index 64c2c9a..155e6ec 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,6 @@ The frontend is bundled with the Worker using [Cloudflare Workers Static Assets] - This project ships a small set of "lightweight self-host" UI tweaks in `public/css/`. - In CI/CD (and optionally locally), we apply them after extracting `bw_web_builds`: - `bash scripts/apply-web-vault-overrides.sh public/web-vault` - - The script can read `DISABLE_USER_REGISTRATION` to decide whether to additionally hide the signup entry in the web vault UI. > [!NOTE] > Migrating from separate frontend deployment? If you previously deployed the frontend separately to Cloudflare Pages, you can delete the `warden-frontend` Pages project and re-setup the router for the worker. The frontend is now bundled with the Worker and no longer requires a separate deployment. diff --git a/public/css/vaultwarden.css b/public/css/vaultwarden.css index 2d9c1cf..a6ce13a 100644 --- a/public/css/vaultwarden.css +++ b/public/css/vaultwarden.css @@ -9,11 +9,6 @@ - After CI/CD or local download of bw_web_builds and extraction, keep `public/web-vault/` as the static resource root directory. - Run: `bash scripts/apply-web-vault-overrides.sh public/web-vault` which will copy this file (public/css/vaultwarden.css) to `public/web-vault/css/vaultwarden.css`. - - Switch description (build-time): - - Registration button hiding: The script decides whether to append CSS hiding registration entries based on the environment variable `DISABLE_USER_REGISTRATION` - (hidden by default; only not hidden when "false"), - consistent with backend `src/handlers/config.rs` logic. */ /* Hide unsupported UI elements */ @@ -47,8 +42,16 @@ app-security > app-two-factor-setup > form, app-user-layout app-danger-zone button:nth-child(1), /* Two-factor providers (hide unsupported ones; keep authenticator/TOTP visible) */ +/* Email */ .providers-2fa-1, + +/* Duo */ +.providers-2fa-2, + +/* YubiKey */ .providers-2fa-3, + +/* WebAuthn */ .providers-2fa-7, /* Emergency access & Sends (not supported) */ diff --git a/scripts/apply-web-vault-overrides.sh b/scripts/apply-web-vault-overrides.sh index 1d2b34d..ae68185 100644 --- a/scripts/apply-web-vault-overrides.sh +++ b/scripts/apply-web-vault-overrides.sh @@ -21,22 +21,4 @@ fi mkdir -p "$(dirname "${DST_CSS}")" cp "${SRC_CSS}" "${DST_CSS}" -# Keep behavior consistent with backend src/handlers/config.rs: -# - Defaults to true if not set -# - Only "false" disables it -disable_user_registration="${DISABLE_USER_REGISTRATION:-}" -disable_user_registration="$(printf '%s' "${disable_user_registration}" | tr '[:upper:]' '[:lower:]')" - -if [[ -z "${disable_user_registration}" || "${disable_user_registration}" != "false" ]]; then - cat >> "${DST_CSS}" <<'EOF' - -/* Build-time option: hide signup/register UI when DISABLE_USER_REGISTRATION != "false" */ -app-root a[routerlink="/signup"], -app-login form div + div + div + div + hr, -app-login form div + div + div + div + hr + p { - display: none !important; -} -EOF -fi - echo "✅ Installed override CSS: ${DST_CSS}"