DP Crosschat+DiscordBot — Linux
===============================

A Discord bot for ARK: Survival Evolved clusters: live server status,
in-game <-> Discord cross-chat, and player join/leave logs.
Nothing needs to be installed — the bot runs from this folder.

Requires: x86_64 Linux with glibc (Ubuntu, Debian, RHEL, etc. — not
Alpine, not ARM).


INSTALL
-------
1. Extract the folder anywhere you like, e.g.:

     tar xzf DP-Crosschat-Bot-linux.tar.gz -C /opt
     cd /opt/DP-Crosschat-Bot-linux

   Keep the dpcrosschatbot binary and the renderer folder together —
   the bot reads its control panel UI from renderer/.

2. That's it. There is no installer.


RUN
---
    ./dpcrosschatbot

The log prints to the terminal. The control panel is at:

    http://localhost:8770

The panel binds to 127.0.0.1 only. On a remote/headless server, reach
it through an SSH tunnel from your own machine:

    ssh -L 8770:localhost:8770 user@your-server

...then open http://localhost:8770 in your local browser.


FIRST-TIME SETUP
----------------
In the control panel:
1. Paste your Discord bot token and channel IDs.
2. Enter the RCON host and admin password of your ARK servers.
3. Click "Generate" next to Bridge API key (copies the key — paste it
   into ApiKey in the DiscordBridge plugin's config.json on your servers).
4. Add each map and its RCON port under Maps.
5. Save Settings, then Start Bot.

Settings are stored in a "config" directory created next to the binary.
Already have a config.json from a previous install? Create config/ next
to the binary and drop the file in BEFORE the first start — the bot
picks it up and starts automatically from then on.


RUN AS A SERVICE (systemd)
--------------------------
With a completed config the bot starts on its own, which makes it a
clean systemd service. Create /etc/systemd/system/dpcrosschatbot.service:

    [Unit]
    Description=DP Crosschat+DiscordBot
    After=network-online.target
    Wants=network-online.target

    [Service]
    WorkingDirectory=/opt/DP-Crosschat-Bot-linux
    ExecStart=/opt/DP-Crosschat-Bot-linux/dpcrosschatbot
    Restart=on-failure
    User=YOUR_USER

    [Install]
    WantedBy=multi-user.target

Then:

    sudo systemctl daemon-reload
    sudo systemctl enable --now dpcrosschatbot
    journalctl -u dpcrosschatbot -f     # follow the log


FIREWALL
--------
- The control panel (port 8770) is reachable from this machine only.
- The plugin bridge listens on port 8765. If the ARK servers run on a
  DIFFERENT machine, allow inbound TCP 8765 (e.g. ufw allow 8765/tcp)
  and use this machine's LAN IP in the plugin's BridgeUrl.


UPDATE / UNINSTALL
------------------
Update:    replace the dpcrosschatbot binary and renderer/ with the new
           versions. Keep your config directory.
Uninstall: stop the bot (or disable the service) and delete the folder.
