From 1496041b48c9c28aa7d75cb12e6c14c4a26fbfcf Mon Sep 17 00:00:00 2001 From: itiligent <94789708+itiligent@users.noreply.github.com> Date: Wed, 18 Sep 2024 14:50:48 +1000 Subject: [PATCH 01/11] Clean up old network profiles Keep Windows networking tidy. At boot a Powershell script will run that clears out old network profile names automatically created at previous system reboots. A regist change disables the "Do you want your PC to be discoverable" nag screen after eachc reboot --- oem/RDPApps.reg | 8 +++++++- oem/install.bat | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/oem/RDPApps.reg b/oem/RDPApps.reg index acb5aac..9c79620 100644 --- a/oem/RDPApps.reg +++ b/oem/RDPApps.reg @@ -1,10 +1,16 @@ Windows Registry Editor Version 5.00 - [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList] + ; Disable RemoteApp allowlist so all applications can be used in a Remote Desktop session + [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList] "fDisabledAllowList"=dword:00000001 + ; Allow unlisted programs to be run in Remote Desktop sessions [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services] "fAllowUnlistedRemotePrograms"=dword:00000001 + ; Disable automatic administrator logon at startup [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] "AutoAdminLogon"="0" + + ; Disable "Do you want your PC to be discoverable" prompt after each host system reboot + [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff] diff --git a/oem/install.bat b/oem/install.bat index 182423c..6d3b0dd 100644 --- a/oem/install.bat +++ b/oem/install.bat @@ -1,3 +1,54 @@ @echo off REG IMPORT C:\OEM\RDPApps.reg + +:: Write the Powershell network profile cleanup script +( +echo # Get the current network profile name +echo $currentProfile = ^(Get-NetConnectionProfile^).Name +echo. +echo # Get all profiles from the registry +echo $profilesKey = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles" +echo $profiles = Get-ChildItem -Path $profilesKey +echo. +echo foreach ^($profile in $profiles^) { +echo $profilePath = "$profilesKey\$($profile.PSChildName)" +echo $profileName = ^(Get-ItemProperty -Path $profilePath^).ProfileName +echo. +echo # Remove profiles that don't match the current one +echo if ^($profileName -ne $currentProfile^) { +echo Remove-Item -Path $profilePath -Recurse +echo Write-Host "Deleted profile: $profileName" +echo } +echo } +echo. +echo # Change the current profile name to "WinApps" +echo $profiles = Get-ChildItem -Path $profilesKey +echo foreach ^($profile in $profiles^) { +echo $profilePath = "$profilesKey\$($profile.PSChildName)" +echo $profileName = ^(Get-ItemProperty -Path $profilePath^).ProfileName +echo. +echo if ^($profileName -eq $currentProfile^) { +echo # Update the profile name +echo Set-ItemProperty -Path $profilePath -Name "ProfileName" -Value "WinApps" +echo Write-Host "Renamed profile to: WinApps" +echo } +echo } +) > C:\Windows\NetProfileCleanup.ps1 + +:: Create network profile cleanup scheduled task +set "taskname=NetworkProfileCleanup" +set "command=powershell.exe -ExecutionPolicy Bypass -File "C:\Windows\NetProfileCleanup.ps1^"" + +schtasks /query /tn "%taskname%" >nul 2>&1 +if %ERRORLEVEL% equ 0 ( + echo Task "%taskname%" already exists, deleting it first... + schtasks /delete /tn "%taskname%" /f +) + +schtasks /create /tn "%taskname%" /tr "%command%" /sc onstart /ru "SYSTEM" /rl HIGHEST /f +if %ERRORLEVEL% equ 0 ( + echo Scheduled task "%taskname%" created successfully. +) else ( + echo Failed to create scheduled task. +) \ No newline at end of file From 90b342270948e2c9ceee27d453524fd4e3b57e63 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 04:58:40 +0000 Subject: [PATCH 02/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- oem/RDPApps.reg | 6 +++--- oem/install.bat | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/oem/RDPApps.reg b/oem/RDPApps.reg index 9c79620..e2dfdc4 100644 --- a/oem/RDPApps.reg +++ b/oem/RDPApps.reg @@ -1,14 +1,14 @@ Windows Registry Editor Version 5.00 ; Disable RemoteApp allowlist so all applications can be used in a Remote Desktop session - [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList] + [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList] "fDisabledAllowList"=dword:00000001 - ; Allow unlisted programs to be run in Remote Desktop sessions + ; Allow unlisted programs to be run in Remote Desktop sessions [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services] "fAllowUnlistedRemotePrograms"=dword:00000001 - ; Disable automatic administrator logon at startup + ; Disable automatic administrator logon at startup [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] "AutoAdminLogon"="0" diff --git a/oem/install.bat b/oem/install.bat index 6d3b0dd..9aae31d 100644 --- a/oem/install.bat +++ b/oem/install.bat @@ -51,4 +51,4 @@ if %ERRORLEVEL% equ 0 ( echo Scheduled task "%taskname%" created successfully. ) else ( echo Failed to create scheduled task. -) \ No newline at end of file +) From e839d1fdcdcbbd587bfc40f393fc2b03ce5fcd28 Mon Sep 17 00:00:00 2001 From: itiligent <94789708+itiligent@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:26:41 +1000 Subject: [PATCH 03/11] change script path to %windir% --- oem/install.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oem/install.bat b/oem/install.bat index 9aae31d..8ff1dbe 100644 --- a/oem/install.bat +++ b/oem/install.bat @@ -34,11 +34,11 @@ echo Set-ItemProperty -Path $profilePath -Name "ProfileName" -Value "Win echo Write-Host "Renamed profile to: WinApps" echo } echo } -) > C:\Windows\NetProfileCleanup.ps1 +) > %windir%\NetProfileCleanup.ps1 :: Create network profile cleanup scheduled task set "taskname=NetworkProfileCleanup" -set "command=powershell.exe -ExecutionPolicy Bypass -File "C:\Windows\NetProfileCleanup.ps1^"" +set "command=powershell.exe -ExecutionPolicy Bypass -File "%windir%\NetProfileCleanup.ps1^"" schtasks /query /tn "%taskname%" >nul 2>&1 if %ERRORLEVEL% equ 0 ( @@ -51,4 +51,4 @@ if %ERRORLEVEL% equ 0 ( echo Scheduled task "%taskname%" created successfully. ) else ( echo Failed to create scheduled task. -) +) \ No newline at end of file From 6d67815c9c04d4eeab06916f40b5db6e82555ca0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 05:26:52 +0000 Subject: [PATCH 04/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- oem/install.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oem/install.bat b/oem/install.bat index 8ff1dbe..25f69d4 100644 --- a/oem/install.bat +++ b/oem/install.bat @@ -51,4 +51,4 @@ if %ERRORLEVEL% equ 0 ( echo Scheduled task "%taskname%" created successfully. ) else ( echo Failed to create scheduled task. -) \ No newline at end of file +) From cd2a73ff30fe1642b2ba6cfafb7df8decc834dbb Mon Sep 17 00:00:00 2001 From: itiligent <94789708+itiligent@users.noreply.github.com> Date: Wed, 18 Sep 2024 23:11:49 +1000 Subject: [PATCH 05/11] Cleanup network profiles --- oem/RDPApps.reg | 2 +- oem/install.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oem/RDPApps.reg b/oem/RDPApps.reg index b1561ae..f1434ab 100644 --- a/oem/RDPApps.reg +++ b/oem/RDPApps.reg @@ -4,7 +4,7 @@ ; SPDX-License-Identifier: Proprietary Windows Registry Editor Version 5.00 - ; Disable RemoteApp allowlist so all applications can be used in a Remote Desktop session + ; Disable RemoteApp allowlist so all applications can be used in Remote Desktop sessions [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList] "fDisabledAllowList"=dword:00000001 diff --git a/oem/install.bat b/oem/install.bat index 711c814..87e0c67 100644 --- a/oem/install.bat +++ b/oem/install.bat @@ -6,7 +6,7 @@ REM SPDX-License-Identifier: AGPL-3.0-or-later REG IMPORT C:\OEM\RDPApps.reg -:: Write the Powershell network profile cleanup script +:: Create Powershell network profile cleanup script ( echo # Get the current network profile name echo $currentProfile = ^(Get-NetConnectionProfile^).Name From b854224ceff3a5d531795ccc013f23cb7004b85a Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:37:06 +0200 Subject: [PATCH 06/11] fix(ci): run lictool without pre-commit --- .github/workflows/lictool.yaml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lictool.yaml b/.github/workflows/lictool.yaml index 6f09545..5a6b0d8 100644 --- a/.github/workflows/lictool.yaml +++ b/.github/workflows/lictool.yaml @@ -1,3 +1,4 @@ + on: pull_request: push: @@ -7,15 +8,24 @@ jobs: lictool: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: Set up Python 3 + uses: actions/setup-python@v4 with: python-version: 3.x - - uses: pre-commit/action@v3.0.1 - with: - extra_args: license-tools + - name: Install lictool + run: pip install git+https://github.com/emzeat/mz-lictools@v2.7.0 - - uses: pre-commit-ci/lite-action@v1.0.2 - if: always() + - name: Run lictool + run: lictool + + - name: Commit and push + uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + message: "[ci] update license header" + push: true + fetch: true From e6e1e26c1439f916685fe7012d7269be15650816 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:40:58 +0200 Subject: [PATCH 07/11] Update lictool.yaml --- .github/workflows/lictool.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lictool.yaml b/.github/workflows/lictool.yaml index 5a6b0d8..aa64f82 100644 --- a/.github/workflows/lictool.yaml +++ b/.github/workflows/lictool.yaml @@ -16,9 +16,12 @@ jobs: with: python-version: 3.x + - name: Set git author to @actions + uses: fregante/setup-git-user@v2 + - name: Install lictool run: pip install git+https://github.com/emzeat/mz-lictools@v2.7.0 - + - name: Run lictool run: lictool From fd90dd837d52457046c4cc0716a760566145a42b Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:51:08 +0200 Subject: [PATCH 08/11] fuck this honestly --- .github/workflows/lictool.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lictool.yaml b/.github/workflows/lictool.yaml index aa64f82..0b03f23 100644 --- a/.github/workflows/lictool.yaml +++ b/.github/workflows/lictool.yaml @@ -31,4 +31,4 @@ jobs: default_author: github_actions message: "[ci] update license header" push: true - fetch: true + fetch: false From 2a70f7f3a257bae11830567015100f9dd74af68c Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:56:49 +0200 Subject: [PATCH 09/11] fucking WORK --- .github/workflows/lictool.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/lictool.yaml b/.github/workflows/lictool.yaml index 0b03f23..ecaf7b2 100644 --- a/.github/workflows/lictool.yaml +++ b/.github/workflows/lictool.yaml @@ -10,6 +10,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + if: ${{ github.event_name != 'pull_request' }} + + - name: Checkout pull request + uses: actions/checkout@v3 + if: ${{ github.event_name == 'pull_request' }} + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} - name: Set up Python 3 uses: actions/setup-python@v4 From 86bfd8bdf121c658166ec03ab6da5a6fcefe3e64 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:59:58 +0200 Subject: [PATCH 10/11] fix: remove trailing spaces --- .github/workflows/lictool.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lictool.yaml b/.github/workflows/lictool.yaml index ecaf7b2..0b64f8d 100644 --- a/.github/workflows/lictool.yaml +++ b/.github/workflows/lictool.yaml @@ -29,7 +29,7 @@ jobs: - name: Install lictool run: pip install git+https://github.com/emzeat/mz-lictools@v2.7.0 - + - name: Run lictool run: lictool From 9ca357642a006e21914f32a476a7866b171ceae0 Mon Sep 17 00:00:00 2001 From: Username404-59 <53659497+Username404-59@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:41:59 +0200 Subject: [PATCH 11/11] README.md: Update Gentoo dependencies list Fixes the ebuild parent dirs & depend on openbsd-netcat instead of netcat because libvirt needs it and is likely to be installed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7896dcb..bde82e7 100644 --- a/README.md +++ b/README.md @@ -300,7 +300,7 @@ Install the required dependencies. ``` - Gentoo Linux: ```bash - sudo emerge --ask=n sys-libs/dialog net-misc/freerdp:3 net-misc/iproute2 x11-libs/libnotify net-analyzer/netcat + sudo emerge --ask=n dev-util/dialog net-misc/freerdp:3 sys-apps/iproute2 x11-libs/libnotify net-analyzer/openbsd-netcat ``` > [!NOTE]