Compare commits

..

No commits in common. "d7e477c4ddc8589df3bb30023edb59ae3d2e5ef3" and "2f1895c42d7e43491aa0d0b2877be5ddad0d85fd" have entirely different histories.

9 changed files with 10 additions and 90 deletions

View file

@ -1,33 +0,0 @@
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

View file

@ -1,7 +0,0 @@
[Desktop Entry]
Name=Sims 2 Package Manager
Exec=s2pk
Icon=logo.svg
Type=Application
Categories=Utility;
Terminal=true

View file

@ -1,5 +1,2 @@
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;

View file

@ -5,9 +5,8 @@ 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 build-appimage package-linux package-mac package-appimage .PHONY: all clean build-linux build-mac package-linux package-mac
all: build-linux build-mac package-linux package-mac all: build-linux build-mac package-linux package-mac
@ -17,9 +16,6 @@ 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
@ -28,6 +24,3 @@ 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

View file

@ -28,14 +28,14 @@ public static class PackageManager
if (!dir.Exists) if (!dir.Exists)
{ {
Log.Error("Source directory does not exist."); Console.Error.WriteLine("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)
{ {
Log.Error("No .package files found to pack."); Console.Error.WriteLine("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))
{ {
Log.Error("Destination directory does not exist."); Console.Error.WriteLine("Destination directory does not exist.");
return; return;
} }
@ -85,21 +85,21 @@ public static class PackageManager
if (!file.Exists) if (!file.Exists)
{ {
Log.Error("Package file does not exist."); Console.Error.WriteLine("Package file does not exist.");
return; return;
} }
if (!file.FullName.Contains(extension)) if (!file.FullName.Contains(extension))
{ {
Log.Error("Package file is not a valid."); Console.Error.WriteLine("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)
{ {
Log.Error("Package is for The Sims 3 but unpacking for The Sims 2."); Console.Error.WriteLine("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))
{ {
Log.Error($"Skipping unsafe path: {entry.FullName}"); Console.Error.WriteLine($"Skipping unsafe path: {entry.FullName}");
continue; continue;
} }

View file

@ -2,14 +2,6 @@ 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.",

View file

@ -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` extension | 🔜 | | v0.3 | Sims 3 support with `s3pk` extention | 🔜 |
| 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 - System.CommandLine for CLI parsing (no external libraries)
- Pure backend logic (no UI planned) - Pure backend logic (no UI planned)
## 📐 Design Principles ## 📐 Design Principles

View file

@ -8,15 +8,11 @@
<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>

View file

@ -1,18 +0,0 @@
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