Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add aliasvault wrapper script to all-in-one Docker image (#1181)
Leendert de Borst016a7e755996
diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.ymlindex 29b53306d..36139c137 100644--- a/.github/workflows/docker-build.yml+++ b/.github/workflows/docker-build.yml@@ -109,8 +109,8 @@ jobs:echo "π§ Testing admin password reset flow..."# Run the reset password script with auto-confirm- echo "Running reset-admin-password.sh script..."- password_output=$(docker exec aliasvault-test reset-admin-password.sh -y 2>&1)+ echo "Running reset-admin-password command..."+ password_output=$(docker exec aliasvault-test "aliasvault reset-admin-password -y" 2>&1)echo "Script output:"echo "$password_output"diff --git a/dockerfiles/all-in-one/Dockerfile b/dockerfiles/all-in-one/Dockerfileindex 4df3c4be5..c756aade9 100644--- a/dockerfiles/all-in-one/Dockerfile+++ b/dockerfiles/all-in-one/Dockerfile@@ -131,8 +131,8 @@ RUN apt-get update && \# Copy built applications and all configuration files from builder stageCOPY --from=dotnet-builder /app /app-# Copy configuration files and scripts directly to their destinations-COPY dockerfiles/all-in-one/reset-admin-password.sh /usr/local/bin/reset-admin-password.sh+# Copy all scripts from scripts directory to /usr/local/bin+COPY dockerfiles/all-in-one/scripts/ /usr/local/bin/COPY apps/server/AliasVault.Client/nginx.conf /app/client/nginx.confCOPY dockerfiles/all-in-one/config/nginx-80-443.conf /etc/nginx/nginx-80-443.confCOPY dockerfiles/all-in-one/config/nginx-443.conf /etc/nginx/nginx-443.conf@@ -141,9 +141,16 @@ COPY dockerfiles/all-in-one/s6-scripts /etc/s6-overlay/s6-rc.d/# Copy InstallCLI to /usr/local/bin and configure everythingRUN cp -r /app/installcli /usr/local/bin/aliasvault-cli && \- chmod +x /usr/local/bin/aliasvault-cli/AliasVault.InstallCli \- /usr/local/bin/reset-admin-password.sh && \+ chmod +x /usr/local/bin/aliasvault-cli/AliasVault.InstallCli && \ln -s /usr/local/bin/aliasvault-cli/AliasVault.InstallCli /usr/local/bin/aliasvault-cli.sh && \+ # Make all scripts executable and create symlinks without .sh extension+ for script in /usr/local/bin/*.sh; do \+ if [ -f "$script" ]; then \+ chmod +x "$script" && \+ basename="$(basename "$script" .sh)" && \+ ln -sf "$script" "/usr/local/bin/$basename"; \+ fi; \+ done && \find /etc/s6-overlay/s6-rc.d -type f \( -name "run" -o -name "up" -o -name "script" \) -exec chmod +x {} \; && \cd /etc/s6-overlay/s6-rc.d/user/contents.d && \touch init postgres api client admin smtp taskrunner nginx notification && \diff --git a/dockerfiles/all-in-one/s6-scripts/notification/run b/dockerfiles/all-in-one/s6-scripts/notification/runindex 90f820baa..608e33e10 100755--- a/dockerfiles/all-in-one/s6-scripts/notification/run+++ b/dockerfiles/all-in-one/s6-scripts/notification/run@@ -37,7 +37,7 @@ if [ "$VERBOSITY" -le 1 ]; then# Admin password hash exists - show the legacy warningecho "π Admin Login:"echo " β’ Username: admin"- echo " β’ Password: (previously set - to reset the admin password, login to this container via \`docker exec -it [container-name] /bin/bash\` and run: reset-admin-password.sh)"+ echo " β’ Password: (previously set - to reset the admin password, login to this container via \`docker exec -it [container-name] /bin/bash\` and run: aliasvault reset-admin-password)"echo ""else# No admin password hash file - show setup instructionsdiff --git a/dockerfiles/all-in-one/scripts/aliasvault.sh b/dockerfiles/all-in-one/scripts/aliasvault.shnew file mode 100644index 000000000..615af1a1f--- /dev/null+++ b/dockerfiles/all-in-one/scripts/aliasvault.sh@@ -0,0 +1,35 @@+#!/bin/bash++# Simple AliasVault command dispatcher wrapper which allows+# running AliasVault commands from the Docker container CLI+# like `aliasvault reset-admin-password`.++case "$1" in+ reset-admin-password)+ shift+ exec /usr/local/bin/reset-admin-password.sh "$@"+ ;;+ hash-password)+ shift+ exec /usr/local/bin/aliasvault-cli/AliasVault.InstallCli hash-password "$@"+ ;;+ help|--help|-h|"")+ echo "AliasVault Commands"+ echo ""+ echo "Usage: aliasvault <command> [options]"+ echo ""+ echo "Commands:"+ echo " reset-admin-password Reset admin password"+ echo " hash-password Hash a password"+ echo " help Show this help"+ echo ""+ echo "Examples:"+ echo " aliasvault reset-admin-password -y"+ echo " aliasvault hash-password 'mypassword'"+ ;;+ *)+ echo "Unknown command: $1"+ echo "Run 'aliasvault help' for usage"+ exit 1+ ;;+esacdiff --git a/dockerfiles/all-in-one/reset-admin-password.sh b/dockerfiles/all-in-one/scripts/reset-admin-password.shsimilarity index 100%rename from dockerfiles/all-in-one/reset-admin-password.shrename to dockerfiles/all-in-one/scripts/reset-admin-password.shdiff --git a/docs/installation/docker-compose/troubleshooting.md b/docs/installation/docker-compose/troubleshooting.mdindex 2fed466a8..9fe8de762 100644--- a/docs/installation/docker-compose/troubleshooting.md+++ b/docs/installation/docker-compose/troubleshooting.md@@ -20,17 +20,17 @@ For any issues you might encounter, the first step is to check the Docker contai1. Check the Docker container running status:```bash-docker compose ps+$ docker compose ps```2. Check the Docker container logs-```-docker compose logs+```bash+$ docker compose logs```3. Try restarting the Docker container```bash-docker compose restart+$ docker compose restart```---@@ -39,7 +39,7 @@ docker compose restartAll AliasVault services log information and errors to text files. These files are located in the `logs` directory. You can check the logs of a specific service by running the following command:```bash-cat logs/[service-name].txt+$ cat logs/[service-name].txt```---@@ -58,19 +58,19 @@ Refer to the [installation guide](./#3-email-server-setup) for more information### 2. Forgot AliasVault Admin Password-If you have lost your admin password, you can reset it by running the install script with the `reset-admin-password` option. This will generate a new random password and update the .env file with it. After that it will restart the AliasVault containers to apply the changes.+If you have lost your admin password, you can reset it by running the `aliasvault reset-admin-password` option. This will generate a new random password and update the secret. After that it will restart the AliasVault containers to apply the changes.1. SSH into the aliasvault container:```bash-docker compose exec -it aliasvault /bin/bash+$ docker compose exec -it aliasvault /bin/bash```2. Run the reset-admin-password.sh script:```bash-./reset-admin-password.sh+$ aliasvault reset-admin-password```3. Remember the password outputted by the step above. Then quit out of the SSH session (ctrl+C) and then restart the container:```bash-docker compose restart+$ docker compose restart```4. You can now login to the admin panel (/admin) with the new password.diff --git a/docs/installation/index.md b/docs/installation/index.mdindex 694b4fc2e..2254105eb 100644--- a/docs/installation/index.md+++ b/docs/installation/index.md@@ -20,7 +20,7 @@ AliasVault can be self-hosted on your own servers using two different installati| **Setup style** | Managed, opinionated, production-ready defaults | Fits into existing homelab/stack tools (Portainer compatible) || **Build from source** | Optional (supported) | Pre-built container only || **Choose ifβ¦** | You want auto SSL and a managed stack | You already have TLS and prefer manual control |-| | [**Self-host via Install Script β**](./script){: .btn .btn-primary } (Recommended) | [**Self-host via Manual Setup β**](./manual){: .btn .btn-primary } |+| | [**Self-host via Install Script β**](./script){: .btn .btn-primary } (Recommended) | [**Self-host via Docker Compose β**](./docker-compose){: .btn .btn-primary } |---