jkd Posted September 13, 2015 #1 Posted September 13, 2015 Bonjour, je souhaite accéder à mon syno depuis mon boulot, le problème auquel je suis confronté c'est la réécriture de l'URL qui est bloquée par le firewall entreprise. J'accède au syno en https sur le 443 mais la réponse du syno se fait par une réecriture d'URL sur le port 5001 alors cela bloque, comment faire pour le syno me retour une URL en 443 ?
K-Li Posted September 14, 2015 #2 Posted September 14, 2015 un acces en VPN par le package VPN server ?
nicoueron Posted September 14, 2015 #3 Posted September 14, 2015 En général le proxy des entreprises bloquent pas mal de chose y compris le service de VPN proposé par Syno, donc la solution proposée par K-Li risque de ne pas marcher. En effet il s'agit d'un proxy HTTP dans 99% des cas et le VPN n'est pas un service HTTP. 2 autres solutions : -soit tu changes le numéro de port par défaut du DSM en HTTPS (ici 5001 par 443) mais il faut alors que tu changes celui de PhotoStation et Webstation par un autre, ce qui implicitement rendra inactif ces derniers depuis ton entreprise... donc pas terrible -soit (comme moi) tu installes un reverse proxy type HAProxy via le gestionnaire de packages. Ce reverse proxy devient alors le seul service exposable depuis l'extérieur sur les ports 80 et 443. Et les redirections internes réalisées par le RP pointent vers le 5001 pour DSM selon une condition que tu choisis. Pour ma part il s'agit du sous domaine. Par exemple si je tape : https://dsm.mondomaine.fr la requête arrive sur le RP et celui-ci voit que cela commence par dsm, donc il redirige vers l'IP du NAS:5001 de façon transparente.
jkd Posted September 14, 2015 Author #4 Posted September 14, 2015 Salut, merci pour vos retours, j'aurai tendance à privilégier la solution HAproxy. je vais voir si je trouve des infos sur cette possibilité. Avez-vous des tuyaux sur la configuration à mettre en oeuvre ?
nicoueron Posted September 15, 2015 #5 Posted September 15, 2015 Un très bon tuto ici : http://www.nas-forum.com/forum/topic/39737-tuto-haproxy-et-regroupement-des-param/ Petit conseil, il faut bien comprendre l'objectif et les principes en s'appuyant sur les schémas
jkd Posted September 15, 2015 Author #6 Posted September 15, 2015 Super, j'ai réussi à mettre en oeuvre HAProxy. Cela fonctionne comme je le souhaite. Cerise sur le gateau je voulais utiliser shellinabox, mais je n'ai pas réussi à l'installer, avez vous des pistes ?
nicoueron Posted September 16, 2015 #7 Posted September 16, 2015 Perso, je n'ai pas essayé cet outil, mais je peux te proposer 2 solutions alternatives : - soit tu utilises GateOne fourni par Synology - soit tu utilises guacamole (guac-dev) qui propose aussi un émulateur SSH
nicoueron Posted September 16, 2015 #8 Posted September 16, 2015 et une autre solution aussi : sslh (fourni aussi par Synology). Mais si tu as déjà mis HAProxy ça devient un peu "chiader" de rajouter ce sslh...
jkd Posted September 16, 2015 Author #9 Posted September 16, 2015 Salut, j'ai installé gateone, par contre je n'arrive pas à l'utiliser avec HAProxy. La seule URL que j'ai réussi à faire fonctionner avec HAProxy c'est https://dsm.mondomaine, j'y accède très bien depuis mon boulot. Les URL https:/photo.mondomaine et https://gateone.mondomaine ne fonctionne pas. Pour https:/photo.mondomaine j'ai une réécriture qui se fait en https:/photo.mondomaine:5000 !!?? et pour https://gateone.mondomaine j'ai un code retour 503 alors que le service est démarré Avez-vous une idée du problème ?
nicoueron Posted September 17, 2015 #10 Posted September 17, 2015 (edited) Le plus simple est que tu nous fournisses ton fichier de conf haproxy.cfg Chez moi, pour gateone, j'ai créé le backend suivant : gateone localhost:8271 ssl check verify none Pour photoStation, c'est un peu plus chiant, en effet celui-ci n'est pas un service dédié mais est exposé par Apache sur le port 80 (et 443) avec un context-root particulier /photo qu'il faut nécessairement ajouter à l'url que tu saisies. Pour ma part, j'ai contourné ce pb en créant un fichier index.html à la racine d'Apache dans le répertoire web. Ce fichier index.html contient une balise de redirection automatique vers ce contexte lorsque j'arrive sur la page https://photo.mondomaine.fr/ ==> https://photo.mondomaine.fr/photo Du coup, pour rester logique dans le nommage de l'url, l'url de mon PhotoStation est plutôt : https://www.mondomaine.fr/photo Voici cette balise : Edited September 17, 2015 by Guest
nicoueron Posted September 17, 2015 #11 Posted September 17, 2015 question supplémentaire, comment déclares-tu tes sous-domaines ? moi je le fais avec OVH - mon fournisseur de domaine
jkd Posted September 19, 2015 Author #12 Posted September 19, 2015 Hello, voila un topo. 1) ce qui fonctionne: https://dsm.mondomaine (j'arrive bien sur l'interface web) 2) ne fonctionne pas https://photo.mondomaine (Une réecriture en http et redirection de port sur le 5000, bloqué au boulot) https://ssh.mondomaine (SSLError: [sSL: HTTP_REQUEST] http request (_ssl.c:590)) https://file.mondomaine (j'arrive au certificat que je valide, puis erreur 503) Mes résolutions sont portées par changeip 3) Configurations box PAT 443 => 5443 NAS - Panneau de configuration -> Réseau -> Paramètres DSM HTTP : 5000 HTTPS : 5001 La connexion https n'est pas activé - haproxy.cfg global user haproxy daemon maxconn 256 log localhost user info spread-checks 10 tune.ssl.default-dh-param 2048 defaults mode http stats enable default-server inter 30s fastinter 5s log global option httplog timeout connect 5s timeout client 50s timeout server 50s timeout tunnel 1h listen stats :8280 stats uri / stats show-legends stats refresh 10s stats realm Haproxy\ Statistics stats auth admin:XXXXXXXXXXXXXXXX frontend http bind :5080 option http-server-close option forwardfor default_backend web frontend https bind :5443 ssl crt /usr/local/haproxy/var/crt/default.pem ciphers AESGCM+AES128:AES128:AESGCM+AES256:AES256:RSA+RC4+SHA:!RSA+AES:!CAMELLIA:!aECDH:!3DES:!DSS:!PSK:!SRP:!aNULL no-sslv3 option http-server-close option forwardfor rspirep ^Location:\ https://(.*)$ Location:\ https://\1 rspadd Strict-Transport-Security:\ max-age=31536000;\ includeSubDomains use_backend web if { hdr_beg(Host) -i photo. } use_backend dsm if { hdr_beg(Host) -i dsm. } use_backend sabnzbd if { hdr_beg(Host) -i sabnzbd. } use_backend nzbget if { hdr_beg(Host) -i nzbget. } use_backend sickbeard if { hdr_beg(Host) -i sickbeard. } use_backend couchpotatoserver if { hdr_beg(Host) -i couchpotatoserver. } use_backend headphones if { hdr_beg(Host) -i headphones. } use_backend maraschino if { hdr_beg(Host) -i maraschino. } use_backend znc if { hdr_beg(Host) -i znc. } use_backend transmission if { hdr_beg(Host) -i transmission. } use_backend gateone if { hdr_beg(Host) -i ssh. } use_backend webdav if { hdr_beg(Host) -i webdav. } use_backend audio if { hdr_beg(Host) -i audio. } use_backend download if { hdr_beg(Host) -i download. } use_backend surveillance if { hdr_beg(Host) -i surveillance. } use_backend video if { hdr_beg(Host) -i video. } use_backend file if { hdr_beg(Host) -i file. } use_backend haproxy if { hdr_beg(Host) -i haproxy. } use_backend deluge if { hdr_beg(Host) -i deluge. } default_backend web backend web server web localhost:80 check backend dsm server dsm localhost:5000 check backend sabnzbd server sabnzbd localhost:8080 check backend nzbget server nzbget localhost:6789 check backend sickbeard server sickbeard localhost:8081 check backend couchpotatoserver server couchpotatoserver localhost:5050 check backend headphones server headphones localhost:8181 check backend maraschino server maraschino localhost:8260 check backend znc server znc localhost:8250 check backend transmission server transmission localhost:9091 check backend gateone server gateone localhost:8271 check verify none backend webdav server webdav localhost:5005 check backend audio server audio localhost:8800 check backend download server download localhost:8000 check backend surveillance server surveillance localhost:9900 check backend video server video localhost:9007 check backend file server file localhost:7000 check backend haproxy server haproxy localhost:8280 check backend deluge server deluge localhost:8112 check
jkd Posted September 19, 2015 Author #13 Posted September 19, 2015 Hello, voila un topo. 1) ce qui fonctionne: https://dsm.mondomaine (j'arrive bien sur l'interface web) 2) ne fonctionne pas https://photo.mondomaine (Une réecriture en http et redirection de port sur le 5000, bloqué au boulot) https://ssh.mondomaine (SSLError: [sSL: HTTP_REQUEST] http request (_ssl.c:590)) https://file.mondomaine (j'arrive au certificat que je valide, puis erreur 503) Mes résolutions sont portées par ChangeIP 3) Configurations box PAT 443 => 5443 NAS - Panneau de configuration -> Réseau -> Paramètres DSM HTTP : 5000 HTTPS : 5001 La connexion https n'est pas activé - haproxy.cfg global user haproxy daemon maxconn 256 log localhost user info spread-checks 10 tune.ssl.default-dh-param 2048 defaults mode http stats enable default-server inter 30s fastinter 5s log global option httplog timeout connect 5s timeout client 50s timeout server 50s timeout tunnel 1h listen stats :8280 stats uri / stats show-legends stats refresh 10s stats realm Haproxy\ Statistics stats auth admin:XXXXXXXXXXXXXXXX frontend http bind :5080 option http-server-close option forwardfor default_backend web frontend https bind :5443 ssl crt /usr/local/haproxy/var/crt/default.pem ciphers AESGCM+AES128:AES128:AESGCM+AES256:AES256:RSA+RC4+SHA:!RSA+AES:!CAMELLIA:!aECDH:!3DES:!DSS:!PSK:!SRP:!aNULL no-sslv3 option http-server-close option forwardfor rspirep ^Location:\ https://(.*)$ Location:\ https://\1 rspadd Strict-Transport-Security:\ max-age=31536000;\ includeSubDomains use_backend web if { hdr_beg(Host) -i photo. } use_backend dsm if { hdr_beg(Host) -i dsm. } use_backend sabnzbd if { hdr_beg(Host) -i sabnzbd. } use_backend nzbget if { hdr_beg(Host) -i nzbget. } use_backend sickbeard if { hdr_beg(Host) -i sickbeard. } use_backend couchpotatoserver if { hdr_beg(Host) -i couchpotatoserver. } use_backend headphones if { hdr_beg(Host) -i headphones. } use_backend maraschino if { hdr_beg(Host) -i maraschino. } use_backend znc if { hdr_beg(Host) -i znc. } use_backend transmission if { hdr_beg(Host) -i transmission. } use_backend gateone if { hdr_beg(Host) -i ssh. } use_backend webdav if { hdr_beg(Host) -i webdav. } use_backend audio if { hdr_beg(Host) -i audio. } use_backend download if { hdr_beg(Host) -i download. } use_backend surveillance if { hdr_beg(Host) -i surveillance. } use_backend video if { hdr_beg(Host) -i video. } use_backend file if { hdr_beg(Host) -i file. } use_backend haproxy if { hdr_beg(Host) -i haproxy. } use_backend deluge if { hdr_beg(Host) -i deluge. } default_backend web backend web server web localhost:80 check backend dsm server dsm localhost:5000 check backend sabnzbd server sabnzbd localhost:8080 check backend nzbget server nzbget localhost:6789 check backend sickbeard server sickbeard localhost:8081 check backend couchpotatoserver server couchpotatoserver localhost:5050 check backend headphones server headphones localhost:8181 check backend maraschino server maraschino localhost:8260 check backend znc server znc localhost:8250 check backend transmission server transmission localhost:9091 check backend gateone server gateone localhost:8271 check verify none backend webdav server webdav localhost:5005 check backend audio server audio localhost:8800 check backend download server download localhost:8000 check backend surveillance server surveillance localhost:9900 check backend video server video localhost:9007 check backend file server file localhost:7000 check backend haproxy server haproxy localhost:8280 check backend deluge server deluge localhost:8112 check
nicoueron Posted September 21, 2015 #14 Posted September 21, 2015 Inspire toi du mien, notamment sur "default_backend web" qui me semble inutile et aussi les ciphers à ne pas mentionner. remarque : le mien s'appuie sur du HTTPS car j'utilise un véritable certificat HTTPS émis par une Autorité racine de confiance reconnue global user haproxy daemon maxconn 256 log localhost user info spread-checks 10 tune.ssl.default-dh-param 2048 defaults mode http stats enable default-server inter 30s fastinter 5s log global option httplog timeout connect 5s timeout client 50s timeout server 50s timeout tunnel 1h frontend http bind :5080 option http-server-close option forwardfor redirect scheme https if !{ ssl_fc } frontend https bind :5443 ssl crt /usr/local/haproxy/var/crt/default.pem option http-server-close option forwardfor use_backend nas if { hdr_beg(Host) -i nas. } use_backend www if { hdr_beg(Host) -i www. } use_backend gateone if { hdr_beg(Host) -i gateone. } use_backend webdav if { hdr_beg(Host) -i webdav. } use_backend video if { hdr_beg(Host) -i video. } use_backend haproxy if { hdr_beg(Host) -i haproxy. } use_backend tomcat if { hdr_beg(Host) -i tomcat. } use_backend freeboxOS if { hdr_beg(Host) -i freebox. } use_backend nzb if { hdr_beg(Host) -i nzb. } use_backend webcam if { hdr_beg(Host) -i webcam. } backend nas server nas localhost:5001 check ssl verify none backend www server www localhost:443 ssl check verify none backend gateone server gateone localhost:8271 ssl check verify none backend webdav server webdav localhost:5006 ssl check verify none backend video server video localhost:9007 check backend haproxy server haproxy localhost:8280 check backend tomcat server tomcat localhost:7070 check backend freeboxOS server freebox mafreebox.free.fr:80 check backend nzb server nzb localhost:8080 check backend webcam server webcam 192.168.0.6:88 check
jkd Posted September 22, 2015 Author #15 Posted September 22, 2015 nicoueron, merci, https://dsm.mondomaine et https://ssh.mondomaine fonctionne. Par contre avant de m'occuper de https://photo.mondomaine, j'ai depuis l'URL https://dsm.mondomaine lancé "photo station" J'ai le message "Désolé, la page que vous recherchez est introuvable." Une réecriture est faite en https://dsm.mondomaine/photo/login.php? ... x&usr=xxxx Une idée ? Ah, la tabulation et Ctrl-C ne fonctionne pas dans Gateone !!??
nicoueron Posted September 22, 2015 #16 Posted September 22, 2015 le bash (sous-entednu les tabulations) fonctionnent pour ma part... par contre il est vrai que le copier/coller n'est pas super opérationnel... pour ma part, j'attaque le service webstation (et par extension PhotoStation) en HTTPS. Donc au niveau d'HAproxy il faut mettre la directive ssl correspondante : www localhost:443 ssl check verify none
jkd Posted September 22, 2015 Author #17 Posted September 22, 2015 Bonsoir, le problème de tabulation que je rencontre avec gateone ne se produit pas avec IE, jusqu'à présent mes tests étaient fait avec firefox. Je n'arrive toujours pas à régler mon problème avec l'URL https://photo.mondomaine Comment cela se fait que les modifications faites directement dans le fichier de configuration haproxy n'apparaissent pas dans l'interface haproxy ?
nicoueron Posted September 23, 2015 #18 Posted September 23, 2015 ah... le point qui fâche! l'interface graphique d'HAProxy n'est pas super opérationnelle. Il faut faire le choix de manipuler le fichier de conf à la main OU l'interface graphique. Par contre pour prendre en compte les modifs il faut cliquer sur "Ecrire la configuration".
jkd Posted September 23, 2015 Author #19 Posted September 23, 2015 ah... le point qui fâche! l'interface graphique d'HAProxy n'est pas super opérationnelle. Il faut faire le choix de manipuler le fichier de conf à la main OU l'interface graphique. Par contre pour prendre en compte les modifs il faut cliquer sur "Ecrire la configuration". ok? donc pas moyen de loader une conf écrite à la mano. Est-il possible d'installer un browser (genre firefox) dans le NAS ? Je souhaite via le NAS me connecter à l'IHM de ma box Pas d'autre piste pour mon problème de photo J'arrive à me connecter à mon album avac l'application DS photo en utilisant photo.mondomaine et connection HTTPS
K-Li Posted September 24, 2015 #20 Posted September 24, 2015 Est-il possible d'installer un browser (genre firefox) dans le NAS ? Je souhaite via le NAS me connecter à l'IHM de ma box Oui, techniquement, c'est possible... mais c'est une usine a gaz a mon sens (je partirais sur une virtualisation par docker). Autre possibilité (celle que j'utilise) : VPN en accès mais je ne sais pas comment ca peut s'articuler avec le proxy. Par contre, il ne faut pas devoir redemarrer en dur ton routeur (comme les freebox ).
nicoueron Posted September 24, 2015 #21 Posted September 24, 2015 Est-il possible d'installer un browser (genre firefox) dans le NAS ? Je souhaite via le NAS me connecter à l'IHM de ma box Tu aimes biens poser les questions qui fachent ! Pour y arriver, la solution indiquée par K-Li en utilisant Docker est je pense, la meilleure et la plus simple. Pour preuve c'est ce que je fais! Une fois que tu as installé Docker via le gestionnaire de package tu vas dans Registre et tu recherches lxde par exemple. Prendre celui qui mentionne le protocole noVNC :https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc/ Ensuite tu fais redirigé le port entrant de cette image Docker avec ton HAproxy. Ce qui fais : Internet ---------->:443 Box ------->:5443 Haproxy ---------> :6080 Docker -----> :6080 LXDE
K-Li Posted September 24, 2015 #23 Posted September 24, 2015 Perso, je me connecte en VPN sur le serveur et je navigue dans le reseau local en rentrant l'adresse IP du routeur... j'evite de laisser docker tourner sur le NAS et donc, j'economise les ressources du NAS.
allergoanmd Posted September 25, 2015 #24 Posted September 25, 2015 (edited) Bonne idée ! je vais essayer aujourd'hui, souhaite economiser bien les ressources du NAS ! Acheter coque Sony Xperia Z5,film étui housse Xperia Z5 Edited September 29, 2015 by Guest
nicoueron Posted September 25, 2015 #25 Posted September 25, 2015 Perso, je me connecte en VPN sur le serveur et je navigue dans le reseau local en rentrant l'adresse IP du routeur... j'evite de laisser docker tourner sur le NAS et donc, j'economise les ressources du NAS. On est d'accord, sauf que le VPN est bloqué lorsque tu es derrière un proxy HTTP en entreprise.
Recommended Posts