diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 0b90b0b..0000000 --- a/.dockerignore +++ /dev/null @@ -1,5 +0,0 @@ -bin/ -obj/ -.idea -*.DotSettings.user -.vs \ No newline at end of file diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 271dffa..d2eebd2 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -7,21 +7,6 @@ on: - '**' types: [ opened, reopened, synchronize ] workflow_call: - inputs: - platforms: - description: 'Platforms to build for' - required: false - type: string - latest: - description: 'Tag image as latest' - required: false - type: boolean - default: false - rc: - description: 'Tag image as rc' - required: false - type: boolean - default: false workflow_dispatch: name: ci-build @@ -29,11 +14,9 @@ name: ci-build permissions: contents: read actions: write - packages: write env: DOTNET_VERSION: 10.0.x - REGISTRY: ghcr.io jobs: @@ -143,55 +126,6 @@ jobs: if-no-files-found: error - build-linux-web-containers: - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - - - name: Log in to Container Registry - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 - with: - images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/desktop - flavor: | - latest=false - tags: | - type=raw,value={{branch}},enable=${{ github.ref_type == 'branch' && github.event_name != 'pull_request' }} - type=raw,value=latest,enable=${{ github.event_name == 'workflow_call' && (inputs.latest || false) }} - type=raw,value=rc,enable=${{ github.event_name == 'workflow_call' && (inputs.rc || false) }} - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}}.{{minor}}.{{patch}} - - - name: Build and push - uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 - with: - context: . - file: Dockerfile - push: ${{ (inputs.latest || inputs.rc) || (github.ref_protected && github.event_name != 'pull_request') }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - platforms: ${{ inputs.platforms || 'linux/amd64' }} - cache-from: | - type=gha - cache-to: | - type=gha - build-linux-photino: runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/.github/workflows/ci-tag.yml b/.github/workflows/ci-tag.yml index ad02dad..97b8609 100644 --- a/.github/workflows/ci-tag.yml +++ b/.github/workflows/ci-tag.yml @@ -8,47 +8,9 @@ name: ci-tag jobs: - # Pre-job to find the latest tag - get-latest-tag: - runs-on: ubuntu-latest - timeout-minutes: 2 - outputs: - latest-tag: ${{ steps.latest-tag.outputs.tag }} - steps: - # Ignore preview or RC tags when searching for the latest - - name: Find latest tag - id: latest-tag - continue-on-error: true - uses: OpenShock/actions/find-latest-tag@21ca2d511bca92cf24fb502fa302f82700822584 # v1.1.1 - with: - regex: '^[0-9]+\.[0-9]+\.[0-9]+$' - - name: Set output - run: echo "latest-tag=${{ steps.latest-tag.outputs.tag }}" - - # Pre-job to find the latest RC tag - get-latest-rc-tag: - runs-on: ubuntu-latest - timeout-minutes: 2 - outputs: - latest-rc: ${{ steps.latest-rc.outputs.tag }} - steps: - - name: Find latest RC tag - id: latest-rc - continue-on-error: true - uses: OpenShock/actions/find-latest-tag@21ca2d511bca92cf24fb502fa302f82700822584 # v1.1.1 - with: - regex: '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$' - - name: Set output - run: echo "latest-rc=${{ steps.latest-rc.outputs.tag }}" - - # Delegate building and containerizing to a single workflow. + # Delegate building to a single workflow. build: - needs: [get-latest-tag, get-latest-rc-tag] uses: ./.github/workflows/ci-build.yml - with: - platforms: linux/amd64,linux/arm64 - latest: ${{ needs.get-latest-tag.outputs.latest-tag == github.ref_name }} - rc: ${{ needs.get-latest-rc-tag.outputs.latest-rc == github.ref_name }} # Build module base for release assets build-module-base: diff --git a/Desktop.slnx b/Desktop.slnx index 6611ab2..73035e0 100644 --- a/Desktop.slnx +++ b/Desktop.slnx @@ -1,33 +1,25 @@ - - - - - - - - diff --git a/Desktop/Bootstrap.cs b/Desktop/Bootstrap.cs index ee43c82..11ed6ed 100644 --- a/Desktop/Bootstrap.cs +++ b/Desktop/Bootstrap.cs @@ -37,7 +37,7 @@ public static void AddOpenShockDesktopServices(this IServiceCollection services) var isDebug = Environment.GetCommandLineArgs() .Any(x => x.Equals("--debug", StringComparison.InvariantCultureIgnoreCase)); -#if DEBUG_WINDOWS || DEBUG_PHOTINO || DEBUG_WEB +#if DEBUG_WINDOWS || DEBUG_PHOTINO isDebug = true; #endif if (isDebug) diff --git a/Desktop/Desktop.csproj b/Desktop/Desktop.csproj index 33d5f10..a464b59 100644 --- a/Desktop/Desktop.csproj +++ b/Desktop/Desktop.csproj @@ -20,7 +20,7 @@ DISABLE_XAML_GENERATED_MAIN - Release-Windows;Debug-Windows;Release-Photino;Debug-Photino;Release-Web;Debug-Web + Release-Windows;Debug-Windows;Release-Photino;Debug-Photino 10.0.17763.0 10.0.17763.0 @@ -52,12 +52,6 @@ - - net10.0 - OpenShock.Desktop.Platforms.Web.WebEntryPoint - WEB - - diff --git a/Desktop/Platforms/Web/App.razor b/Desktop/Platforms/Web/App.razor deleted file mode 100644 index 1a130df..0000000 --- a/Desktop/Platforms/Web/App.razor +++ /dev/null @@ -1,24 +0,0 @@ -@using Microsoft.AspNetCore.Components.Web - - - - - - - OpenShock - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Desktop/Platforms/Web/WebEntryPoint.cs b/Desktop/Platforms/Web/WebEntryPoint.cs deleted file mode 100644 index 28f1163..0000000 --- a/Desktop/Platforms/Web/WebEntryPoint.cs +++ /dev/null @@ -1,73 +0,0 @@ -#if WEB -using Microsoft.AspNetCore.Hosting.StaticWebAssets; -using Microsoft.Extensions.FileProviders; -using OpenShock.Desktop.Cli; -using OpenShock.Desktop.Cli.Uri; -using OpenShock.Desktop.Services; -using OpenShock.Desktop.Utils; - -namespace OpenShock.Desktop.Platforms.Web; - -public static class WebEntryPoint -{ - public static Task Main(string[] args) - { - return ParseHelper.ParseAsync(args, Start); - } - - private static async Task Start(CliOptions config) - { - StartupUri.Capture(config.Uri); - - if (config.Headless) - { - Console.WriteLine("Running in headless mode."); - - var host = HeadlessProgram.SetupHeadlessHost(); - await host.RunAsync(); - - return; - } - - var builder = WebApplication.CreateBuilder(); - - builder.Services.AddRazorComponents() - .AddInteractiveServerComponents(); - - builder.Services.AddOpenShockDesktopServices(); - builder.Services.AddCommonBlazorServices(); - -#if WINDOWS - builder.Services.AddWindowsServices(); -#endif - - var app = builder.Build(); - - app.UseHttpsRedirection(); - - var moduleManager = app.Services.GetRequiredService(); - - // This modifies the WebRootFileProvider - StaticWebAssetsLoader.UseStaticWebAssets(builder.Environment, builder.Configuration); - - // actually create our file provider - var compositeFileProvider = - new CompositeFileProvider(app.Environment.WebRootFileProvider, new ModuleFileProvider(moduleManager)); - - app.UseStaticFiles(new StaticFileOptions - { - FileProvider = compositeFileProvider - }); - app.UseAntiforgery(); - - - app.MapRazorComponents() - .AddInteractiveServerRenderMode(); - - app.Services.StartOpenShockDesktopServices(true); - - await app.RunAsync(); - } -} - -#endif \ No newline at end of file diff --git a/Desktop/Utils/RestartHelper.cs b/Desktop/Utils/RestartHelper.cs index 6a41d3e..70a154c 100644 --- a/Desktop/Utils/RestartHelper.cs +++ b/Desktop/Utils/RestartHelper.cs @@ -131,7 +131,7 @@ sleep 0.5 Environment.Exit(0); #else - // No restart mechanism for other targets (e.g. the web host); no-op. + // No restart mechanism for other targets; no-op. #endif } } diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 688ae99..0000000 --- a/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build -WORKDIR /src -COPY --link *.props *.props ./ -COPY --link Desktop/*.csproj Desktop/ -COPY --link ModuleBase/*.csproj ModuleBase/ - -RUN dotnet restore Desktop/Desktop.csproj /p:Configuration=Release-Web - -COPY . . -RUN dotnet publish Desktop/Desktop.csproj -c Release-Web -o /publish/Web-Linux - -FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble@sha256:bfd912c83295ce66d4b706ebb8541b9f14259b0e76fbb88b2751f58ce2399d2e AS runtime -WORKDIR /app -LABEL org.opencontainers.image.authors="team@openshock.org" - -EXPOSE 8080 -ENV OPENSHOCK_DATA_FOLDER=/data -ENV HOME=$OPENSHOCK_DATA_FOLDER -VOLUME ["/data"] - -COPY --link --from=build ./publish/Web-Linux . - -ENTRYPOINT ["dotnet", "OpenShock.Desktop.dll"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 504ab93..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - desktop: - image: ghcr.io/openshock/desktop:latest - restart: unless-stopped - volumes: - - ./data:/data - network_mode: host - environment: - ASPNETCORE_HTTP_PORTS: 8888 \ No newline at end of file diff --git a/renovate.json b/renovate.json index cde1529..3d8d1ab 100644 --- a/renovate.json +++ b/renovate.json @@ -19,11 +19,6 @@ "matchManagers": ["github-actions"], "matchDepTypes": ["action"], "groupName": "github-actions" - }, - { - "description": "The .NET SDK and runtime images must move together", - "matchPackageNames": ["dotnet-sdk", "mcr.microsoft.com/dotnet/sdk", "mcr.microsoft.com/dotnet/aspnet"], - "groupName": "dotnet sdk and images" } ] }