Files
self-host/CommonMarketplace/scripts/01-setup-first-run.sh
fntyler c9826baa33 [BRE-2009] fix(marketplace): run setup wizard on demand, not on login
[BRE-2009](https://bitwarden.atlassian.net/browse/BRE-2009)

The edition-selection wizard auto-launched on every login via
/etc/profile.d, blocking any login-shell session — including the Azure
Marketplace certification harness — on its `read` prompt. Stop
auto-launching it; advertise it through the MOTD and let the user run it
on demand. Robust for every session type (PTY or non-PTY, login or
command exec) and fixes the latent hang for non-interactive SSH
(scp/automation) against customer VMs.

* Delete the /etc/profile.d/bitwarden-first-login.sh auto-launch trigger
  and its references in the Azure/AWS/DO packer builds
* MOTD now instructs the user to run `sudo bitwarden-setup` when no
  edition has been selected
* Symlink setup-wizard.sh to /usr/local/bin/bitwarden-setup; drop the
  wizard's self-removal of the trigger
* Update the 001_onboot comment to reference the on-demand wizard
2026-06-11 16:12:02 -04:00

38 lines
889 B
Bash

#!/bin/bash
#
# Scripts in this directory are run during the build process.
# Each script will be uploaded to /tmp on your build server,
# given execute permissions and run. The cleanup process will
# remove the scripts from your build system after they have run
# if you use the build_image task.
#
#
# Create dedicated bitwarden user with Docker access
#
useradd -m -s /bin/bash bitwarden
usermod -aG docker bitwarden
#
# Make MOTD and boot script executable
#
chmod +x /var/lib/cloud/scripts/per-instance/001_onboot
chmod +x /etc/update-motd.d/99-bitwarden-welcome
#
# Make setup wizard scripts executable
#
chmod +x /opt/bitwarden/setup-wizard.sh
chmod +x /opt/bitwarden/install-standard.sh
chmod +x /opt/bitwarden/install-lite.sh
#
# Expose the setup wizard as `bitwarden-setup` (advertised by the MOTD)
#
ln -sf /opt/bitwarden/setup-wizard.sh /usr/local/bin/bitwarden-setup