Skip to content

Commit

Permalink
Upd: layout improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Sep 22, 2024
1 parent 8c053c1 commit 788f65c
Show file tree
Hide file tree
Showing 62 changed files with 131 additions and 166 deletions.
2 changes: 1 addition & 1 deletion docs/010-installation/compiling/build-sh.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ You can self create packages for your distribution:
- `./build.sh pkgdebian` for Debian based distributions (e.g. Ubuntu. Raspbian)
- `./build.sh pkgrpm` for RPM based distributions (e.g. openSUSE, Fedora)
- `./build.sh pkgdocker` to create a Docker image based on Alpine Linux
- For gentoo you have to create a local overlay: https://wiki.gentoo.org/wiki/Custom_repository, the ebuild file is in the directory `contrib/packaging/gentoo`
- For gentoo you have to create a [local overlay](https://wiki.gentoo.org/wiki/Custom_repository), the ebuild file is in the directory `contrib/packaging/gentoo`
- Build a [OpenWrt package](openwrt.md)

### Cross compiling debian packages
Expand Down
14 changes: 7 additions & 7 deletions docs/010-installation/compiling/freebsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ It is expected you have /usr/ports populated.

1. Copy the contents of `contrib/packaging/freebsd` to `/usr/ports`
2. Generate the checksums:
```
``` sh
cd /usr/ports/multimedia/mympd/
make makesum
```
``` sh
3. Install myMPD:
```
``` sh
make install
make clean
```
Expand All @@ -36,20 +36,20 @@ I would use the poudriere's ports tree installed in `/usr/local/poudriere/ports/
1. Copy the contents of `contrib/packaging/freebsd` to `/usr/local/poudriere/ports/local`
2. Generate the checksums:
```
``` sh
cd /usr/local/poudriere/ports/local/multimedia/mympd
make makesum
```
3. If the previous step fails, you may need to create temporary symlink from `/usr/ports` to this local tree (revert it back afterwards):
```
``` sh
mv /usr/ports /usr/ports.bu
ln -s /usr/local/poudriere/ports/local /usr/ports
```
4. Build the myMPD package (consult the options with the handbook):
```
``` sh
poudriere bulk -j 13amd64 -p local multimedia/mympd
```
5. Install the package. You may need to add poudriere's repository if you haven't done that earlier.
```
``` sh
pkg install myMPD
```
6 changes: 5 additions & 1 deletion docs/010-installation/compiling/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: Compiling
---

Expand Down Expand Up @@ -40,6 +39,11 @@ myMPD has only a few dependencies beside the standard c libraries. Not installin
- flac - to extract embedded coverimages
- liblua >= 5.3.0 - for myMPD scripting
- libmygpio - for GPIO scripting functions
- Documentation:
- Doxygen
- JSDoc
- LuaDoc
- mkdocs

You can type `./build.sh installdeps` as root to install the dependencies (works only for supported distributions). For all other distributions you must install the packages manually.

Expand Down
7 changes: 3 additions & 4 deletions docs/010-installation/compiling/openwrt.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: OpenWrt
---

Expand All @@ -9,14 +8,14 @@ title: OpenWrt
The SDK must match the version of OpenWrt installed on Your device.
2. Unpack SDK and change current directory to it.
3. Run following commands to download dependencies recipes:
```
```sh
scripts/feeds update -a
scripts/feeds install libflac libid3tag liblua5.3 libopenssl libpcre2
```
4. Copy contents of `contrib/packaging/openwrt` from myMPD tree
to `package/mympd` directory of SDK.
5. To build package run:
```
```sh
make -j$(nproc) BUILD_LOG=1
```
6. Resulting package will be placed in `bin` directory.
Expand All @@ -25,7 +24,7 @@ title: OpenWrt

1. Clone the OpenWrt tree [https://git.openwrt.org/openwrt/openwrt.git](https://git.openwrt.org/openwrt/openwrt.git)
2. Run following commands to download dependencies recipes:
```
```sh
scripts/feeds update -a
scripts/feeds install libflac libid3tag liblua5.3 libopenssl libpcre2
```
Expand Down
7 changes: 3 additions & 4 deletions docs/010-installation/compiling/termux.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: Termux
---

Expand Down Expand Up @@ -29,7 +28,7 @@ make -C release

Create the config directory for myMPD and run it to create the config files from the environment variables

```
```sh
mkdir -p $HOME/.config/mympd

export MYMPD_HTTP_PORT=8080 # you can use '80' if using root
Expand All @@ -46,15 +45,15 @@ $HOME/myMPD/release/bin/mympd -w $HOME/.config/mympd # run it

After this run myMPD with just this, the rest is necessary for the first start only

```
```sh
$HOME/myMPD/release/bin/mympd -w $HOME/.config/mympd
```

## Running with root (if you want to use lower ports, or use SSL)

I made this little script which should run mympd as root with little trouble **(run it as the user!)**

```
```sh
#!/bin/bash
su root -c "$HOME/myMPD/release/bin/mympd -w $HOME/.config/mympd -u $(whoami)"
```
Expand Down
8 changes: 3 additions & 5 deletions docs/010-installation/distributions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: Distributions
---

Expand All @@ -15,10 +14,9 @@ myMPD is available in the following distributions:
- [Snakeoil OS](https://www.snakeoil-os.net/)
- [Termux](https://termux.com/)

!!! info
If you want to package myMPD for any other distribution don't hesitate to [contact me](https://github.com/jcorporation).

## myMPDos

[myMPDos](https://github.com/jcorporation/myMPDos) is my Raspberry Pi image (aarch64) based on Alpine Linux. It is running entirely in RAM and provides the latest MPD and myMPD packages and some goodies.

---

If you want to package myMPD for any other distribution don't hesitate to [contact me](https://github.com/jcorporation).
8 changes: 3 additions & 5 deletions docs/010-installation/docker.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---

title: Docker
---

The Docker images are based on [Alpine Linux](https://alpinelinux.org). They are published through the GitHub docker registry [ghcr.io](https://github.com/jcorporation?tab=packages).

There are two images:

- mympd/mympd: the latest stable release
- mympd/mympd-devel: development version
- [mympd/mympd](https://github.com/users/jcorporation/packages/container/package/mympd%2Fmympd): the latest stable release
- [mympd/mympd-devel](https://github.com/users/jcorporation/packages/container/package/mympd%2Fmympd-devel): development version

Available architectures:

Expand Down Expand Up @@ -38,14 +37,13 @@ Starts the myMPD docker container:
| `/var/lib/mpd/music/` | MPD music directory. Use the same path in the container to enable auto detection. |
| `/var/lib/mpd/playlists/` | MPD playlist directory. Use the same path in the container to enable auto detection. |


You must create the `cachedir` and `workdir` before starting the container.

### Docker Compose

Save this as `docker-compose.yml`:

```yml
```yaml
services:
mympd:
image: ghcr.io/jcorporation/mympd/mympd
Expand Down
1 change: 0 additions & 1 deletion docs/010-installation/prebuild-packages-debian.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: Debian Installation
---

Expand Down
1 change: 0 additions & 1 deletion docs/010-installation/prebuild-packages.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: Prebuild packages
---

Expand Down
7 changes: 2 additions & 5 deletions docs/020-configuration/acl.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: ACL
---

Expand All @@ -9,9 +8,8 @@ The ACL is a comma separated list of IPv4 subnets: x.x.x.x/x Each subnet is prep

If the acl is empty, all connections are allowed else all connections are denied if not explicitly allowed.

<div class="alert alert-warning">
ACLs for IPv6 are currently not supported.
</div>
!!! info
ACLs for IPv6 are currently not supported.

## Example ACLs

Expand All @@ -20,4 +18,3 @@ ACLs for IPv6 are currently not supported.
| `+0.0.0.0/0`| Allow all |
| `+127.0.0.0/8`| Allow localhost |
| `+127.0.0.0/8,+192.168.0.0/24` | Allow localhost and all hosts in the net 192.168.0.x |

1 change: 0 additions & 1 deletion docs/020-configuration/command-line-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ The `workdir` and `cachedir` options are useful if you want to run more then one
| `-w`, `--workdir <path>` | working directory (default: `/var/lib/mympd`). This folder must exist, if not started as root. |
| `-a`, `--cachedir <path>` | cache directory (default: `/var/cache/mympd`). This folder must exist, if not started as root. |
| `-p`, `--pin` | sets a pin for myMPD settings |

16 changes: 7 additions & 9 deletions docs/020-configuration/configuration-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ title: Configuration files

At the first start (if there is no config folder in the working folder) myMPD reads some environment variables and writes the configuration files.

<div class="alert alert-warning">
After the first start all environment variables are ignored, except loglevel.
</div>
!!! tip
After the first start all environment variables are ignored, except loglevel.

To change these settings afterwards, you can use the `mympd-config` utility and restart myMPD. As an alternative you can edit the files in the folder `/var/lib/mympd/config/`.

You can use `mympd -c` to create the initial configuration in the `/var/lib/mympd/config/` directory.

**Note:**
!!! note
Use [systemd-run](../030-running.md#manual-startup), if you use a distribution with systemd, e.g.:

Use [systemd-run](../030-running.md#manual-startup), if you use a distribution with systemd, e.g.:

```sh
systemd-run -p DynamicUser=yes -p StateDirectory=mympd -p CacheDirectory=mympd -E MYMPD_LOGLEVEL=4 -E MYMPD_HTTP=false -E MYMPD_SSL_PORT=1333 mympd -c
```
```sh
systemd-run -p DynamicUser=yes -p StateDirectory=mympd -p CacheDirectory=mympd -E MYMPD_LOGLEVEL=4 -E MYMPD_HTTP=false -E MYMPD_SSL_PORT=1333 mympd -c
```

## General options

Expand Down
15 changes: 7 additions & 8 deletions docs/020-configuration/index.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
---

title: Configuration
---

myMPD has no single configuration file. Most of the options are configurable through the web-ui.

There are some command line options to define basic settings, for example the working directory.

- <a href="command-line-options">Command line options</a>
- [Command line options](command-line-options.md)

myMPD populates at first startup the default configuration files. You can configure this files with the `mympd-config` utility.

- <a href="configuration-files">Configuration files</a>
- <a href="mpd-connection">MPD connection</a>
- [Configuration files](configuration-files.md)
- [MPD connection](mpd-connection.md)

Other setting that are not configurable in the web-ui:

- <a href="acl">ACL</a>
- <a href="logging">Logging</a>
- <a href="ssl">SSL</a>
- <a href="pin-protection">Pin protection</a>
- [ACL](acl.md)
- [Logging](logging.md)
- [SSL](ssl.md)
- [Pin protection](pin-protection.md)
2 changes: 0 additions & 2 deletions docs/020-configuration/logging.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: Logging
---

Expand All @@ -18,5 +17,4 @@ The log levels are unix default.
| 6 | info |
| 7 | debug |


If you want to start myMPD with a different loglevel as configured you can set the `MYMPD_LOGLEVEL` environment variable accordingly.
3 changes: 0 additions & 3 deletions docs/020-configuration/mpd-connection.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: MPD connection
---

Expand All @@ -13,7 +12,6 @@ The mpd connection settings can be configured in the web-ui (Main menu -> MPD co
| MPD port | 6600 |
| MPD timeout | 30 |


### MPD autodetection

myMPD tries to autodetect the mpd connection only at first start (if no mpd_host file is found in the `state` directory).
Expand All @@ -32,5 +30,4 @@ myMPD tries to autodetect the mpd connection only at first start (if no mpd_host
| MPD_PORT | MPD port |
| MPD_TIMEOUT | MPD timeout in seconds |


This is done after dropping privileges to the mympd user.
3 changes: 1 addition & 2 deletions docs/020-configuration/pin-protection.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: Pin protection
---

Expand All @@ -13,4 +12,4 @@ You can goto the main menu and login to create a session, press `L` or simply ta

The session is valid until restart of myMPD, closing the browser, refreshing the site or you logout.

The <a href="references/api/methods">API documentation</a> shows whether a method is protected or not.
The [API documentation](../060-references/api/methods.md) shows whether a method is protected or not.
5 changes: 1 addition & 4 deletions docs/020-configuration/ssl.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

title: SSL
---

Expand All @@ -23,8 +22,7 @@ The default certificates are saved in the directory `/var/lib/mympd/ssl/`.
| server.pem | Server certificate |
| server.key | Server private key |


The server certificates SAN is:
The server certificate SAN is:

- DNS: localhost
- DNS: ip6-localhost
Expand Down Expand Up @@ -54,4 +52,3 @@ You can of course use your own certificate, e.g. from [Let's Encrypt](https://le
| custom_cert | true |
| ssl_key | path to custom ssl key |
| ssl_cert | path to custom ssl certificate |

14 changes: 8 additions & 6 deletions docs/030-running.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ On startup myMPD does the following:
- Dropping privileges, if started as root.
- Check and create the directories inside `cachedir` and `workdir`.

- **Note:** It is not supported to run myMPD as root. If started as root, myMPD drops privileges to the configured user (default mympd).
!!! note
It is not supported to run myMPD as root. If started as root, myMPD drops privileges to the configured user (default mympd).

## Startup script

Expand All @@ -22,7 +23,7 @@ The installation process installs a LSB compatible startup script / systemd unit
| INIT SYSTEM | SCRIPT |
| ----------- | ------ |
| open-rc | `/etc/init.d/mympd` |
| systemd | `/usr/lib/systemd/system/mympd` or `/lib/systemd/system/mympd` |
| systemd | `/usr/lib/systemd/system/mympd` and`/usr/lib/systemd/user/mympd` |
| sysVinit | `/etc/init.d/mympd` |

### Systemd usage
Expand All @@ -35,12 +36,13 @@ The default myMPD service unit uses the `DynamicUser=` directive, therefore no s

**Example: add the mympd user to the music group**

```
```sh
mkdir /etc/systemd/system/mympd.service.d
echo -e '[Service]\nSupplementaryGroups=music' > /etc/systemd/system/mympd.service.d/music-group.conf
```

- **Note:** The default systemd service unit supports only systemd v235 and above.
!!! note
The default systemd service unit supports only systemd v235 and above.

### Openrc usage

Expand All @@ -50,11 +52,11 @@ myMPD logs to syslog to facility `daemon`, you can see the live logs with `tail

## Manual startup

To start myMPD in the actual console session: `mympd` (myMPD keeps in foreground and logs to the console, press CTRL+C to stop myMPD)
To start myMPD in the actual console session: `mympd` (myMPD keeps in foreground and logs to the console, press `CTRL+C` to stop myMPD)

If you use a distribution with systemd (without a static mympd user):

```
```sh
systemd-run -t -p DynamicUser=yes -p StateDirectory=mympd -p CacheDirectory=mympd /usr/bin/mympd
```

Expand Down
Loading

0 comments on commit 788f65c

Please sign in to comment.