diff --git a/.config/dotnet-tools.json.license b/.config/dotnet-tools.json.license new file mode 100644 index 00000000..8fcfab57 --- /dev/null +++ b/.config/dotnet-tools.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Emulsion contributors + +SPDX-License-Identifier: MIT diff --git a/.dockerignore b/.dockerignore index fcf2e671..02eaeacd 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2024 Emulsion contributors +# +# SPDX-License-Identifier: MIT + .git .idea .vs diff --git a/.editorconfig b/.editorconfig index fcbd7a08..8ae5c640 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2024 Emulsion contributors +# +# SPDX-License-Identifier: MIT + root = true [*] diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 325bd617..ffacc338 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2024 Emulsion contributors +# +# SPDX-License-Identifier: MIT + name: Docker on: push: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e7c9f7f..21dd306c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2024 Emulsion contributors +# +# SPDX-License-Identifier: MIT + name: Main on: push: @@ -38,3 +42,17 @@ jobs: - name: Test run: dotnet test timeout-minutes: 10 + encoding: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Verify encoding + shell: pwsh + run: scripts/Test-Encoding.ps1 + licenses: + runs-on: ubuntu-22.04 + steps: + - name: Check out the sources + uses: actions/checkout@v4 + - name: REUSE license check + uses: fsfe/reuse-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e612e45..cc9b4b30 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2024 Emulsion contributors +# +# SPDX-License-Identifier: MIT + name: Release on: push: diff --git a/.gitignore b/.gitignore index ec8d06dd..d8698d42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2024 Emulsion contributors +# +# SPDX-License-Identifier: MIT + /.idea/ /.vscode/ /logs/ diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 00000000..7d0d4cd0 --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,12 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Emulsion +Upstream-Contact: Friedrich von Never +Source: https://github.com/codingteam/emulsion + +Files: .idea/**/* +Copyright: 2024 Emulsion contributors +License: MIT + +Files: *.DotSettings +Copyright: 2024 Emulsion contributors +License: MIT diff --git a/CHANGELOG.md b/CHANGELOG.md index f2d20c6b..6ea88109 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -# Changelog + + +# Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index deff3b4c..43f7a0fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,10 @@ -Contributor Guide + + +Contributor Guide ================= Prerequisites @@ -32,6 +38,25 @@ Execute the tests using the following shell command: $ dotnet test ``` +License Automation +------------------ + +If the CI asks you to update the file licenses, follow one of these: +1. Update the headers manually (look at the existing files), something like this: + ```fsharp + // SPDX-FileCopyrightText: %year% %your name% <%your contact info, e.g. email%> + // + // SPDX-License-Identifier: MIT + ``` + (accommodate to the file's comment style if required). +2. Alternately, use [REUSE][reuse] tool: + ```console + $ reuse annotate --license MIT --copyright '%your name% <%your contact info, e.g. email%>' %file names to annotate% + ``` + +(Feel free to attribute the changes to "Emulsion contributors " instead of your name in a multi-author file, or if you don't want your name to be mentioned in the project's source: this doesn't mean you'll lose the copyright.) + + Docker Publish -------------- To build and push the container to Docker Hub, use the following shell commands: diff --git a/Directory.Build.props b/Directory.Build.props index 75a7fa9c..0ddccfbd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,3 +1,9 @@ + + true diff --git a/Dockerfile b/Dockerfile index 0e073a3d..671778c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2024 Emulsion contributors +# +# SPDX-License-Identifier: MIT + FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env # Install Node.js 18 diff --git a/Emulsion.ContentProxy/ContentStorage.fs b/Emulsion.ContentProxy/ContentStorage.fs index eca682c8..e1ee89e4 100644 --- a/Emulsion.ContentProxy/ContentStorage.fs +++ b/Emulsion.ContentProxy/ContentStorage.fs @@ -1,4 +1,8 @@ -module Emulsion.ContentProxy.ContentStorage +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.ContentProxy.ContentStorage open Emulsion.Database open Emulsion.Database.DataStorage diff --git a/Emulsion.ContentProxy/Emulsion.ContentProxy.fsproj b/Emulsion.ContentProxy/Emulsion.ContentProxy.fsproj index a1edd6d6..3563c663 100644 --- a/Emulsion.ContentProxy/Emulsion.ContentProxy.fsproj +++ b/Emulsion.ContentProxy/Emulsion.ContentProxy.fsproj @@ -1,4 +1,10 @@ - + + + net8.0 diff --git a/Emulsion.ContentProxy/FileCache.fs b/Emulsion.ContentProxy/FileCache.fs index f4ab6d9d..108991fa 100644 --- a/Emulsion.ContentProxy/FileCache.fs +++ b/Emulsion.ContentProxy/FileCache.fs @@ -1,4 +1,8 @@ -namespace Emulsion.ContentProxy +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.ContentProxy open System open System.IO diff --git a/Emulsion.ContentProxy/Proxy.fs b/Emulsion.ContentProxy/Proxy.fs index e4a86963..81ee0a33 100644 --- a/Emulsion.ContentProxy/Proxy.fs +++ b/Emulsion.ContentProxy/Proxy.fs @@ -1,7 +1,10 @@ -module Emulsion.ContentProxy.Proxy +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.ContentProxy.Proxy open System -open System.Collections open HashidsNet let encodeHashId (salt: string) (id: int64): string = diff --git a/Emulsion.ContentProxy/SimpleHttpClientFactory.fs b/Emulsion.ContentProxy/SimpleHttpClientFactory.fs index 01a91ac3..299d7d82 100644 --- a/Emulsion.ContentProxy/SimpleHttpClientFactory.fs +++ b/Emulsion.ContentProxy/SimpleHttpClientFactory.fs @@ -1,4 +1,8 @@ -namespace Emulsion.ContentProxy +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.ContentProxy open System.Net.Http diff --git a/Emulsion.Database/DataStorage.fs b/Emulsion.Database/DataStorage.fs index 4d866332..54611faa 100644 --- a/Emulsion.Database/DataStorage.fs +++ b/Emulsion.Database/DataStorage.fs @@ -1,4 +1,8 @@ -module Emulsion.Database.DataStorage +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Database.DataStorage open System.Data diff --git a/Emulsion.Database/DatabaseSettings.fs b/Emulsion.Database/DatabaseSettings.fs index f6091800..4e720881 100644 --- a/Emulsion.Database/DatabaseSettings.fs +++ b/Emulsion.Database/DatabaseSettings.fs @@ -1,4 +1,8 @@ -namespace Emulsion.Database +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.Database open Microsoft.EntityFrameworkCore diff --git a/Emulsion.Database/Emulsion.Database.fsproj b/Emulsion.Database/Emulsion.Database.fsproj index 02fe7119..f3ecf420 100644 --- a/Emulsion.Database/Emulsion.Database.fsproj +++ b/Emulsion.Database/Emulsion.Database.fsproj @@ -1,4 +1,10 @@ - + + + net8.0 diff --git a/Emulsion.Database/EmulsionDbContext.fs b/Emulsion.Database/EmulsionDbContext.fs index da74a654..464ad2a6 100644 --- a/Emulsion.Database/EmulsionDbContext.fs +++ b/Emulsion.Database/EmulsionDbContext.fs @@ -1,4 +1,8 @@ -namespace Emulsion.Database +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.Database open Microsoft.EntityFrameworkCore open Microsoft.EntityFrameworkCore.Design diff --git a/Emulsion.Database/Entities.fs b/Emulsion.Database/Entities.fs index fe560be0..44afbc74 100644 --- a/Emulsion.Database/Entities.fs +++ b/Emulsion.Database/Entities.fs @@ -1,4 +1,8 @@ -namespace Emulsion.Database.Entities +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.Database.Entities open System open System.ComponentModel.DataAnnotations diff --git a/Emulsion.Database/Migrations/20211026164449_Initial.fs b/Emulsion.Database/Migrations/20211026164449_Initial.fs index 596ffdf8..19216c58 100644 --- a/Emulsion.Database/Migrations/20211026164449_Initial.fs +++ b/Emulsion.Database/Migrations/20211026164449_Initial.fs @@ -1,13 +1,15 @@ -// +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +// namespace Emulsion.Database.Migrations open System open Emulsion.Database open Microsoft.EntityFrameworkCore open Microsoft.EntityFrameworkCore.Infrastructure -open Microsoft.EntityFrameworkCore.Metadata open Microsoft.EntityFrameworkCore.Migrations -open Microsoft.EntityFrameworkCore.Storage.ValueConversion [)>] [] diff --git a/Emulsion.Database/Migrations/20211031102019_TelegramContentUniqueConstraint.fs b/Emulsion.Database/Migrations/20211031102019_TelegramContentUniqueConstraint.fs index 324edb7f..71da484a 100644 --- a/Emulsion.Database/Migrations/20211031102019_TelegramContentUniqueConstraint.fs +++ b/Emulsion.Database/Migrations/20211031102019_TelegramContentUniqueConstraint.fs @@ -1,4 +1,8 @@ -// +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +// namespace Emulsion.Database.Migrations open System diff --git a/Emulsion.Database/Migrations/20220828133844_ContentFileNameAndMimeType.fs b/Emulsion.Database/Migrations/20220828133844_ContentFileNameAndMimeType.fs index d441705e..51ed0cab 100644 --- a/Emulsion.Database/Migrations/20220828133844_ContentFileNameAndMimeType.fs +++ b/Emulsion.Database/Migrations/20220828133844_ContentFileNameAndMimeType.fs @@ -1,4 +1,8 @@ -// +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +// namespace Emulsion.Database.Migrations open System diff --git a/Emulsion.Database/Migrations/20220828152910_ContentChatId.fs b/Emulsion.Database/Migrations/20220828152910_ContentChatId.fs index 6ab8ca3d..0085b833 100644 --- a/Emulsion.Database/Migrations/20220828152910_ContentChatId.fs +++ b/Emulsion.Database/Migrations/20220828152910_ContentChatId.fs @@ -1,4 +1,8 @@ -// +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +// namespace Emulsion.Database.Migrations open System diff --git a/Emulsion.Database/Migrations/20230625203424_ArchiveEntry.fs b/Emulsion.Database/Migrations/20230625203424_ArchiveEntry.fs index e0b58620..8f0a0cb5 100644 --- a/Emulsion.Database/Migrations/20230625203424_ArchiveEntry.fs +++ b/Emulsion.Database/Migrations/20230625203424_ArchiveEntry.fs @@ -1,13 +1,15 @@ -// +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +// namespace Emulsion.Database.Migrations open System open Emulsion.Database open Microsoft.EntityFrameworkCore open Microsoft.EntityFrameworkCore.Infrastructure -open Microsoft.EntityFrameworkCore.Metadata open Microsoft.EntityFrameworkCore.Migrations -open Microsoft.EntityFrameworkCore.Storage.ValueConversion [)>] [] diff --git a/Emulsion.Database/Migrations/EmulsionDbContextModelSnapshot.fs b/Emulsion.Database/Migrations/EmulsionDbContextModelSnapshot.fs index b845761a..57aebf77 100644 --- a/Emulsion.Database/Migrations/EmulsionDbContextModelSnapshot.fs +++ b/Emulsion.Database/Migrations/EmulsionDbContextModelSnapshot.fs @@ -1,13 +1,14 @@ -// +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +// namespace Emulsion.Database.Migrations open System open Emulsion.Database open Microsoft.EntityFrameworkCore open Microsoft.EntityFrameworkCore.Infrastructure -open Microsoft.EntityFrameworkCore.Metadata -open Microsoft.EntityFrameworkCore.Migrations -open Microsoft.EntityFrameworkCore.Storage.ValueConversion [)>] type EmulsionDbContextModelSnapshot() = diff --git a/Emulsion.Database/QueryableEx.fs b/Emulsion.Database/QueryableEx.fs index b0e96a26..51753bd6 100644 --- a/Emulsion.Database/QueryableEx.fs +++ b/Emulsion.Database/QueryableEx.fs @@ -1,4 +1,8 @@ -module Emulsion.Database.QueryableEx +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Database.QueryableEx open System.Linq diff --git a/Emulsion.MessageArchive.Frontend/Emulsion.MessageArchive.Frontend.proj b/Emulsion.MessageArchive.Frontend/Emulsion.MessageArchive.Frontend.proj index bfe2cfaf..ce3fb60a 100644 --- a/Emulsion.MessageArchive.Frontend/Emulsion.MessageArchive.Frontend.proj +++ b/Emulsion.MessageArchive.Frontend/Emulsion.MessageArchive.Frontend.proj @@ -1,4 +1,10 @@ - + + + net8.0 diff --git a/Emulsion.MessageArchive.Frontend/api.d.ts b/Emulsion.MessageArchive.Frontend/api.d.ts index 82a27d61..23ea11f1 100644 --- a/Emulsion.MessageArchive.Frontend/api.d.ts +++ b/Emulsion.MessageArchive.Frontend/api.d.ts @@ -1,4 +1,8 @@ -type Statistics = { +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +type Statistics = { messageCount: number; } diff --git a/Emulsion.MessageArchive.Frontend/app.tsx b/Emulsion.MessageArchive.Frontend/app.tsx index 2dcc2052..8fb3e2df 100644 --- a/Emulsion.MessageArchive.Frontend/app.tsx +++ b/Emulsion.MessageArchive.Frontend/app.tsx @@ -1,4 +1,8 @@ -import React, {useState} from 'react'; +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +import React, {useState} from 'react'; import {render} from 'react-dom'; class LoadedPage { diff --git a/Emulsion.MessageArchive.Frontend/index.html b/Emulsion.MessageArchive.Frontend/index.html index 08a14004..33c16248 100644 --- a/Emulsion.MessageArchive.Frontend/index.html +++ b/Emulsion.MessageArchive.Frontend/index.html @@ -1,4 +1,10 @@ - + + + Emulsion Message Archive diff --git a/Emulsion.MessageArchive.Frontend/package-lock.json.license b/Emulsion.MessageArchive.Frontend/package-lock.json.license new file mode 100644 index 00000000..8fcfab57 --- /dev/null +++ b/Emulsion.MessageArchive.Frontend/package-lock.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Emulsion contributors + +SPDX-License-Identifier: MIT diff --git a/Emulsion.MessageArchive.Frontend/package.json.license b/Emulsion.MessageArchive.Frontend/package.json.license new file mode 100644 index 00000000..8fcfab57 --- /dev/null +++ b/Emulsion.MessageArchive.Frontend/package.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Emulsion contributors + +SPDX-License-Identifier: MIT diff --git a/Emulsion.MessageArchive.Frontend/style.less b/Emulsion.MessageArchive.Frontend/style.less index cad8cf51..9ec28c3a 100644 --- a/Emulsion.MessageArchive.Frontend/style.less +++ b/Emulsion.MessageArchive.Frontend/style.less @@ -1,4 +1,10 @@ -.message { +/* + * SPDX-FileCopyrightText: 2024 Emulsion contributors + * + * SPDX-License-Identifier: MIT + */ + +.message { .dateTime, .sender, .text { display: inline-block; } .dateTime { color: #AAA; diff --git a/Emulsion.MessageArchive.Frontend/tsconfig.json.license b/Emulsion.MessageArchive.Frontend/tsconfig.json.license new file mode 100644 index 00000000..8fcfab57 --- /dev/null +++ b/Emulsion.MessageArchive.Frontend/tsconfig.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Emulsion contributors + +SPDX-License-Identifier: MIT diff --git a/Emulsion.Messaging/AssemblyInfo.fs b/Emulsion.Messaging/AssemblyInfo.fs index ce988e12..9234b7cd 100644 --- a/Emulsion.Messaging/AssemblyInfo.fs +++ b/Emulsion.Messaging/AssemblyInfo.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Messaging open System.Runtime.CompilerServices diff --git a/Emulsion.Messaging/Emulsion.Messaging.fsproj b/Emulsion.Messaging/Emulsion.Messaging.fsproj index d108f9c3..47ecb5c7 100644 --- a/Emulsion.Messaging/Emulsion.Messaging.fsproj +++ b/Emulsion.Messaging/Emulsion.Messaging.fsproj @@ -1,4 +1,10 @@ - + + + net8.0 true diff --git a/Emulsion.Messaging/Message.fs b/Emulsion.Messaging/Message.fs index 8a012aa5..449415bb 100644 --- a/Emulsion.Messaging/Message.fs +++ b/Emulsion.Messaging/Message.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Messaging [] diff --git a/Emulsion.Messaging/MessageSender.fs b/Emulsion.Messaging/MessageSender.fs index 97e661e5..aa92c637 100644 --- a/Emulsion.Messaging/MessageSender.fs +++ b/Emulsion.Messaging/MessageSender.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Messaging.MessageSender open System diff --git a/Emulsion.Messaging/MessageSystem.fs b/Emulsion.Messaging/MessageSystem.fs index 01213a56..878f95da 100644 --- a/Emulsion.Messaging/MessageSystem.fs +++ b/Emulsion.Messaging/MessageSystem.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Messaging.MessageSystem open System diff --git a/Emulsion.Settings/Emulsion.Settings.fsproj b/Emulsion.Settings/Emulsion.Settings.fsproj index 956c7514..a107ebe5 100644 --- a/Emulsion.Settings/Emulsion.Settings.fsproj +++ b/Emulsion.Settings/Emulsion.Settings.fsproj @@ -1,4 +1,10 @@ - + + + net8.0 diff --git a/Emulsion.Settings/Settings.fs b/Emulsion.Settings/Settings.fs index 70e1e61c..e43e31d1 100644 --- a/Emulsion.Settings/Settings.fs +++ b/Emulsion.Settings/Settings.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Settings open System diff --git a/Emulsion.Telegram/AssemblyInfo.fs b/Emulsion.Telegram/AssemblyInfo.fs index 45906365..7f30d37b 100644 --- a/Emulsion.Telegram/AssemblyInfo.fs +++ b/Emulsion.Telegram/AssemblyInfo.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Telegram open System.Runtime.CompilerServices diff --git a/Emulsion.Telegram/Client.fs b/Emulsion.Telegram/Client.fs index 73e6ccae..0abcdfd0 100644 --- a/Emulsion.Telegram/Client.fs +++ b/Emulsion.Telegram/Client.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Telegram open System diff --git a/Emulsion.Telegram/Emulsion.Telegram.fsproj b/Emulsion.Telegram/Emulsion.Telegram.fsproj index b926667f..f38b07d6 100644 --- a/Emulsion.Telegram/Emulsion.Telegram.fsproj +++ b/Emulsion.Telegram/Emulsion.Telegram.fsproj @@ -1,4 +1,10 @@ - + + + net8.0 true diff --git a/Emulsion.Telegram/Funogram.fs b/Emulsion.Telegram/Funogram.fs index 9513998f..670fd6b9 100644 --- a/Emulsion.Telegram/Funogram.fs +++ b/Emulsion.Telegram/Funogram.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Telegram.Funogram open System diff --git a/Emulsion.Telegram/Html.fs b/Emulsion.Telegram/Html.fs index 44ad96ec..2bf8293d 100644 --- a/Emulsion.Telegram/Html.fs +++ b/Emulsion.Telegram/Html.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Telegram.Html /// HTML escaping for Telegram only. According to the docs: https://core.telegram.org/bots/api#html-style diff --git a/Emulsion.Telegram/LinkGenerator.fs b/Emulsion.Telegram/LinkGenerator.fs index b9149386..0f9e2f32 100644 --- a/Emulsion.Telegram/LinkGenerator.fs +++ b/Emulsion.Telegram/LinkGenerator.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + /// A module that generates links to various content from Telegram. module Emulsion.Telegram.LinkGenerator diff --git a/Emulsion.TestFramework/Emulsion.TestFramework.fsproj b/Emulsion.TestFramework/Emulsion.TestFramework.fsproj index e01eb5ee..b327cb37 100644 --- a/Emulsion.TestFramework/Emulsion.TestFramework.fsproj +++ b/Emulsion.TestFramework/Emulsion.TestFramework.fsproj @@ -1,4 +1,10 @@ - + + + net8.0 diff --git a/Emulsion.TestFramework/Exceptions.fs b/Emulsion.TestFramework/Exceptions.fs index 85c4b55c..e0aee416 100644 --- a/Emulsion.TestFramework/Exceptions.fs +++ b/Emulsion.TestFramework/Exceptions.fs @@ -1,4 +1,8 @@ -module Emulsion.TestFramework.Exceptions +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.TestFramework.Exceptions open System open Microsoft.EntityFrameworkCore diff --git a/Emulsion.TestFramework/FileCacheUtil.fs b/Emulsion.TestFramework/FileCacheUtil.fs index e062a4c8..bdeb7225 100644 --- a/Emulsion.TestFramework/FileCacheUtil.fs +++ b/Emulsion.TestFramework/FileCacheUtil.fs @@ -1,4 +1,8 @@ -module Emulsion.TestFramework.FileCacheUtil +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.TestFramework.FileCacheUtil open System.IO diff --git a/Emulsion.TestFramework/LockedBuffer.fs b/Emulsion.TestFramework/LockedBuffer.fs index dfae3891..a67c3f6b 100644 --- a/Emulsion.TestFramework/LockedBuffer.fs +++ b/Emulsion.TestFramework/LockedBuffer.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.TestFramework type LockedBuffer<'T>() = diff --git a/Emulsion.TestFramework/Logging.fs b/Emulsion.TestFramework/Logging.fs index 25018f73..72b4b708 100644 --- a/Emulsion.TestFramework/Logging.fs +++ b/Emulsion.TestFramework/Logging.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.TestFramework.Logging open Serilog diff --git a/Emulsion.TestFramework/Signals.fs b/Emulsion.TestFramework/Signals.fs index 9c4432dc..ffd55b9b 100644 --- a/Emulsion.TestFramework/Signals.fs +++ b/Emulsion.TestFramework/Signals.fs @@ -1,4 +1,8 @@ -module Emulsion.TestFramework.Signals +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.TestFramework.Signals open System open System.Threading.Tasks diff --git a/Emulsion.TestFramework/StreamUtils.fs b/Emulsion.TestFramework/StreamUtils.fs index a92505d4..f8b82a34 100644 --- a/Emulsion.TestFramework/StreamUtils.fs +++ b/Emulsion.TestFramework/StreamUtils.fs @@ -1,4 +1,8 @@ -module Emulsion.TestFramework.StreamUtils +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.TestFramework.StreamUtils open System.IO open Serilog diff --git a/Emulsion.TestFramework/TelegramClientMock.fs b/Emulsion.TestFramework/TelegramClientMock.fs index c66c9181..02cdb9ec 100644 --- a/Emulsion.TestFramework/TelegramClientMock.fs +++ b/Emulsion.TestFramework/TelegramClientMock.fs @@ -1,4 +1,8 @@ -namespace Emulsion.TestFramework +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.TestFramework open System.Collections.Generic diff --git a/Emulsion.TestFramework/TestDataStorage.fs b/Emulsion.TestFramework/TestDataStorage.fs index 0787628f..fff0d198 100644 --- a/Emulsion.TestFramework/TestDataStorage.fs +++ b/Emulsion.TestFramework/TestDataStorage.fs @@ -1,4 +1,8 @@ -module Emulsion.TestFramework.TestDataStorage +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.TestFramework.TestDataStorage open System.IO diff --git a/Emulsion.TestFramework/Waiter.fs b/Emulsion.TestFramework/Waiter.fs index 89fe61f2..e6d4f519 100644 --- a/Emulsion.TestFramework/Waiter.fs +++ b/Emulsion.TestFramework/Waiter.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.TestFramework.Waiter open System diff --git a/Emulsion.TestFramework/WebFileStorage.fs b/Emulsion.TestFramework/WebFileStorage.fs index b0f0f22a..87d699e9 100644 --- a/Emulsion.TestFramework/WebFileStorage.fs +++ b/Emulsion.TestFramework/WebFileStorage.fs @@ -1,4 +1,8 @@ -namespace Emulsion.TestFramework +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.TestFramework open System open System.Net diff --git a/Emulsion.Tests/ContentProxy/ContentStorageTests.fs b/Emulsion.Tests/ContentProxy/ContentStorageTests.fs index ff241d16..7f65d147 100644 --- a/Emulsion.Tests/ContentProxy/ContentStorageTests.fs +++ b/Emulsion.Tests/ContentProxy/ContentStorageTests.fs @@ -1,4 +1,8 @@ -module Emulsion.Tests.ContentProxy.ContentStorageTests +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Tests.ContentProxy.ContentStorageTests open Xunit diff --git a/Emulsion.Tests/ContentProxy/FileCacheTests.fs b/Emulsion.Tests/ContentProxy/FileCacheTests.fs index 8ed100b4..9394db17 100644 --- a/Emulsion.Tests/ContentProxy/FileCacheTests.fs +++ b/Emulsion.Tests/ContentProxy/FileCacheTests.fs @@ -1,4 +1,8 @@ -namespace Emulsion.Tests.ContentProxy +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.Tests.ContentProxy open System open System.Collections.Generic diff --git a/Emulsion.Tests/ContentProxy/ProxyTests.fs b/Emulsion.Tests/ContentProxy/ProxyTests.fs index 148aa8eb..d46c6a0b 100644 --- a/Emulsion.Tests/ContentProxy/ProxyTests.fs +++ b/Emulsion.Tests/ContentProxy/ProxyTests.fs @@ -1,4 +1,8 @@ -module Emulsion.Tests.ContentProxy.ProxyTests +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Tests.ContentProxy.ProxyTests open System diff --git a/Emulsion.Tests/Database/DataStorageTests.fs b/Emulsion.Tests/Database/DataStorageTests.fs index 3a524663..a05998be 100644 --- a/Emulsion.Tests/Database/DataStorageTests.fs +++ b/Emulsion.Tests/Database/DataStorageTests.fs @@ -1,4 +1,8 @@ -module Emulsion.Tests.Database.InitializerTests +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Tests.Database.InitializerTests open System.IO diff --git a/Emulsion.Tests/Database/DatabaseStructureTests.fs b/Emulsion.Tests/Database/DatabaseStructureTests.fs index 430645af..c3e0eedf 100644 --- a/Emulsion.Tests/Database/DatabaseStructureTests.fs +++ b/Emulsion.Tests/Database/DatabaseStructureTests.fs @@ -1,4 +1,8 @@ -module Emulsion.Tests.Database.DatabaseStructureTests +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Tests.Database.DatabaseStructureTests open Microsoft.Data.Sqlite open Xunit diff --git a/Emulsion.Tests/Emulsion.Tests.fsproj b/Emulsion.Tests/Emulsion.Tests.fsproj index 2cdcb1f0..ac394467 100644 --- a/Emulsion.Tests/Emulsion.Tests.fsproj +++ b/Emulsion.Tests/Emulsion.Tests.fsproj @@ -1,4 +1,10 @@ - + + + net8.0 false diff --git a/Emulsion.Tests/ExceptionUtilsTests.fs b/Emulsion.Tests/ExceptionUtilsTests.fs index 1bf8a38b..149c244d 100644 --- a/Emulsion.Tests/ExceptionUtilsTests.fs +++ b/Emulsion.Tests/ExceptionUtilsTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Tests.ExceptionUtilsTests open System diff --git a/Emulsion.Tests/LifetimesTests.fs b/Emulsion.Tests/LifetimesTests.fs index 3fec5367..1e3130ad 100644 --- a/Emulsion.Tests/LifetimesTests.fs +++ b/Emulsion.Tests/LifetimesTests.fs @@ -1,10 +1,13 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Tests.LifetimesTests open JetBrains.Lifetimes open Xunit -open System.Threading.Tasks open Emulsion.Lifetimes [] diff --git a/Emulsion.Tests/LoggingTests.fs b/Emulsion.Tests/LoggingTests.fs index 9b2899c9..9d1eb9f2 100644 --- a/Emulsion.Tests/LoggingTests.fs +++ b/Emulsion.Tests/LoggingTests.fs @@ -1,4 +1,8 @@ -module Emulsion.Tests.LoggingTests +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Tests.LoggingTests open Emulsion open JetBrains.Diagnostics diff --git a/Emulsion.Tests/MessageSenderTests.fs b/Emulsion.Tests/MessageSenderTests.fs index d29783e9..ad533ce6 100644 --- a/Emulsion.Tests/MessageSenderTests.fs +++ b/Emulsion.Tests/MessageSenderTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Tests open System diff --git a/Emulsion.Tests/MessageSystemTests/MessageSystemBaseTests.fs b/Emulsion.Tests/MessageSystemTests/MessageSystemBaseTests.fs index f34747f0..d0bbd0c7 100644 --- a/Emulsion.Tests/MessageSystemTests/MessageSystemBaseTests.fs +++ b/Emulsion.Tests/MessageSystemTests/MessageSystemBaseTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Tests.MessageSystemTests open System @@ -7,7 +11,6 @@ open System.Threading.Tasks open Xunit open Xunit.Abstractions -open Emulsion open Emulsion.Messaging open Emulsion.Messaging.MessageSystem open Emulsion.TestFramework diff --git a/Emulsion.Tests/MessageSystemTests/WrapRunTests.fs b/Emulsion.Tests/MessageSystemTests/WrapRunTests.fs index 8c1f00a6..f75db4e0 100644 --- a/Emulsion.Tests/MessageSystemTests/WrapRunTests.fs +++ b/Emulsion.Tests/MessageSystemTests/WrapRunTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Tests.MessageSystemTests.WrapRunTests open System diff --git a/Emulsion.Tests/MessagingCoreTests.fs b/Emulsion.Tests/MessagingCoreTests.fs index fd878f7e..3ba4456a 100644 --- a/Emulsion.Tests/MessagingCoreTests.fs +++ b/Emulsion.Tests/MessagingCoreTests.fs @@ -1,4 +1,8 @@ -namespace Emulsion.Tests +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.Tests open System open System.Threading diff --git a/Emulsion.Tests/SettingsTests.fs b/Emulsion.Tests/SettingsTests.fs index c0b281ff..38e6a80f 100644 --- a/Emulsion.Tests/SettingsTests.fs +++ b/Emulsion.Tests/SettingsTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Tests.SettingsTests open System diff --git a/Emulsion.Tests/Telegram/FunogramTests.fs b/Emulsion.Tests/Telegram/FunogramTests.fs index 85709352..44078bd0 100644 --- a/Emulsion.Tests/Telegram/FunogramTests.fs +++ b/Emulsion.Tests/Telegram/FunogramTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Tests.Telegram.Client open System diff --git a/Emulsion.Tests/Telegram/Html.fs b/Emulsion.Tests/Telegram/Html.fs index 95904dc9..8e3b14d8 100644 --- a/Emulsion.Tests/Telegram/Html.fs +++ b/Emulsion.Tests/Telegram/Html.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Tests.Telegram.Html open Xunit diff --git a/Emulsion.Tests/Telegram/LinkGeneratorTests.fs b/Emulsion.Tests/Telegram/LinkGeneratorTests.fs index d728047e..2266b924 100644 --- a/Emulsion.Tests/Telegram/LinkGeneratorTests.fs +++ b/Emulsion.Tests/Telegram/LinkGeneratorTests.fs @@ -1,4 +1,8 @@ -module Emulsion.Tests.Telegram.LinkGeneratorTests +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Tests.Telegram.LinkGeneratorTests open System diff --git a/Emulsion.Tests/Web/ContentControllerTests.fs b/Emulsion.Tests/Web/ContentControllerTests.fs index 2ba8f611..b260bacf 100644 --- a/Emulsion.Tests/Web/ContentControllerTests.fs +++ b/Emulsion.Tests/Web/ContentControllerTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Tests.Web open System diff --git a/Emulsion.Tests/Xmpp/EmulsionXmppTests.fs b/Emulsion.Tests/Xmpp/EmulsionXmppTests.fs index 61d536d1..0160e07c 100644 --- a/Emulsion.Tests/Xmpp/EmulsionXmppTests.fs +++ b/Emulsion.Tests/Xmpp/EmulsionXmppTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Tests.Xmpp.EmulsionXmppTests open System diff --git a/Emulsion.Tests/Xmpp/SharpXmppHelperTests.fs b/Emulsion.Tests/Xmpp/SharpXmppHelperTests.fs index c0e58369..9a4400e4 100644 --- a/Emulsion.Tests/Xmpp/SharpXmppHelperTests.fs +++ b/Emulsion.Tests/Xmpp/SharpXmppHelperTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Tests.Xmpp.SharpXmppHelperTests open System.Xml.Linq diff --git a/Emulsion.Tests/Xmpp/SharpXmppPingHandlerTests.fs b/Emulsion.Tests/Xmpp/SharpXmppPingHandlerTests.fs index 70aa96ba..ea368c64 100644 --- a/Emulsion.Tests/Xmpp/SharpXmppPingHandlerTests.fs +++ b/Emulsion.Tests/Xmpp/SharpXmppPingHandlerTests.fs @@ -1,4 +1,8 @@ -module Emulsion.Tests.Xmpp.SharpXmppPingHandlerTests +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Tests.Xmpp.SharpXmppPingHandlerTests open System.IO open System.Xml diff --git a/Emulsion.Tests/Xmpp/XmppClientFactory.fs b/Emulsion.Tests/Xmpp/XmppClientFactory.fs index f38157e9..8563bf70 100644 --- a/Emulsion.Tests/Xmpp/XmppClientFactory.fs +++ b/Emulsion.Tests/Xmpp/XmppClientFactory.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Tests.Xmpp open Emulsion.Xmpp.XmppClient diff --git a/Emulsion.Tests/Xmpp/XmppClientRoomTests.fs b/Emulsion.Tests/Xmpp/XmppClientRoomTests.fs index ee3f3b14..684f1c4b 100644 --- a/Emulsion.Tests/Xmpp/XmppClientRoomTests.fs +++ b/Emulsion.Tests/Xmpp/XmppClientRoomTests.fs @@ -1,4 +1,8 @@ -namespace Emulsion.Tests.Xmpp +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.Tests.Xmpp open System open System.Threading diff --git a/Emulsion.Tests/Xmpp/XmppClientTests.fs b/Emulsion.Tests/Xmpp/XmppClientTests.fs index 6ec091c2..f46c452e 100644 --- a/Emulsion.Tests/Xmpp/XmppClientTests.fs +++ b/Emulsion.Tests/Xmpp/XmppClientTests.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Tests.Xmpp.XmppClientTests open System diff --git a/Emulsion.Tests/Xmpp/XmppMessageFactory.fs b/Emulsion.Tests/Xmpp/XmppMessageFactory.fs index fa86e0c9..7b49f19a 100644 --- a/Emulsion.Tests/Xmpp/XmppMessageFactory.fs +++ b/Emulsion.Tests/Xmpp/XmppMessageFactory.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Tests.Xmpp open System.Xml.Linq diff --git a/Emulsion.Web/ContentController.fs b/Emulsion.Web/ContentController.fs index 97fb7282..325ae673 100644 --- a/Emulsion.Web/ContentController.fs +++ b/Emulsion.Web/ContentController.fs @@ -1,4 +1,8 @@ -namespace Emulsion.Web +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.Web open System open System.Threading.Tasks diff --git a/Emulsion.Web/Emulsion.Web.fsproj b/Emulsion.Web/Emulsion.Web.fsproj index e8af7c82..accbce4e 100644 --- a/Emulsion.Web/Emulsion.Web.fsproj +++ b/Emulsion.Web/Emulsion.Web.fsproj @@ -1,3 +1,9 @@ + + Library diff --git a/Emulsion.Web/HistoryController.fs b/Emulsion.Web/HistoryController.fs index aa9ca556..e0d3685b 100644 --- a/Emulsion.Web/HistoryController.fs +++ b/Emulsion.Web/HistoryController.fs @@ -1,8 +1,11 @@ -namespace Emulsion.Web +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.Web open System open System.Collections.Generic -open System.Linq open System.Threading.Tasks open Microsoft.AspNetCore.Mvc diff --git a/Emulsion.Web/WebServer.fs b/Emulsion.Web/WebServer.fs index d827402d..2b55f726 100644 --- a/Emulsion.Web/WebServer.fs +++ b/Emulsion.Web/WebServer.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Web.WebServer open System diff --git a/Emulsion.sln b/Emulsion.sln index 54554293..d49c6e31 100644 --- a/Emulsion.sln +++ b/Emulsion.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26124.0 @@ -17,6 +17,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution MAINTAINERSHIP.md = MAINTAINERSHIP.md Directory.Build.props = Directory.Build.props CONTRIBUTING.md = CONTRIBUTING.md + emulsion.example.json.license = emulsion.example.json.license + Emulsion.sln.license = Emulsion.sln.license + renovate.json.license = renovate.json.license + .dockerignore = .dockerignore + .editorconfig = .editorconfig EndProjectSection EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Emulsion.Tests", "Emulsion.Tests\Emulsion.Tests.fsproj", "{1B3B65DD-FD58-45FA-B6FF-8532B513A7D9}" @@ -35,6 +40,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{D03C4F4A-9806-46AA-8654-14363DFB3FBE}" ProjectSection(SolutionItems) = preProject .config\dotnet-tools.json = .config\dotnet-tools.json + .config\dotnet-tools.json.license = .config\dotnet-tools.json.license EndProjectSection EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Emulsion.ContentProxy", "Emulsion.ContentProxy\Emulsion.ContentProxy.fsproj", "{A520FD41-A1CB-4062-AFBC-62A8BED12E81}" @@ -54,6 +60,21 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Emulsion.TestFramework", "E EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emulsion.MessageArchive.Frontend", "Emulsion.MessageArchive.Frontend\Emulsion.MessageArchive.Frontend.proj", "{A0FA9B40-4FD3-4EF9-AFCF-2CB7445A677E}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".reuse", ".reuse", "{E23EFD2B-A80C-4F15-B965-27416EE1CF09}" + ProjectSection(SolutionItems) = preProject + .reuse\dep5 = .reuse\dep5 + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{E3091B22-752A-4260-B4F3-903B9043479F}" + ProjectSection(SolutionItems) = preProject + scripts\Test-Encoding.ps1 = scripts\Test-Encoding.ps1 + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LICENSES", "LICENSES", "{BBA60ACE-9FB4-4F3B-89EC-16A5BB9F5686}" + ProjectSection(SolutionItems) = preProject + LICENSES\MIT.txt = LICENSES\MIT.txt + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Emulsion.sln.license b/Emulsion.sln.license new file mode 100644 index 00000000..8fcfab57 --- /dev/null +++ b/Emulsion.sln.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Emulsion contributors + +SPDX-License-Identifier: MIT diff --git a/Emulsion/Emulsion.fsproj b/Emulsion/Emulsion.fsproj index 264a3d90..8639754b 100644 --- a/Emulsion/Emulsion.fsproj +++ b/Emulsion/Emulsion.fsproj @@ -1,4 +1,10 @@ - + + + Exe net8.0 diff --git a/Emulsion/ExceptionUtils.fs b/Emulsion/ExceptionUtils.fs index 28f54d27..93214db6 100644 --- a/Emulsion/ExceptionUtils.fs +++ b/Emulsion/ExceptionUtils.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.ExceptionUtils open System.Runtime.ExceptionServices diff --git a/Emulsion/Lifetimes.fs b/Emulsion/Lifetimes.fs index 26d06fe7..318670d8 100644 --- a/Emulsion/Lifetimes.fs +++ b/Emulsion/Lifetimes.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Lifetimes open System.Threading.Tasks diff --git a/Emulsion/Logging.fs b/Emulsion/Logging.fs index 46e33769..3e725d3e 100644 --- a/Emulsion/Logging.fs +++ b/Emulsion/Logging.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + module Emulsion.Logging open System.IO diff --git a/Emulsion/MessageArchive.fs b/Emulsion/MessageArchive.fs index c167c7a2..b401e157 100644 --- a/Emulsion/MessageArchive.fs +++ b/Emulsion/MessageArchive.fs @@ -1,4 +1,8 @@ -namespace Emulsion +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion open System diff --git a/Emulsion/MessagingCore.fs b/Emulsion/MessagingCore.fs index b71ea459..b94d9d7c 100644 --- a/Emulsion/MessagingCore.fs +++ b/Emulsion/MessagingCore.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion open System diff --git a/Emulsion/Program.fs b/Emulsion/Program.fs index 0d103ceb..3eb84bd9 100644 --- a/Emulsion/Program.fs +++ b/Emulsion/Program.fs @@ -1,4 +1,8 @@ -module Emulsion.Program +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +module Emulsion.Program open System open System.IO diff --git a/Emulsion/Xmpp/EmulsionXmpp.fs b/Emulsion/Xmpp/EmulsionXmpp.fs index 313b6de6..5faaec9b 100644 --- a/Emulsion/Xmpp/EmulsionXmpp.fs +++ b/Emulsion/Xmpp/EmulsionXmpp.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + /// Main business logic for an XMPP part of the Emulsion application. module Emulsion.Xmpp.EmulsionXmpp diff --git a/Emulsion/Xmpp/SharpXmppClient.fs b/Emulsion/Xmpp/SharpXmppClient.fs index 9f1262e5..8067057f 100644 --- a/Emulsion/Xmpp/SharpXmppClient.fs +++ b/Emulsion/Xmpp/SharpXmppClient.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + /// An implementation of an IXmppClient based on SharpXMPP library. module Emulsion.Xmpp.SharpXmppClient diff --git a/Emulsion/Xmpp/SharpXmppHelper.fs b/Emulsion/Xmpp/SharpXmppHelper.fs index 7aafa59d..7959e961 100644 --- a/Emulsion/Xmpp/SharpXmppHelper.fs +++ b/Emulsion/Xmpp/SharpXmppHelper.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + /// Helper functions to deal with SharpXMPP low-level details (such as XML stuff). module Emulsion.Xmpp.SharpXmppHelper diff --git a/Emulsion/Xmpp/SharpXmppPingHandler.fs b/Emulsion/Xmpp/SharpXmppPingHandler.fs index 4d6d1767..eb30553f 100644 --- a/Emulsion/Xmpp/SharpXmppPingHandler.fs +++ b/Emulsion/Xmpp/SharpXmppPingHandler.fs @@ -1,4 +1,8 @@ -namespace Emulsion.Xmpp +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + +namespace Emulsion.Xmpp open SharpXMPP.XMPP.Client diff --git a/Emulsion/Xmpp/Types.fs b/Emulsion/Xmpp/Types.fs index d22771ab..888e830f 100644 --- a/Emulsion/Xmpp/Types.fs +++ b/Emulsion/Xmpp/Types.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Xmpp open System diff --git a/Emulsion/Xmpp/XmppClient.fs b/Emulsion/Xmpp/XmppClient.fs index e722eb50..1ef94117 100644 --- a/Emulsion/Xmpp/XmppClient.fs +++ b/Emulsion/Xmpp/XmppClient.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + /// A general abstraction around an XMPP client and common functions. module Emulsion.Xmpp.XmppClient diff --git a/Emulsion/Xmpp/XmppMessageSystem.fs b/Emulsion/Xmpp/XmppMessageSystem.fs index 44bc8114..322aaa37 100644 --- a/Emulsion/Xmpp/XmppMessageSystem.fs +++ b/Emulsion/Xmpp/XmppMessageSystem.fs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 Emulsion contributors +// +// SPDX-License-Identifier: MIT + namespace Emulsion.Xmpp open System.Threading diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 00000000..2071b23b --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/MAINTAINERSHIP.md b/MAINTAINERSHIP.md index 4d7c3a61..ae159697 100644 --- a/MAINTAINERSHIP.md +++ b/MAINTAINERSHIP.md @@ -1,4 +1,10 @@ -Maintainership + + +Maintainership ============== Release diff --git a/NuGet.Config b/NuGet.Config index 0cce0f00..25677c11 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,4 +1,9 @@ + diff --git a/README.md b/README.md index 0661894a..31bf7cf3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + + emulsion [![Docker Image][badge.docker]][docker-hub] [![Status Aquana][status-aquana]][andivionian-status-classifier] ======== @@ -126,9 +132,14 @@ Documentation ------------- - [Changelog][docs.changelog] - [Contributor Guide][docs.contributing] -- [License (MIT)][docs.license] - [Maintainership][docs.maintainership] +License +------- +The project is distributed under the terms of [the MIT license][docs.license]. + +The license indication in the project's sources is compliant with the [REUSE specification v3.0][reuse.spec]. + [andivionian-status-classifier]: https://github.com/ForNeVeR/andivionian-status-classifier#status-aquana- [badge.docker]: https://img.shields.io/docker/v/codingteam/emulsion?sort=semver [docker-hub]: https://hub.docker.com/r/codingteam/emulsion @@ -140,6 +151,7 @@ Documentation [dotnet]: https://dot.net/ [hashids.net]: https://github.com/ullmark/hashids.net [releases]: https://github.com/codingteam/emulsion/releases +[reuse.spec]: https://reuse.software/spec/ [status-aquana]: https://img.shields.io/badge/status-aquana-yellowgreen.svg [telegram]: https://telegram.org/ [xmpp]: https://xmpp.org/ diff --git a/emulsion.example.json.license b/emulsion.example.json.license new file mode 100644 index 00000000..8fcfab57 --- /dev/null +++ b/emulsion.example.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Emulsion contributors + +SPDX-License-Identifier: MIT diff --git a/renovate.json.license b/renovate.json.license new file mode 100644 index 00000000..8fcfab57 --- /dev/null +++ b/renovate.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Emulsion contributors + +SPDX-License-Identifier: MIT diff --git a/scripts/Test-Encoding.ps1 b/scripts/Test-Encoding.ps1 new file mode 100644 index 00000000..113fc83e --- /dev/null +++ b/scripts/Test-Encoding.ps1 @@ -0,0 +1,76 @@ +# SPDX-FileCopyrightText: 2024 Friedrich von Never +# +# SPDX-License-Identifier: MIT + +<# +.SYNOPSIS + This script will verify that there's no UTF-8 BOM or CRLF line endings in the files inside of the project. +#> +param ( + # Path to the repository root. All text files under the root will be checked for UTF-8 BOM and CRLF. + $SourceRoot = "$PSScriptRoot/..", + + # Makes the script to perform file modifications to bring them to the standard. + [switch] $Autofix +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +# For PowerShell to properly process the UTF-8 output from git ls-tree we need to set up the output encoding: +[Console]::OutputEncoding = [Text.Encoding]::UTF8 + +$allFiles = git -c core.quotepath=off ls-tree -r HEAD --name-only +Write-Output "Total files in the repository: $($allFiles.Length)" + +# https://stackoverflow.com/questions/6119956/how-to-determine-if-git-handles-a-file-as-binary-or-as-text#comment15281840_6134127 +$nullHash = '4b825dc642cb6eb9a060e54bf8d69288fbee4904' +$textFiles = git -c core.quotepath=off diff --numstat $nullHash HEAD -- @allFiles | + Where-Object { -not $_.StartsWith('-') } | + ForEach-Object { [Regex]::Unescape($_.Split("`t", 3)[2]) } +Write-Output "Text files in the repository: $($textFiles.Length)" + +$bom = @(0xEF, 0xBB, 0xBF) +$bomErrors = @() +$lineEndingErrors = @() +[array] $excludeExtensions = @('.dotsettings') + +try { + Push-Location $SourceRoot + foreach ($file in $textFiles) { + if ($excludeExtensions -contains [IO.Path]::GetExtension($file).ToLowerInvariant()) { + continue + } + + $fullPath = Resolve-Path -LiteralPath $file + $bytes = [IO.File]::ReadAllBytes($fullPath) | Select-Object -First $bom.Length + $bytesEqualsBom = @(Compare-Object $bytes $bom -SyncWindow 0).Length -eq 0 + if ($bytesEqualsBom -and $Autofix) { + $fullContent = [IO.File]::ReadAllBytes($fullPath) + $newContent = $fullContent | Select-Object -Skip $bom.Length + [IO.File]::WriteAllBytes($fullPath, $newContent) + Write-Output "Removed UTF-8 BOM from file $file" + } elseif ($bytesEqualsBom) { + $bomErrors += @($file) + } + + $text = [IO.File]::ReadAllText($fullPath) + $hasWrongLineEndings = $text.Contains("`r`n") + if ($hasWrongLineEndings -and $Autofix) { + $newText = $text -replace "`r`n", "`n" + [IO.File]::WriteAllText($fullPath, $newText) + Write-Output "Fixed the line endings for file $file" + } elseif ($hasWrongLineEndings) { + $lineEndingErrors += @($file) + } + } + + if ($bomErrors.Length) { + throw "The following $($bomErrors.Length) files have UTF-8 BOM:`n" + ($bomErrors -join "`n") + } + if ($lineEndingErrors.Length) { + throw "The following $($lineEndingErrors.Length) files have CRLF instead of LF:`n" + ($lineEndingErrors -join "`n") + } +} finally { + Pop-Location +}