]> git.r.bdr.sh - rbdr/mobius/blame - README.md
Delete docs/Screenshot 2024-05-03 at 4.40.09 PM.png
[rbdr/mobius] / README.md
CommitLineData
4fa4a57c 1<!--<picture>
a3ca1960 2 <source media="(prefers-color-scheme: dark)" srcset="dark_logo.png">
3 <source media="(prefers-color-scheme: light)" srcset="light_logo.png">
4fad3266 4 <img src="dark_logo.png" alt="Mobius Logo">
6e16e926 5</picture>
4fa4a57c 6-->
6e16e926 7
6988a057
JH
8# Mobius
9
2a46179f 10Mobius is a cross-platform command line [Hotline](https://en.wikipedia.org/wiki/Hotline_Communications) client and server implemented in Golang.
6988a057 11
4fa4a57c
JH
12- **Server Goal:** Make it simple to run a Hotline server on macOS, Linux, and Windows, with full compatibility for all popular Hotline clients.
13- **Client Goal:** Make it fun and easy to connect to multiple Hotline servers through a [terminal UI](https://github.com/jhalter/mobius/wiki/Mobius-Client-Screenshot-Gallery).
6988a057 14
6988a057 15
4fa4a57c
JH
16## Installation
17
18Mobius is distributed through a single binary.
19
20Depending on your platform and preferences, you can acquire the binary in the following ways:
21
22### Build from source
23
241. Install [Go](https://go.dev) if needed
252. Run `make server`
26
27### Download pre-built release
28
29See [Releases](https://github.com/jhalter/mobius/releases) page.
30
69fceb2e 31
2a46179f
JH
32### Docker
33
4fa4a57c 34To run a Hotline server with a default, sample configuration with ports forwarded from the host OS to the container:
d4207f0d
JH
35
36 docker run --rm -p 5500:5500 -p 5501:5501 ghcr.io/jhalter/mobius:latest
2a46179f 37
d4207f0d 38You can now connect to localhost:5500 with your favorite Hotline client and play around, but all changes will be lost on container restart.
2a46179f 39
d4207f0d 40To serve files from the host OS and persist configuration changes, you'll want to set up a [bind mount](https://docs.docker.com/storage/bind-mounts/) that maps a directory from the host into the container.
2a46179f 41
4fa4a57c
JH
42To do this, create a directory in a location of your choice on the host OS. For clarity, we'll assign the path to the `HLFILES` environment variable and re-use it.
43
44Then run the docker command with `-v` and `-init` like so:
69fceb2e 45
d4207f0d
JH
46```
47export HLFILES=/home/myuser/hotline-files
48mdkir $HLFILES
49
50sudo docker run \
51 --pull=always \
52 --rm \
53 -p 5500:5500 \
54 -p 5501:5501 \
55 -v $HLFILES:/usr/local/var/mobius/config \
56 ghcr.io/jhalter/mobius:latest \
57 -init
58```
59
60It's a good security practice to run your server as a non-root user, which also happens to make editing the configuration files easier from the host OS.
61
62To do this, add the `--user` flag to the docker run arguments with a user ID and group ID of a user on the host OS.
63
64`--user 1001:1001`
69fceb2e 65
4fa4a57c
JH
66### Homebrew
67
68For macOS the easiest path to installation is through Homebrew, as this works around Apple's notarization requirements for downloaded pre-compiled binaries by compiling the binary on your system during brew installation.
69
70To install the server:
71
72 brew install jhalter/mobius-hotline-server/mobius-hotline-server
73
74After installation `mobius-hotline-server` will be installed at `$HOMEBREW_PREFIX/bin/mobius-hotline-server` and should be in your $PATH.
75
76The server config directory will be created under `$HOMEBREW_PREFIX/var/mobius`.
77
78To start the service:
79
80`brew services start mobius-hotline-server`
81
82
83## Server Configuration
84
85After you have a server binary, the next step is to configure the server.
86
87### Configuration directory
88
89Mobius stores its configuration and server state in a directory tree:
2a46179f
JH
90
91```
4fa4a57c
JH
92config
93├── Agreement.txt
94├── Files
95│   └── hello.txt
96├── MessageBoard.txt
97├── ThreadedNews.yaml
98├── Users
99│   ├── admin.yaml
100│   └── guest.yaml
101├── banner.jpg
102└── config.yaml
2a46179f
JH
103```
104
4fa4a57c 105If you acquired the server binary by downloading it or compiling it, this directory doesn't exist yet! But you can generate it by running the the server with the `-init` flag:
69fceb2e 106
4fa4a57c 107`./mobius-hotline-server -init -config example-config-dir`
69fceb2e 108
4fa4a57c 109Brew users can find the config directory in `$HOMEBREW_PREFIX/var/mobius`.
6988a057 110
4fa4a57c 111Within this directory some files are intended to be edited to customize the server, while others are not.
6988a057 112
4fa4a57c 113---
69fceb2e 114
4fa4a57c
JH
115* 🛠️ Edit this file to customize your server.
116* ⚠️ Avoid manual edits outside of special circumstances (e.g. remove offending news content).
69fceb2e 117
4fa4a57c 118---
69fceb2e 119
4fa4a57c 120🛠️ `Agreement.text` - The server agreement sent to users after they join the server.
6988a057 121
4fa4a57c 122🛠️ `Files` - Home of your warez or any other files you'd like to share.
2a46179f 123
4fa4a57c 124⚠️ `MessageBoard.txt` - Plain text file containing the server's message board. No need to edit this.
6988a057 125
4fa4a57c 126⚠️ `ThreadedNews.yaml` - YAML file containing the server's threaded news. No need to edit this.
69fceb2e 127
4fa4a57c 128⚠️ `Users` - Directory containing user account YAML files. No need to edit this.
69fceb2e 129
4fa4a57c 130🛠️ `banner.jpg` - Path to server banner image.
69fceb2e 131
4fa4a57c 132🛠️ `config.yaml` - Edit to set your server name, description, and enable tracker registration.
69fceb2e 133
69fceb2e 134
4fa4a57c 135### User accounts
69fceb2e 136
4fa4a57c 137The default installation includes two users:
6988a057 138
4fa4a57c
JH
139* guest (no password)
140* admin (default password admin).
6988a057 141
4fa4a57c 142User administration should be performed from a Hotline client. Avoid editing the files under the `Users` directory.
6988a057 143
4fa4a57c 144## Run the server
6988a057 145
4fa4a57c
JH
146By default running `mobius-hotline-server` will listen on ports 5500/5501 of all interfaces with info level logging to STDOUT.
147
148Use the -h or -help flag for a list of options:
149
150```
151$ mobius-hotline-server -h
152Usage of mobius-hotline-server:
153 -bind int
154 Base Hotline server port. File transfer port is base port + 1. (default 5500)
155 -config string
156 Path to config root (default "/usr/local/var/mobius/config/")
157 -init
158 Populate the config dir with default configuration
159 -interface string
160 IP addr of interface to listen on. Defaults to all interfaces.
161 -log-file string
162 Path to log file
163 -log-level string
164 Log level (default "info")
165 -stats-port string
166 Enable stats HTTP endpoint on address and port
167 -version
168 Print version and exit
169```
6988a057 170
6988a057 171
4fa4a57c 172To run as a systemd service, refer to this sample unit file: [mobius-hotline-server.service](https://github.com/jhalter/mobius/blob/master/cmd/mobius-hotline-server/mobius-hotline-server.service)
2a46179f 173