Skip to content

Commit

Permalink
Merge branch 'dev' into 86b1d8vwy_Change_Username_And_Password
Browse files Browse the repository at this point in the history
  • Loading branch information
brettlazarine authored Nov 22, 2024
2 parents 995ad89 + 51727e3 commit f005b10
Show file tree
Hide file tree
Showing 131 changed files with 1,845 additions and 772 deletions.
70 changes: 47 additions & 23 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,39 @@ name: .NET

on:
push:
branches: [ "main", "dev" ]
branches: "**"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: benjlevesque/short-sha@v2.2

- name: Get Short SHA
id: short-sha
with:
length: 7
run: echo "short_sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT

- name: Set Lowercase Variables
id: vars
shell: bash
run: |
echo "IMAGE_NAME=$(echo ${GITHUB_REPOSITORY} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "BRANCH_NAME=$(echo ${GITHUB_REF_NAME} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Modify asset versions
uses: mingjun97/file-regex-replace@v1
with:
regex: '\$\(SHORTHASH\)'
replacement: '${{ env.SHA }}'
flags: "g" # Optional, defaults to "g"
include: '.*' # Optional, defaults to ".*"
exclude: '.^' # Optional, defaults to '.^'
encoding: 'utf8' # Optional, defaults to 'utf8'
path: '.' # Optional, defaults to '.'
replacement: '${{ steps.short-sha.outputs.short_sha }}'
flags: "g"
include: '.*'
exclude: '.^'
encoding: 'utf8'
path: '.'

- name: Delete .js files if corresponding .ts files exist
run: |
#!/bin/bash
Expand All @@ -38,52 +46,68 @@ jobs:
rm "$jsfile"
fi
done
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.100-rc.1.24452.12
include-prerelease: true

- name: Restore workload
run: dotnet workload restore

- name: Clean
run: dotnet clean

- name: Restore dependencies
run: dotnet restore

- name: Clean
run: dotnet clean

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal
continue-on-error: true

- name: Publish Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: "**/test_results.trx"

- name: Publish Shared Nuget Package
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: Valour/Shared/Valour.Shared.csproj
VERSION_FILE_PATH: Valour/Shared/Valour.Shared.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
NUGET_KEY: ${{ secrets.NUGET_API_KEY }}

- name: Publish API Nuget Package
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: Valour/Sdk/Valour.Sdk.csproj
VERSION_FILE_PATH: Valour/Sdk/Valour.Sdk.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
NUGET_KEY: ${{ secrets.NUGET_API_KEY }}

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: '${{ steps.meta.outputs.tags }}-${{ env.SHA }}'
labels: ${{ steps.meta.outputs.labels }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}-${{ steps.short-sha.outputs.short_sha }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}-latest
labels: |
org.opencontainers.image.source=${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
12 changes: 12 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -659,3 +659,15 @@ specific requirements.
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

-----------------------------------------

Additional Terms - Trademark Usage:

The name "Valour" is a trademark of Valour Software LLC, and a trademark application is pending. While the project is open-source, use of the trademark must not imply endorsement by Valour Software LLC or mislead others regarding the origin of the project.

Forks or derivative projects may not use the name "Valour" or related branding without prior written permission from Valour Software LLC. Any use of the trademark outside the scope of this project requires explicit permission.

While use of the trademark is not permitted for forks of the project itself, use of the mark is allowed for Valour bots, plugins, or integrations.


8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
![Valour logo](Valour/Client/wwwroot/media/logo/wide/logo_wide_blue_black_trans.png)

![.NET Test](https://github.com/Valour-Software/Valour/actions/workflows/dotnet.yml/badge.svg)

# Valour

### Valour is an open-source, modern chat client designed by communities for communities.
Expand Down Expand Up @@ -64,4 +66,10 @@ Building a platform is hard work. You can directly support Valour at the followi
- Bitcoin: bc1qcdzt989gszygpudjlrre0cmvkws77gagjglhav
- Ethereum: 0x40B56C98Fc115f4e503d8FaBa77F8DeF6d8412F1

## Trademark Notice

The name "Valour" is a trademark of Valour Software LLC, and a trademark application is pending. While the project is open-source, use of the trademark must not imply endorsement by Valour Software LLC or mislead others regarding the origin of the project.

Forks or derivative projects may not use the name "Valour" or related branding without prior written permission from Valour Software LLC. Any use of the trademark outside the scope of this project requires explicit permission.

While use of the trademark is not permitted for forks of the project itself, use of the mark is allowed for Valour bots, plugins, or integrations. If you are unsure, contact us!
6 changes: 6 additions & 0 deletions Valour.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Valour.Database", "Valour\D
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Valour.Sdk", "Valour\Sdk\Valour.Sdk.csproj", "{B192A998-9AED-40F7-BF3D-0BF7D060BEAD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Valour.Tests", "Valour\Tests\Valour.Tests.csproj", "{E0ECFCA0-767D-4E71-B54D-66BB4C9BEEC9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -50,6 +52,10 @@ Global
{B192A998-9AED-40F7-BF3D-0BF7D060BEAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B192A998-9AED-40F7-BF3D-0BF7D060BEAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B192A998-9AED-40F7-BF3D-0BF7D060BEAD}.Release|Any CPU.Build.0 = Release|Any CPU
{E0ECFCA0-767D-4E71-B54D-66BB4C9BEEC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0ECFCA0-767D-4E71-B54D-66BB4C9BEEC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0ECFCA0-767D-4E71-B54D-66BB4C9BEEC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0ECFCA0-767D-4E71-B54D-66BB4C9BEEC9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
if (firstRender)
{
_resizeObserver = new ResizeObserver();
_resizeObserver.ResizeEvent.AddHandler(OnWindowResize);
_resizeObserver.ResizeEvent += OnWindowResize;
await _resizeObserver.Initialize(_ref, JsRuntime, 3);
}

Expand All @@ -239,9 +239,7 @@
public async ValueTask DisposeAsync()
{
if (_resizeObserver is not null)
{
await _resizeObserver.DisposeAsync();
}
}

}
2 changes: 1 addition & 1 deletion Valour/Client/Components/Eco/GlobalPayComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ else
{
_errorSpan = null;

var result = await LiveModel.CreateAsync(new EcoAccount()
var result = await ClientModel.CreateAsync(new EcoAccount()
{
PlanetId = ISharedPlanet.ValourCentralId,
UserId = ValourClient.Self.Id,
Expand Down
2 changes: 1 addition & 1 deletion Valour/Client/Components/Eco/PlanetPayComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ else
{
_errorSpan = null;

var result = await LiveModel.CreateAsync(new EcoAccount()
var result = await ClientModel.CreateAsync(new EcoAccount()
{
PlanetId = _focusedPlanet.Id,
UserId = ValourClient.Self.Id,
Expand Down
2 changes: 1 addition & 1 deletion Valour/Client/Components/Menus/Modals/BanModal.razor
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
Reason = reason
};

_result = await LiveModel.CreateAsync(ban);
_result = await ClientModel.CreateAsync(ban);

if (_result.Success)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
Channel.Name = _nameValue;
Channel.Description = _descValue;

var result = await LiveModel.UpdateAsync(Channel);
var result = await ClientModel.UpdateAsync(Channel);
if (!result.Success)
{
_errorSpan = "Failed to save changes. Try again?";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

Target.InheritsPerms = !Target.InheritsPerms;

await LiveModel.UpdateAsync(Target);
await ClientModel.UpdateAsync(Target);

StateHasChanged();
}
Expand Down Expand Up @@ -220,7 +220,7 @@
{
if (_needCreate[i])
{
var result = await LiveModel.CreateAsync(_nodes[i]);
var result = await ClientModel.CreateAsync(_nodes[i]);
if (!result.Success)
{
Console.WriteLine("Error in channel permission node creation!");
Expand All @@ -235,7 +235,7 @@
}
else if (_needUpdate[i])
{
var result = await LiveModel.UpdateAsync(_nodes[i]);
var result = await ClientModel.UpdateAsync(_nodes[i]);
if (!result.Success)
{
Console.WriteLine("Error in channel permission node update!");
Expand Down
2 changes: 1 addition & 1 deletion Valour/Client/Components/Menus/Modals/KickModal.razor
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

private async Task OnConfirm()
{
var result = await LiveModel.DeleteAsync(Data.Member);
var result = await ClientModel.DeleteAsync(Data.Member);
Console.WriteLine(result);
await CloseAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

await ValourClient.AddJoinedPlanetAsync(planet);

var mainChannel = await planet.GetPrimaryChannelAsync();
var mainChannel = planet.GetPrimaryChannel();

await Data.Window.Layout.AddTab(await ChatChannelWindowComponent.GetDefaultContent(mainChannel));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
async () =>
{
Console.WriteLine("Confirmed planet deletion.");
var result = await LiveModel.DeleteAsync(Data.Planet);
var result = await ClientModel.DeleteAsync(Data.Planet);

if (result.Success)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@
// New currency
if (Currency.Id == 0)
{
result = await LiveModel.CreateAsync(Currency);
result = await ClientModel.CreateAsync(Currency);
}
else
{
result = await LiveModel.UpdateAsync(Currency);
result = await ClientModel.UpdateAsync(Currency);
}

if (!result.Success)
Expand All @@ -204,7 +204,7 @@
PlanetId = Currency.PlanetId,
};

var result = await LiveModel.CreateAsync(newAccount);
var result = await ClientModel.CreateAsync(newAccount);
if (!result.Success)
{
_accountError = result.Message;
Expand All @@ -218,7 +218,7 @@

private async Task OnClickSaveAccount(EcoAccount account)
{
var result = await LiveModel.UpdateAsync(account);
var result = await ClientModel.UpdateAsync(account);
if (!result.Success)
{
_accountError = result.Message;
Expand All @@ -233,7 +233,7 @@

private async Task OnClickDeleteAccount(EcoAccount account)
{
var result = await LiveModel.DeleteAsync(account);
var result = await ClientModel.DeleteAsync(account);
if (!result.Success)
{
_accountError = result.Message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,13 @@
// If the id is not set, this is a new role to be created
if (_role.Id == 0)
{
response = await LiveModel.CreateAsync(_role);
response = await ClientModel.CreateAsync(_role);
creating = true;
}
// Otherwise we are editing a prior role
else
{
response = await LiveModel.UpdateAsync(_role);
response = await ClientModel.UpdateAsync(_role);
}

_result = response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@inject IJSRuntime JsRuntime

@using Valour.Sdk.Extensions
@using System.Net.Http.Headers
@using Valour.Shared.Extensions
@* Editing page *@
@if (_editingTheme is not null)
{
Expand Down Expand Up @@ -423,12 +423,12 @@ else
if (_editingTheme.Id == 0)
{
// New theme
_editingResult = await LiveModel.CreateAsync(_editingTheme);
_editingResult = await ClientModel.CreateAsync(_editingTheme);
}
else
{
// Existing theme
_editingResult = await LiveModel.UpdateAsync(_editingTheme);
_editingResult = await ClientModel.UpdateAsync(_editingTheme);
}

if (!_editingResult.Value.Success)
Expand Down
Loading

0 comments on commit f005b10

Please sign in to comment.