commit 0fcd26fa3e7916138863f735a888d0f89392f264
parent cc04ea54dc6a2201383db8bfedd5875a8610f5f6
Author: Leayawi <lea.oualli@outlook.fr>
Date: Wed, 18 Jun 2025 17:57:37 +0200
test
Diffstat:
4 files changed, 47 insertions(+), 21 deletions(-)
diff --git a/install-taler-from-apt.sh b/install-taler-from-apt.sh
@@ -8,6 +8,7 @@ set -e
set -x
trap 'echo "Error occurred on line $LINENO." >&2' ERR
exec > >(tee -a /tmp/install-output.log) 2>&1
+mkdir -p /home/taleruser/taler-installer
echo "ARGS: $1 $2 $3 $4" >> /home/taleruser/taler-installer/install.log
@@ -44,15 +45,15 @@ if [ "$1" = "8" ] && [ -n "$2" ]; then
fi
echo "HTTPS reverse proxy configured for $DOMAIN (Nginx)" | tee -a "/home/$WSL_USER/taler-installer/install.log"
fi
- else
+ else # HTTP only
if [ "$PROXY_TYPE" = "APACHE" ]; then
- if ! sudo taler-merchant-rproxy-setup --domain "$DOMAIN" --apache --no-certbot; then
+ if ! sudo taler-merchant-rproxy-setup --domain "$DOMAIN" --apache; then
echo "WARNING: Unable to configure HTTP proxy for $DOMAIN (Apache)" | tee -a "/home/$WSL_USER/taler-installer/install.log"
exit 0
fi
echo "HTTP reverse proxy configured for $DOMAIN (Apache, no SSL)" | tee -a "/home/$WSL_USER/taler-installer/install.log"
else
- if ! sudo taler-merchant-rproxy-setup --domain "$DOMAIN" --nginx --no-certbot; then
+ if ! sudo taler-merchant-rproxy-setup --domain "$DOMAIN" --nginx; then
echo "WARNING: Unable to configure HTTP proxy for $DOMAIN (Nginx)" | tee -a "/home/$WSL_USER/taler-installer/install.log"
exit 0
fi
@@ -63,6 +64,7 @@ if [ "$1" = "8" ] && [ -n "$2" ]; then
exit 0
fi
+
# Vérification de l'utilisateur système
if ! id "$WSL_USER" &>/dev/null; then
echo "System user $WSL_USER not found. Please create it." >&2
diff --git a/setup-wsl-debian.bat b/setup-wsl-debian.bat
@@ -186,7 +186,7 @@ if /I "%DOMAIN%"=="localhost" set PROXY_TYPE=APACHE
if /I "%DOMAIN:~-6%"==".local" set PROXY_TYPE=APACHE
if /I "%PROXY_MODE%"=="HTTPS" (
- if "%PROXY_TYPE%"=="APACHE" (
+ if /I "%PROXY_TYPE%"=="APACHE" (
echo Setting up HTTPS with Let's Encrypt (Apache) for %DOMAIN% ...
%WSL% -d %DISTRO% -- bash -c "sudo taler-merchant-rproxy-setup --domain %DOMAIN% --apache"
) else (
@@ -194,35 +194,27 @@ if /I "%PROXY_MODE%"=="HTTPS" (
%WSL% -d %DISTRO% -- bash -c "sudo taler-merchant-rproxy-setup --domain %DOMAIN% --nginx"
)
) else (
- if "%PROXY_TYPE%"=="APACHE" (
+ if /I "%PROXY_TYPE%"=="APACHE" (
echo Setting up HTTP only (Apache) for %DOMAIN% ...
- %WSL% -d %DISTRO% -- bash -c "sudo taler-merchant-rproxy-setup --domain %DOMAIN% --apache --no-certbot"
+ %WSL% -d %DISTRO% -- bash -c "sudo taler-merchant-rproxy-setup --domain %DOMAIN% --apache --httponly"
) else (
echo Setting up HTTP only (Nginx) for %DOMAIN% ...
- %WSL% -d %DISTRO% -- bash -c "sudo taler-merchant-rproxy-setup --domain %DOMAIN% --nginx --no-certbot"
+ %WSL% -d %DISTRO% -- bash -c "sudo taler-merchant-rproxy-setup --domain %DOMAIN% --nginx --httponly"
)
)
-
-if "%PROXY_TYPE%"=="APACHE" (
- %WSL% -d %DISTRO% -- bash -c "sudo service apache2 start"
-) else (
- %WSL% -d %DISTRO% -- bash -c "sudo service nginx start"
-)
-
-if "%PROXY_TYPE%"=="APACHE" (
+REM Démarrer le bon service
+if /I "%PROXY_TYPE%"=="APACHE" (
%WSL% -d %DISTRO% -- bash -c "sudo service apache2 start"
- REM Optionnel: planifier Apache au démarrage WSL
+ REM Planifie Apache au démarrage WSL (optionnel)
powershell -Command "Register-ScheduledTask -Action (New-ScheduledTaskAction -Execute '%WINDIR%\System32\wsl.exe' -Argument '-d %DISTRO% -- bash -c \"sudo service apache2 start && while true; do sleep 3600; done\"') -Trigger (New-ScheduledTaskTrigger -AtLogOn) -TaskName 'StartTalerApacheWSL' -User '$env:USERNAME' -RunLevel Highest -Force"
) else (
%WSL% -d %DISTRO% -- bash -c "sudo service nginx start"
- REM Tu peux planifier nginx aussi si tu veux
+ REM (Optionnel : tu peux planifier nginx ici)
)
-REM Scheduled task (on next boot): Apache will start automatically
-powershell -Command "Register-ScheduledTask -Action (New-ScheduledTaskAction -Execute '%WINDIR%\System32\wsl.exe' -Argument '-d %DISTRO% -- bash -c \"sudo service apache2 start && while true; do sleep 3600; done\"') -Trigger (New-ScheduledTaskTrigger -AtLogOn) -TaskName 'StartTalerApacheWSL' -User '$env:USERNAME' -RunLevel Highest -Force"
-
echo.
echo GNU Taler-Merchant installed successfully!
timeout /t 5 /nobreak >nul
exit /b
+
diff --git a/taler-installer-taler.nsi b/taler-installer-taler.nsi
@@ -209,11 +209,22 @@ Function ReverseProxyPage
${EndIf}
${NSD_CreateLabel} 0 10u 100% 12u $(MSG_REVERSE_PROXY_TITLE)
Pop $0
+
${NSD_CreateRadioButton} 0 30u 100% 12u $(MSG_HTTP_ONLY)
Pop $RADIO_HTTP_ONLY
+
+ ; Si domaine = localhost, griser/désactiver HTTPS et forcer HTTP
${NSD_CreateRadioButton} 0 45u 100% 12u $(MSG_HTTPS)
Pop $RADIO_HTTPS
- ${NSD_SetState} $RADIO_HTTPS 1
+
+ ${NSD_GetText} $DOMAIN_INPUT $1
+ ${If} $1 == "localhost"
+ EnableWindow $RADIO_HTTPS 0
+ ${NSD_SetState} $RADIO_HTTP_ONLY 1
+ ${NSD_SetState} $RADIO_HTTPS 0
+ ${Else}
+ ${NSD_SetState} $RADIO_HTTPS 1
+ ${EndIf}
nsDialogs::Show
FunctionEnd
diff --git a/test-if.bat b/test-if.bat
@@ -0,0 +1,21 @@
+@echo off
+set MODE=%1
+set TYPE=%2
+
+echo MODE=%MODE%
+echo TYPE=%TYPE%
+
+if /I "%MODE%"=="HTTPS" (
+ if /I "%TYPE%"=="APACHE" (
+ echo HTTPS APACHE
+ ) else (
+ echo HTTPS NGINX
+ )
+) else (
+ if /I "%TYPE%"=="APACHE" (
+ echo HTTP APACHE
+ ) else (
+ echo HTTP NGINX
+ )
+)
+pause