Skip to content

Commit

Permalink
Licenses: REUSE compliance; CI: test licensing and encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Jun 22, 2024
1 parent 56a0973 commit 292f58b
Show file tree
Hide file tree
Showing 113 changed files with 676 additions and 66 deletions.
3 changes: 3 additions & 0 deletions .config/dotnet-tools.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>

SPDX-License-Identifier: MIT
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
#
# SPDX-License-Identifier: MIT

.git
.idea
.vs
Expand Down
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
#
# SPDX-License-Identifier: MIT

root = true

[*]
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
#
# SPDX-License-Identifier: MIT

name: Docker
on:
push:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
#
# SPDX-License-Identifier: MIT

name: Main
on:
push:
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
#
# SPDX-License-Identifier: MIT

name: Release
on:
push:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
#
# SPDX-License-Identifier: MIT

/.idea/
/.vscode/
/logs/
Expand Down
12 changes: 12 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Emulsion
Upstream-Contact: Friedrich von Never <[email protected]>
Source: https://github.com/codingteam/emulsion

Files: .idea/**/*
Copyright: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
License: MIT

Files: *.DotSettings
Copyright: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
License: MIT
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Changelog
<!--
SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
SPDX-License-Identifier: MIT
-->

# Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic
Expand Down
27 changes: 26 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Contributor Guide
<!--
SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
SPDX-License-Identifier: MIT
-->

Contributor Guide
=================

Prerequisites
Expand Down Expand Up @@ -32,6 +38,25 @@ Execute the tests using the following shell command:
$ dotnet test
```

License Automation
------------------
<!-- REUSE-IgnoreStart -->
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 <https://github.com/codingteam/emulsion>" 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.)
<!-- REUSE-IgnoreEnd -->

Docker Publish
--------------
To build and push the container to Docker Hub, use the following shell commands:
Expand Down
6 changes: 6 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
SPDX-License-Identifier: MIT
-->

<Project>
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
#
# SPDX-License-Identifier: MIT

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env

# Install Node.js 18
Expand Down
6 changes: 5 additions & 1 deletion Emulsion.ContentProxy/ContentStorage.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module Emulsion.ContentProxy.ContentStorage
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

module Emulsion.ContentProxy.ContentStorage

open Emulsion.Database
open Emulsion.Database.DataStorage
Expand Down
8 changes: 7 additions & 1 deletion Emulsion.ContentProxy/Emulsion.ContentProxy.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--
SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
SPDX-License-Identifier: MIT
-->

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand Down
6 changes: 5 additions & 1 deletion Emulsion.ContentProxy/FileCache.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace Emulsion.ContentProxy
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

namespace Emulsion.ContentProxy

open System
open System.IO
Expand Down
7 changes: 5 additions & 2 deletions Emulsion.ContentProxy/Proxy.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
module Emulsion.ContentProxy.Proxy
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

module Emulsion.ContentProxy.Proxy

open System
open System.Collections
open HashidsNet

let encodeHashId (salt: string) (id: int64): string =
Expand Down
6 changes: 5 additions & 1 deletion Emulsion.ContentProxy/SimpleHttpClientFactory.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace Emulsion.ContentProxy
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

namespace Emulsion.ContentProxy

open System.Net.Http

Expand Down
6 changes: 5 additions & 1 deletion Emulsion.Database/DataStorage.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module Emulsion.Database.DataStorage
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

module Emulsion.Database.DataStorage

open System.Data

Expand Down
6 changes: 5 additions & 1 deletion Emulsion.Database/DatabaseSettings.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace Emulsion.Database
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

namespace Emulsion.Database

open Microsoft.EntityFrameworkCore

Expand Down
8 changes: 7 additions & 1 deletion Emulsion.Database/Emulsion.Database.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--
SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
SPDX-License-Identifier: MIT
-->

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand Down
6 changes: 5 additions & 1 deletion Emulsion.Database/EmulsionDbContext.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace Emulsion.Database
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

namespace Emulsion.Database

open Microsoft.EntityFrameworkCore
open Microsoft.EntityFrameworkCore.Design
Expand Down
6 changes: 5 additions & 1 deletion Emulsion.Database/Entities.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace Emulsion.Database.Entities
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

namespace Emulsion.Database.Entities

open System
open System.ComponentModel.DataAnnotations
Expand Down
8 changes: 5 additions & 3 deletions Emulsion.Database/Migrations/20211026164449_Initial.fs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// <auto-generated />
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

// <auto-generated />
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

[<DbContext(typeof<EmulsionDbContext>)>]
[<Migration("20211026164449_Initial")>]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <auto-generated />
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

// <auto-generated />
namespace Emulsion.Database.Migrations

open System
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <auto-generated />
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

// <auto-generated />
namespace Emulsion.Database.Migrations

open System
Expand Down
6 changes: 5 additions & 1 deletion Emulsion.Database/Migrations/20220828152910_ContentChatId.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// <auto-generated />
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

// <auto-generated />
namespace Emulsion.Database.Migrations

open System
Expand Down
8 changes: 5 additions & 3 deletions Emulsion.Database/Migrations/20230625203424_ArchiveEntry.fs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// <auto-generated />
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

// <auto-generated />
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

[<DbContext(typeof<EmulsionDbContext>)>]
[<Migration("20230625203424_ArchiveEntry")>]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// <auto-generated />
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

// <auto-generated />
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

[<DbContext(typeof<EmulsionDbContext>)>]
type EmulsionDbContextModelSnapshot() =
Expand Down
6 changes: 5 additions & 1 deletion Emulsion.Database/QueryableEx.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module Emulsion.Database.QueryableEx
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

module Emulsion.Database.QueryableEx

open System.Linq

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<Project Sdk="Microsoft.Build.NoTargets/3.7.0">
<!--
SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
SPDX-License-Identifier: MIT
-->

<Project Sdk="Microsoft.Build.NoTargets/3.7.0">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand Down
6 changes: 5 additions & 1 deletion Emulsion.MessageArchive.Frontend/api.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
type Statistics = {
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

type Statistics = {
messageCount: number;
}

Expand Down
6 changes: 5 additions & 1 deletion Emulsion.MessageArchive.Frontend/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import React, {useState} from 'react';
// SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
//
// SPDX-License-Identifier: MIT

import React, {useState} from 'react';
import {render} from 'react-dom';

class LoadedPage {
Expand Down
8 changes: 7 additions & 1 deletion Emulsion.MessageArchive.Frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<html lang="en">
<!--
SPDX-FileCopyrightText: 2024 Emulsion contributors <https://github.com/codingteam/emulsion>
SPDX-License-Identifier: MIT
-->

<html lang="en">
<head>
<title>Emulsion Message Archive</title>
<script type="module" src="./app.tsx"></script>
Expand Down
Loading

0 comments on commit 292f58b

Please sign in to comment.