Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kr45732 committed Jun 29, 2024
1 parent 2bf83a9 commit b3bb5dd
Show file tree
Hide file tree
Showing 16 changed files with 189 additions and 365 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Some of these prerequisites are not necessarily required but having all of them
### Steps
If you are stuck or encounter a problem in the steps below, create an issue and I will try to help you in 3-5 business days!
1. Clone this repository
2. Rename DevSettingsTemplate.properties to DevSettings.properties and move it to the project root (or use environment variables) and follow the instructions there and below to fill it out (see [DevSettingsExample.properties](https://github.com/kr45732/skyblock-plus/tree/master/setup-resources/DevSettingsExample.properties) for examples):
2. Rename DevSettingsTemplate.properties to DevSettings.properties and move it to the project root and follow the instructions there and below to fill it out:
- Feel free to set the API_USERNAME and API_PASSWORD to some gibberish, but do not leave it blank because you do not want anyone to be able to access the private endpoints (server settings, linked accounts, etc)
- Same thing as above with JACOB_KEY, you will probably never use that endpoint, but you do not want anyone to be able to POST data to it
- Ensure the AUCTION_API_KEY is the same as the ADMIN_API_KEY of your self-hosted rust-query-api
Expand All @@ -62,9 +62,6 @@ If you are stuck or encounter a problem in the steps below, create an issue and
5. Data repository: you will need to make your own clone of the skyblock-plus-data repository so your bot can automatically update it:
- Fork or clone [skyblock-plus-data](https://github.com/kr45732/skyblock-plus-data)
- Set "DATA_REPO_GITHUB" in DevSettings to point to your repository **on GitHub**
- Navigate to "Settings.json" of your repository and edit the following:
- Change "ahApiUrl" to point to your self-hosted rust-query-api
- Change "hasteUrl" to point to your self-hosted hastebin
- Create a new channel in your PRIMARY_GUILD and set "NEU_REPO_UPDATE_CHANNEL_ID" in DevSettings
- Join [Moulberry's Bush](https://discord.gg/moulberry) and follow "#item-repo-github" (send it to the channel you just created)
6. Hardcoded constants you will need to change:
Expand Down
131 changes: 0 additions & 131 deletions setup-resources/DevSettingsExample.properties

This file was deleted.

82 changes: 49 additions & 33 deletions setup-resources/DevSettingsTemplate.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
## --------------------------------------------------------------------------- ##

# found in Discord Developer Portal --> Application --> Bot --> Token
BOT_TOKEN =
BOT_TOKEN = secret :)

# found in Discord Developer Portal --> Application --> General Information --> Application ID
BOT_ID =
BOT_ID = 796791167366594592

# found in Discord Developer Portal --> Application --> OAuth2 --> Client Secret
# this is only used in linked roles for OAuth
CLIENT_SECRET =
CLIENT_SECRET = secret :)

## --------------------------------------------------------------------------- ##
## Bot Configuration ##
Expand All @@ -21,41 +21,57 @@ CLIENT_SECRET =
DEV = false

# guild used for logging, bug reports, etc
PRIMARY_GUILD_ID =
PRIMARY_GUILD_ID = 796790757947867156

# text channel in PRIMARY_GUILD where command uses are logged to
LOG_CHANNEL_ID =
LOG_CHANNEL_ID = 818469899848515624

# text channel in PRIMARY_GUILD where errors in commands and features are logged to
ERROR_LOG_CHANNEL_ID =
ERROR_LOG_CHANNEL_ID = 864156114060705814

# text channel in PRIMARY_GUILD where bot status notifications are sent (same channel as the BOT_STATUS_WEBHOOK)
BOT_STATUS_CHANNEL_ID =
BOT_STATUS_CHANNEL_ID = 957658797155975208

# text channel in PRIMARY_GUILD where networth bug reports are logged to
NETWORTH_BUG_REPORT_CHANNEL_ID =
NETWORTH_BUG_REPORT_CHANNEL_ID = 1017573342288564264

# text channel where NEU-repo updates are forwarded to (see step 6 in README)
NEU_REPO_UPDATE_CHANNEL_ID =
NEU_REPO_UPDATE_CHANNEL_ID = 958771784004567063

# text channel where your self-hosted https://github.com/kr45732/rust-query-api webhook logs too
QUERY_API_LOG_CHANNEL_ID =
QUERY_API_LOG_CHANNEL_ID = 869278025018114108

# GitHub reference to your clone of https://github.com/kr45732/skyblock-plus-data formatted as "username/repo" (e.g. "kr45732/skyblock-plus-data")
DATA_REPO_GITHUB =
DATA_REPO_GITHUB = kr45732/skyblock-plus-data

# email used for automatic GitHub commits in the data repo (e.g. "[email protected]")
# the email does not matter, but note that it will be visible in the automatic commits on GitHub
GITHUB_EMAIL =
GITHUB_EMAIL = [email protected]

# used for prefix commands (mainly dev commands)
# requires message content intent to be enabled to use prefix
# if you do not have the message content intent & want to use prefix commands, then just mention the bot instead of a prefix
# e.g. "+evaluate 1+1" becomes "@Skyblock Plus#0205 evaluate 1+1" (there must be a space between the mention & command name)
PREFIX =
PREFIX = +

# allows the user with this Discord ID to use owner commands (mostly dev commands)
OWNER_ID =
# allows the user with this Discord ID to use owner commands (mainly dev commands)
OWNER_ID = 385939031596466176

# sets the API used for uuid/username conversions
# default: https://github.com/Electroid/mojang-api; 1: https://playerdb.co; 2: https://api.minetools.eu
MOJANG_API_NUM = 1

# whether to use the official Mojang API as a fallback for uuid/username conversions
ALLOW_MOJANG_API = true

# URL pointing to your self-hosted https://github.com/kr45732/rust-query-api
QUERY_API_URL = https://auctions.sbplus.codes/

# URL pointing to your self-hosted https://github.com/kr45732/hste (or your own implementation)
HASTE_URL = https://haste.sbplus.codes/api/

# which branch of the NEU-repo to use when updating the data repo
NEU_BRANCH = master

## --------------------------------------------------------------------------- ##
## Bot API ##
Expand All @@ -64,56 +80,56 @@ OWNER_ID =
# base URL to access APIs defined in com.skyblockplus.api.controller package
# if you do not want to expose the API, use "localhost:PORT"
# or you can use a domain, e.g. "sbplus.codes"
BASE_URL =
BASE_URL = sbplus.codes

# username to access private endpoints
# refer to endpoints that start with "/private" in com.skyblockplus.api.controller.ApiController
API_USERNAME =
API_USERNAME = username

# username to access private endpoints
# refer to endpoints that start with "/private" in com.skyblockplus.api.controller.ApiController
API_PASSWORD =
API_PASSWORD = password

# legacy method to authenticate jacob data sent from my HypixelAddons mod
# refer to com.skyblockplus.api.controller.ApiController#postJacobData
JACOB_KEY =
JACOB_KEY = jacobkey

## --------------------------------------------------------------------------- ##
## External API Keys ##
## --------------------------------------------------------------------------- ##

# Hypixel API key from https://developer.hypixel.net/
HYPIXEL_API_KEY =
HYPIXEL_API_KEY = secret :)

# key (ADMIN_API_KEY) to access your self-hosted https://github.com/kr45732/rust-query-api (this is NOT your Hypixel API key)
# you will have to self-host this as it is used for many things related to auctions such as price calculations, auction flipper, etc
AUCTION_API_KEY =
AUCTION_API_KEY = auctionapikey

# key used to access the SBZ scammer data
# used for "/scammer" and scammer check in guild applications
# if a key is not set, then scammer checks will always return false
SBZ_SCAMMER_DB_KEY =
SBZ_SCAMMER_DB_KEY = sbzscammerdbkey

# personal access token from https://github.com/settings/tokens (give it the repo scope)
# main purpose is to automatically update the skyblock-plus-data repo (refer to com.skyblockplus.utils.utils.Utils.updateDataRepo)
# also used to authenticate GitHub raw endpoints (not sure if that is actually necessary or not)
GITHUB_TOKEN =
GITHUB_TOKEN = secret :)

# key to access my haste API (https://github.com/kr45732/hste)
# key to access the haste API (https://github.com/kr45732/hste)
# feel free to replace it with your own pastebin or self-host my wacky one
HASTE_KEY =
HASTE_KEY = hastekey

# tokens to push stats to bot list websites (you probably do not need this)
DISCORD_BOT_LIST_TOKEN =
DISCORD_BOTS_GG_TOKEN =
DISCORDS_COM_TOKEN =
TOP_GG_TOKEN =
DISCORD_BOT_LIST_TOKEN = secret :)
DISCORD_BOTS_GG_TOKEN = secret :)
DISCORDS_COM_TOKEN = secret :)
TOP_GG_TOKEN = secret :)

# Discord webhook URL where auction flips will be posted (requires https://github.com/kr45732/rust-query-api)
AUCTION_FLIPPER_WEBHOOK =
AUCTION_FLIPPER_WEBHOOK = https://discord.com/api/webhooks/ID/TOKEN

# Discord webhook URL where bot status updates will be posted (e.g. bot restarting notifications)
BOT_STATUS_WEBHOOK =
BOT_STATUS_WEBHOOK = https://discord.com/api/webhooks/ID/TOKEN

## --------------------------------------------------------------------------- ##
## Databases ##
Expand All @@ -125,7 +141,7 @@ BOT_STATUS_WEBHOOK =
# feel free to combine both databases into single database

# server settings and linked accounts
DATABASE_URL =
DATABASE_URL = jdbc:postgresql://myfavoritehost.com:6969/database?user=USERNAME&password=PASSWORD

# leaderboards and caching
LEADERBOARD_DB_URL =
LEADERBOARD_DB_URL = jdbc:postgresql://myfavoritehost.com/database?user=USERNAME&password=PASSWORD
59 changes: 59 additions & 0 deletions setup-resources/cache-dump.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
-- Dumped from database version 14.4


--
-- Name: guild; Type: TABLE; Schema: public
--

CREATE TABLE public.guild (
guild_id character varying(32) NOT NULL,
request_time bigint NOT NULL,
members jsonb NOT NULL,
request_discord text NOT NULL,
guild_name text NOT NULL
);


--
-- Name: json_cache; Type: TABLE; Schema: public
--

CREATE TABLE public.json_cache (
id character varying(255) NOT NULL,
expiry bigint NOT NULL,
data jsonb NOT NULL
);


--
-- Name: json_storage; Type: TABLE; Schema: public
--

CREATE TABLE public.json_storage (
id integer NOT NULL,
data jsonb NOT NULL
);


--
-- Name: guild guild_pkey; Type: CONSTRAINT; Schema: public
--

ALTER TABLE ONLY public.guild
ADD CONSTRAINT guild_pkey PRIMARY KEY (guild_id);


--
-- Name: json_cache json_cache_pkey; Type: CONSTRAINT; Schema: public
--

ALTER TABLE ONLY public.json_cache
ADD CONSTRAINT json_cache_pkey PRIMARY KEY (id);


--
-- Name: json_storage json_storage_pkey; Type: CONSTRAINT; Schema: public
--

ALTER TABLE ONLY public.json_storage
ADD CONSTRAINT json_storage_pkey PRIMARY KEY (id);
Loading

0 comments on commit b3bb5dd

Please sign in to comment.