Skip to content

Commit

Permalink
Merge pull request #437 from the-draupnir-project/gnuxie/draupnir-doc…
Browse files Browse the repository at this point in the history
…umentation-links

Update documentation links and provide a link to the documentation in the status and help commands.
  • Loading branch information
Gnuxie authored May 24, 2024
2 parents 829712c + 5304b26 commit 14aa20e
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sign-off.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>`')
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
Expand All @@ -77,7 +80,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.

Expand All @@ -94,7 +97,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
Expand All @@ -106,16 +109,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/...
Expand All @@ -130,6 +133,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.
2 changes: 1 addition & 1 deletion docs/appservice.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/code-style.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/context.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/development-environment.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/moderators.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/setup_docker.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/setup_selfbuild.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/synapse_module.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/triaging.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/commands/Help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <fragment>
<b>Documentation: </b> <a href={DOCUMENTATION_URL}>{DOCUMENTATION_URL}</a><br/>
<details>
<summary><b>{table.name} commands:</b></summary>
{table.getExportedCommands().map(renderCommandSummary)}
Expand Down
7 changes: 5 additions & 2 deletions src/commands/StatusCommand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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<ListInfo[]> {
Expand Down Expand Up @@ -90,6 +91,7 @@ export async function draupnirStatusInfo(draupnir: Draupnir): Promise<StatusInfo
numberOfProtectedRooms: draupnir.protectedRoomsSet.allProtectedRooms.length,
subscribedLists: unprotectedListProfiles,
subscribedAndProtectedLists: protectedWatchedLists,
documentationURL: DOCUMENTATION_URL,
version: SOFTWARE_VERSION,
repository: PACKAGE_JSON['repository'] ?? 'Unknown'
}
Expand Down Expand Up @@ -117,6 +119,7 @@ export function renderStatusInfo(info: StatusInfo): DocumentNode {
{renderPolicyLists('Subscribed and protected policy rooms', info.subscribedAndProtectedLists)}
<b>Version: </b><code>{info.version}</code><br/>
<b>Repository: </b><code>{info.repository}</code><br/>
<b>Documentation: </b> <a href={info.documentationURL}>{info.documentationURL}</a><br/>
</root>
}

Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 14aa20e

Please sign in to comment.