Skip to content

Commit

Permalink
Merge pull request #240 from crazy-max/update
Browse files Browse the repository at this point in the history
addy.io 1.0.3
  • Loading branch information
crazy-max authored Dec 15, 2023
2 parents 74e3ebd + 24fdd4e commit b322d3c
Show file tree
Hide file tree
Showing 33 changed files with 167 additions and 275 deletions.
2 changes: 1 addition & 1 deletion .github/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ You are now ready to [create a new issue](https://github.com/anonaddy/docker/iss

## Closure policy

* Support directly related to anonaddy will not be provided if your problem is not related to the operation of this image.
* Support directly related to addy.io will not be provided if your problem is not related to the operation of this image.
* Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines.
* Issues that go a week without a response from original poster are subject to closure at my discretion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
type=ref,event=pr
type=edge
labels: |
org.opencontainers.image.title=AnonAddy
org.opencontainers.image.title=addy.io
org.opencontainers.image.description=Anonymous Email Forwarding
org.opencontainers.image.vendor=CrazyMax
-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ on:
- '**.md'

env:
BUILD_TAG: anonaddy:test
CONTAINER_NAME: anonaddy
BUILD_TAG: addy:test
CONTAINER_NAME: addy

jobs:
test:
Expand Down
80 changes: 42 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# syntax=docker/dockerfile:1

ARG ANONADDY_VERSION=0.14.1
ARG ANONADDY_VERSION=1.0.3
ARG ALPINE_VERSION=3.18

FROM crazymax/yasu:latest AS yasu
FROM crazymax/alpine-s6:3.18-2.2.0.3
FROM crazymax/alpine-s6:${ALPINE_VERSION}-2.2.0.3

COPY --from=yasu / /
RUN apk --no-cache add \
Expand All @@ -17,35 +18,35 @@ RUN apk --no-cache add \
mysql-client \
nginx \
openssl \
php81 \
php81-cli \
php81-ctype \
php81-curl \
php81-dom \
php81-fileinfo \
php81-fpm \
php81-gd \
php81-gmp \
php81-iconv \
php81-intl \
php81-json \
php81-opcache \
php81-openssl \
php81-pdo \
php81-pdo_mysql \
php81-pecl-imagick \
php81-pecl-mailparse \
php81-phar \
php81-redis \
php81-session \
php81-simplexml \
php81-sodium \
php81-tokenizer \
php81-xml \
php81-xmlreader \
php81-xmlwriter \
php81-zip \
php81-zlib \
php82 \
php82-cli \
php82-ctype \
php82-curl \
php82-dom \
php82-fileinfo \
php82-fpm \
php82-gd \
php82-gmp \
php82-iconv \
php82-intl \
php82-json \
php82-mbstring \
php82-opcache \
php82-openssl \
php82-pdo \
php82-pdo_mysql \
php82-pecl-imagick \
php82-phar \
php82-redis \
php82-session \
php82-simplexml \
php82-sodium \
php82-tokenizer \
php82-xml \
php82-xmlreader \
php82-xmlwriter \
php82-zip \
php82-zlib \
postfix \
postfix-mysql \
rspamd \
Expand All @@ -54,6 +55,7 @@ RUN apk --no-cache add \
shadow \
tar \
tzdata \
&& ln -s /usr/bin/php82 /usr/bin/php \
&& cp /etc/postfix/master.cf /etc/postfix/master.cf.orig \
&& cp /etc/postfix/main.cf /etc/postfix/main.cf.orig \
&& apk --no-cache add -t build-dependencies \
Expand All @@ -63,9 +65,12 @@ RUN apk --no-cache add \
gpgme-dev \
libtool \
pcre-dev \
php81-dev \
php81-pear \
&& pecl81 install gnupg \
php82-dev \
php82-pear \
&& pecl82 install gnupg \
&& echo "extension=gnupg.so" > /etc/php82/conf.d/60_gnupg.ini \
&& pecl82 install mailparse \
&& echo "extension=mailparse.so" > /etc/php82/conf.d/60_mailparse.ini \
&& apk del build-dependencies \
&& rm -rf /tmp/* /var/www/*

Expand All @@ -91,11 +96,10 @@ RUN apk --no-cache add -t build-dependencies \
&& git config --global --add safe.directory /var/www/anonaddy \
&& git init . && git remote add origin "https://github.com/anonaddy/anonaddy.git" \
&& git fetch --depth 1 origin "v${ANONADDY_VERSION}" && git checkout -q FETCH_HEAD \
&& composer install --optimize-autoloader --no-dev --no-interaction --no-ansi \
&& composer install --optimize-autoloader --no-dev --no-interaction --no-ansi --ignore-platform-req=php-64bit \
&& chown -R anonaddy. /var/www/anonaddy \
&& npm install --global cross-env \
&& npm ci --ignore-scripts --only=production \
&& npm run production \
&& npm ci --ignore-scripts \
&& APP_URL=https://addy-sh.test npm run production \
&& npm prune --production \
&& chown -R nobody.nogroup /var/www/anonaddy \
&& apk del build-dependencies \
Expand Down
57 changes: 23 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

## About

Docker image for [AnonAddy](https://anonaddy.com/), an anonymous email
forwarding service.
Docker image for [addy.io](https://addy.io/), an anonymous email forwarding service.

> **Note**
>
Expand All @@ -27,7 +26,6 @@ ___
* [Environment variables](#environment-variables)
* [General](#general)
* [App](#app)
* [AnonAddy](#anonaddy)
* [Database](#database)
* [Redis](#redis)
* [Mail](#mail)
Expand Down Expand Up @@ -59,8 +57,8 @@ ___
## Build locally

```console
git clone https://github.com/anonaddy/docker.git docker-anonaddy
cd docker-anonaddy
git clone https://github.com/anonaddy/docker.git docker-addy
cd docker-addy

# Build image and output to docker (default)
docker buildx bake
Expand Down Expand Up @@ -89,8 +87,8 @@ Image: anonaddy/anonaddy:latest
### General

* `TZ`: The timezone assigned to the container (default `UTC`)
* `PUID`: AnonAddy user id (default `1000`)
* `PGID`: AnonAddy group id (default `1000`)
* `PUID`: user id (default `1000`)
* `PGID`: group id (default `1000`)
* `MEMORY_LIMIT`: PHP memory limit (default `256M`)
* `UPLOAD_MAX_SIZE`: Upload max size (default `16M`)
* `CLEAR_ENV`: Clear environment in FPM workers (default `yes`)
Expand All @@ -103,18 +101,10 @@ Image: anonaddy/anonaddy:latest

### App

* `APP_NAME`: Name of the application (default `AnonAddy`)
* `APP_NAME`: Name of the application (default `addy.io`)
* `APP_KEY`: Application key for encrypter service. You can generate one through `anonaddy key:generate --show` or `echo "base64:$(openssl rand -base64 32)"`. **required**
* `APP_DEBUG`: Enables or disables debug mode, used to troubleshoot issues (default `false`)
* `APP_URL`: The URL of your AnonAddy installation

> **Note**
>
> `APP_KEY_FILE` can be used to fill in the value from a file, especially for
> Docker's secrets feature.
### AnonAddy

* `APP_URL`: The URL of your installation
* `ANONADDY_RETURN_PATH`: Return-path header for outbound emails
* `ANONADDY_ADMIN_USERNAME`: If set this value will be used and allow you to receive forwarded emails at the root domain
* `ANONADDY_ENABLE_REGISTRATION`: If set to false this will prevent new users from registering on the site (default `true`)
Expand All @@ -133,8 +123,9 @@ Image: anonaddy/anonaddy:latest

> **Note**
>
> `ANONADDY_SECRET_FILE` and `ANONADDY_SIGNING_KEY_FINGERPRINT_FILE` can be used
> to fill in the value from a file, especially for Docker's secrets feature.
> `APP_KEY_FILE`, `ANONADDY_SECRET_FILE` and `ANONADDY_SIGNING_KEY_FINGERPRINT_FILE`
> can be used to fill in the value from a file, especially for Docker's secrets
> feature.
### Database

Expand Down Expand Up @@ -163,8 +154,8 @@ Image: anonaddy/anonaddy:latest
### Mail

* `MAIL_FROM_NAME`: From name (default `AnonAddy`)
* `MAIL_FROM_ADDRESS`: From email address (default `anonaddy@${ANONADDY_DOMAIN}`)
* `MAIL_FROM_NAME`: From name (default `addy.io`)
* `MAIL_FROM_ADDRESS`: From email address (default `addy@${ANONADDY_DOMAIN}`)
* `MAIL_ENCRYPTION`: Encryption protocol to send e-mail messages (default `null`)

### Postfix
Expand Down Expand Up @@ -224,7 +215,7 @@ Image: anonaddy/anonaddy:latest
## Ports

* `8000`: HTTP port (anonaddy web)
* `8000`: HTTP port (addy.io)
* `11334`: HTTP port (rspamd web dashboard)
* `25`: SMTP port (postfix)

Expand All @@ -242,9 +233,6 @@ docker compose logs -f

## Upgrade

You can upgrade AnonAddy automatically through the UI, it works well. But I
recommend to recreate the container whenever I push an update:

```console
docker compose pull
docker compose up -d
Expand All @@ -258,25 +246,25 @@ If you want to use the artisan command to perform common server operations like
manage users, passwords and more, type:

```console
docker compose exec anonaddy anonaddy <command>
docker compose exec addy anonaddy <command>
```

For example to list all available commands:

```console
docker compose exec anonaddy anonaddy list
docker compose exec addy anonaddy list
```

### Create user

```console
docker compose exec anonaddy anonaddy anonaddy:create-user "username" "[email protected]"
docker compose exec addy anonaddy anonaddy:create-user "username" "[email protected]"
```

### Generate DKIM private/public keypair

```console
docker compose run --entrypoint '' anonaddy gen-dkim
docker compose run --entrypoint '' addy gen-dkim
```

```text
Expand All @@ -297,14 +285,14 @@ If you don't have an existing GPG key, you can generate a new GPG key with the
following command:

```console
docker compose exec --user anonaddy anonaddy gpg --full-gen-key
docker compose exec --user anonaddy addy gpg --full-gen-key
```

Keys will be stored in `/data/.gnupg` folder.

### Define additional env vars

You can define additional environment variables that will be used by AnonAddy
You can define additional environment variables that will be used by the app
by creating a file named `.env` in `/data`.

### Override Postfix main configuration
Expand Down Expand Up @@ -335,9 +323,10 @@ and complete the registration procedure. After you register an account, you can

## Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You
can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) or by making
a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely!
Want to contribute? Awesome! The most basic way to show your support is to star
the project, or to raise issues. You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max)
or by making a [PayPal donation](https://www.paypal.me/crazyws) to ensure this
journey continues indefinitely!

Thanks again for your support, it is much appreciated! :pray:

Expand Down
2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "DEFAULT_TAG" {
default = "anonaddy:local"
default = "addy:local"
}

// Special target: https://github.com/docker/metadata-action#bake-definition
Expand Down
6 changes: 3 additions & 3 deletions examples/compose/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MYSQL_DATABASE=anonaddy
MYSQL_USER=anonaddy
MYSQL_PASSWORD=anonaddy
MYSQL_DATABASE=addy
MYSQL_USER=addy
MYSQL_PASSWORD=addy
6 changes: 3 additions & 3 deletions examples/compose/anonaddy.env → examples/compose/addy.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ APP_DEBUG=false
APP_URL=http://127.0.0.1:8000

ANONADDY_RETURN_PATH=[email protected]
ANONADDY_ADMIN_USERNAME=anonaddy
ANONADDY_ADMIN_USERNAME=addy
ANONADDY_ENABLE_REGISTRATION=true
ANONADDY_DOMAIN=example.com
ANONADDY_ALL_DOMAINS=example.com
Expand All @@ -26,8 +26,8 @@ ANONADDY_BANDWIDTH_LIMIT=104857600
ANONADDY_NEW_ALIAS_LIMIT=10
ANONADDY_ADDITIONAL_USERNAME_LIMIT=3

MAIL_FROM_NAME=AnonAddy
MAIL_FROM_ADDRESS=anonaddy@example.com
MAIL_FROM_NAME=addy.io
MAIL_FROM_ADDRESS=addy@example.com

POSTFIX_DEBUG=false
POSTFIX_SMTPD_TLS=false
Expand Down
12 changes: 6 additions & 6 deletions examples/compose/compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: annoaddy
name: addy

services:
db:
image: mariadb:10.5
container_name: anonaddy_db
container_name: addy_db
command:
- "mysqld"
- "--character-set-server=utf8mb4"
Expand All @@ -19,12 +19,12 @@ services:

redis:
image: redis:4.0-alpine
container_name: anonaddy_redis
container_name: addy_redis
restart: always

anonaddy:
addy:
image: anonaddy/anonaddy:latest
container_name: anonaddy
container_name: addy
depends_on:
- db
- redis
Expand All @@ -38,7 +38,7 @@ services:
volumes:
- "./data:/data"
env_file:
- "./anonaddy.env"
- "./addy.env"
environment:
- "DB_HOST=db"
- "DB_DATABASE=${MYSQL_DATABASE}"
Expand Down
4 changes: 2 additions & 2 deletions examples/nginx/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prerequisites

Read [self-hosting docs](https://anonaddy.com/self-hosting/)
Read [self-hosting docs](https://addy.io/self-hosting/)

## Let's Encrypt

Expand All @@ -22,4 +22,4 @@ let's encrypt and dhparam certs.

This nginx configuration supports rspamd web ui out of the box. if you choose
to not run rspamd, make sure to remove the `RSPAMD_ENABLE` variable in
`anonaddy.env` and remove the proxy block in `nginx/templates/default.conf.template`.
`addy.env` and remove the proxy block in `nginx/templates/default.conf.template`.
Loading

0 comments on commit b322d3c

Please sign in to comment.