Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RELEASE] 1.6.0 #276

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
bff1679
[Halpy-142] Save Initial Attempt
Rixxan Sep 7, 2022
eaa7793
[Halpy-142] Example of Working Gateway
Rixxan Sep 9, 2022
43fd56b
[Halpy-142] Remove Old DB Command Logic
Rixxan Sep 9, 2022
2ccdc21
[Halpy-142] Initial DB Handover - Facts, WHOAMI
Rixxan Sep 9, 2022
701a6ef
[Halpy-142] Tail Handover
Rixxan Sep 9, 2022
23ef9a4
[Halpy-142] Apply Rough DB Update to Delayed
Rixxan Sep 9, 2022
1ab3f5c
[Halpy-142] General Cleanup
Rixxan Sep 9, 2022
25fcc80
[Halpy-142] Elevate Out Of DBAPI
Rixxan Sep 9, 2022
a530a1f
[Halpy-142] CLI Handover
Rixxan Sep 22, 2022
e1d3920
[Minor] Rename the Box
Rixxan Sep 26, 2022
b7b5f99
Merge branch 'feature/halpy-142' into 'develop'
rik079 Sep 26, 2022
03e512f
[Halpy-140] Refactor duplicated fact code
Rixxan Sep 26, 2022
a2be9d4
Merge branch 'feature/halpy-140' into 'develop'
rik079 Sep 26, 2022
d112522
[Minor] Remove DB Echo, DBPING Specific increase
Rixxan Sep 28, 2022
5d6fae7
[Fix] Remove Old Code
Rixxan Oct 5, 2022
9fb71bc
[Timed Tasks] Add Timed Tasks Decorator
Rixxan Oct 5, 2022
86cef60
[Minor] Formatting Updates
Rixxan Oct 5, 2022
5eb0f77
Merge branch 'fix/timed-tasks' into 'develop'
rik079 Oct 5, 2022
8c1ce5a
[Halpy-143] Add the Tasks and Task Starter
Rixxan Oct 20, 2022
f5e55b3
[Minor] Add Custom UserAgent
Rixxan Oct 20, 2022
832a3bf
[Halpy-143] Remove Unused Period
Rixxan Oct 27, 2022
b67dea1
[Halpy-143] Add UFI and OLM checks
Rixxan Oct 27, 2022
241d06b
[Halpy-143] Fix Circular Import
Rixxan Oct 27, 2022
164b203
[Halpy-143] Fix the Circular Import
Rixxan Oct 28, 2022
7f53c98
[Halpy-143] Add DB Connection Test
Rixxan Oct 28, 2022
6868e77
[Halpy-143] List
Rixxan Oct 28, 2022
4d1f9e1
[Halpy-143] Replace Timed Tasks with Futures
Rixxan Oct 31, 2022
c3c8069
Merge branch 'feature/halpy-143' into 'develop'
rik079 Nov 1, 2022
16126a4
[2.0 Prep] Remove Delayed System & Prep
Rixxan Nov 1, 2022
1d3f838
Merge remote-tracking branch 'origin/master' into develop
Rixxan Nov 1, 2022
4d90ee8
Merge branch 'feature/2.0-prep' into 'develop'
Rixxan Nov 1, 2022
e7ce90b
[Minor] Change DSSA authoritative field
Rixxan Nov 1, 2022
4dd2320
[Entry Logic] Change Entry Handover
Rixxan Nov 4, 2022
cae8be4
[Minor] Remove Unused dbconfig value
Rixxan Nov 4, 2022
5b7eb0c
[Minor] Clarify CLI Function Names
Rixxan Nov 4, 2022
e1f1f5f
[Minor] Clarify CLI Function Names
Rixxan Nov 4, 2022
e4a3656
[Minor] Reformat Entry and Logging Logic
Rixxan Nov 4, 2022
f4754e2
[FIX] Remove Unsync Cross-Thread Write
Rixxan Nov 6, 2022
7af340c
Merge branch 'feature/pydle-entry-improvement' into 'develop'
rik079 Nov 7, 2022
8dc31ba
Merge branch 'master' into develop
Rixxan Nov 7, 2022
5156b7d
[Thread Removal] Integrate Server and Bot
Rixxan Nov 7, 2022
d3fe7b4
[Fix] Fact Handler SQL
Rixxan Nov 7, 2022
b1991fa
[Minor] Add Docstrings, Rename variables
Rixxan Nov 7, 2022
fbfb34a
[Fix] Revert IP Change
Rixxan Nov 7, 2022
73e8399
[Minor] Add the Dice Roller
Rixxan Nov 7, 2022
aa3403e
[Minor] FOR FIREBAAAAAAAAAAAAAALL!
Rixxan Nov 11, 2022
15056a1
[Fix] Fix No Vhost KeyError
Rixxan Nov 11, 2022
d4afe0d
Merge branch 'feature/thread-removal' into 'develop'
rik079 Nov 14, 2022
7f72bbc
[Implement Timer Decorator]
Rixxan Nov 22, 2022
84654f7
[Halpy-137] Remove Unused Content
Rixxan Nov 22, 2022
2c8794e
[Halpy-137] Update Error Message with Config Value
Rixxan Nov 22, 2022
ce5785e
[Halpy-144] Add Configurable SASL
Rixxan Nov 22, 2022
625f00f
Merge branch 'master' into develop
Rixxan Nov 28, 2022
6197911
Merge branch 'feature/halpy-144' into 'develop'
rik079 Dec 2, 2022
4d9c1cb
Merge branch 'feature/halpy-137' into 'develop'
rik079 Dec 2, 2022
4f56365
[Minor] Remove Useless Newline
Rixxan Dec 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 22 additions & 19 deletions CLI/BackupFactUpdater/__main__.py
Expand Up @@ -14,25 +14,26 @@
import sys
import pathlib
import configparser
import mysql.connector
from sqlalchemy import create_engine, text, exc


# noinspection PyBroadException
def run():
def run_facts():
"""Run the Backup Fact Updater"""
rootpath = pathlib.PurePath(__file__).parent.parent.parent
rootpath = str(rootpath).replace("\\", "/")
json_path = rf"{rootpath}/data/facts/backup_facts.json"
config = configparser.ConfigParser()
config.read(rf"{rootpath}/CLI/BackupFactUpdater/config.ini")

dbconfig = {
"user": config.get("Database", "user"),
"password": config.get("Database", "password"),
"host": config.get("Database", "host"),
"database": config.get("Database", "database"),
"connect_timeout": int(config.get("Database", "timeout")),
}
dbconfig = (
f'mysql+mysqldb://{config["Database"]["user"]}:{config["Database"]["password"]}@'
f'{config["Database"]["host"]}/{config["Database"]["database"]}'
)

engine = create_engine(
dbconfig,
connect_args={"connect_timeout": int(config["Database"]["timeout"])},
)

print("=============\nHalpyBOT fact file updater\n=============")
print("\n")
Expand All @@ -54,23 +55,25 @@ def run():
with open(json_path, "r", encoding="UTF-8") as jsonfile:
print("20% Opening backup file...")
resdict = json.load(jsonfile)
database_connection = mysql.connector.connect(**dbconfig)
print("40% Connection started...")
cursor = database_connection.cursor()
cursor.execute(f"SELECT factName, factLang, factText FROM {table}")
print("60% Got data, parsing...")
for (name, lang, text) in cursor:
resdict[f"{name}-{lang}"] = text
database_connection.close()
with engine.connect() as conn:
result = conn.execute(
text(
f"SELECT factName, factLang, factText FROM {table}",
)
)
print("60% Got data, parsing...")
for (name, lang, facttext) in result:
resdict[f"{name}-{lang}"] = facttext
print("80% Writing to file...")
with open(json_path, "w+", encoding="UTF-8") as jsonfile:
json.dump(resdict, jsonfile, indent=4)
print(
"100% Done. Confirm that the update was successful, and have a great day!"
)
except mysql.connector.Error:
except exc.OperationalError:
print("MySQL encountered an error. Aborting!")


if __name__ == "__main__":
run()
run_facts()
10 changes: 4 additions & 6 deletions CLI/DSSAUpdater/__main__.py
Expand Up @@ -30,7 +30,7 @@
# noinspection PyBroadException


def run():
def run_dssa():
"""Run the DSSA Updater"""
rootpath = pathlib.PurePath(__file__).parent
rootpath = str(rootpath).replace("\\", "/")
Expand All @@ -42,9 +42,7 @@ def run():
+ "=" * 20
+ "\n"
)
print(
f"JSON and CSV files will be placed in folder: {filepath}"
)
print(f"JSON and CSV files will be placed in folder: {filepath}")

carriers_good = []
carriers_bad = []
Expand Down Expand Up @@ -82,7 +80,7 @@ def run():
# Create an object for all our carriers and get their locations
try:
for carrier in tqdm(carrierdata):
crobj = DSSACarrier(name=carrier["Name"], location=carrier["Location"])
crobj = DSSACarrier(name=carrier["Name"], location=carrier["Destination"])
if not crobj.has_system:
needs_manual.append(crobj.name)
carriers_bad.append(
Expand Down Expand Up @@ -139,6 +137,6 @@ def run():

if __name__ == "__main__":
try:
run()
run_dssa()
except KeyboardInterrupt:
sys.exit()
4 changes: 2 additions & 2 deletions CLI/EDDBFormatter/__main__.py
Expand Up @@ -16,7 +16,7 @@
from tqdm import tqdm


def run():
def run_eddb():
"""Run the EDDB Formatter"""
rootpath = pathlib.PurePath(__file__).parent
rootpath = str(rootpath).replace("\\", "/")
Expand Down Expand Up @@ -151,6 +151,6 @@ def run():

if __name__ == "__main__":
try:
run()
run_eddb()
except KeyboardInterrupt:
sys.exit()
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -76,7 +76,7 @@ Otherwise, use the type of request:

#### Non-commands

This project uses [Google Style Python Docstrings](https://gist.github.com/redlotus/3bc387c2591e3e908c9b63b97b11d24e)for
This project uses [Google Style Python Docstrings](https://gist.github.com/redlotus/3bc387c2591e3e908c9b63b97b11d24e) for
non-commands
(functions that do not directly interact with a command handler)

Expand Down
2 changes: 2 additions & 0 deletions certs/.gitignore
@@ -0,0 +1,2 @@
# Ignore everything in this directory
*
9 changes: 5 additions & 4 deletions config/config_template.ini
@@ -1,7 +1,12 @@
[SASL]
use_sasl = # True or False
sasl_mode = # PLAIN or EXTERNAL
# For SASL PLAIN
identity = # Registered nick
username = # Hull Seals account name
password = # Hull Seals account password
# For SASL EXTERNAL
cert = # Name of the cert in the /certs directory, if using EXTERNAL

[IRC]
server = irc.hullseals.space
Expand Down Expand Up @@ -32,8 +37,6 @@ joinable = #debrief #Code-Black #Repair-Requests #bot-test #cybers

[Offline Mode]
enabled = False
announce_channels = #bot-test
warning override = False

[EDSM]
Maximum landmark distance = 10000
Expand Down Expand Up @@ -78,8 +81,6 @@ access_token =
access_secret =

[System Monitoring]
enabled = True
anope_timer = 300
message_channel = #seal-bob
failure_button = False

Expand Down
8 changes: 7 additions & 1 deletion data/facts/backup_facts.json
Expand Up @@ -37,5 +37,11 @@
"rr-en": "Reboot/Repair is a way for your ship to cannibalize working modules in an effort to repair damaged modules. (1/4) %n% To initiate Reboot/Repair, please navigate to the right-hand menu, and select 'Ship'. (2/4) %n% Select 'Reboot/Repair', wait for the timer to complete, then select 'Confirm' (3/4) %n% Ship will power down and reboot all modules/systems until complete. (4/4)",
"go-en": "{{Mentioned seals, }}You're up.",
"team-en": "Please add your Seal to your Team. Open your Comms Panel (top left option), and select the third tab. Then, select the Seal(s) you want, and select Invite to Team.",
"escapeneutron-en": "Guide to Escaping a Neutron Cone: (1/2) %n% Text: https://hullse.al/enText --- Video: https://hullse.al/enVid (2/2)"
"escapeneutron-en": "Guide to escaping Stellar Cones: https://hullse.al/neutronguide",
"ticket-en": "Please create a ticket here to ensure the appropriate staff members get notified: https://hullseals.space/support/create_ticket.php. A Hull Seals account is required.",
"f-en": "https://dev.hullseals.space/images/Unsuccessful_Rescue.png",
"pcfrcb-en": "Please REMAIN in the main menu, go into the Social menu, search for the Seals assigned to you in the search box in the top right corner, and click to add them.",
"mechanic-en": "You've not been around for a while, have you...",
"toby-en": "Gosh darnit Toby! Have a snish.",
"kaboom-en": "https://c.tenor.com/SqrZAbYtcq0AAAAM/madagscar-penguins.gif"
}
53 changes: 7 additions & 46 deletions data/help/commands.json
Expand Up @@ -189,52 +189,6 @@
"use": "Shorten a provided URL"
}
},
"Delay": {
"delaystatus": {
"aliases": [
"checkstatus"
],
"arguments": "",
"use": "Checks the system for Delayed Cases"
},
"delaycase": {
"aliases": [],
"arguments": "[case status] [notes]",
"use": "Adds a new case to the Delayed system, and responds with a unique Case ID."
},
"updatestatus": {
"aliases": [],
"arguments": "[case ID] [case status]",
"use": "Updates the Status Code of a case - see the table of different status codes below!"
},
"updatenotes": {
"aliases": [],
"arguments": "[case ID] [new notes]",
"use": "Updates the Notes attached to a case - this replaces the old notes entirely, so be sure to be complete in your new notes!"
},
"updatecase": {
"aliases": [],
"arguments": "[case ID] (case status) (case notes)",
"use": "Updates both the Status Code and Notes of a case - this replaces the old notes entirely, so be sure to be complete in your new notes!"
},
"close": {
"aliases": [
"endcase"
],
"arguments": "[case ID]",
"use": "Closes a case and removes it from the Delayed Case system. It's encouraged to update the notes before you close a case!"
},
"reopen": {
"aliases": [],
"arguments": "[case ID] [case status]",
"use": "Reopens a previously-closed case, if a case is improperly closed. Moderator only"
},
"checkstatus": {
"aliases": [],
"arguments": "",
"use": "Check if any cases are currently marked as 'Delayed' in the database."
}
},
"Drill": {
"drillcase": {
"aliases": [],
Expand Down Expand Up @@ -312,5 +266,12 @@
"arguments": "",
"use": "Shut down the bot. Will restart the bot if configured under daemon processing."
}
},
"Fun": {
"roll": {
"aliases": [],
"arguments": "#d#",
"use": "Roll the dice! (Up to 10 dice of any size)"
}
}
}
2 changes: 1 addition & 1 deletion halpybot/__init__.py
Expand Up @@ -10,7 +10,7 @@

from halpybot.packages.configmanager import config

__version__ = "1.6.3"
__version__ = "2.0.0-alpha"

DEFAULT_USER_AGENT = (
"HalpyBOT/"
Expand Down
2 changes: 0 additions & 2 deletions halpybot/commands/__init__.py
Expand Up @@ -8,7 +8,6 @@
See license.md
"""

from . import delayedboard
from . import edsm
from . import fact
from . import forcejoin
Expand All @@ -26,7 +25,6 @@
from . import misc

__all__ = [
"delayedboard",
"edsm",
"fact",
"forcejoin",
Expand Down