update readme and api docs
This commit is contained in:
78
README.md
78
README.md
@@ -1,72 +1,10 @@
|
||||
## Note for Visitors
|
||||
* This README mainly contains information for operation but not usage. API documentation is available [here](https://enstrayed.com/posts/20240409-API-Documentation.html).
|
||||
* Have feedback or experiencing a problem with an endpoint? Please [open a GitHub issue](https://github.com/Enstrayed/enstrayedapi/issues/new).
|
||||
* Security problem? [Open a ticket here](https://helpdesk.enstrayed.com/open.php) with the topic set as 'Responsible Disclosure'.
|
||||
## Note for passersby
|
||||
* If you have feedback or are experiencing a problem, [click here](https://enstrayed.com/helpdesk/ticket/new?form=TBD).
|
||||
* If you need to report a security issue, [click here](https://enstrayed.com/helpdesk/ticket/new?form=TBD).
|
||||
* This code is unlicensed but I don't really care if you use parts of it (I don't know why you would though).
|
||||
|
||||
## Configuration
|
||||
|
||||
<details> <summary>Configuration</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"oidc": {
|
||||
"clientId": "nowaybuddy",
|
||||
"tokenUrl": "https://login.enstrayed.com/application/o/token/",
|
||||
"userinfoUrl": "https://login.enstrayed.com/application/o/userinfo/",
|
||||
"authorizeUrl": "https://login.enstrayed.com/application/o/authorize/",
|
||||
"clientSecret": "nowaybuddy"
|
||||
},
|
||||
"email": {
|
||||
"host": "orenco.enstrayed.com",
|
||||
"password": "nowaybuddy",
|
||||
"username": "nowaybuddy"
|
||||
},
|
||||
"nowplaying": {
|
||||
"cider": {
|
||||
"hosts": [],
|
||||
"apiKeys": []
|
||||
},
|
||||
"lastfm": {
|
||||
"apiKey": "nowaybuddy",
|
||||
"target": "enstrayed"
|
||||
},
|
||||
"jellyfin": {
|
||||
"host": "http://hawthorne.pizzly-catfish.ts.net:8096",
|
||||
"apiKey": "nowaybuddy",
|
||||
"target": "nathan",
|
||||
"hostPublic": "https://jellyfin.enstrayed.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details> <summary>Komodo Files</summary>
|
||||
|
||||
|
||||
```toml
|
||||
[[build]]
|
||||
name = "enstrayedapi"
|
||||
[build.config]
|
||||
builder = "local"
|
||||
repo = "Enstrayed/enstrayedapi"
|
||||
webhook_secret = "nowaybuddy"
|
||||
```
|
||||
```toml
|
||||
[[deployment]]
|
||||
name = "enstrayedapi"
|
||||
[deployment.config]
|
||||
server = "hawthorne"
|
||||
image.type = "Build"
|
||||
image.params.build = "enstrayedapi"
|
||||
network = "caddy"
|
||||
restart = "unless-stopped"
|
||||
extra_args = ["--network=postgres"]
|
||||
environment = """
|
||||
DATABASE_URL=postgres://nowaybuddy:nowaybuddy@postgres:5432/api
|
||||
"""
|
||||
```
|
||||
|
||||
</details>
|
||||
## Links
|
||||
* [Published API Documentation](https://enstrayed.com/posts/99999999-API-Documentation.html)
|
||||
* [Internal Use Endpoints](https://git.enstrayed.com/enstrayed/enstrayedapi/wiki/Internal-Use-Endpoints)
|
||||
* [Configuration Reference](https://git.enstrayed.com/enstrayed/enstrayedapi/wiki/Configuration)
|
||||
* [Komodo Configuration](https://git.enstrayed.com/enstrayed/enstrayedapi/wiki/Komodo)
|
||||
@@ -16,16 +16,14 @@
|
||||
<body>
|
||||
<a href="/">Return to enstrayed.com</a>
|
||||
<h1>API Documentation</h1>
|
||||
<p>This page was last updated 2025-12-12.</p>
|
||||
|
||||
<!-- <p>Source Code & Issue Tracker: <a href="https://github.com/enstrayed/enstrayedapi">github.com/enstrayed/enstrayedapi</a></p> -->
|
||||
<p>This page was last updated 2025-12-15.</p>
|
||||
|
||||
<hr>
|
||||
<h2>Attention: This page is overdue for a rewrite and the information currently presented may not be accurate.</h2>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/nowplaying</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/nowplaying.js">nowplaying.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/nowplaying.js">nowplaying.js</a>
|
||||
<div>
|
||||
<span>GET</span>
|
||||
</div>
|
||||
@@ -35,7 +33,7 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/nowplayingbeta</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/nowplaying.js">nowplaying.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/nowplaying.js">nowplaying.js</a>
|
||||
<div>
|
||||
<span>GET</span>
|
||||
</div>
|
||||
@@ -45,7 +43,7 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/etyd/*</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/etyd.js">etyd.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/etyd.js">etyd.js</a>
|
||||
<div>
|
||||
<span>GET</span>
|
||||
<span>POST</span>
|
||||
@@ -66,7 +64,7 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/sendemail</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/mailjet.js#L3">mailjet.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/email.js">email.js</a>
|
||||
<div>
|
||||
<span>POST</span>
|
||||
</div>
|
||||
@@ -87,7 +85,7 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/ip</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/ip.js">ip.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/ip.js">ip.js</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
|
||||
@@ -95,7 +93,7 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/headers</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/ip.js">ip.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/ip.js">ip.js</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
|
||||
@@ -103,52 +101,17 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/auth/whoami</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/new-db/routes/auth.js">auth.js:6</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/auth.js">auth.js</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
<p>Returns JSON with the username of the token owner as well as what scopes the token has access to.</p>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2 id="jumplink_authlogin">/api/auth/login</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/new-db/routes/auth.js">auth.js:23</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
<p>Redirects the user to ECLS to login. The <code>state</code> parameter can be used to specify how the login flow will behave. The accepted "states" are:</p>
|
||||
<ul>
|
||||
<li><code>redirect</code> - Redirects the user to a page after logging in. This paramter requires the <code>destination</code> paramter to also be set with the URL the user will be redirected to.</li>
|
||||
<li><code>display</code> - Displays the generated token to the user after login. Currently, this still writes the new token to the <code>APIToken</code> cookie, though this is planned to change.</li>
|
||||
<li><code>close</code> - This will close the page after logging in. This requires the page to be opened with JavaScript otherwise it will not automatically close.</li>
|
||||
</ul>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/auth/logout</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/new-db/routes/auth.js">auth.js:40</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/auth.js">auth.js</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
<p>Invalidates the token used to access the endpoint.</p>
|
||||
|
||||
<!-- <div class="inlineheader">
|
||||
<h2>/api/auth/callback</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/new-db/routes/auth.js">auth.js:57</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
<p><b>Internal Use Only. </b>This is the endpoint used by ECLS to finish the login flow. It will write the newly created token to the <code>APIToken</code> cookie as well as performing the action set by <code>state</code>, see <a href="#jumplink_authlogin">login endpoint</a>.</p>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/helpdesk/forms/*</h2>
|
||||
<a>helpdesk.js:15</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
|
||||
<p><b>Internal Use Only. </b>Serves all files in the <code>website/helpdesk/forms</code> directory for use in the Helpdesk frontend.</p> -->
|
||||
|
||||
<!-- <div class="inlineheader">
|
||||
<h2>/dynamic/icon/*</h2>
|
||||
<a>dynamic.js:3</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
|
||||
<p><b>Internal Use Only. </b>Returns the requested icon (stored in <code>website/dynamic/icons</code>) in any color (hex) specified in the URL. Example: <code>/dynamic/icon/github/00ff00</code> will return the GitHub logo in neon green.</p> -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user