Skip to content

Commit

Permalink
Merge pull request #729 from Crypter-File-Transfer/stable
Browse files Browse the repository at this point in the history
Merge 'stable' to 'main'
  • Loading branch information
Jack-Edwards authored Oct 6, 2024
2 parents 9889bc9 + 99e6209 commit ebf484e
Show file tree
Hide file tree
Showing 181 changed files with 7,089 additions and 1,648 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CADDY_DOMAIN=localhost
CADDY_REDIRECT_TO_WWW=127.0.0.1
CADDY_OPTIONS=""
CADDY_TLS_VOLUME=./Volumes/Caddy/tls
CADDY_MAX_REQUEST_BODY=130MB
CADDY_MAX_REQUEST_BODY=251MB
POSTGRES_BIND_IP=""
POSTGRES_HOST=""
POSTGRES_HANGFIRE_HOST=""
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d #v3
with:
version: 8

- name: Install wasm-tools
run: dotnet workload install wasm-tools
Expand Down
36 changes: 32 additions & 4 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,52 @@ on:

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d #v3
with:
version: 8

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore Crypter.Test

- name: Build
run: dotnet build Crypter.Test --configuration Release --no-restore

- name: Test
run: dotnet test Crypter.Test --configuration Release --no-build --verbosity normal

build-and-test-web:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d #v3
with:
version: 8

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x

- name: Install wasm-tools
run: dotnet workload install wasm-tools

- name: Restore dependencies
run: dotnet restore
run: dotnet restore Crypter.Test.Web

- name: Build
run: dotnet build --configuration Release --no-restore
run: dotnet build Crypter.Test.Web --configuration Release --no-restore

- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
run: dotnet test Crypter.Test.Web --configuration Release --no-build --verbosity normal
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -452,3 +452,9 @@ Volumes/API/storage/
Volumes/Caddy/tls/
Volumes/PostgreSQL/data
Volumes/Caddy/data

# Compiled javascript
Crypter.Web/wwwroot/js/dist

# pnpm lock file
Crypter.Web/pnpm-lock.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
/*
* Copyright (C) 2023 Crypter File Transfer
*
* This file is part of the Crypter file transfer project.
*
* Crypter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Crypter source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You can be released from the requirements of the aforementioned license
* by purchasing a commercial license. Buying such a license is mandatory
* as soon as you develop commercial activities involving the Crypter source
* code without disclosing the source code of your own applications.
*
* Contact the current copyright holder to discuss commercial license options.
*/

using Crypter.API.Contracts.ModelBinders;
using Crypter.Common.Contracts.Features.Transfer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Crypter.API.Contracts;

public class UploadFileTransferReceipt
{
[ModelBinder(BinderType = typeof(FormDataJsonBinder))]
public UploadFileTransferRequest? Data { get; init; }

public IFormFile? Ciphertext { get; init; }
}
/*
* Copyright (C) 2023 Crypter File Transfer
*
* This file is part of the Crypter file transfer project.
*
* Crypter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Crypter source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You can be released from the requirements of the aforementioned license
* by purchasing a commercial license. Buying such a license is mandatory
* as soon as you develop commercial activities involving the Crypter source
* code without disclosing the source code of your own applications.
*
* Contact the current copyright holder to discuss commercial license options.
*/

using Crypter.API.Contracts.ModelBinders;
using Crypter.Common.Contracts.Features.Transfer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Crypter.API.Contracts;

public class UploadFileTransferBundle
{
[ModelBinder(BinderType = typeof(FormDataJsonBinder))]
public UploadFileTransferRequest? Data { get; init; }

public IFormFile? Ciphertext { get; init; }
}
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
/*
* Copyright (C) 2023 Crypter File Transfer
*
* This file is part of the Crypter file transfer project.
*
* Crypter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Crypter source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You can be released from the requirements of the aforementioned license
* by purchasing a commercial license. Buying such a license is mandatory
* as soon as you develop commercial activities involving the Crypter source
* code without disclosing the source code of your own applications.
*
* Contact the current copyright holder to discuss commercial license options.
*/

using Crypter.API.Contracts.ModelBinders;
using Crypter.Common.Contracts.Features.Transfer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Crypter.API.Contracts;

public class UploadMessageTransferReceipt
{
[ModelBinder(BinderType = typeof(FormDataJsonBinder))]
public UploadMessageTransferRequest? Data { get; init; }

public IFormFile? Ciphertext { get; init; }
}
/*
* Copyright (C) 2023 Crypter File Transfer
*
* This file is part of the Crypter file transfer project.
*
* Crypter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Crypter source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You can be released from the requirements of the aforementioned license
* by purchasing a commercial license. Buying such a license is mandatory
* as soon as you develop commercial activities involving the Crypter source
* code without disclosing the source code of your own applications.
*
* Contact the current copyright holder to discuss commercial license options.
*/

using Crypter.API.Contracts.ModelBinders;
using Crypter.Common.Contracts.Features.Transfer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Crypter.API.Contracts;

public class UploadMessageTransferBundle
{
[ModelBinder(BinderType = typeof(FormDataJsonBinder))]
public UploadMessageTransferRequest? Data { get; init; }

public IFormFile? Ciphertext { get; init; }
}
1 change: 1 addition & 0 deletions Crypter.API/Controllers/Base/TransferControllerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ protected IActionResult MakeErrorResponse(UploadTransferError error)
{
UploadTransferError.UnknownError => MakeErrorResponseBase(HttpStatusCode.InternalServerError, error),
UploadTransferError.InvalidRequestedLifetimeHours
or UploadTransferError.TooLarge
or UploadTransferError.OutOfSpace => MakeErrorResponseBase(HttpStatusCode.BadRequest, error),
UploadTransferError.RecipientNotFound => MakeErrorResponseBase(HttpStatusCode.NotFound, error)
};
Expand Down
Loading

0 comments on commit ebf484e

Please sign in to comment.