Compare commits
5 commits
2f1895c42d
...
d7e477c4dd
Author | SHA1 | Date | |
---|---|---|---|
d7e477c4dd | |||
9af646b534 | |||
dfe83fcf00 | |||
55d89f835b | |||
6f25ab9bb1 |
9 changed files with 90 additions and 10 deletions
33
.github/workflows/monthly-vulnerability-scan.yml
vendored
Normal file
33
.github/workflows/monthly-vulnerability-scan.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
name: Monthly Vulnerability Scan
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 1 * *" # Runs at 00:00 on the 1st day of every month
|
||||||
|
workflow_dispatch: # Allows manual triggering
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
scan-vulnerabilities:
|
||||||
|
name: Scan for .NET Package Vulnerabilities
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: "8.0.x" # Match latest LTS or adjust as needed
|
||||||
|
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: dotnet restore
|
||||||
|
|
||||||
|
- name: List vulnerable packages
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
results=$(dotnet list package --vulnerable)
|
||||||
|
echo "$results"
|
||||||
|
if echo "$results" | grep -q "has the following vulnerable packages"; then
|
||||||
|
echo "Vulnerabilities found!"
|
||||||
|
exit 1
|
||||||
|
fi
|
7
AppDir/s2pk.desktop
Normal file
7
AppDir/s2pk.desktop
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=Sims 2 Package Manager
|
||||||
|
Exec=s2pk
|
||||||
|
Icon=logo.svg
|
||||||
|
Type=Application
|
||||||
|
Categories=Utility;
|
||||||
|
Terminal=true
|
|
@ -1,2 +1,5 @@
|
||||||
global using S2PK;
|
global using S2PK;
|
||||||
global using Tomlyn;
|
global using Tomlyn;
|
||||||
|
global using Serilog;
|
||||||
|
global using Serilog.Sinks.Debug;
|
||||||
|
global using Serilog.Sinks.Console;
|
||||||
|
|
9
Makefile
9
Makefile
|
@ -5,8 +5,9 @@ CONFIGURATION = Release
|
||||||
RUNTIME_LINUX = linux-x64
|
RUNTIME_LINUX = linux-x64
|
||||||
RUNTIME_MAC = osx-x64
|
RUNTIME_MAC = osx-x64
|
||||||
OUTPUT_DIR = ./dist
|
OUTPUT_DIR = ./dist
|
||||||
|
APPIMAGE_DIR = ./AppDir
|
||||||
|
|
||||||
.PHONY: all clean build-linux build-mac package-linux package-mac
|
.PHONY: all clean build-linux build-mac build-appimage package-linux package-mac package-appimage
|
||||||
|
|
||||||
all: build-linux build-mac package-linux package-mac
|
all: build-linux build-mac package-linux package-mac
|
||||||
|
|
||||||
|
@ -16,6 +17,9 @@ clean:
|
||||||
build-linux:
|
build-linux:
|
||||||
dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_LINUX) --self-contained true /p:PublishSingleFile=true -o $(OUTPUT_DIR)/$(APP_NAME)-linux
|
dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_LINUX) --self-contained true /p:PublishSingleFile=true -o $(OUTPUT_DIR)/$(APP_NAME)-linux
|
||||||
|
|
||||||
|
build-appimage:
|
||||||
|
dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_LINUX) --self-contained true /p:PublishSingleFile=true -o $(APPIMAGE_DIR)/usr/bin
|
||||||
|
|
||||||
build-mac:
|
build-mac:
|
||||||
dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_MAC) --self-contained true /p:PublishSingleFile=true -o $(OUTPUT_DIR)/$(APP_NAME)-mac
|
dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_MAC) --self-contained true /p:PublishSingleFile=true -o $(OUTPUT_DIR)/$(APP_NAME)-mac
|
||||||
|
|
||||||
|
@ -24,3 +28,6 @@ package-linux:
|
||||||
|
|
||||||
package-mac:
|
package-mac:
|
||||||
tar -czvf $(OUTPUT_DIR)/$(APP_NAME)-mac.tar.gz -C $(OUTPUT_DIR)/$(APP_NAME)-mac .
|
tar -czvf $(OUTPUT_DIR)/$(APP_NAME)-mac.tar.gz -C $(OUTPUT_DIR)/$(APP_NAME)-mac .
|
||||||
|
|
||||||
|
package-appimage:
|
||||||
|
appimage-builder
|
||||||
|
|
|
@ -28,14 +28,14 @@ public static class PackageManager
|
||||||
|
|
||||||
if (!dir.Exists)
|
if (!dir.Exists)
|
||||||
{
|
{
|
||||||
Console.Error.WriteLine("Source directory does not exist.");
|
Log.Error("Source directory does not exist.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var packageFiles = dir.GetFiles($"*{PackageExtension}", SearchOption.AllDirectories);
|
var packageFiles = dir.GetFiles($"*{PackageExtension}", SearchOption.AllDirectories);
|
||||||
if (packageFiles.Length == 0)
|
if (packageFiles.Length == 0)
|
||||||
{
|
{
|
||||||
Console.Error.WriteLine("No .package files found to pack.");
|
Log.Error("No .package files found to pack.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public static class PackageManager
|
||||||
// Check if destination directory exists
|
// Check if destination directory exists
|
||||||
if (!Directory.Exists(destination))
|
if (!Directory.Exists(destination))
|
||||||
{
|
{
|
||||||
Console.Error.WriteLine("Destination directory does not exist.");
|
Log.Error("Destination directory does not exist.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,21 +85,21 @@ public static class PackageManager
|
||||||
|
|
||||||
if (!file.Exists)
|
if (!file.Exists)
|
||||||
{
|
{
|
||||||
Console.Error.WriteLine("Package file does not exist.");
|
Log.Error("Package file does not exist.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!file.FullName.Contains(extension))
|
if (!file.FullName.Contains(extension))
|
||||||
{
|
{
|
||||||
Console.Error.WriteLine("Package file is not a valid.");
|
Log.Error("Package file is not a valid.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for extension mismatch
|
// Check for extension mismatch
|
||||||
if (file.FullName.Contains(S3pkExtension) && !ts3)
|
if (file.FullName.Contains(S3pkExtension) && !ts3)
|
||||||
{
|
{
|
||||||
Console.Error.WriteLine("Package is for The Sims 3 but unpacking for The Sims 2.");
|
Log.Error("Package is for The Sims 3 but unpacking for The Sims 2.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ public static class PackageManager
|
||||||
// Sanitize path to prevent directory traversal
|
// Sanitize path to prevent directory traversal
|
||||||
if (!fullPath.StartsWith(dir.FullName, StringComparison.OrdinalIgnoreCase))
|
if (!fullPath.StartsWith(dir.FullName, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
Console.Error.WriteLine($"Skipping unsafe path: {entry.FullName}");
|
Log.Error($"Skipping unsafe path: {entry.FullName}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,14 @@ using System.CommandLine;
|
||||||
|
|
||||||
var rootCommand = new RootCommand("The Sims 2 .s2pk Package Manager");
|
var rootCommand = new RootCommand("The Sims 2 .s2pk Package Manager");
|
||||||
|
|
||||||
|
Log.Logger = new LoggerConfiguration()
|
||||||
|
#if DEBUG
|
||||||
|
.WriteTo.Debug()
|
||||||
|
#else
|
||||||
|
.WriteTo.Console(theme: AnsiConsoleTheme.Code)
|
||||||
|
#endif
|
||||||
|
.CreateLogger();
|
||||||
|
|
||||||
var sims3option = new Option<bool>(
|
var sims3option = new Option<bool>(
|
||||||
aliases: ["--ts3"],
|
aliases: ["--ts3"],
|
||||||
description: "Switch to The Sims 3 mode.",
|
description: "Switch to The Sims 3 mode.",
|
||||||
|
|
|
@ -26,7 +26,7 @@ While The Sims 2 runs well on Linux through Wine, especially with Lutris setups,
|
||||||
| ----- | ------------------------------------------- | ------ |
|
| ----- | ------------------------------------------- | ------ |
|
||||||
| v0.1 | Core package manager | ✅ |
|
| v0.1 | Core package manager | ✅ |
|
||||||
| v0.2 | Config file with default paths | ✅ |
|
| v0.2 | Config file with default paths | ✅ |
|
||||||
| v0.3 | Sims 3 support with `s3pk` extention | 🔜 |
|
| v0.3 | Sims 3 support with `s3pk` extension | 🔜 |
|
||||||
| v0.x | Target .NET 10 | 🔜 |
|
| v0.x | Target .NET 10 | 🔜 |
|
||||||
| v1.0 | Stable "Release" version with documentation | 🔜 |
|
| v1.0 | Stable "Release" version with documentation | 🔜 |
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ While The Sims 2 runs well on Linux through Wine, especially with Lutris setups,
|
||||||
|
|
||||||
- .NET 8.0
|
- .NET 8.0
|
||||||
- C# (focused on clarity, safety, minimalism)
|
- C# (focused on clarity, safety, minimalism)
|
||||||
- System.CommandLine for CLI parsing (no external libraries)
|
- System.CommandLine for CLI parsing
|
||||||
- Pure backend logic (no UI planned)
|
- Pure backend logic (no UI planned)
|
||||||
|
|
||||||
## 📐 Design Principles
|
## 📐 Design Principles
|
||||||
|
|
|
@ -8,11 +8,15 @@
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Authors>Tony Bark</Authors>
|
<Authors>Tony Bark</Authors>
|
||||||
<PackAsTool>true</PackAsTool>
|
<PackAsTool>true</PackAsTool>
|
||||||
|
<AssemblyName>s2pk</AssemblyName>
|
||||||
<ToolCommandName>s2pk</ToolCommandName>
|
<ToolCommandName>s2pk</ToolCommandName>
|
||||||
<PackageId>s2pk</PackageId>
|
<PackageId>s2pk</PackageId>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Serilog" Version="4.2.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
|
||||||
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
||||||
<PackageReference Include="Tomlyn" Version="0.19.0" />
|
<PackageReference Include="Tomlyn" Version="0.19.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
18
appimage-builder.yml
Normal file
18
appimage-builder.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
version: 1
|
||||||
|
AppDir:
|
||||||
|
path: ./AppDir
|
||||||
|
app_info:
|
||||||
|
id: com.tonybark.s2pk
|
||||||
|
name: s2pk
|
||||||
|
icon: s2pk
|
||||||
|
version: 0.3.101
|
||||||
|
exec: usr/bin/s2pk
|
||||||
|
exec_args: ""
|
||||||
|
runtime:
|
||||||
|
env:
|
||||||
|
PATH: "$APPDIR/usr/bin:$PATH"
|
||||||
|
|
||||||
|
recipe:
|
||||||
|
AppImage:
|
||||||
|
arch: x86_64
|
||||||
|
output: s2pk-x86_64.AppImage
|
Loading…
Add table
Add a link
Reference in a new issue