Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
f264e07
First drop
mdaneri Oct 16, 2024
d42b58d
Merge branch 'develop' into service
mdaneri Oct 16, 2024
f965cbf
Integrated in Pode
mdaneri Oct 16, 2024
2791504
update
mdaneri Oct 17, 2024
d60d1cc
Update to linux, Mac
mdaneri Oct 17, 2024
3c3a5cd
fix Mac detection
mdaneri Oct 17, 2024
430ea27
FIx Mac service
Oct 17, 2024
b87561e
Fix Windows
mdaneri Oct 18, 2024
6c51a48
Fix tests
mdaneri Oct 18, 2024
0091321
Remove settingsfile with unregister
mdaneri Oct 18, 2024
e29752e
fixes
mdaneri Oct 18, 2024
99f5109
Merge branch 'develop' into service
mdaneri Oct 19, 2024
9d90c78
Add UAC support
mdaneri Oct 19, 2024
2ca3621
FIx Mac service
Oct 19, 2024
c3073d2
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Oct 20, 2024
65b28d6
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Oct 21, 2024
1f55857
Update Pode.psd1
mdaneri Oct 21, 2024
97d8e3c
fix linux 1
mdaneri Oct 21, 2024
734f6b3
fixes
mdaneri Oct 21, 2024
36e14cc
fix
mdaneri Oct 21, 2024
9e76fbb
fix service path
mdaneri Oct 21, 2024
5c0c33d
fixes
mdaneri Oct 21, 2024
1e0cf3b
Add logs
mdaneri Oct 22, 2024
b19643d
Update Service.ps1
mdaneri Oct 22, 2024
8a314ea
Code completed
mdaneri Oct 22, 2024
00c5252
remove spaces between function Register-PodeService and header
mdaneri Oct 22, 2024
302bb09
reinstated create user
mdaneri Oct 22, 2024
a67b3c3
fixes
mdaneri Oct 22, 2024
afcd5c1
fixes
mdaneri Oct 22, 2024
9326e32
fix the example
mdaneri Oct 22, 2024
88246e8
Merge branch 'develop' into service
mdaneri Oct 23, 2024
78e50f2
minor log fixex
mdaneri Oct 23, 2024
d79fe5f
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Oct 23, 2024
fc3e1c3
MacOS improvements
Oct 23, 2024
b113821
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Oct 27, 2024
49b45c0
Merge branch 'develop' into service
mdaneri Oct 28, 2024
2e6b153
Merge branch 'develop' into service
mdaneri Oct 30, 2024
96cc8a3
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Nov 2, 2024
b3579ea
Merge branch 'develop' into service
mdaneri Nov 3, 2024
6cc2da7
Merge branch 'develop' into service
mdaneri Nov 3, 2024
756853e
Merge branch 'develop' into service
mdaneri Nov 6, 2024
87254b3
add suspend ,resume
mdaneri Nov 17, 2024
ebf36a2
Improvements
mdaneri Nov 17, 2024
c11eb7f
revert to net8
mdaneri Nov 17, 2024
4996642
improvements
mdaneri Nov 17, 2024
93ca614
Added comments
mdaneri Nov 17, 2024
b04f761
fixes
mdaneri Nov 18, 2024
d4ada0f
Add restart to windows using sc control 'Hello Service2' 128
mdaneri Nov 18, 2024
ab64da5
add EnableTransactions to mac plist
mdaneri Nov 18, 2024
0e5765d
Rename folders and fix windows service credential
mdaneri Nov 19, 2024
d959b34
fixes
mdaneri Nov 19, 2024
9bb9747
minor fixes
mdaneri Nov 19, 2024
ac2fd82
Linux fixes
mdaneri Nov 19, 2024
0978c68
fixes
mdaneri Nov 19, 2024
cc5787e
Mac fixes
mdaneri Nov 20, 2024
6c2b883
add DisableLifecycleServiceOperations to build
mdaneri Nov 20, 2024
66e4817
fix Test-PodeAdminPrivilege
mdaneri Nov 20, 2024
44f8768
improve workflow
mdaneri Nov 21, 2024
5ee2225
improvements
mdaneri Nov 21, 2024
3cdfb0d
windows fixes
mdaneri Nov 22, 2024
ad28272
Merge branch 'develop' into service
mdaneri Nov 22, 2024
b0bd204
Update Helpers.ps1
mdaneri Nov 22, 2024
697cd8b
adding tests
mdaneri Nov 22, 2024
770702e
Added stopping and fix suspended report on linux
mdaneri Nov 23, 2024
d568de1
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Nov 23, 2024
6040563
Update pode.build.ps1
mdaneri Nov 23, 2024
6ba6419
linux fixes
mdaneri Nov 23, 2024
a576386
support workflow debug
mdaneri Nov 23, 2024
ae24dd9
retry
mdaneri Nov 23, 2024
bb1fbb2
try to catch $_ -like "*##[debug]*"
mdaneri Nov 23, 2024
f000a9e
fix trhe workflow
mdaneri Nov 23, 2024
1b188e6
again
mdaneri Nov 23, 2024
55df3ab
adding delays
mdaneri Nov 23, 2024
7d208c6
build improvements
mdaneri Nov 23, 2024
d6946f3
replace Test-PodeBuildIsWindows with $iswindows
mdaneri Nov 23, 2024
ad7a7e8
add group adm as sudo users
mdaneri Nov 23, 2024
d18b1f6
Fix the macos part
mdaneri Nov 23, 2024
304457d
modified: tests/integration/Service.Tests.ps1
mdaneri Nov 23, 2024
6af3213
tests fix
mdaneri Nov 24, 2024
50b23a3
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Nov 25, 2024
12c33a4
improvements to the service commands
mdaneri Nov 25, 2024
7f77d94
fix windows test
mdaneri Nov 26, 2024
035cb12
linux fixes
mdaneri Nov 26, 2024
bc36b0f
test fixes
mdaneri Nov 26, 2024
79e5b2f
fix MacOS
mdaneri Nov 26, 2024
6f817e6
fixes
mdaneri Nov 27, 2024
10a272d
fix MacOS test (I hope)
mdaneri Nov 27, 2024
0c50dd1
Retry
mdaneri Nov 27, 2024
c9c84f3
Code Improvements
mdaneri Nov 27, 2024
d6a026f
fix linux
mdaneri Nov 27, 2024
40d5bbc
fixes for Powershell 5.1
mdaneri Nov 27, 2024
1761077
Added log rotation and additional features
mdaneri Nov 27, 2024
d2b5b49
add full support for macos agents
mdaneri Nov 28, 2024
ac4cbb9
fix pipename generator on mac/linux+ log errors
mdaneri Nov 28, 2024
5c8bb3d
Fix examples
mdaneri Nov 29, 2024
886b8a7
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Jan 26, 2025
717c8d8
first fixes
mdaneri Jan 26, 2025
285026c
Fix a resume issue
mdaneri Jan 26, 2025
e5317b8
update
mdaneri Jan 27, 2025
5864d56
enum changes
mdaneri Jan 28, 2025
1c9d486
states improvement
mdaneri Jan 28, 2025
609d71b
udate service test to include suspend
mdaneri Jan 28, 2025
752cbab
minor fixes
mdaneri Jan 29, 2025
060f313
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Feb 5, 2025
adc01aa
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Feb 9, 2025
a25119b
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Feb 12, 2025
4ef1b84
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Feb 16, 2025
c559b8e
Merge branch 'develop' into service
mdaneri Feb 22, 2025
30e7223
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Feb 22, 2025
f3c3aac
Merge branch 'develop' into service
mdaneri Feb 23, 2025
cb50f63
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Mar 18, 2025
2c22236
new Test-PodeBindToPrivilegedPort
mdaneri Mar 21, 2025
1a640a6
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Mar 29, 2025
6cd28f5
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Apr 12, 2025
7619fc1
Merge branch 'develop' into service
mdaneri Apr 12, 2025
0faebac
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Apr 19, 2025
192bbf6
change port 80 to 36842
mdaneri Apr 19, 2025
2622b6f
fix check
mdaneri Apr 19, 2025
72271af
revert some changes
mdaneri Apr 19, 2025
de50a28
fix test
mdaneri Apr 19, 2025
6a52582
remove write-verbose from a catch for powershell 5.1 compatibility
mdaneri Apr 20, 2025
da6d224
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Apr 21, 2025
b300340
Update Context.Tests.ps1
mdaneri Apr 21, 2025
d6a2c96
Merge branch 'develop' into service
mdaneri Apr 25, 2025
f182515
Merge branch 'develop' into service
mdaneri Apr 26, 2025
4166afd
Merge remote-tracking branch 'upstream/develop' into service
mdaneri Apr 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/ci-powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,18 @@ jobs:
- name: Run Pester Tests
shell: powershell
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-Build Test
# Check if the runner is in debug mode
if ($env:RUNNER_DEBUG -eq '1') {
$debug = $true
} else {
$debug = $false
}

if ($debug) {
Invoke-Build Test -PesterVerbosity Diagnostic
} else {
Invoke-Build Test
}

- name: Build Packages
shell: powershell
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/ci-pwsh7_5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,18 @@ jobs:
- name: Run Pester Tests
shell: pwsh
run: |
Invoke-Build Test
# Check if the runner is in debug mode
if ($env:RUNNER_DEBUG -eq '1') {
$debug = $true
} else {
$debug = $false
}

if ($debug) {
Invoke-Build Test -PesterVerbosity Diagnostic
} else {
Invoke-Build Test
}

- name: Build Packages
shell: pwsh
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/ci-pwsh_lts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,18 @@ jobs:
- name: Run Pester Tests
shell: pwsh
run: |
Invoke-Build Test
# Check if the runner is in debug mode
if ($env:RUNNER_DEBUG -eq '1') {
$debug = $true
} else {
$debug = $false
}

if ($debug) {
Invoke-Build Test -PesterVerbosity Diagnostic
} else {
Invoke-Build Test
}

- name: Build Packages
shell: pwsh
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/ci-pwsh_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,18 @@ jobs:
- name: Run Pester Tests
shell: pwsh
run: |
Invoke-Build Test
# Check if the runner is in debug mode
if ($env:RUNNER_DEBUG -eq '1') {
$debug = $true
} else {
$debug = $false
}

if ($debug) {
Invoke-Build Test -PesterVerbosity Diagnostic
} else {
Invoke-Build Test
}

- name: Build Packages
shell: pwsh
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ examples/PetStore/data/PetData.json
packers/choco/pode.nuspec
packers/choco/tools/ChocolateyInstall.ps1
docs/Getting-Started/Samples.md
examples/HelloService/*_svcsettings.json
examples/HelloService/svc_settings

# Dump Folder
Dump
2 changes: 2 additions & 0 deletions Pode.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{41F81369-868
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pode", "src\Listener\Pode.csproj", "{772D5C9F-1B25-46A7-8977-412A5F7F77D1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PodeMonitor", "src\PodeMonitor\PodeMonitor.csproj", "{A927D6A5-A2AC-471A-9ABA-45916B597EB6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
55 changes: 55 additions & 0 deletions docs/Hosting/PortsBelow1024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Using Ports Below 1024

#### Introduction

Traditionally in Linux, binding to ports below 1024 requires root privileges. This is a security measure, as these low-numbered ports are considered privileged. However, running applications as the root user poses significant security risks. This article explores methods to use these privileged ports with PowerShell (`pwsh`) in Linux, without running it as the root user.
There are different methods to achieve the goals.
Reverse Proxy is the right approach for a production environment, primarily if the server is connected directly to the internet.
The other solutions are reasonable after an in-depth risk analysis.

#### Using a Reverse Proxy

A reverse proxy like Nginx can listen on the privileged port and forward requests to your application running on an unprivileged port.

**Configuration:**

* Configure Nginx to listen on port 443 and forward requests to the port where your PowerShell script is listening.
* This method is widely used in web applications for its additional benefits like load balancing and SSL termination.

#### iptables Redirection

Using iptables, you can redirect traffic from a privileged port to a higher, unprivileged port.

**Implementation:**

* Set up an iptables rule to redirect traffic from, say, port 443 to a higher port where your PowerShell script is listening.
* `sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8080`

**Benefits:**

* This approach doesn't require changing the privileges of the PowerShell executable or script.

#### Using `setcap` Command

The `setcap` utility can grant specific capabilities to an executable, like `pwsh`, enabling it to bind to privileged ports.

**How it Works:**

* Run `sudo setcap 'cap_net_bind_service=+ep' $(which pwsh)`. This command sets the `CAP_NET_BIND_SERVICE` capability on the PowerShell executable, allowing it to bind to any port below 1024.

**Security Consideration:**

* This method enhances security by avoiding running PowerShell as root, but it still grants significant privileges to the PowerShell process.

#### Utilizing Authbind

Authbind is a tool that allows a non-root user to bind to privileged ports.

**Setup:**

* Install Authbind, configure it to allow the desired port, and then start your PowerShell script using Authbind.
* For instance, `authbind --deep pwsh yourscript.ps1` allows the script to bind to a privileged port.

**Advantages:**

* It provides a finer-grained control over port access and doesn't require setting special capabilities on the PowerShell binary itself.
Loading