Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit f3c3aac
Merge: 30e7223 67505f5
Author: mdaneri <[email protected]>
Date:   Sun Feb 23 07:30:56 2025 -0800

    Merge branch 'develop' into service

commit 30e7223
Merge: c559b8e cbdc62f
Author: mdaneri <[email protected]>
Date:   Sat Feb 22 09:18:44 2025 -0800

    Merge remote-tracking branch 'upstream/develop' into service

commit c559b8e
Merge: 4ef1b84 fbf6ecf
Author: mdaneri <[email protected]>
Date:   Sat Feb 22 06:33:02 2025 -0800

    Merge branch 'develop' into service

commit 4ef1b84
Merge: a25119b a76741b
Author: mdaneri <[email protected]>
Date:   Sun Feb 16 07:08:44 2025 -0800

    Merge remote-tracking branch 'upstream/develop' into service

commit a25119b
Merge: adc01aa a236a1a
Author: mdaneri <[email protected]>
Date:   Tue Feb 11 18:51:30 2025 -0800

    Merge remote-tracking branch 'upstream/develop' into service

commit adc01aa
Merge: 060f313 75e2962
Author: mdaneri <[email protected]>
Date:   Sun Feb 9 07:24:08 2025 -0800

    Merge remote-tracking branch 'upstream/develop' into service

commit 060f313
Merge: 752cbab 6b23fc3
Author: mdaneri <[email protected]>
Date:   Wed Feb 5 14:35:21 2025 -0800

    Merge remote-tracking branch 'upstream/develop' into service

commit 752cbab
Author: mdaneri <[email protected]>
Date:   Wed Jan 29 07:16:16 2025 -0800

    minor fixes

commit 609d71b
Author: mdaneri <[email protected]>
Date:   Tue Jan 28 13:40:54 2025 -0800

     udate service test to include suspend

commit 1c9d486
Author: mdaneri <[email protected]>
Date:   Tue Jan 28 07:47:49 2025 -0800

    states improvement

commit 5864d56
Author: mdaneri <[email protected]>
Date:   Tue Jan 28 07:23:51 2025 -0800

    enum changes

commit e5317b8
Author: mdaneri <[email protected]>
Date:   Mon Jan 27 10:23:15 2025 -0800

    update

commit 285026c
Author: mdaneri <[email protected]>
Date:   Sun Jan 26 11:40:44 2025 -0800

    Fix a resume issue

commit 717c8d8
Author: mdaneri <[email protected]>
Date:   Sun Jan 26 08:49:22 2025 -0800

    first fixes

commit 886b8a7
Merge: 5c8bb3d f4db4b6
Author: mdaneri <[email protected]>
Date:   Sun Jan 26 08:20:14 2025 -0800

    Merge remote-tracking branch 'upstream/develop' into service

commit 5c8bb3d
Author: mdaneri <[email protected]>
Date:   Fri Nov 29 05:28:44 2024 -0800

    Fix examples

commit ac4cbb9
Author: mdaneri <[email protected]>
Date:   Thu Nov 28 07:25:56 2024 -0800

    fix pipename generator on mac/linux+ log errors

commit d2b5b49
Author: mdaneri <[email protected]>
Date:   Thu Nov 28 06:37:06 2024 -0800

    add full support for macos agents

commit 1761077
Author: mdaneri <[email protected]>
Date:   Wed Nov 27 15:46:16 2024 -0800

    Added log rotation and additional features

commit 40d5bbc
Author: mdaneri <[email protected]>
Date:   Wed Nov 27 14:30:29 2024 -0800

    fixes for Powershell 5.1

commit d6a026f
Author: MDaneri <[email protected]>
Date:   Wed Nov 27 10:25:18 2024 -0800

    fix linux

commit c9c84f3
Author: mdaneri <[email protected]>
Date:   Wed Nov 27 10:10:58 2024 -0800

    Code Improvements

commit 0c50dd1
Author: mdaneri <[email protected]>
Date:   Tue Nov 26 21:20:12 2024 -0800

    Retry

commit 10a272d
Author: mdaneri <[email protected]>
Date:   Tue Nov 26 17:49:17 2024 -0800

    fix MacOS test (I hope)

commit 6f817e6
Author: mdaneri <[email protected]>
Date:   Tue Nov 26 16:17:48 2024 -0800

    fixes

commit 79e5b2f
Author: mdaneri <[email protected]>
Date:   Tue Nov 26 15:56:33 2024 -0800

    fix MacOS

commit bc36b0f
Author: MDaneri <[email protected]>
Date:   Mon Nov 25 21:27:32 2024 -0800

    test fixes

commit 035cb12
Author: MDaneri <[email protected]>
Date:   Mon Nov 25 17:58:12 2024 -0800

    linux fixes

commit 7f77d94
Author: mdaneri <[email protected]>
Date:   Mon Nov 25 17:40:39 2024 -0800

    fix windows test

commit 12c33a4
Author: mdaneri <[email protected]>
Date:   Mon Nov 25 14:31:28 2024 -0800

    improvements to the service commands

commit 50b23a3
Merge: 6af3213 391bdff
Author: mdaneri <[email protected]>
Date:   Sun Nov 24 16:50:42 2024 -0800

    Merge remote-tracking branch 'upstream/develop' into service

commit 6af3213
Author: mdaneri <[email protected]>
Date:   Sat Nov 23 17:37:52 2024 -0800

    tests fix

commit 304457d
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 15:50:24 2024 -0800

     	modified:   tests/integration/Service.Tests.ps1

commit d18b1f6
Author: mdaneri <[email protected]>
Date:   Sat Nov 23 14:49:54 2024 -0800

    Fix the macos part

commit ad7a7e8
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 11:20:40 2024 -0800

    add group adm as sudo users

commit d6946f3
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 11:16:41 2024 -0800

    replace Test-PodeBuildIsWindows  with $iswindows

commit 7d208c6
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 11:11:41 2024 -0800

    build improvements

commit 55df3ab
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 10:53:44 2024 -0800

    adding delays

commit 1b188e6
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 10:11:38 2024 -0800

    again

commit f000a9e
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 10:06:27 2024 -0800

    fix trhe workflow

commit bb1fbb2
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 10:03:58 2024 -0800

    try to catch $_ -like "*##[debug]*"

commit ae24dd9
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 09:41:36 2024 -0800

    retry

commit a576386
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 09:25:10 2024 -0800

    support workflow debug

commit 6ba6419
Author: MDaneri <[email protected]>
Date:   Sat Nov 23 09:02:22 2024 -0800

    linux fixes

commit 6040563
Author: mdaneri <[email protected]>
Date:   Sat Nov 23 07:56:55 2024 -0800

    Update pode.build.ps1

commit d568de1
Merge: 770702e 7a2cf53
Author: mdaneri <[email protected]>
Date:   Sat Nov 23 07:56:52 2024 -0800

    Merge remote-tracking branch 'upstream/develop' into service

commit 770702e
Author: MDaneri <[email protected]>
Date:   Fri Nov 22 17:04:55 2024 -0800

    Added stopping and fix suspended report on linux

commit 697cd8b
Author: mdaneri <[email protected]>
Date:   Fri Nov 22 08:34:00 2024 -0800

    adding tests

commit b0bd204
Author: mdaneri <[email protected]>
Date:   Fri Nov 22 06:30:30 2024 -0800

    Update Helpers.ps1

commit ad28272
Merge: 3cdfb0d 508c2da
Author: mdaneri <[email protected]>
Date:   Fri Nov 22 05:40:18 2024 -0800

    Merge branch 'develop' into service

commit 3cdfb0d
Author: mdaneri <[email protected]>
Date:   Thu Nov 21 21:16:04 2024 -0800

    windows fixes

commit 5ee2225
Author: mdaneri <[email protected]>
Date:   Thu Nov 21 10:14:29 2024 -0800

    improvements

commit 44f8768
Author: mdaneri <[email protected]>
Date:   Thu Nov 21 09:45:19 2024 -0800

    improve workflow

commit 66e4817
Author: mdaneri <[email protected]>
Date:   Wed Nov 20 12:10:13 2024 -0800

    fix Test-PodeAdminPrivilege

commit 6c2b883
Author: mdaneri <[email protected]>
Date:   Wed Nov 20 11:25:50 2024 -0800

    add DisableLifecycleServiceOperations to build

commit cc5787e
Author: mdaneri <[email protected]>
Date:   Tue Nov 19 20:43:09 2024 -0800

    Mac fixes

commit 0978c68
Author: mdaneri <[email protected]>
Date:   Tue Nov 19 14:23:43 2024 -0800

    fixes

commit ac2fd82
Author: Max Daneri <[email protected]>
Date:   Tue Nov 19 17:19:58 2024 -0500

    Linux fixes

commit 9bb9747
Author: mdaneri <[email protected]>
Date:   Tue Nov 19 12:34:34 2024 -0800

    minor fixes

commit d959b34
Author: mdaneri <[email protected]>
Date:   Tue Nov 19 10:16:03 2024 -0800

    fixes

commit 0e5765d
Author: mdaneri <[email protected]>
Date:   Mon Nov 18 18:04:40 2024 -0800

    Rename folders and fix windows service credential

commit ab64da5
Author: mdaneri <[email protected]>
Date:   Mon Nov 18 09:51:36 2024 -0800

    add EnableTransactions to mac plist

commit d4ada0f
Author: mdaneri <[email protected]>
Date:   Mon Nov 18 09:45:00 2024 -0800

    Add restart to windows using sc control 'Hello Service2' 128

commit b04f761
Author: mdaneri <[email protected]>
Date:   Mon Nov 18 07:55:08 2024 -0800

    fixes

commit 93ca614
Author: mdaneri <[email protected]>
Date:   Sun Nov 17 10:32:09 2024 -0800

    Added comments

commit 4996642
Author: mdaneri <[email protected]>
Date:   Sun Nov 17 10:23:14 2024 -0800

    improvements

commit c11eb7f
Author: mdaneri <[email protected]>
Date:   Sun Nov 17 10:09:50 2024 -0800

    revert to net8

commit ebf36a2
Author: mdaneri <[email protected]>
Date:   Sun Nov 17 09:56:45 2024 -0800

    Improvements

commit 87254b3
Author: mdaneri <[email protected]>
Date:   Sat Nov 16 19:25:45 2024 -0800

    add suspend ,resume

commit 756853e
Merge: 6cc2da7 5a0bee1
Author: mdaneri <[email protected]>
Date:   Wed Nov 6 05:49:17 2024 -0800

    Merge branch 'develop' into service

commit 6cc2da7
Merge: b3579ea 62bc705
Author: mdaneri <[email protected]>
Date:   Sun Nov 3 13:26:46 2024 -0800

    Merge branch 'develop' into service

commit b3579ea
Merge: 96cc8a3 312654b
Author: mdaneri <[email protected]>
Date:   Sun Nov 3 12:40:55 2024 -0800

    Merge branch 'develop' into service

commit 96cc8a3
Merge: 2e6b153 a37f33b
Author: mdaneri <[email protected]>
Date:   Sat Nov 2 14:10:16 2024 -0700

    Merge remote-tracking branch 'upstream/develop' into service

commit 2e6b153
Merge: 49b45c0 308035d
Author: mdaneri <[email protected]>
Date:   Wed Oct 30 05:35:35 2024 -0700

    Merge branch 'develop' into service

commit 49b45c0
Merge: b113821 c47ad6f
Author: mdaneri <[email protected]>
Date:   Mon Oct 28 04:03:56 2024 -0700

    Merge branch 'develop' into service

commit b113821
Merge: fc3e1c3 09d9ad0
Author: mdaneri <[email protected]>
Date:   Sun Oct 27 16:45:42 2024 -0700

    Merge remote-tracking branch 'upstream/develop' into service

commit fc3e1c3
Author: mdaneri <[email protected]>
Date:   Wed Oct 23 15:50:03 2024 -0700

    MacOS improvements

commit d79fe5f
Merge: 78e50f2 c8e23fb
Author: mdaneri <[email protected]>
Date:   Wed Oct 23 12:56:02 2024 -0700

    Merge remote-tracking branch 'upstream/develop' into service

commit 78e50f2
Author: mdaneri <[email protected]>
Date:   Wed Oct 23 11:15:23 2024 -0700

    minor log fixex

commit 88246e8
Merge: 9326e32 0b08d67
Author: mdaneri <[email protected]>
Date:   Wed Oct 23 06:46:21 2024 -0700

    Merge branch 'develop' into service

commit 9326e32
Author: mdaneri <[email protected]>
Date:   Tue Oct 22 15:06:05 2024 -0700

    fix the example

commit afcd5c1
Author: Max Daneri <[email protected]>
Date:   Tue Oct 22 17:57:54 2024 -0400

    fixes

commit a67b3c3
Author: mdaneri <[email protected]>
Date:   Tue Oct 22 13:30:39 2024 -0700

    fixes

commit 302bb09
Author: mdaneri <[email protected]>
Date:   Tue Oct 22 12:49:32 2024 -0700

    reinstated create user

commit 00c5252
Author: mdaneri <[email protected]>
Date:   Tue Oct 22 09:57:47 2024 -0700

    remove spaces between function Register-PodeService and header

commit 8a314ea
Author: mdaneri <[email protected]>
Date:   Tue Oct 22 09:50:20 2024 -0700

    Code completed

commit b19643d
Author: mdaneri <[email protected]>
Date:   Mon Oct 21 18:56:28 2024 -0700

    Update Service.ps1

commit 1e0cf3b
Author: mdaneri <[email protected]>
Date:   Mon Oct 21 18:46:03 2024 -0700

    Add logs

commit 5c0c33d
Author: Max Daneri <[email protected]>
Date:   Mon Oct 21 18:17:39 2024 -0400

    fixes

commit 9e76fbb
Author: mdaneri <[email protected]>
Date:   Mon Oct 21 13:14:34 2024 -0700

    fix service path

commit 36e14cc
Author: Max Daneri <[email protected]>
Date:   Mon Oct 21 16:13:16 2024 -0400

    fix

commit 734f6b3
Author: mdaneri <[email protected]>
Date:   Mon Oct 21 13:06:19 2024 -0700

    fixes

commit 97d8e3c
Author: Max Daneri <[email protected]>
Date:   Mon Oct 21 15:12:14 2024 -0400

    fix linux 1

commit 1f55857
Author: mdaneri <[email protected]>
Date:   Mon Oct 21 08:03:04 2024 -0700

    Update Pode.psd1

commit 65b28d6
Merge: c3073d2 79ec468
Author: mdaneri <[email protected]>
Date:   Mon Oct 21 08:03:01 2024 -0700

    Merge remote-tracking branch 'upstream/develop' into service

commit c3073d2
Merge: 2ca3621 0411580
Author: mdaneri <[email protected]>
Date:   Sun Oct 20 09:25:44 2024 -0700

    Merge remote-tracking branch 'upstream/develop' into service

commit 2ca3621
Author: mdaneri <[email protected]>
Date:   Sat Oct 19 10:57:50 2024 -0700

    FIx Mac service

commit 9d90c78
Author: mdaneri <[email protected]>
Date:   Sat Oct 19 09:23:11 2024 -0700

    Add UAC support

commit 99f5109
Merge: e29752e a181172
Author: mdaneri <[email protected]>
Date:   Fri Oct 18 20:29:13 2024 -0400

    Merge branch 'develop' into service

commit e29752e
Author: Max Daneri <[email protected]>
Date:   Fri Oct 18 15:58:52 2024 -0400

    fixes

commit 0091321
Author: mdaneri <[email protected]>
Date:   Fri Oct 18 09:48:32 2024 -0700

    Remove settingsfile with unregister

commit 6c51a48
Author: mdaneri <[email protected]>
Date:   Fri Oct 18 08:48:28 2024 -0700

    Fix tests

commit b87561e
Author: mdaneri <[email protected]>
Date:   Thu Oct 17 17:28:47 2024 -0700

    Fix Windows

commit 430ea27
Author: mdaneri <[email protected]>
Date:   Thu Oct 17 16:16:02 2024 -0700

    FIx Mac service

commit 3c3a5cd
Author: mdaneri <[email protected]>
Date:   Thu Oct 17 11:55:45 2024 -0700

    fix Mac detection

commit d60d1cc
Author: mdaneri <[email protected]>
Date:   Thu Oct 17 10:21:14 2024 -0700

    Update to linux, Mac

commit 2791504
Author: mdaneri <[email protected]>
Date:   Wed Oct 16 19:50:14 2024 -0700

    update

commit f965cbf
Author: mdaneri <[email protected]>
Date:   Wed Oct 16 07:51:08 2024 -0700

    Integrated in Pode

commit d42b58d
Merge: f264e07 696cc43
Author: mdaneri <[email protected]>
Date:   Wed Oct 16 04:01:08 2024 -0700

    Merge branch 'develop' into service

commit f264e07
Author: mdaneri <[email protected]>
Date:   Tue Oct 15 18:39:03 2024 -0700

    First drop
  • Loading branch information
mdaneri committed Mar 3, 2025
1 parent f233553 commit 1cc7bb6
Show file tree
Hide file tree
Showing 54 changed files with 6,194 additions and 199 deletions.
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 @@ -72,7 +72,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 @@ -267,6 +267,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
Expand Down
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

0 comments on commit 1cc7bb6

Please sign in to comment.