A web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
1M+
You can run 2fauth in a single Docker container.
amd64, 386, arm64, arm/v6 and arm/v71000 and group id 1000We assume your current directory is /yourpath.
Create a directory on your host:
mkdir 2fauth
If your host is not Windows: since the container runs without root as user 1000:1000, you need to fix the ownership and permissions of that directory:
chown 1000:1000 2fauth
chmod 700 2fauth
đ if you feel like using another ID, you can build the image with build argumentsâ .
Run the container interactively:
docker run -it --rm -p 8000:8000/tcp \
-v /yourpath/2fauth:/2fauth 2fauth/2fauth
-e AUTHENTICATION_GUARD=web-guard #fix for issue #68
Access it at http://localhost:8000â
You can stop it with CTRL+C.
-it --rm with -d.-e, for example -e APP_NAME=2FAuth.docker-compose and modify it as you wish.If you already have an SQLite file, move it to /yourpath/2fauth/database.sqlite on your host before starting the container. Don't forget to fix its ownership and permissions if you run on *nix:
chown 1000:1000 /yourpath/2fauth/database.sqlite
chmod 700 /yourpath/2fauth/database.sqlite
The container will automagically pick it up.
â ď¸ At the very least, backup your database.sqlite file to avoid bad surprises!
The Docker image 2fauth/2fauth is built on every commit pushed to the master branch.
You can therefore pull the image with docker pull 2fauth/2fauth and restart the container to update it.
You can also use tagged images, see Docker Hub tagsâ which are produced on Github releases.
You can build the image from the master branch with docker and git using:
docker build -t 2fauth/2fauth https://github.com/Bubka/2FAuth.git
You can build a specific releaseâ by appending the release tag with #<release-tag> to the command. For example:
docker build -t 2fauth/2fauth https://github.com/Bubka/2FAuth.git#v3.0.0
You can build a specific commit (see master's commitsâ ) by appending the commit hash with #<commit-hash> to the command. For example:
docker build -t 2fauth/2fauth https://github.com/Bubka/2FAuth.git#fba9e29bd4e3bb697296bb0bde60ae869537528b
There are the following build arguments you can use to customize the image using --build-arg key=value:
| Build argument | Default | Description |
|---|---|---|
UID | 1000 | The UID of the user to run the container as |
GID | 1000 | The GID of the user to run the container as |
DEBIAN_VERSION | buster-slim | The Debian version to use |
PHP_VERSION | 8.2-buster | The PHP version to use to get composer dependencies |
COMPOSER_VERSION | 2.7 | The version of composer to use |
SUPERVISORD_VERSION | v0.7.3 | The version of supervisord to use |
VERSION | unknown | The version of the image |
CREATED | an unknown date | The date of the image build time |
COMMIT | unknown | The commit hash of the Git commit used |
Refer your email provider documentation to configure your mail settings
Set a value for every available setting to avoid issue
| Build argument | Recommendation | Description |
|---|---|---|
MAIL_MAILER | SMTP | The driver type |
MAIL_HOST | smtp.yourdomain.com | The SMTP hostname |
MAIL_PORT | 587 | The corresponding SMTP port (587 with STARTTLS) or (465 with SSL recommended) |
MAIL_USERNAME | [email protected] | The SMTP username |
MAIL_PASSWORD | password1234 | The SMTP password |
MAIL_ENCRYPTION | TLS | The encrytion type (TLS -> STARTTLS) or SSL |
MAIL_FROM_NAME | 2FAuth | The sender name |
MAIL_FROM_ADDRESS | [email protected] | The sender adress |
Example:
-e MAIL_MAILER=SMTP
-e MAIL_HOST=smtp.example.com
-e MAIL_PORT=587 # STARTTLS
-e [email protected]
-e MAIL_PASSWORD=password1234
-e MAIL_ENCRYPTION=TLS # STARTTLS
-e MAIL_FROM_NAME=2FAuth
-e [email protected]
alpine:3.14 with minimal packages installedsupervisordâ to handle both an Nginx server and a PHP-FPM server together/srv directory holds the repository data and PHP code./2fauth directory is targeted for the container end users./2fauth/storage/logs.Content type
Image
Digest
sha256:fe799fdbfâŚ
Size
39.2 MB
Last updated
7 days ago
docker pull 2fauth/2fauth