The webmail frontend for LiveArchive https://exchangedefender.com/docs/livearchive-cloud-backend
9.4K
Setup LiveArchive
Start a docker container instance
docker run -d --rm -p 8008:80 exchangedefender/livearchive-webmail:latest
Browse to http://localhost:8008
Be aware that this quick method does not persist any data and will be reset when the docker container is stopped. Follow the installation instructions for a production setup.
LiveArchive Webmail is a php based archive mailbox viewer for LiveArchive. By utilizing object storage users are able to self store archive data in their own cloud buckets with ease. Administrators can OPTIONALLY enhance the performance by enabling a SQL backend to provide additional features like filtering, searching and faster archive browsing.
LiveArchive is designed to use one bucket for all users. In order to partition LiveArchive across multiple buckets, you would need to run multiple instances of LiveArchive. LiveArchive will scan the root of the object store and list all available mailboxes. LiveArchive uses the industry standard Maildir format to archive messages in the object store. Users are able to export individual messages to .eml format or the entire archive in .eml format.
LiveArchive provides no login interface and authentication and authorization should happen by the webserver, firewall or ingress rules with your provider (out of scope for this document), however, since LiveArchive running in docker is powered by frankenphp, you can easily configure basic authentication within the embedded caddy webserver.
TLS and HTTPS is also out of scope for this application, but as above, using our docker image there is a way to enable following these steps
Chose an installation method below (compose, docker or source) and then browse to the site (default http://localhost).
The first request to the site will automatically redirect to /_ which will perform a one time initialization (setting up encryption keys).
Once the site is initialized, you will be automatically redirect to /setup/ to start the setup wizard if an existing configuration was not found.
The setup wizard allows you to configure the archive dynamically instead of modifying environment variables or individual configuration files. Upon completion of each step the setup wizard will update the configuration loaded by LIVEARCHIVE_PERSISTENCE and the sites local .env file
While this is a laravel based application, be aware that the setup wizard will overwrite the provided values from the wizard to the env file. You can disable the site from changing the .env file by setting the environment variable LIVEARCHIVE_ENV_SYNC to false or 0
The quickest way to get started is to run the prebuilt docker images along with one of the sample docker compose files.
Choose one of the below installation methods
We have two sample docker compose files inside the repository. Use docker-compose.standalone.yml if you already have object storage created (S3, etc) or use docker-compose.sample.yml to create an all-in-one setup which includes minio for the object storage and mysql for the database storage.
LiveArchive Webmail persists global configuration data under /app/storage/app/settings.
Here is a minimum service entry
services:
app:
image: exchangedefender/livearchive-webmail:latest
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '80:80'
volumes:
- ./livearchive-config:/app/storage/app/settings
- ./livearchive-data:/data
environment:
LIVEARCHIVE_PERSISTENCE: disk
docker run -p 80:80 exchangedefender/livearchive:latest
Requirements:
Clone the repository and composer install the required PHP dependencies.
Next, run npx vite build to build the sites assets.
Finally, run artisan storage:link
LiveArchive persists the configuration to JSON after running the initial setup wizard and loads the configuration when browsing the mail archive.
LiveArchive offers two built in persistence adapters, the default local file system and one via cookies in the browser.
To enable storing the configuration in the browser set the environment variable LIVEARCHIVE_PERSISTENCE to browser
If no configuration is found then LiveArchive attempts to use the config files under config/ and environment variables as the default values
Most of these are configured during the Setup Wizard and do not need to be set manually. However, the values for the below env variables are used to initially populate the configuration files
| Name | Default | Notes |
|---|---|---|
| AWS_ACCESS_KEY_ID | NONE | Bucket access key |
| AWS_SECRET_ACCESS_KEY | NONE | Bucket secret access key |
| AWS_DEFAULT_REGION | NONE | Bucket region |
| AWS_BUCKET | NONE | Bucket name |
| AWS_URL | NONE | Set to public address for minio if not using AWS |
| LIVEARCHIVE_ENV_SYNC | true | allow the site to manage the .env file when running the setup wizard |
| LIVEARCHIVE_PERSISTENCE | disk | disk or browser to switch between using a central file for all users or each browser stores its own configuration |
| LIVEARCHIVE_LAYOUT | gmail | gmail or office to switch between different layout styles |
| LIVEARCHIVE_DB_HOST | NONE | address for livearchive mysql backend if enabled |
| LIVEARCHIVE_DB_PORT | 3306 | port number for livearchive mysql backend |
| LIVEARCHIVE_DB_DATABASE | NONE | database name for livearchive mysql backend |
| LIVEARCHIVE_DB_USERNAME | NONE | username to connect to livearchive mysql backend |
| LIVEARCHIVE_DB_PASSWORD | NONE | password to connect to livearchive mysql backend |
| APP_NAME | LiveArchive | application name used in various areas like the title bar and headers. |
| APP_TIMEZONE | UTC | local timezone to convert to when showing dates |
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php82-composer:latest \
composer install --ignore-platform-reqs
./vendor/bin/sail up -d
./vendor/bin/sail artisan storage:link
./vendor/bin/sail npm install
./vendor/bin/sail npm run dev
./vendor/bin/sail artisan migrate
./vendor/bin/sail artisan migrate --database=livearchive
./vendor/bin/sail up -d
./vendor/bin/sail npm run dev
ArchiveFileSystem and look for '//TODO remove.. just here for previewing timestamp with relative time'routes/web.phpapp/Http/Controllers/ArchiveInboxController)Content type
Image
Digest
sha256:9aa1eb78e…
Size
238.4 MB
Last updated
over 2 years ago
docker pull exchangedefender/livearchive-webmail