diff --git a/win/README.md b/win/README.md new file mode 100644 index 000000000..4cdc43b2c --- /dev/null +++ b/win/README.md @@ -0,0 +1,18 @@ +# win + +In this folder, there are two scripts: +1- 'addRule' : adds a rule to the Windows firewall to accept requests on ports 3000 and 5000. +2- 'redirect' : allows redirecting ports 3000 and 5000 so that our machine processes them with our local Salix server. + + +## Run + +Two ways: + +1-Search the project of Salix in WSL with the explorer of windows, for example: \\wsl.localhost\Debian\home\your_user\projects\salix and with a terminal with administrator permissions execute addRule only one time and execute redirect.ps1 every time you need redirect ports. + +2-Search the project of Salix in WSL with the explorer of windows and edit the .lnk with the path of your installation of Salix. So , you will have a direct link for execute. + +## Server + +To access your Salix server, you can directly enter the IP or name of your computer along with the corresponding port \ No newline at end of file diff --git a/win/addRule.ps1 b/win/addRule.ps1 new file mode 100644 index 000000000..363f4fee4 --- /dev/null +++ b/win/addRule.ps1 @@ -0,0 +1,26 @@ +# Definir las propiedades de la nueva regla +# Define el nombre de la regla +$ruleName = "salixRule" + +# Define el perfil de la regla (Dominio, Privado, P�blico) +$profile = "Domain,Private,Public" + +# Define la acción (Permitir/Bloquear) +$action = "Allow" + +# Define el protocolo (TCP/UDP) +$protocol = "TCP" + +# Define el puerto local +$port = 3000, 5000 + +# Define una descripción (opcional) +$description = "Permitir tráfico HTTP.Frontend y backend Salix." + +# Crea la regla de firewall +New-NetFirewallRule -DisplayName $ruleName -Profile $profile -Action $action -Protocol $protocol -LocalPort $port -Description $description + +# Imprime un mensaje de confirmación +Write-Host "Regla de firewall creada exitosamente: $ruleName" + +pause diff --git a/win/powershellAddRule.lnk b/win/powershellAddRule.lnk new file mode 100644 index 000000000..bb462149a Binary files /dev/null and b/win/powershellAddRule.lnk differ diff --git a/win/powershellRedirect.lnk b/win/powershellRedirect.lnk new file mode 100644 index 000000000..e5cc78862 Binary files /dev/null and b/win/powershellRedirect.lnk differ diff --git a/win/redirect.ps1 b/win/redirect.ps1 new file mode 100644 index 000000000..431e569b2 --- /dev/null +++ b/win/redirect.ps1 @@ -0,0 +1,5 @@ +# Redireccionar ports + +$wslip = ((wsl hostname -I) -split " ")[0] +netsh interface portproxy set v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=$wslip +netsh interface portproxy set v4tov4 listenport=5000 listenaddress=0.0.0.0 connectport=5000 connectaddress=$wslip