chore: remove DISABLE_USER_REGISTRATION handling from deployment scripts and documentation
This commit is contained in:
parent
fcbfb928f7
commit
0565734e8e
5 changed files with 8 additions and 30 deletions
3
.github/workflows/deploy-dev.yaml
vendored
3
.github/workflows/deploy-dev.yaml
vendored
|
|
@ -86,9 +86,6 @@ jobs:
|
||||||
ls -la public/web-vault/ | head -20
|
ls -la public/web-vault/ | head -20
|
||||||
|
|
||||||
- name: Apply web vault overrides (vaultwarden.css)
|
- 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: |
|
run: |
|
||||||
bash scripts/apply-web-vault-overrides.sh public/web-vault
|
bash scripts/apply-web-vault-overrides.sh public/web-vault
|
||||||
|
|
||||||
|
|
|
||||||
3
.github/workflows/push-cloudflare.yaml
vendored
3
.github/workflows/push-cloudflare.yaml
vendored
|
|
@ -96,9 +96,6 @@ jobs:
|
||||||
ls -la public/web-vault/ | head -20
|
ls -la public/web-vault/ | head -20
|
||||||
|
|
||||||
- name: Apply web vault overrides (vaultwarden.css)
|
- 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: |
|
run: |
|
||||||
bash scripts/apply-web-vault-overrides.sh public/web-vault
|
bash scripts/apply-web-vault-overrides.sh public/web-vault
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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/`.
|
- 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`:
|
- In CI/CD (and optionally locally), we apply them after extracting `bw_web_builds`:
|
||||||
- `bash scripts/apply-web-vault-overrides.sh public/web-vault`
|
- `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]
|
> [!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.
|
> 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.
|
||||||
|
|
|
||||||
|
|
@ -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.
|
- 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`
|
- 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`.
|
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 */
|
/* 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),
|
app-user-layout app-danger-zone button:nth-child(1),
|
||||||
|
|
||||||
/* Two-factor providers (hide unsupported ones; keep authenticator/TOTP visible) */
|
/* Two-factor providers (hide unsupported ones; keep authenticator/TOTP visible) */
|
||||||
|
/* Email */
|
||||||
.providers-2fa-1,
|
.providers-2fa-1,
|
||||||
|
|
||||||
|
/* Duo */
|
||||||
|
.providers-2fa-2,
|
||||||
|
|
||||||
|
/* YubiKey */
|
||||||
.providers-2fa-3,
|
.providers-2fa-3,
|
||||||
|
|
||||||
|
/* WebAuthn */
|
||||||
.providers-2fa-7,
|
.providers-2fa-7,
|
||||||
|
|
||||||
/* Emergency access & Sends (not supported) */
|
/* Emergency access & Sends (not supported) */
|
||||||
|
|
|
||||||
|
|
@ -21,22 +21,4 @@ fi
|
||||||
mkdir -p "$(dirname "${DST_CSS}")"
|
mkdir -p "$(dirname "${DST_CSS}")"
|
||||||
cp "${SRC_CSS}" "${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}"
|
echo "✅ Installed override CSS: ${DST_CSS}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue