From 7d4009cf1a4314b99c7c9a623e5d64ba87beca87 Mon Sep 17 00:00:00 2001 From: gnuxie Date: Fri, 24 May 2024 15:21:47 +0100 Subject: [PATCH 1/3] Update documentation links for new base url. Context is that we had `docs` as part of the base URL, fixed in https://github.com/the-draupnir-project/draupnir-documentation/pull/13. --- .github/workflows/sign-off.yml | 2 +- CONTRIBUTING.md | 2 +- README.md | 18 +++++++++--------- docs/appservice.md | 2 +- docs/code-style.md | 2 +- docs/context.md | 2 +- docs/development-environment.md | 2 +- docs/development.md | 2 +- docs/moderators.md | 2 +- docs/setup.md | 2 +- docs/setup_docker.md | 2 +- docs/setup_selfbuild.md | 2 +- docs/synapse_module.md | 2 +- docs/triaging.md | 2 +- 14 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/sign-off.yml b/.github/workflows/sign-off.yml index 68846aea..2119dbe7 100644 --- a/.github/workflows/sign-off.yml +++ b/.github/workflows/sign-off.yml @@ -55,5 +55,5 @@ jobs: return; } - core.setFailed('No sign off found. Please ensure you have signed off following the advice in https://the-draupnir-project.github.io/draupnir-documentation/docs/contributing#sign-off .') + core.setFailed('No sign off found. Please ensure you have signed off following the advice in https://the-draupnir-project.github.io/draupnir-documentation/contributing#sign-off .') core.notice('Ensure you have matched the format `Signed-off-by: Your Name `') diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eff49f39..c45b897f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing to Draupnir -Our contributing guidelines can be found as part of our documentation. [This link](https://the-draupnir-project.github.io/draupnir-documentation/docs/contributing) leads to the contributing guidelines. +Our contributing guidelines can be found as part of our documentation. [This link](https://the-draupnir-project.github.io/draupnir-documentation/contributing) leads to the contributing guidelines. diff --git a/README.md b/README.md index b13b09fc..c8016a67 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,9 @@ In general, all commands have been migrated to a new interface which feature better error messages for common problems and allow admins to trace the cause of unexpected errors much more easily. -[^the-gif-width]: Yes, i know they don't align horizontally, -you are welcome to suggest how this should be fixed. - +[^the-gif-width]: + Yes, i know they don't align horizontally, + you are welcome to suggest how this should be fixed. ## Status @@ -77,7 +77,7 @@ Any problems with migration should be reported to our [support room](https://mat ## Setting up -See the [setup documentation](https://the-draupnir-project.github.io/draupnir-documentation/docs/bot/setup) for first-time setup documentation. +See the [setup documentation](https://the-draupnir-project.github.io/draupnir-documentation/bot/setup) for first-time setup documentation. See the [configuration sample with documentation](config/default.yaml) for detailed information about Draupnir's configuration. @@ -94,7 +94,7 @@ set up: as the visibility of the room. 2. `!draupnir default coc` - This sets the default ban list to the list we just created to help with the ban commands later on. -3. Review the [Moderator's Guide](https://the-draupnir-project.github.io/draupnir-documentation/docs/bot/moderators). +3. Review the [Moderator's Guide](https://the-draupnir-project.github.io/draupnir-documentation/bot/moderators). 4. Review `!draupnir help` to see what else the bot can do. ## Enabling readable abuse reports @@ -106,16 +106,16 @@ this data from an admin API. This requires two configuration steps: 1. In your Draupnir configuration file, typically `/etc/draupnir/config/production.yaml`, copy and paste the `web` section from `default.yaml`, if you don't have it yet (it appears with version 1.20) and set `enabled: true` for both `web` and -`abuseReporting`. + `abuseReporting`. 2. Setup a reverse proxy that will redirect requests from `^/_matrix/client/(r0|v3)/rooms/([^/]*)/report/(.*)$` to `http://host:port/api/1/report/$2/$3`, where `host` is the host where you run Draupnir, and `port` is the port you configured in `production.yaml`. For an example nginx configuration, see `test/nginx.conf`. It's the confirmation we use during runtime testing. ### Security note This mechanism can extract some information from **unencrypted** rooms. We have taken precautions to ensure that this cannot be abused: the only case in which -this feature will publish information from room *foo* is: +this feature will publish information from room _foo_ is: -1. If it is used by a member of room *foo*; AND +1. If it is used by a member of room _foo_; AND 2. If said member did witness the event; AND 3. If the event was unencrypted; AND 4. If the event was not redacted/removed/... @@ -130,6 +130,6 @@ server can only receive requests from your reverse proxy (e.g. `localhost`). ## Contributing & Opening Issues Draupnir wants to be yours as much as it is ours. -Please see or [contributing document](https://the-draupnir-project.github.io/draupnir-documentation/docs/contributing), but do not +Please see or [contributing document](https://the-draupnir-project.github.io/draupnir-documentation/contributing), but do not worry too much about following the guidance to the letter. And keep that in mind throughout. diff --git a/docs/appservice.md b/docs/appservice.md index 2479bbb5..b04cee71 100644 --- a/docs/appservice.md +++ b/docs/appservice.md @@ -1 +1 @@ -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/appservice +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/appservice diff --git a/docs/code-style.md b/docs/code-style.md index 1f35b13a..2f146d0a 100644 --- a/docs/code-style.md +++ b/docs/code-style.md @@ -1,3 +1,3 @@ # Code style -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/contributing/code-style +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/contributing/code-style diff --git a/docs/context.md b/docs/context.md index eafe55fe..9b61d8e3 100644 --- a/docs/context.md +++ b/docs/context.md @@ -1,3 +1,3 @@ ## Context for developing Draupnir -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/contributing/context +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/contributing/context diff --git a/docs/development-environment.md b/docs/development-environment.md index e8f8543f..9e97fcff 100644 --- a/docs/development-environment.md +++ b/docs/development-environment.md @@ -1,3 +1,3 @@ # Developing Draupnir - tests, tools, and environment -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/contributing/development-environment +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/contributing/development-environment diff --git a/docs/development.md b/docs/development.md index f7d9a399..e906b64b 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,3 +1,3 @@ # Developing Draupnir -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/contributing/development +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/contributing/development diff --git a/docs/moderators.md b/docs/moderators.md index 78afa11f..cf62e2ca 100644 --- a/docs/moderators.md +++ b/docs/moderators.md @@ -1,3 +1,3 @@ # Moderator's guide to Draupnir (bot edition) -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/bot/moderators +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/bot/moderators diff --git a/docs/setup.md b/docs/setup.md index 36c55180..dcc9162f 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -1,3 +1,3 @@ # Setting up Draupnir -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/bot/setup +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/bot/setup diff --git a/docs/setup_docker.md b/docs/setup_docker.md index 41e75de8..c84b716b 100644 --- a/docs/setup_docker.md +++ b/docs/setup_docker.md @@ -1 +1 @@ -This document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/bot/setup_docker +This document has moved to https://the-draupnir-project.github.io/draupnir-documentation/bot/setup_docker diff --git a/docs/setup_selfbuild.md b/docs/setup_selfbuild.md index 9b520bf1..a3643fa1 100644 --- a/docs/setup_selfbuild.md +++ b/docs/setup_selfbuild.md @@ -1 +1 @@ -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/bot/setup_selfbuild +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/bot/setup_selfbuild diff --git a/docs/synapse_module.md b/docs/synapse_module.md index 427b3880..e0472e40 100644 --- a/docs/synapse_module.md +++ b/docs/synapse_module.md @@ -1 +1 @@ -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/bot/synapse_module +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/bot/synapse_module diff --git a/docs/triaging.md b/docs/triaging.md index 9f69c7e4..0638fd0f 100644 --- a/docs/triaging.md +++ b/docs/triaging.md @@ -1,3 +1,3 @@ # Triaging issues -This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/docs/contributing/triaging +This Document has moved to https://the-draupnir-project.github.io/draupnir-documentation/contributing/triaging From 8aa46b85261965ee2ab1427ed7708e438fceae74 Mon Sep 17 00:00:00 2001 From: gnuxie Date: Fri, 24 May 2024 15:25:55 +0100 Subject: [PATCH 2/3] Add README link to v1.87.0. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c8016a67..66d7d164 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,9 @@ As Draupnir heads towards `v2.0.0`, releases will appear [here](https://github.c Until `v2.0.0` there will be frequent changes to commands but all of these will be noted in the changes for that release. +For the latest stable release, see `v1.87.0`, the documentation +for which can be found [here](https://github.com/the-draupnir-project/Draupnir/tree/v1.87.0). + ### Migration Migrating from Mjolnir is straightforward and requires no manual steps, From 5304b260e19bd928761a65b758ee6eabbc816563 Mon Sep 17 00:00:00 2001 From: gnuxie Date: Fri, 24 May 2024 15:38:11 +0100 Subject: [PATCH 3/3] Add documentation link to status and help commands. --- src/commands/Help.tsx | 2 ++ src/commands/StatusCommand.tsx | 7 +++++-- src/config.ts | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/commands/Help.tsx b/src/commands/Help.tsx index 54b9a279..4c25217f 100644 --- a/src/commands/Help.tsx +++ b/src/commands/Help.tsx @@ -33,10 +33,12 @@ import { findPresentationType, parameters, RestDescription } from "./interface-m import { defineMatrixInterfaceAdaptor } from "./interface-manager/MatrixInterfaceAdaptor"; import { renderMatrixAndSend } from "./interface-manager/DeadDocumentMatrix"; import { ActionResult, Ok, isError } from "matrix-protection-suite"; +import { DOCUMENTATION_URL } from "../config"; function renderTableHelp(table: CommandTable): DocumentNode { // FIXME: is it possible to force case of table names? return + Documentation: {DOCUMENTATION_URL}
{table.name} commands: {table.getExportedCommands().map(renderCommandSummary)} diff --git a/src/commands/StatusCommand.tsx b/src/commands/StatusCommand.tsx index afc17ab2..14fdc9c5 100644 --- a/src/commands/StatusCommand.tsx +++ b/src/commands/StatusCommand.tsx @@ -25,7 +25,7 @@ limitations under the License. * are NOT distributed, contributed, committed, or licensed under the Apache License. */ -import { PACKAGE_JSON, SOFTWARE_VERSION } from "../config"; +import { DOCUMENTATION_URL, PACKAGE_JSON, SOFTWARE_VERSION } from "../config"; import { defineInterfaceCommand, findTableCommand } from "./interface-manager/InterfaceCommand"; import { parameters } from "./interface-manager/ParameterParsing"; import { DraupnirContext } from "./CommandHandler"; @@ -57,7 +57,8 @@ export interface StatusInfo { subscribedLists: ListInfo[], subscribedAndProtectedLists: ListInfo[], version: string, - repository: string + repository: string, + documentationURL: string, } export async function listInfo(draupnir: Draupnir): Promise { @@ -90,6 +91,7 @@ export async function draupnirStatusInfo(draupnir: Draupnir): PromiseVersion: {info.version}
Repository: {info.repository}
+ Documentation: {info.documentationURL}
} diff --git a/src/config.ts b/src/config.ts index 272557a8..ed5f9d24 100644 --- a/src/config.ts +++ b/src/config.ts @@ -314,6 +314,7 @@ export const SOFTWARE_VERSION = (() => { return /^(.*)$/m.exec(versionFile)?.at(0) ?? defaultText; })(); +export const DOCUMENTATION_URL = "https://the-draupnir-project.github.io/draupnir-documentation/"; // Command line related functions