Skip to content

Commit

Permalink
βœ¨πŸ“(website): implement diataxis, reorganize docs
Browse files Browse the repository at this point in the history
  • Loading branch information
debloper committed Sep 3, 2024
1 parent 1c3d403 commit dd3a3da
Show file tree
Hide file tree
Showing 23 changed files with 666 additions and 590 deletions.
31 changes: 19 additions & 12 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default defineConfig({
github: 'https://github.com/debloper/xplex',
},
sidebar: [
{ slug: 'quick-start' },
{
label: 'Introduction',
items: [
Expand All @@ -33,21 +34,27 @@ export default defineConfig({
],
},
{
label: 'Installation',
items: [
'setup/index',
'setup/host',
'setup/precheck',
'setup/docker',
'setup/native',
],
label: 'How-to Setup',
autogenerate: { directory: 'setup' },
},
{
label: 'Invocation',
label: 'References',
items: [
'usage/index',
'usage/ingests',
'usage/streaming',
{
label: 'Choose',
items: [
'refs/choose/hosts',
'refs/choose/clouds',
],
},
{
label: 'Check',
autogenerate: { directory: 'refs/check' },
},
{
label: 'Manage',
autogenerate: { directory: 'refs/manage' },
},
],
},
],
Expand Down
19 changes: 0 additions & 19 deletions docs/src/content/docs/intro/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,6 @@ There's no transcoding involved, so not only the stream quality remains the same

<Xplex /> is **free and open source software**. You can run it on your own home server, or use a cloud server to host it. The only cost you would incur is the server cost; and the exact value depends on your cloud provider and their pricing of the compute unit of your choice.

:::note[Choosing Cloud Host]
Here's a price comparison of cheapest compute units provided by some popular cloud providers:
| Cloud Host | Compute | Bandwidth | Cost/month | Referral Link |
|--------------|--------------|-----------|------------|---------------|
| DigitalOcean | 1core, 0.5GB | 500GB | $4 | [$200 starting credit](https://m.do.co/c/97a76c3ca7ad) |
| Linode | 1core, 1.0GB | 1000GB | $5 | Coming Soon |
| Vultr | 1core, 0.5GB | 500GB | $2.5 | [$10 starting credit](https://www.vultr.com/?ref=9638716) |

Either of them should be a good option; however, the author has only extensively used & tested DigitalOcean. If you face any quirk or edge case on the other servers, please [let us know](https://github.com/debloper/xplex/issues/new).
:::

:::tip[Free Test Run]
By using the referral links to sign up, you'll receive ample credits to explore `xplex` for a couple of months at no cost to you.

While we have no affiliation with the mentioned cloud providers, should you choose to continue their services after the credits expire and spend a small amount ($25 on DO, $10 on Vultr), we'll receive an one-time cloud credit of the same value.

There's no obligation, but your support would make a meaningful contribution to the project.
:::

---

Hopefully you now have a good idea of what to expect from <Xplex /> as a user. But, if you're still curious to know more about its internal details, let's dive in a bit deeper...
4 changes: 2 additions & 2 deletions docs/src/content/docs/intro/internals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: The explanation of xplex's technical implementation.
import Xplex from '@components/Xplex.astro';
import { FileTree } from '@astrojs/starlight/components';

## Strategic Abstract
## Objective Abstract

At its core, <Xplex /> is an [rtmp-enabled](https://github.com/arut/nginx-rtmp-module) [nginx server](http://nginx.org/) that pushes identical copies of incoming RTMP streams to one or more pre-configured RTMP endpoints.

Expand Down Expand Up @@ -81,5 +81,5 @@ while leaving room for progressive enhancements
- [ ] ...and more

:::note[Missing Something?]
If you can think of the missing pieces that will make understanding this technical overview easier and more enjoyable; or you have a question about the implementation, please [let us know](https://github.com/debloper/xplex/issues/new).
If you can think of the missing pieces that will make understanding this technical overview easier and more enjoyable; or you have a question about the implementation, please [let us know](https://github.com/debloper/xplex/issues).
:::
32 changes: 32 additions & 0 deletions docs/src/content/docs/quick-start.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Quick Start
description: Abridged manual for setting up xplex.
---
import Xplex from '@components/Xplex.astro';
import { Steps } from '@astrojs/starlight/components';

:::note[Brevity Alert]
This gets you jump-started with <Xplex />. For more comprehensive docs, use the [how-to](/setup) guide.
:::

<Steps>

1. ```bash title="Run the xplex container"
docker run -d --name xplex -p 80:80 -p 1935:1935 xplex/xplex
```

2. Open a browser & access your <Xplex isHQ /> dashboard at `http://<hostname-or-IP>/` to ensure <Xplex /> is up & running.

3. Add the [ingest URLs](/refs/manage/ingest) of the platforms you want to stream to (e.g. YouTube, Twitch etc), in the <Xplex isHQ /> dashboard & apply changes to reload new settings.

4. Configure your streaming software to send the stream to <Xplex />, by setting the streaming server URL to `rtmp://<xplex-hostname-or-IP>:1935/live`.

5. Start streaming!

<span style="font-size: 4rem;">πŸš€πŸš€πŸš€</span>

</Steps>

:::tip[For more details]
Check the [docker setup guide](/setup/docker) for more detailed instructions.
:::
29 changes: 29 additions & 0 deletions docs/src/content/docs/refs/check/docker.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Docker Installation
description: How to install & verify Docker on a Debian based system.
---
import Xplex from '@components/Xplex.astro';
import { Badge, Steps } from '@astrojs/starlight/components';

Docker is necessary for running <Xplex /> as a container. If you went with the [system image with Docker preinstalled](/setup/host#option-1-set-up-a-new-cloud-host), or if you want to run <Xplex /> natively, then you can skip this section.

## Verify Installation

Before we get into the installation steps, let's verify if Docker is already installed on your system.

```bash title="Check Docker Installation"
docker --version
sudo docker run hello-world
```

If you see a version number and the `hello world` container runs without any issue, then Docker is already installed.

If not, then let's get started with the installation.

## Installation Script

```bash title="Get Docker One-liner"
curl -fsSL https://get.docker.com | sudo sh
```

This script will install Docker on any Linux host. Make sure to verify the installation by running the commands mentioned above.
55 changes: 55 additions & 0 deletions docs/src/content/docs/refs/check/nginx.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Conflicting nginx
description: Check if existing nginx is running on the host system.
---
import Xplex from '@components/Xplex.astro';
import { Badge, Card, Icon, Steps } from '@astrojs/starlight/components';

You should ensure your host is <Badge text="NOT" variant="caution" /> already running `nginx` which will conflict with <Xplex />.

These following checks are especially necessary if you're reusing a host system, which may already have `nginx` installed & running for other services:

<Steps>

1. <details>
<summary>Is `nginx` running as a service/daemon?</summary>
```bash title="Check nginx service status"
systemctl status nginx
# should be inactive or not found
```
If it shows `active` or `enabled`, it's up to you to decide whether to stop/disable it. It may be running important services on the host, so be careful of stopping or disabling it.
:::danger[NO WARRANTY & NO REFUNDS!]
Run the following commands only if you are absolutely sure that removing existing nginx won't break any critical services on the host, or you don't care if it does.
:::
```bash title="Remove previous nginx service from host"
systemctl stop nginx
systemctl mask nginx
systemctl disable nginx
```
</details>
2. <details>
<summary>Is `nginx` running as a process?</summary>
```bash title="Check nginx process status"
ps aux | grep nginx
```
Even in this case, if it's running, then it's up to you to decide whether to stop it. It may break important services on the host, so be careful of stopping it.
:::danger[NO WARRANTY & NO REFUNDS!]
Run the following commands only if you are absolutely sure that removing existing nginx won't break any critical services on the host, or you don't care if it does.
:::
```bash title="Stop existing nginx process"
nginx -s stop
```
</details>
3. <details>
<summary>Is `nginx` installed on host?</summary>
```bash title="Check if nginx is available in $PATH"
which nginx
```
If nginx is installed, but from the previous steps you've verified that it's not running, then you can safely ignore it. We will use a different (RTMP enabled) `nginx` build for <Xplex />.
You can also choose to remove it if you're sure it'll not be needed (*not recommended*).
</details>
</Steps>
26 changes: 26 additions & 0 deletions docs/src/content/docs/refs/check/ports.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Port Availability
description: Check if required ports are available on the host system.
---
import Xplex from '@components/Xplex.astro';
import { Badge, Card, Icon, Steps } from '@astrojs/starlight/components';

<Xplex /> needs to listen on ports `80` (HTTP) & `1935` (RTMP) to serve the web dashboard & accept RTMP streams. So, you should ensure that these ports are available & not being used by other services.

```bash {2} title="Check ports availability"
netstat -tuln | grep -E ':80|:1935'
```

If it returns some output similar to this:

```bash title="Output if ports are busy"
user@host:~# netstat -tuln | grep -E ':80|:1935'
tcp 0 0 0.0.0.0:1935 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp6 0 0 :::1935 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
```

Then that means the <Badge text="ports are in use" variant="danger" /> by some other process. You should investigate further to find out which service is using the ports & decide whether to stop/disable it. In such cases it's better to <Badge text="use a fresh host system" variant="caution" /> than punching holes in an existing setup.

But if it returns <Badge text="no output" />, then the <Badge text="ports are available" /> & not being used by other services. πŸŽ‰
47 changes: 47 additions & 0 deletions docs/src/content/docs/refs/check/superuser.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Superuser Access
description: Check if you have superuser access to the host system.
---
import Xplex from '@components/Xplex.astro';
import { Badge, Card, Icon, Steps } from '@astrojs/starlight/components';

As we'll be installing software and configuring services, it's a must to have superuser access to the host system. Try which one ever of the following options fits you the most, to verify root access:

<Steps>

1. <details>
<summary>I used `root` user to login to this host</summary>
```bash title="Verify being root user"
whoami
```
If it returns `root` then you have root access.
</details>

2. <details>
<summary>My regular user has superuser privileges</summary>
```bash title="Verify being superuser"
sudo -i
# you will be prompted to enter your password
```
If it succeeds then you've superuser access.
</details>
3. <details>
<summary>I know the `root` password, but my regular user isn't a superuser</summary>
```bash title="Verify having root credentials"
su
# you will be prompted to enter root password
```
If it succeeds then you've root access. While it's possible to run the setup as root, it's generally not recommended.
```bash title="Add normal user to superuser group"
# replace `<username>` with actual username
adduser <username> sudo
# this is for Debian/Ubuntu based systems
```
Once you login with that user the next time, you can use `sudo` to run commands with superuser privileges. Please verify it's working before proceeding to the next steps.
</details>

</Steps>

Once you've verified having superuser access, press <kbd>Ctrl+D</kbd> to exit root shell to become regular (albeit sudoer) user or type `exit` in the terminal and press <kbd>Enter</kbd> to the same effect.
Loading

0 comments on commit dd3a3da

Please sign in to comment.