Add ip bindings to .env and Add stalwart-cli install script

This commit is contained in:
2026-09-14 20:51:29 +03:00
parent 1cd38af60e
commit 4c1fcc6d6f
7 changed files with 96 additions and 4 deletions
+46
View File
@@ -2,6 +2,52 @@
These scripts support the EternityMail Docker Compose deployment. Run them from the repository root.
## `install-stalwart-cli.sh`
Installs the latest official `stalwart-cli` release on Linux. The upstream installer places the binary in the system executable path, normally `/usr/local/bin`.
Requirements:
- Linux
- `curl`
- `sudo`, unless the script is run as root
Usage:
```bash
chmod +x scripts/install-stalwart-cli.sh
./scripts/install-stalwart-cli.sh
```
Verify the installation with:
```bash
stalwart-cli --version
```
## `install-stalwart-cli.ps1`
Installs the latest official `stalwart-cli` release on Windows using the upstream PowerShell installer. The official installer uses a user-local executable directory and updates the user PATH.
Requirements:
- Windows PowerShell 5.1 or PowerShell 7+
- Internet access to GitHub Releases
Usage from PowerShell:
```powershell
.\scripts\install-stalwart-cli.ps1
```
Open a new terminal if the current shell cannot find the command, then verify it:
```powershell
stalwart-cli --version
```
The scripts always download the current release from the official Stalwart CLI GitHub repository. Review the upstream release and installer before using them in a restricted or audited environment.
## `generate-des-key.sh`
Generates a random 24-character alphanumeric value for Roundcube's `RC_DES_KEY` setting.
+21
View File
@@ -0,0 +1,21 @@
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
$installerUrl = 'https://github.com/stalwartlabs/cli/releases/latest/download/stalwart-cli-installer.ps1'
$tempFile = Join-Path ([System.IO.Path]::GetTempPath()) 'stalwart-cli-installer.ps1'
try {
Invoke-WebRequest -Uri $installerUrl -OutFile $tempFile
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $tempFile
}
finally {
Remove-Item -LiteralPath $tempFile -Force -ErrorAction SilentlyContinue
}
if (Get-Command stalwart-cli -ErrorAction SilentlyContinue) {
stalwart-cli --version
}
else {
Write-Warning 'stalwart-cli was installed, but the current shell PATH does not include its install directory. Open a new terminal and run stalwart-cli --version.'
}
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
installer_url="https://github.com/stalwartlabs/cli/releases/latest/download/stalwart-cli-installer.sh"
if ! command -v curl >/dev/null 2>&1; then
printf '%s\n' 'curl is required to install stalwart-cli.' >&2
exit 1
fi
if [[ "${EUID}" -eq 0 ]]; then
curl --fail --silent --show-error --location --proto '=https' --tlsv1.2 "$installer_url" | sh
else
if ! command -v sudo >/dev/null 2>&1; then
printf '%s\n' 'Run this script as root or install sudo for a system-wide installation.' >&2
exit 1
fi
curl --fail --silent --show-error --location --proto '=https' --tlsv1.2 "$installer_url" | sudo sh
fi
command -v stalwart-cli >/dev/null 2>&1 && stalwart-cli --version