Change URL protocol in the ocumentation and sample configs to HTTPS (#623)

* Config: Use variables for similar values
* Configs and Documentation: http -> https, except for localhost
This commit is contained in:
Christian Paul 2023-01-13 16:39:34 +01:00 committed by GitHub
parent 9a7839ce42
commit 67fc55af93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 14 deletions

1
changelog.d/623.doc Normal file
View File

@ -0,0 +1 @@
Change URL protocol in the ocumentation and sample configs to HTTPS.

View File

@ -5,7 +5,7 @@ bridge:
# #
domain: example.com domain: example.com
url: http://localhost:8008 url: http://localhost:8008
mediaUrl: http://example.com mediaUrl: https://example.com
port: 9993 port: 9993
bindAddress: 127.0.0.1 bindAddress: 127.0.0.1
github: github:
@ -154,7 +154,7 @@ widgets:
- fec0::/10 - fec0::/10
roomSetupWidget: roomSetupWidget:
addOnInvite: false addOnInvite: false
publicUrl: http://example.com/widgetapi/v1/static/ publicUrl: https://example.com/widgetapi/v1/static/
branding: branding:
widgetTitle: Hookshot Configuration widgetTitle: Hookshot Configuration
permissions: permissions:

View File

@ -39,7 +39,7 @@ widgets:
# - 2001:db8::/32 # - 2001:db8::/32
# - ff00::/8 # - ff00::/8
# - fec0::/10 # - fec0::/10
publicUrl: http://example.com/widgetapi/v1/static publicUrl: https://example.com/widgetapi/v1/static
branding: branding:
widgetTitle: Hookshot Configuration widgetTitle: Hookshot Configuration
openIdOverrides: openIdOverrides:

View File

@ -74,7 +74,7 @@ To begin, configure your `config.yml`:
```yaml ```yaml
jira: jira:
url: http://yourjirainstance.com # The location of your jira instance. url: https://yourjirainstance.com # The location of your jira instance.
webhook: webhook:
# A secret string generated by you. # A secret string generated by you.
secret: Ieph7iecheiThoo1othaineewieSh1koh2chainohtooyoh4waht1oetoaSoh6oh secret: Ieph7iecheiThoo1othaineewieSh1koh2chainohtooyoh4waht1oetoaSoh6oh
@ -98,7 +98,7 @@ To start with, set up your JIRA instance to support OAuth.
1. The Application Name can be anything, but for simplicty we usually use `matrix-hookshot` 1. The Application Name can be anything, but for simplicty we usually use `matrix-hookshot`
2. The Application Type should be **Generic Application** 2. The Application Type should be **Generic Application**
3. The Consumer key, and shared secret can be any string, they are not used. 3. The Consumer key, and shared secret can be any string, they are not used.
4. The URLs can be any URL, they are not used (e.g. `http://example.com`) 4. The URLs can be any URL, they are not used (e.g. `https://example.com`)
5. Ensure you enable **Create incoming link** 5. Ensure you enable **Create incoming link**
6. Click **Continue** 6. Click **Continue**
6. On the next step: 6. On the next step:

View File

@ -5,11 +5,14 @@ import { Node, YAMLSeq } from "yaml/types";
import { randomBytes } from "crypto"; import { randomBytes } from "crypto";
import { DefaultDisallowedIpRanges } from "matrix-appservice-bridge"; import { DefaultDisallowedIpRanges } from "matrix-appservice-bridge";
const serverName = "example.com";
const hookshotWebhooksUrl = "https://example.com";
export const DefaultConfig = new BridgeConfig({ export const DefaultConfig = new BridgeConfig({
bridge: { bridge: {
domain: "example.com", domain: serverName,
url: "http://localhost:8008", url: "http://localhost:8008",
mediaUrl: "http://example.com", mediaUrl: "https://example.com",
port: 9993, port: 9993,
bindAddress: "127.0.0.1", bindAddress: "127.0.0.1",
}, },
@ -25,7 +28,7 @@ export const DefaultConfig = new BridgeConfig({
timestampFormat: "HH:mm:ss:SSS", timestampFormat: "HH:mm:ss:SSS",
}, },
permissions: [{ permissions: [{
actor: "example.com", actor: serverName,
services: [{ services: [{
service: "*", service: "*",
level: "admin" level: "admin"
@ -33,7 +36,7 @@ export const DefaultConfig = new BridgeConfig({
}], }],
passFile: "passkey.pem", passFile: "passkey.pem",
widgets: { widgets: {
publicUrl: "http://example.com/widgetapi/v1/static", publicUrl: `${hookshotWebhooksUrl}/widgetapi/v1/static`,
addToAdminRooms: false, addToAdminRooms: false,
roomSetupWidget: { roomSetupWidget: {
addOnInvite: false, addOnInvite: false,
@ -64,7 +67,7 @@ export const DefaultConfig = new BridgeConfig({
oauth: { oauth: {
client_id: "foo", client_id: "foo",
client_secret: "bar", client_secret: "bar",
redirect_uri: "https://example.com/bridge_oauth/", redirect_uri: `${hookshotWebhooksUrl}/bridge_oauth/`,
}, },
webhook: { webhook: {
secret: "secrettoken", secret: "secrettoken",
@ -85,7 +88,7 @@ export const DefaultConfig = new BridgeConfig({
}, },
webhook: { webhook: {
secret: "secrettoken", secret: "secrettoken",
publicUrl: "https://example.com/hookshot/" publicUrl: `${hookshotWebhooksUrl}/hookshot/`,
}, },
userIdPrefix: "_gitlab_", userIdPrefix: "_gitlab_",
}, },
@ -96,19 +99,19 @@ export const DefaultConfig = new BridgeConfig({
oauth: { oauth: {
client_id: "foo", client_id: "foo",
client_secret: "bar", client_secret: "bar",
redirect_uri: "https://example.com/bridge_oauth/", redirect_uri: `${hookshotWebhooksUrl}/bridge_oauth/`,
}, },
}, },
generic: { generic: {
allowJsTransformationFunctions: false, allowJsTransformationFunctions: false,
enabled: false, enabled: false,
enableHttpGet: false, enableHttpGet: false,
urlPrefix: "https://example.com/webhook/", urlPrefix: `${hookshotWebhooksUrl}/webhook/`,
userIdPrefix: "_webhooks_", userIdPrefix: "_webhooks_",
waitForComplete: false, waitForComplete: false,
}, },
figma: { figma: {
publicUrl: "https://example.com/hookshot/", publicUrl: `${hookshotWebhooksUrl}/hookshot/`,
instances: { instances: {
"your-instance": { "your-instance": {
teamId: "your-team-id", teamId: "your-team-id",