Pomoc Let's encrypt certboot na snap-ie nexcloud - nie generuje certyfikatu

Status
Brak możliwości dodawania odpowiedzi.

SebekW

System Engineer
Q Specialist
9 Czerwiec 2020
110
11
18
TG
QNAP
TS-x31P
Ethernet
1 GbE
Hejka postawiłem se w końcu na wsl2 na Ubuntu 20.04 ale mam problem z let's encrypt
Czy kto może doradzić co ten let's encrypt odwala ? xD
Subdomenę mam postawioną na rekordzie A z IP-kiem zew. na Cyberfolks.pl pod domeną XXX.pl >> cloud.XXX.pl = IP zew.

wbijam na końcu sudo nextcloud.enable-https lets-encrypt a łon ->>

Kod:
Have you met these requirements? (y/n) y
Please enter an email address (for urgent notices or key recovery): admin@XXX.com.pl
Please enter your domain name(s) (space-separated): cloud.XXX.pl
Attempting to obtain certificates... error running certbot:

Saving debug log to /var/snap/nextcloud/current/certs/certbot/logs/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for cloud.XXX.pl
Using the webroot path /var/snap/nextcloud/current/certs/certbot for all unmatched domains.
Waiting for verification...
Challenge failed for domain cloud.XXX.pl
http-01 challenge for cloud.XXX.pl
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: cloud.XXX.pl
   Type:   connection
   Detail: Fetching
   http://cloud.XXX.pl/.well-known/acme-challenge/8G5xff8onbttACxPQTyLvrXDPvUqm3ssUci56jx_fnA:
   Timeout during connect (likely firewall problem)

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address. Additionally, please check that
   your computer has a publicly routable IP address and that no
   firewalls are preventing the server from communicating with the
   client. If you're using the webroot plugin, you should also verify
   that you are serving files from the webroot path you provided.

pozdrawiam
SW
 
no napisał że nie może się dobic do http://cloud.XXX.pl/.well-known/...
na pewno port 80 i 443 przekierowane poprawnie do kontnerera ?
nazwa DNS poprawnie przekierowana ?
 
Zakupiłem sobie Cert SSL na CyberFolks, zresztą tam też mam serwer fizyczny do webmaila.
i weszło za pierwszym xD
sudo nextcloud.enable-https custom -s cert.pem privkey.pem chain.pem
Wcześniej trzeba było zmienić rozszerzenia na pem ale to sobie zrobiłem w powershelu
Move-Item c:/... c:/...
---------------------------
Ogólnie wszystko przez to że WSL2 to Wirtualna maszyna i ona generuje sobie swoją sieć:
1646504543753.png

Problem polega na tym żeby to po prostu przekierować i pootwierać porty między hostem a wirtualną maszyną.
W VirtualBoxie to nie problem, w Deckerze raczej też nie duży, najgorzej jest w wsl.
Oprócz ponaprawiania miliona rzeczy na samym końcu trzeba sobie luknąc jaki ip jest na eth0.
Potem w PowerShell wklepać to:
netsh interface portproxy add v4tov4 listenport=80 listenaddress=0.0.0.0 connectport=80 connectaddress="IP z eth0 w Linuxie"
netsh interface portproxy add v4tov4 listenport=443 listenaddress=0.0.0.0 connectport=443 connectaddress="IP z eth0 w Linuxie"

Nie zadziałało no to się wnerwiłem i klepnąłem to:
sudo curl -X PUT -d arg=val -d arg2=val2 https://cloud.XXXX.pl/ -i

Knifów na zrobienie sobie dobrze jest kilka :ROFLMAO:

i poszło

Mam też mały skrypt na to:

Kod:
$remoteport = bash.exe -c “ifconfig eth0 | grep 'inet'”
$found = $remoteport -match ‘\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}’;

if( $found ){
$remoteport = $matches[0];
} else{
echo “Skrypt zakończony, nie można znaleźć adresu IP WSL 2”;
exit;
}
#[Ports]
#Wszystkie porty, które chcesz przekierować oddzielone przecinkiem
$ports=@(80,443);
#[Static ip]
# Możesz zmienić adres do swojej konfiguracji ip, aby nasłuchiwać określonego adresu
$addr=‘0.0.0.0’;
$ports_a = $ports -join “,”;
#Usuń reguły wyjątków zapory
iex "Remove-NetFireWallRule -DisplayName ‘WSL 2 Firewall Unlock’ ";

#Dodanie reguł wyjątków dla reguł przychodzących i wychodzących
iex “New-NetFireWallRule -DisplayName ‘WSL 2 Firewall Unlock’ -Direction Outbound -LocalPort $ports_a -Action Allow -Protocol TCP”;
iex “New-NetFireWallRule -DisplayName ‘WSL 2 Firewall Unlock’ -Direction Inbound -LocalPort $ports_a -Action Allow -Protocol TCP”;

for( $i = 0; $i -lt $ports.length; $i++ ){
$port = $ports[$i];
iex “netsh interface portproxy delete v4tov4 listenport=$port listenaddress=$addr”;
iex “netsh interface portproxy add v4tov4 listenport=$port listenaddress=$addr connectport=$port connectaddress=$remoteport”;

no i tyle, nexcloud stoi i ma się dobrze na, WSL2/Ubuntu20.04/SnapNexcloud, zrobię to jednak tak jak zawsze normalnie na maszynce na linuxie z jakimś raidem bo te wirtualizacje to mi już bokiem wychodzą. xD

pozdrawiam
SW
 
dlatego natywne kontenery linuxowe odpala się na linuxie, a nie grzebie w Windows :D
 
  • Lubię to
Reakcje: SebekW
Status
Brak możliwości dodawania odpowiedzi.

Użytkownicy znaleźli tą stronę używając tych słów:

  1. Lets encrypt
  2. Let's Encrypt SSL Certificate
  3. Let's Encrypt