Implement built-in docs, update settings and URLs across the app.

This commit is contained in:
Buster Neece 2023-10-10 15:51:18 -05:00
parent c29cfbb01d
commit 32cb16038e
No known key found for this signature in database
26 changed files with 68 additions and 5360 deletions

View File

@ -5,6 +5,10 @@ release channel, you can take advantage of these new features and fixes.
## New Features/Changes
- **Built-in Documentation**: AzuraCast now bundles its own documentation alongside the application itself. By
visiting `/docs`, you can see the documentation as it existed when the version you're using was released. This is
useful if you're on an older version or in an environment without good Internet connectivity.
- The "Listeners by Time Period" report has been expanded to include showing either "Average Listeners" (the previous
mode) or "Unique Listeners", similar to the dashboard charts. You can also view per-hour totals for every given day of
the week.
@ -321,7 +325,7 @@ multi-tenant installations (i.e. resellers). Upgrading is strongly recommended i
high-performance (Websocket/SSE) Now Playing updates system due to an error in the library on Ubuntu 22.04. We have
since found an excellent replacement library and implemented it. If you're using Websockets or Server-Sent Events (
SSE) for your Now Playing updates, you'll need to make minor changes to how you connect, which we've documented
here: https://docs.azuracast.com/en/developers/apis/now-playing-data#high-performance-updates
here: https://www.azuracast.com/docs/developers/now-playing-data/#high-performance-updates
- On Mastodon and Twitter posts, you can now specify different message bodies for the different web hook trigger types (
i.e. live DJ connect/disconnect or station online/offline).
@ -760,7 +764,7 @@ multi-tenant installations (i.e. resellers). Upgrading is strongly recommended i
installation with fewer containers. If you are not using the multi-site setup (i.e. hosting another site on the same
Docker installation), no changes are required to your installation. If you want to continue using the multi-site
installation, you can follow
the [instructions in our documentation](https://docs.azuracast.com/en/administration/docker/multi-site-installation).
the [instructions in our documentation](https://www.azuracast.com/docs/administration/multi-site-installation/).
- We have updated how we handle Listener Reports to significantly reduce both memory and overall processing times,
meaning stations with large listener counts can now more easily view and export reports for long time periods.
@ -1965,7 +1969,7 @@ important updates to the software in that time, especially in the fields of reli
the "Now Playing" API, which is a rich summary of the state of a radio station at the moment. To improve performance
of more popular stations using our software, we've introduced two new methods of accessing this data: a static JSON
file and a live Websocket/EventSource-driven plugin. You can read more on our
new [Now Playing Data APIs Guide](https://docs.azuracast.com/en/developers/apis/now-playing-data).
new [Now Playing Data APIs Guide](https://www.azuracast.com/docs/developers/now-playing-data/).
## Bug Fixes and Minor Updates

View File

@ -55,6 +55,9 @@ RUN bash /bd_build/mariadb/setup.sh
COPY ./util/docker/redis /bd_build/redis/
RUN bash /bd_build/redis/setup.sh
COPY ./util/docker/docs /bd_build/docs/
RUN bash /bd_build/docs/setup.sh
RUN bash /bd_build/cleanup.sh \
&& rm -rf /bd_build

View File

@ -17,12 +17,12 @@ currently beta software.
![](https://www.azuracast.com/img/ScreenshotTour.gif)
You can learn more about AzuraCast via our [Documentation](https://docs.azuracast.com/):
You can learn more about AzuraCast via our [Documentation](https://www.azuracast.com/docs):
- [About AzuraCast](https://docs.azuracast.com/en/home#core-features)
- [Included Software](https://docs.azuracast.com/en/home#whats-included)
- [System Requirements](https://docs.azuracast.com/en/getting-started/requirements)
- [Installation](https://docs.azuracast.com/en/getting-started/installation)
- [About AzuraCast](https://www.azuracast.com/docs/#core-features)
- [Included Software](https://www.azuracast.com/docs/#whats-included)
- [System Requirements](https://www.azuracast.com/docs/getting-started/requirements/)
- [Installation](https://www.azuracast.com/docs/getting-started/installation/)
## Live Demo
@ -36,7 +36,8 @@ Want to see AzuraCast for yourself? Visit our demo site at [demo.azuracast.com](
To install AzuraCast, you should have a basic understanding of the Linux shell terminal. Once installed, every aspect of
your radio station can be managed via AzuraCast's web interface.
Follow our **[installation guide](https://docs.azuracast.com/en/getting-started/installation)** for instructions on how
Follow our **[installation guide](https://www.azuracast.com/docs/getting-started/installation/)** for instructions on
how
to install AzuraCast on your own server.
## License
@ -49,7 +50,7 @@ and open-source software, and pull requests are always welcome.
## Need Help?
If you need help with AzuraCast, the first place you should visit is
our [Support page](https://docs.azuracast.com/en/user-guide/troubleshooting)
our [Support page](https://www.azuracast.com/docs/help/troubleshooting/)
, which features solutions to a number of commonly encountered issues and questions, as well as instructions on how to
check your server's log files for more details. If you do need our help via GitHub, supplying these logs is absolutely
essential in helping us diagnose and resolve your issue.

View File

@ -29,7 +29,7 @@ return static function (RouteCollectorProxy $app) {
$group->get(
'',
function (ServerRequest $request, Response $response, ...$params): ResponseInterface {
return $response->withRedirect('/static/api/index.html');
return $response->withRedirect('/docs/api/');
}
)->setName('api:index:index');

View File

@ -17,15 +17,11 @@ services:
labels:
- "com.centurylinklabs.watchtower.scope=azuracast"
# Want to customize the HTTP/S ports? Follow the instructions here:
# https://docs.azuracast.com/en/administration/docker#using-non-standard-ports
# https://www.azuracast.com/docs/administration/docker/#using-non-standard-ports
ports:
- '${AZURACAST_HTTP_PORT:-80}:80'
- '${AZURACAST_HTTPS_PORT:-443}:443'
- '${AZURACAST_SFTP_PORT:-2022}:2022'
# This default mapping is the outgoing and incoming ports for the first 50 stations.
# You can override this port mapping in your own docker-compose.override.yml file.
# For instructions, see:
# https://docs.azuracast.com/en/administration/docker#expanding-the-station-port-range
- '8000:8000'
- '8005:8005'
- '8006:8006'

View File

@ -16,7 +16,7 @@
>
<template #description>
<a
href="https://docs.azuracast.com/en/getting-started/updates/release-channels"
href="/docs/getting-started/updates/release-channels/"
target="_blank"
>
{{ $gettext('Learn more about release channels in the AzuraCast docs.') }}

View File

@ -57,7 +57,7 @@
<template #footer_actions>
<a
class="btn btn-info"
href="https://docs.azuracast.com/en/getting-started/updates/release-channels"
href="/docs/getting-started/updates/release-channels/"
target="_blank"
>
<icon :icon="IconInfo" />
@ -137,7 +137,7 @@
<a
class="btn btn-info"
href="https://docs.azuracast.com/en/getting-started/updates"
href="/docs/getting-started/updates/"
target="_blank"
>
<icon :icon="IconInfo" />

View File

@ -93,13 +93,26 @@
{{ $gettext('Switch Theme') }}
</a>
</li>
<li class="dropdown-divider">
&nbsp;
</li>
<li>
<a
class="dropdown-item"
href="https://docs.azuracast.com/en/user-guide/troubleshooting"
href="/docs"
target="_blank"
>
<icon :icon="IconSupport" />
{{ $gettext('Documentation') }}
</a>
</li>
<li>
<a
class="dropdown-item"
href="/docs/help/troubleshooting"
target="_blank"
>
<icon :icon="IconHelp" />
{{ $gettext('Help') }}
</a>
</li>
@ -155,7 +168,7 @@
<span v-html="platform" /><br>
{{ $gettext('Like our software?') }}
<a
href="https://docs.azuracast.com/en/contribute/donate"
href="https://donate.azuracast.com/"
target="_blank"
>
{{ $gettext('Donate to support AzuraCast!') }}
@ -170,6 +183,7 @@ import useTheme from "~/functions/theme";
import {
IconAccountCircle,
IconExitToApp,
IconHelp,
IconHome,
IconInvertColors,
IconMenu,

View File

@ -43,7 +43,7 @@
</p>
<p class="card-text">
<a
href="https://docs.azuracast.com/en/user-guide/troubleshooting"
href="/docs/help/troubleshooting/"
target="_blank"
>
{{ $gettext('Support Documents') }}

View File

@ -88,7 +88,7 @@
>
<template #description>
<a
href="https://docs.azuracast.com/en/user-guide/playlists/advanced-playlists"
href="/docs/user-guide/playlists/#advanced-playlists"
target="_blank"
>
{{ $gettext('Learn about Advanced Playlists') }}

View File

@ -79,7 +79,7 @@
{{ $gettext('Setup instructions for broadcasting software are available on the AzuraCast wiki.') }}
<br>
<a
href="https://docs.azuracast.com/en/user-guide/streaming-software"
href="/docs/user-guide/streaming-software/"
target="_blank"
>
{{ $gettext('AzuraCast Wiki') }}

View File

@ -98,7 +98,7 @@ final class UpdateCheck
);
$notification->type = FlashLevels::Info->value;
$notification->actionLabel = __('About Release Channels');
$notification->actionUrl = 'https://docs.azuracast.com/en/getting-started/updates/release-channels';
$notification->actionUrl = '/docs/getting-started/updates/release-channels/';
$event->addNotification($notification);
}

View File

@ -27,7 +27,7 @@ $this->layout(
)?>
</p>
<a class="btn btn-primary btn-block mt-2 mb-3" href="https://docs.azuracast.com/en/administration/users#resetting-an-account-password" target="_blank">
<a class="btn btn-primary btn-block mt-2 mb-3" href="/docs/administration/users/#resetting-an-account-password" target="_blank">
<?=__('Password Reset Instructions')?>
</a>
</div>

18
util/docker/docs/setup.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -e
set -x
export DEBIAN_FRONTEND=noninteractive
mkdir -p /tmp/docs
cd /tmp/docs
# Updated 2023-10-10
git clone https://github.com/AzuraCast/azuracast.com.git .
cd builtin
bash build.sh
mkdir -p /var/azuracast/docs
cp -TR /tmp/docs/builtin/dist/ /var/azuracast/docs/
rm -rf /tmp/docs

View File

@ -80,6 +80,12 @@ server {
try_files $uri =404;
}
# Built-in docs
location /docs {
alias /var/azuracast/docs;
index index.html;
}
# Serve a static version of the nowplaying data for non-PHP-blocking delivery.
location /api/nowplaying_static {
expires 10s;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

View File

@ -1,60 +0,0 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after
{
box-sizing: inherit;
}
body
{
margin:0;
background: #fafafa;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "/api/openapi.yml",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
// End Swagger UI call region
window.ui = ui;
};
</script>
</body>
</html>

View File

@ -1,75 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<title>Swagger UI: OAuth2 Redirect</title>
</head>
<body>
<script>
'use strict';
function run () {
var oauth2 = window.opener.swaggerUIRedirectOauth2;
var sentState = oauth2.state;
var redirectUrl = oauth2.redirectUrl;
var isValid, qp, arr;
if (/code|token|error/.test(window.location.hash)) {
qp = window.location.hash.substring(1);
} else {
qp = location.search.substring(1);
}
arr = qp.split("&");
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
qp = qp ? JSON.parse('{' + arr.join() + '}',
function (key, value) {
return key === "" ? value : decodeURIComponent(value);
}
) : {};
isValid = qp.state === sentState;
if ((
oauth2.auth.schema.get("flow") === "accessCode" ||
oauth2.auth.schema.get("flow") === "authorizationCode" ||
oauth2.auth.schema.get("flow") === "authorization_code"
) && !oauth2.auth.code) {
if (!isValid) {
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "warning",
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
});
}
if (qp.code) {
delete oauth2.state;
oauth2.auth.code = qp.code;
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
} else {
let oauthErrorMsg;
if (qp.error) {
oauthErrorMsg = "["+qp.error+"]: " +
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
(qp.error_uri ? "More info: "+qp.error_uri : "");
}
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "error",
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
});
}
} else {
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
}
window.close();
}
window.addEventListener('DOMContentLoaded', function () {
run();
});
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long