AlternC / alternc-acme

GNU Affero General Public License v3.0
3 stars 8 forks source link

couldn't get address #44

Open ddeenniiss opened 5 years ago

ddeenniiss commented 5 years ago

Au lancement de /usr/lib/alternc/install.d/alternc-certbot apache2, message d'erreur. Le message d'erreur est identique pour tous les domaines

Requesting domain 5/212: @.adashboard.org dig: couldn't get address for '.adashboard.org': not found

camlafit commented 5 years ago

Bonjour

Etrange , quel est le domaine a traiter ? Je vois qu'il y un "." qui préfixe ce qui ne devrait pas être le cas. Est ce pour tous les hôtes déclarés ?

ddeenniiss commented 5 years ago

oui pour tous les hôtes déclarés.

Et pour info, dans vhosts_all.conf, j'ai 2 Virtualhost avec un ServerName @.adashboard.org

<VirtualHost *:443>
  DocumentRoot /usr/share/alternc/panel/admin

  ServerName @.adashboard.org
<VirtualHost *:80>
  DocumentRoot /usr/share/alternc/panel/admin

  ServerName @.adashboard.org
camlafit commented 5 years ago

C'est un vhost licite ? J'ai un doute là

ddeenniiss commented 5 years ago

www.adashboard.org

<Virtualhost *:80>
  ServerName www.adashboard.org
  AssignUserId #2012 #2012
  SetEnv LOGIN "2012-agentfutur"
  KeepAlive Off
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
  RewriteCond %{REQUEST_FILENAME} !/.well-known/acme-challenge/
  RewriteRule ^/(.*)$ https://www.adashboard.org/$1 [R=301,L]
</Virtualhost>
<VirtualHost *:443>
  ServerName www.adashboard.org
  DocumentRoot "/var/www/alternc/a/agentfutur/www/agentfutur.constantvzw.org/"
  AssignUserId #2012 #2012
  SetEnv LOGIN "2012-agentfutur"
  <Directory "/var/www/alternc/a/agentfutur/www/agentfutur.constantvzw.org/">
    php_admin_value open_basedir "/var/www/alternc/a/agentfutur:/usr/share/php/"
    php_admin_value upload_tmp_dir /var/www/alternc/a/agentfutur/tmp
    php_admin_value sys_temp_dir /var/www/alternc/a/agentfutur/tmp
    php_admin_value sendmail_path '/usr/lib/alternc/sendmail "agentfutur@bureau.constantvzw.org" '
    php_admin_flag mail.add_x_header on
    Options +MultiViews -FollowSymLinks +SymLinksIfOwnerMatch
    AllowOverride AuthConfig FileInfo Limit Options Indexes
  </Directory>
  SSLEngine On
  SSLCertificateFile /var/lib/alternc/ssl/private/0/636.pem
  SSLCertificateKeyFile /var/lib/alternc/ssl/private/0/636.key
  SSLCertificateChainFile /var/lib/alternc/ssl/private/0/636.chain
</VirtualHost>

adashboard.org

<Virtualhost *:80>
  ServerName adashboard.org
  AssignUserId #2012 #2012
  SetEnv LOGIN "2012-agentfutur"
  KeepAlive Off
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
  RewriteCond %{REQUEST_FILENAME} !/.well-known/acme-challenge/
  RewriteRule ^/(.*)$ https://adashboard.org/$1 [R=301,L]
</Virtualhost>
<VirtualHost *:443>
  ServerName adashboard.org
  DocumentRoot "/var/www/alternc/a/agentfutur/www/agentfutur.constantvzw.org/"
  AssignUserId #2012 #2012
  SetEnv LOGIN "2012-agentfutur"
  <Directory "/var/www/alternc/a/agentfutur/www/agentfutur.constantvzw.org/">
    php_admin_value open_basedir "/var/www/alternc/a/agentfutur:/usr/share/php/"
    php_admin_value upload_tmp_dir /var/www/alternc/a/agentfutur/tmp
    php_admin_value sys_temp_dir /var/www/alternc/a/agentfutur/tmp
    php_admin_value sendmail_path '/usr/lib/alternc/sendmail "agentfutur@bureau.constantvzw.org" '
    php_admin_flag mail.add_x_header on
    Options +MultiViews -FollowSymLinks +SymLinksIfOwnerMatch
    AllowOverride AuthConfig FileInfo Limit Options Indexes
  </Directory>
  SSLEngine On
  SSLCertificateFile /var/lib/alternc/ssl/private/0/792.pem
  SSLCertificateKeyFile /var/lib/alternc/ssl/private/0/792.key
  SSLCertificateChainFile /var/lib/alternc/ssl/private/0/792.chain
</VirtualHost>
<VirtualHost *:80>
  DocumentRoot /usr/share/alternc/panel/admin

  AssignUserId alterncpanel alterncpanel
  SetEnv LOGIN "0000-panel"

  ServerName @.adashboard.org

  RewriteEngine On
  # Mail autoconfig
  RewriteRule ^/mail/mailautoconfig.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^/mail/config-v1.1.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^mail/mailautoconfig.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^mail/config-v1.1.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^/autodiscover/autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^/Autodiscover/Autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^/Autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^/autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^autodiscover/autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^Autodiscover/Autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^Autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule (.*) - [F]

</VirtualHost>

Voici ce que j'ai:

<VirtualHost *:443>
  DocumentRoot /usr/share/alternc/panel/admin

  AssignUserId alterncpanel alterncpanel
  SetEnv LOGIN "0000-panel"

  ServerName @.adashboard.org

  RewriteEngine On
  # Mail autoconfig
  RewriteRule ^/mail/mailautoconfig.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^/mail/config-v1.1.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^mail/mailautoconfig.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^mail/config-v1.1.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^/autodiscover/autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^/Autodiscover/Autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^/Autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^/autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^autodiscover/autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^Autodiscover/Autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^Autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule (.*) - [F]

  SSLEngine On
  SSLCertificateFile /var/lib/alternc/ssl/private/0/773.pem
  SSLCertificateKeyFile /var/lib/alternc/ssl/private/0/773.key
  SSLCertificateChainFile /var/lib/alternc/ssl/private/0/773.chain

</VirtualHost>
kienanstewart commented 5 years ago

J'ai vue la même erreur. Dans le cas que j'ai vue, c'était le nouveau entrée de type autodiscover qui le faisait:

    [1] => Array
        (
            [sub_domain] => Array
                (
                    [id] => 41
                    [compte] => 2000
                    [domaine] => example.com
                    [sub] => @
                    [valeur] =>
                    [type] => autodiscover
                    [web_action] => OK
                    [web_result] => 0
                    [enable] => ENABLED
                    [certificate_id] => 4
                    [provider] =>
                    [https] =>
                    [type_desc] => Email autoconfiguration
                    [only_dns] => 0
                    [advanced] => 1
                    [has_https_option] => 0
                    [name] => @
                    [dest] =>
                    [fqdn] => @.example.com
                )

            [cuid] => 2000
        )

Je crois que le fix serait de modifier ce type pour être only_dns = 1 (voir https://github.com/AlternC/AlternC/blob/master/install/mysql.sql#L484). J'ai pas encore regardé de plus proche si ça impactera la fonctionalité de ce type de sous-domaine.

En tout cas, je propose de transferer cet rapport de bogue vers le coeur d'alternc

camlafit commented 1 year ago

Hello

resteindre sur only_dns n'est pas une bonne approche. On peut gérer des vhost localement sans gérer la partie DNS. Je me dis également qu'avec le nouveau test sur islocalAltenrcndomain cela ne devrait plus poser de problème.