2fAuth - Datenbankprobleme


Mor9oth

Recommended Posts

Hallo zusammen,

ich habe 2FAuth aus dem Unraid-App-Store installiert und konnte diesen auch mit sqlite verwenden. Allerdings möchte ich ihn gerne mit Mysql nutzen. Ich habe daher eine Datenbank mit MariaDB erstellt und in dem 2FA-Docker entsprechend der Dokumentation (https://github.com/Bubka/2FAuth/blob/master/.env.example) die Variablen ergänzt.

# or if you want to use SQL (uncomment lines)

# DB_CONNECTION=mysql
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=homestead
# DB_USERNAME=homestead
# DB_PASSWORD=secret

 

Meine sind entsprechend dieser angelegt. Starte ich den Docker sieht alles richtig aus:

The [/srv/public/storage] link already exists.
The links have been created.
Configuration cache cleared!
Configuration cached successfully!
time="2022-02-26T15:53:33Z" level=info msg="load configuration from file" file=/etc/supervisor/supervisord.conf

 

Sobald ich aber das WebUI aufrufe, bekomme ich folgende Fehler: Siehe Screenshot.

Leider verstehe ich das gar nicht. Sieht aus, als ob etwas fehlt, bei meiner Recherche habe ich aber für mich nichts Greifbares gefunden. Weiß jemand, wie ich das lösen kann?

 

Besten Dank vorab!

 

Fehlermeldung.png

Link to comment
  • 3 weeks later...
1 hour ago, mgutt said:

Wenn ich das hier richtig verstehe, dann kommt es zu so einem Fehler, wenn nicht die notwendigen Datenbanktreiber in PHP installiert sind:

https://stackoverflow.com/questions/9308147/pdoexception-could-not-find-driver-in-php

 

Daraus schließe ich, dass der Container nicht mit einer SQL Datenbank kompatibel ist. Was sagt die Doku des Containers dazu?

Ich bin von dieser Doku bzw. den Optionen der env.example darin ausgegangen: https://github.com/Bubka/2FAuth/blob/master/.env.example.
Darin ist eben in Zeile 62-69 die Anbindung mit SQL aufgeführt. Ich bin dann wiederum davon ausgegangen, dass ich diese Option auch in den Unraid bzw. Docker Einstellungen vornehmen kann. Ist mir aber weder in Unraid noch mit dem Pi gelungen, daher auch dieser Beitrag. Geht es dann einfach "nur" mit SQLite oder gibt es eine Lösung? Vielleicht verstehe ich auch einfach nur den Kontext mit der Environment (.env) nicht.

Link to comment
2 hours ago, deanrparry said:

did you have issues with attaching logos to them? nginx permissions?

Hey! No, I can attach images without problems. Maybe you forgot to set the permissions according to the description?

WARNING
Even if the config dir (/.../appdata/2fauth) is supposed to work with 700 (chmod) permissions, I could not get it working as it should on unRAID. Instead, I had to set full permissions: 777, if not, the container refused to start. If someone could help on this I would thank you very much.


NOTES
• Run the following cmd via Terminal (unRAID) before building the container: mkdir -m 777 /mnt/user/appdata/2fauth.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.