Replace hardcoded hosts with example.com placeholders
This commit is contained in:
@@ -22,7 +22,7 @@ Node-RED nodes for the [Zammad](https://zammad.org/) helpdesk API. Part of the
|
|||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- An existing [nextcloud-node-red](https://kode.hannesahlin.se/n3wk/nextcloud-nodered-ocs-api) installation.
|
- An existing [nextcloud-node-red](https://kode.hannesahlin.se/n3wk/nextcloud-nodered-ocs-api) installation.
|
||||||
- A Zammad API token with `ticket.agent` permission, created while logged into `support.hanssonit.se`.
|
- A Zammad API token with `ticket.agent` permission.
|
||||||
|
|
||||||
### Quick install (recommended)
|
### Quick install (recommended)
|
||||||
|
|
||||||
@@ -53,10 +53,10 @@ The integrate script:
|
|||||||
|
|
||||||
| Method | Header | Notes |
|
| Method | Header | Notes |
|
||||||
|--------|--------|-------|
|
|--------|--------|-------|
|
||||||
| Token (preferred) | `Authorization: Token token=<your-token>` | Create token on support.hanssonit.se with `ticket.agent` permission |
|
| Token (preferred) | `Authorization: Token token=<your-token>` | Create token with `ticket.agent` permission |
|
||||||
| Basic | `Authorization: Basic base64(user:pass)` | Username is typically just `Hannes` (not full email) |
|
| Basic | `Authorization: Basic base64(user:pass)` | Username is typically just `Hannes` (not full email) |
|
||||||
|
|
||||||
**Important:** Base URL must be `https://support.hanssonit.se/api/v1/`.
|
**Important:** Base URL is the Zammad API v1 URL, e.g. `https://example.com/api/v1/`.
|
||||||
Using `zammad.kafit.se` or other hosts will result in authentication errors.
|
Using `zammad.kafit.se` or other hosts will result in authentication errors.
|
||||||
|
|
||||||
## Node Details
|
## Node Details
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
category: "config",
|
category: "config",
|
||||||
defaults: {
|
defaults: {
|
||||||
name: { value: "" },
|
name: { value: "" },
|
||||||
baseUrl: { value: "https://support.hanssonit.se/api/v1", required: true },
|
baseUrl: { value: "https://example.com/api/v1", required: true },
|
||||||
useToken: { value: true }
|
useToken: { value: true }
|
||||||
},
|
},
|
||||||
credentials: {
|
credentials: {
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-config-input-baseUrl"><i class="fa fa-server"></i> Base URL</label>
|
<label for="node-config-input-baseUrl"><i class="fa fa-server"></i> Base URL</label>
|
||||||
<input type="text" id="node-config-input-baseUrl" placeholder="https://support.hanssonit.se/api/v1">
|
<input type="text" id="node-config-input-baseUrl" placeholder="https://example.com/api/v1">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-config-input-useToken"><i class="fa fa-lock"></i> Use Token Auth</label>
|
<label for="node-config-input-useToken"><i class="fa fa-lock"></i> Use Token Auth</label>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<label for="node-config-input-token"><i class="fa fa-key"></i> API Token</label>
|
<label for="node-config-input-token"><i class="fa fa-key"></i> API Token</label>
|
||||||
<input type="text" id="node-config-input-token" autocomplete="off">
|
<input type="text" id="node-config-input-token" autocomplete="off">
|
||||||
<div class="form-tips" style="color:#888; font-size:11px; margin-top:4px;">
|
<div class="form-tips" style="color:#888; font-size:11px; margin-top:4px;">
|
||||||
Create token at https://support.hanssonit.se while logged in.<br>
|
Create token at your Zammad instance while logged in.<br>
|
||||||
Required permission: <b>ticket.agent</b>
|
Required permission: <b>ticket.agent</b>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,8 +60,8 @@
|
|||||||
<h3>Details</h3>
|
<h3>Details</h3>
|
||||||
<p>Configure your Zammad instance connection.</p>
|
<p>Configure your Zammad instance connection.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Base URL</b> – Must be <code>https://support.hanssonit.se/api/v1</code> (do not use zammad.kafit.se).</li>
|
<li><b>Base URL</b> – Your Zammad API v1 URL, e.g. <code>https://example.com/api/v1</code></li>
|
||||||
<li><b>Token Auth</b> – Preferred. Create token on support.hanssonit.se with <code>ticket.agent</code> permission.</li>
|
<li><b>Token Auth</b> – Preferred. Create token with <code>ticket.agent</code> permission.</li>
|
||||||
<li><b>Basic Auth</b> – Username is typically just <code>Hannes</code> (not full email).</li>
|
<li><b>Basic Auth</b> – Username is typically just <code>Hannes</code> (not full email).</li>
|
||||||
</ul>
|
</ul>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ module.exports = function (RED) {
|
|||||||
RED.nodes.createNode(this, config);
|
RED.nodes.createNode(this, config);
|
||||||
const node = this;
|
const node = this;
|
||||||
|
|
||||||
node.baseUrl = (config.baseUrl || "https://support.hanssonit.se/api/v1").replace(/\/+$/, "");
|
node.baseUrl = (config.baseUrl || "https://example.com/api/v1").replace(/\/+$/, "");
|
||||||
node.useToken = config.useToken !== false;
|
node.useToken = config.useToken !== false;
|
||||||
node.token = config.token || "";
|
node.token = config.token || "";
|
||||||
node.username = config.username || "";
|
node.username = config.username || "";
|
||||||
|
|||||||
Reference in New Issue
Block a user