Photo Station 2fa Photo Station DSM 6.2

Whitman

Benutzer
Mitglied seit
12. Nov 2014
Beiträge
43
Punkte für Reaktionen
5
Punkte
8
Hallo zusammen,

gibt es eine Möglichkeit die alte Photo Station mit 2fa abzusichern? 2fa kann man scheinbar nur für die DSM Oberfläche aktivieren.
Oder gibt es ein "application portal" (Docker) bei dem man sich einmal anmeldet und es die Login-Daten per SSO durchreicht?

BG, Jürgen
 

Ulfhednir

Benutzer
Sehr erfahren
Mitglied seit
26. Aug 2013
Beiträge
3.264
Punkte für Reaktionen
922
Punkte
174

Whitman

Benutzer
Mitglied seit
12. Nov 2014
Beiträge
43
Punkte für Reaktionen
5
Punkte
8
Danke für die Info, hab es befürchtet. Dann muss ich mich doch einarbeiten.
 

Cavekeeper

Benutzer
Mitglied seit
08. Okt 2008
Beiträge
117
Punkte für Reaktionen
3
Punkte
18
Ich arbeite mich auch gerade in swag ein. Ich habe für swag 2 Netzwerke angelegt.
- macvlan_network --> öffentlicher port 80/443 von der Fritzbox
- swag_network --> docker container, die erreichbar sein sollen
Mit der jeweiligen subdomain.conf aus dem Ordner proxy-confs komme ich mit meiner Subdomain auf den Docker-Container, z.B. Vaultwarden. Dafür gibt es vorgefertigte conf-Dateien, in diesem Fall von Bitwarden, welche man leicht abändern kann.
Leider habe ich noch keine Weiterleitung auf die Apps der DiskStation z.B. Photostation oder DSM port 5000 hinbekommen.
@Ulfhednir hättest du eine Beispiel-conf?
Code:
## Version 2022/09/08
# REMOVE THIS LINE BEFORE SUBMITTING: The structure of the file (all of the existing lines) should be kept as close as possible to this template.
# REMOVE THIS LINE BEFORE SUBMITTING: Look through this file for <tags> and replace them. Review other sample files to see how things are done.
# REMOVE THIS LINE BEFORE SUBMITTING: The comment lines at the top of the file (below this line) should explain any prerequisites for using the proxy such as DNS or app settings.
# make sure that your dns has a cname set for <container_name> and that your <container_name> container is not using a base url

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name cloud.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable for ldap auth (requires ldap-server.conf in the server block)
        #include /config/nginx/ldap-location.conf;

        # enable for Authelia (requires authelia-server.conf in the server block)
        #include /config/nginx/authelia-location.conf;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app 192.168.178.10;
        set $upstream_port 5000;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        # REMOVE THIS LINE BEFORE SUBMITTING: Additional proxy settings such as headers go below this line, leave the blank line above.
    }

    # REMOVE THIS LINE BEFORE SUBMITTING: Some proxies require one or more additional location blocks for things like API or RPC endpoints.
    # REMOVE THIS LINE BEFORE SUBMITTING: If the proxy you are making a sample for does not require an additional location block please remove the commented out section below.
    # location ~ (/<container_name>)?/api {
    #     include /config/nginx/proxy.conf;
    #     include /config/nginx/resolver.conf;
    #     set $upstream_app <container_name>;
    #     set $upstream_port <port_number>;
    #     set $upstream_proto <http or https>;
    #     proxy_pass $upstream_proto://$upstream_app:$upstream_port;
    #
    #     # REMOVE THIS LINE BEFORE SUBMITTING: Additional proxy settings such as headers go below this line, leave the blank line above.
    # }
}
 

Ulfhednir

Benutzer
Sehr erfahren
Mitglied seit
26. Aug 2013
Beiträge
3.264
Punkte für Reaktionen
922
Punkte
174
Für die Photo Station und Co. musst du im Anmeldeportal einen benutzerdefinierten Alias anlegen.
Beispiel photo.deinedomain.tld:5443

Dann musst du nur noch upstream_app und upstream_port und upstream_proto abändern.
 

Whitman

Benutzer
Mitglied seit
12. Nov 2014
Beiträge
43
Punkte für Reaktionen
5
Punkte
8
Hallo zusammen, ich hab jetzt schon einiges probiert aber irgendwo scheitere ich schon bei den Basics. Wir haben einen Windows Domain und eigene Zertifikate, deswegen bin ich mir nicht ganz sicher was ich bei Validation einstellen soll. Ich bringe leider nicht einmal das SWAG Dashboard zum laufen, hat vielleicht jemand ein paar Tipps für mich. LG
 

Ulfhednir

Benutzer
Sehr erfahren
Mitglied seit
26. Aug 2013
Beiträge
3.264
Punkte für Reaktionen
922
Punkte
174
Lets Enrcypt ist elementarer Bestandteil von SWAG. Es ist zwingend erforderlich, dass du eine Authentifizierung verwendest.
The validation is performed when the container is started for the first time. Nginx won't be up until ssl certs are successfully generated.
https://docs.linuxserver.io/general/swag

Du solltest also mindestens pseduomäßig http verwenden. Im Anschluss kannst du den Nginx auch so umbiegen, sodass du deine eigenen Zertifikate verwendest. Ich betreue einen Verein und habe für Drive ein selbst signiertes Zertifikat mit verlängerter Gültigkeit im Einsatz.

Prinzipiell kannst du die 2FA aber auch anderweitig abbilden. Du könntest dir beispielsweise den Nginx Proxymanager anschauen oder aber auch selbst einen Nginx aufbauen / umbiegen und Authelia dranklatschen.
 

Whitman

Benutzer
Mitglied seit
12. Nov 2014
Beiträge
43
Punkte für Reaktionen
5
Punkte
8
Danke für den Hinweis, bin dann gestern noch über einen Beitrag in einem Forum gestolpert bei dem das selbe Thema behandelt wurde. War gestern schon ein bisschen verzweifelt. Hab auch ein bisschen mit Traefik getestet und da bin ich dann weiter gekommen aber ich werde SWAG noch einmal in Angriff nehmen, lässt mir eh keine Ruhe. Danke für die Infos.
 

Ulfhednir

Benutzer
Sehr erfahren
Mitglied seit
26. Aug 2013
Beiträge
3.264
Punkte für Reaktionen
922
Punkte
174

Cavekeeper

Benutzer
Mitglied seit
08. Okt 2008
Beiträge
117
Punkte für Reaktionen
3
Punkte
18
Bei mir wird das Dashboard auch nicht aufgerufen. Ich bin ebenfalls nach der o.a. Anleitung vorgegangen:
- Enviroment-Variable eingetragen
- Port 81 gemappt
- dashboard.subdomain.conf gepimpt und alle allow/ deny-Einträge auskommentiert.
- Docker-Compose neu durchlaufen lassen
Weder Intern über http://server-ip:81 oder extern https://dasboard.mydomain.de wird das Dashboard aufgerufen.
Alle anderen Apps/ Sites werden einwandfrei gemappt. Nur das Dashboard nicht.
Wo könnte das Problem sein?
Code:
version: "2.1"
services:
  swag:
    image: lscr.io/linuxserver/swag
    container_name: swag
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - URL=mydomain.de
      - SUBDOMAINS=wildcard
      - VALIDATION=dns
      - DNSPLUGIN=ovh
      - DOCKER_MODS=linuxserver/mods:swag-dashboard
    volumes:
      - /opt/containers/swag/config:/config
      - /opt/containers/vaultwarden:/vaultwarden:ro
    ports:
      - 443:443
      - 80:80
      - 81:81
    restart: unless-stopped
    networks:
      - proxy
     
networks:
  proxy:
    external: true
Code:
## Version 2022/03/19
# Make sure that your dns has a cname set for dashboard

server {
    listen 81;

    server_name _;

        root /dashboard/www;
        index index.php;

    client_max_body_size 0;

    # enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;

    # enable for Authelia
    #include /config/nginx/authelia-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /ldaplogin;

        # enable for Authelia
        #include /config/nginx/authelia-location.conf;

#        allow 10.0.0.0/8;
#        allow 172.16.0.0/12;
#        allow 192.168.178.0/16;
#        deny all;

        try_files $uri $uri/ /index.php?$args =404;
    }
    location ~ \.php$ {

#        allow 10.0.0.0/8;
#        allow 172.16.0.0/12;
#        allow 192.168.178.0/16;
#        deny all;

        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
    }
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name dashboard.*;

        root /dashboard/www;
        index index.php;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;

    # enable for Authelia
    #include /config/nginx/authelia-server.conf;


    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /ldaplogin;

        # enable for Authelia
        #include /config/nginx/authelia-location.conf;

#        allow 10.0.0.0/8;
#        allow 172.16.0.0/12;
#        allow 192.168.178.0/16;
#        deny all;

        try_files $uri $uri/ /index.php?$args =404;
    }
    location ~ \.php$ {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /ldaplogin;


        # enable for Authelia
        #include /config/nginx/authelia-location.conf;

#        allow 10.0.0.0/8;
#        allow 172.16.0.0/12;
#        allow 192.168.178.0/16;
#        deny all;

        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
    }
}
 

Ulfhednir

Benutzer
Sehr erfahren
Mitglied seit
26. Aug 2013
Beiträge
3.264
Punkte für Reaktionen
922
Punkte
174
Wird denn der SWAG-Container sauber durchgestartet? Unter #7 habe ich bereits verlauten lassen, dass der Container nicht startet, wenn es Probleme mit Lets Encrypt gibt.

Ich gehe jetzt erstmal davon aus, dass du die ENV angepasst hast, oder?
- URL=mydomain.de - SUBDOMAINS=wildcard - VALIDATION=dns - DNSPLUGIN=ovh

Ansonsten schau erstmal in den Log.

P.S.: Ich hab SWAG jetzt seit Februar letzten Jahres in Betrieb und die Ganze Zeit OHNE Dashboard betrieben.
Erst vor 14 Tagen habe ich das Dashboard eingerichtet. Damit kein Missverständnis aufkommt: Das Dashboard ist keine Konfigurationsoberfläche, sondern das ist pure Handarbeit.

Für den Zugriff auf das Dashboard wird übrigens auch die subdomain.conf nicht zwangsweise benötigt.
 

Cavekeeper

Benutzer
Mitglied seit
08. Okt 2008
Beiträge
117
Punkte für Reaktionen
3
Punkte
18
Ich gehe jetzt erstmal davon aus, dass du die ENV angepasst hast, oder?
- URL=mydomain.de - SUBDOMAINS=wildcard - VALIDATION=dns - DNSPLUGIN=ovh
Das ist alles ok. Grundsätzlich läuft der Container durch, und SWAG funktioniert. Jedenfalls werden die gemappten Sites alle aufgerufen. Nur eben das Dashboard nicht. Die dashboard.subdomain.conf habe ich testweise abgeschaltet -> ohne Erfolg. Beim Aufruf des Servers auf port 81 kommt es zu einem Timeout mit folgenden Error-LOG:
Code:
[error] 328#328: *142 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 192.168.178.59, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.178.100:81"
 

Whitman

Benutzer
Mitglied seit
12. Nov 2014
Beiträge
43
Punkte für Reaktionen
5
Punkte
8
Habe jetzt Traefik und Authelia zum laufen gebracht. Wenn ich die URL der Photostation aufrufe kann ich mich bei Authelia erfolgreich anmelden aber SSO funktioniert nicht, ich muss mich immer noch an der Photostation anmelden. Brauch ich dazu noch NGINX oder Plugin? Wäre für einen Hinweis sehr dankbar.
 


 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat