From f9eee4ab29a4918ddc9be0e2059f394cc03f691b Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Wed, 20 Aug 2025 14:30:51 -0700 Subject: [PATCH] Add info for how to setup the server for selfhosting --- README.md | 27 ++++++++++++++++++++++++++- genkeys.py | 6 ++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 genkeys.py diff --git a/README.md b/README.md index 3f07385..4fdd776 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,28 @@ # Berry Dash Server -This is the new server source code for Berry Dash. It is being rewritten at the moment and does not contain all the files the original servers have. \ No newline at end of file +This is the new rewritten server source code for Berry Dash. + +## Setup + +1. Upload the files on a webserver +2. Import database.sql into a MySQL/MariaDB database +3. Configure everything in `config/` folder (use `python3 genkeys.py` for `encryption.php`) +4. Use `git clone https://github.com/BerryDash/source.git` to clone the client and configure `Assets/Scripts/SensitiveInfo.cs` + +**Note:** + +When configuring keys in the client, `SERVER_RECEIVE_TRANSFER_KEY` will the key `SERVER_SEND_TRANSFER_KEY` from the server, and the other way around too. + +If this isn't configured properly, you will not be able to make requests to the server you have setup. + +Example: + +```cs +public static readonly string SERVER_DATABASE_PREFIX = "https://berrydash.lncvrt.xyz/database/"; +public static readonly string SERVER_RECEIVE_TRANSFER_KEY = "02b3c624552588ba0929e43fbad36221"; // This would be `SERVER_SEND_TRANSFER_KEY` from the server +public static readonly string SERVER_SEND_TRANSFER_KEY = "d4269db023de05fd59bf05378fa57324"; // This would be `SERVER_RECEIVE_TRANSFER_KEY` from the server +public static readonly string BAZOOKA_MANAGER_KEY = "19387a0e6b861e79d38657d0059bce8c"; +public static readonly string BAZOOKA_MANAGER_FILE_KEY = "7fb47db04d9babf42ee3713289516208"; +``` + +In conclusion: `SERVER_RECEIVE_TRANSFER_KEY` and `SERVER_SEND_TRANSFER_KEY` are swapped between client and server. This may be changed in the future. diff --git a/genkeys.py b/genkeys.py new file mode 100644 index 0000000..8cff8a2 --- /dev/null +++ b/genkeys.py @@ -0,0 +1,6 @@ +import os + +keys_needed = ["SERVER_RECEIVE_TRANSFER_KEY", "SERVER_SEND_TRANSFER_KEY", "BAZOOKA_MANAGER_KEY", "BAZOOKA_MANAGER_FILE_KEY"] + +for key_needed in keys_needed: + print("Key for \"" + key_needed + "\": " + os.urandom(16).hex()) \ No newline at end of file