Compare commits
No commits in common. "f566b2eeda930447dea5ef80185edfa27689b28e" and "6f13b2532d23dabfb8078adc9db3fc4c684b15d1" have entirely different histories.
f566b2eeda
...
6f13b2532d
@ -25,9 +25,6 @@ RUN curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyri
|
|||||||
RUN apt update \
|
RUN apt update \
|
||||||
&& apt install -y redis grafana
|
&& apt install -y redis grafana
|
||||||
|
|
||||||
# Configure Grafana
|
|
||||||
RUN grafana-cli plugins install frser-sqlite-datasource
|
|
||||||
|
|
||||||
COPY requirements.txt /app/requirements.txt
|
COPY requirements.txt /app/requirements.txt
|
||||||
RUN python3 -m pip install -r requirements.txt
|
RUN python3 -m pip install -r requirements.txt
|
||||||
|
|
||||||
|
17
V6.py
17
V6.py
@ -391,22 +391,17 @@ def login_part_1():
|
|||||||
)
|
)
|
||||||
# 2FA
|
# 2FA
|
||||||
try:
|
try:
|
||||||
if not wait_until_visible(By.ID, "idTxtBx_SAOTCC_OTC", browser=driver, timeout=5, raise_error=False):
|
wait_until_visible(By.ID, "idTxtBx_SAOTCC_OTC", browser=driver, timeout=5)
|
||||||
custom_sleep(2)
|
|
||||||
return
|
|
||||||
|
|
||||||
tfa = config.UserCredentials.get_tfa()
|
|
||||||
if tfa is None:
|
|
||||||
error("2FA needed but no code available for this account, sending error")
|
|
||||||
raise ValueError("2FA needed but no code available for this account")
|
|
||||||
else:
|
|
||||||
a2f_code = tfa.now()
|
|
||||||
|
|
||||||
|
a2f_code = config.UserCredentials.get_tfa().now()
|
||||||
info(f"Need 2FA, I have code: {a2f_code}")
|
info(f"Need 2FA, I have code: {a2f_code}")
|
||||||
send_wait_and_confirm(
|
send_wait_and_confirm(
|
||||||
driver.find_element(By.ID, "idTxtBx_SAOTCC_OTC"),
|
driver.find_element(By.ID, "idTxtBx_SAOTCC_OTC"),
|
||||||
a2f_code
|
a2f_code
|
||||||
)
|
)
|
||||||
|
except NoSuchElementException:
|
||||||
|
custom_sleep(2)
|
||||||
|
pass
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
log_error(err)
|
log_error(err)
|
||||||
|
|
||||||
@ -709,7 +704,7 @@ def json_start(json_entry, cred: UserCredentials):
|
|||||||
config.WebDriver.switch_to_driver("PC")
|
config.WebDriver.switch_to_driver("PC")
|
||||||
driver = config.WebDriver.driver
|
driver = config.WebDriver.driver
|
||||||
try:
|
try:
|
||||||
if "unban" in json_entry and str(account_id) in json_entry["unban"]:
|
if str(account_id) in json_entry["unban"]:
|
||||||
login_part_1()
|
login_part_1()
|
||||||
info("\nGO TO example.com TO PROCEED or wait 1200 secs.")
|
info("\nGO TO example.com TO PROCEED or wait 1200 secs.")
|
||||||
for _ in range(1200):
|
for _ in range(1200):
|
||||||
|
@ -59,6 +59,7 @@ sqlite3 /app/MsRewards-Reborn/MsRewards.db "CREATE TABLE comptes (id INTEGER PRI
|
|||||||
printf "\nconfigurating grafana\n"
|
printf "\nconfigurating grafana\n"
|
||||||
|
|
||||||
cp /app/MsRewards-Reborn/config/grafana.ini /etc/grafana/
|
cp /app/MsRewards-Reborn/config/grafana.ini /etc/grafana/
|
||||||
|
grafana-cli plugins install frser-sqlite-datasource
|
||||||
|
|
||||||
printf "setting up default dashboard"
|
printf "setting up default dashboard"
|
||||||
cp /app/MsRewards-Reborn/config/Stats-dashbord.json /usr/share/grafana/public/dashboards/home.json
|
cp /app/MsRewards-Reborn/config/Stats-dashbord.json /usr/share/grafana/public/dashboards/home.json
|
||||||
|
1459
config/grafana.ini
1459
config/grafana.ini
File diff suppressed because it is too large
Load Diff
@ -50,14 +50,9 @@ class Config:
|
|||||||
"""
|
"""
|
||||||
self.discord = DiscordConfig()
|
self.discord = DiscordConfig()
|
||||||
self.discord.avatar_url = settings["avatarlink"]
|
self.discord.avatar_url = settings["avatarlink"]
|
||||||
|
|
||||||
if (
|
|
||||||
"discord" in config[args.config]
|
|
||||||
and config[args.config]["discord"] in discord
|
|
||||||
and "errorsL" in discord[config[args.config]["discord"]]
|
|
||||||
and discord[config[args.config]["discord"]]["errorsL"] != ""
|
|
||||||
):
|
|
||||||
self.discord.wh_link = discord[config[args.config]["discord"]]["errorsL"]
|
self.discord.wh_link = discord[config[args.config]["discord"]]["errorsL"]
|
||||||
|
|
||||||
|
if self.discord.wh_link != "":
|
||||||
self.discord.wh = Webhook.from_url(self.discord.wh_link, adapter=RequestsWebhookAdapter())
|
self.discord.wh = Webhook.from_url(self.discord.wh_link, adapter=RequestsWebhookAdapter())
|
||||||
else:
|
else:
|
||||||
self.discord.wh = FakeWebHook()
|
self.discord.wh = FakeWebHook()
|
||||||
|
@ -9,6 +9,6 @@ class DiscordConfig:
|
|||||||
|
|
||||||
|
|
||||||
class FakeWebHook:
|
class FakeWebHook:
|
||||||
def send(self, *args, **kwargs):
|
def send(self, *args):
|
||||||
debug(f"Used a webhook call without webhook url with {args} {kwargs}")
|
debug(f"Used a webhook call without webhook url with {args}")
|
||||||
|
|
||||||
|
@ -30,8 +30,7 @@ class UserCredentials:
|
|||||||
|
|
||||||
def get_tfa(self):
|
def get_tfa(self):
|
||||||
if not self.tfa_enable():
|
if not self.tfa_enable():
|
||||||
warning("Warning: TFA is not enabled. Can't get a TFA code.")
|
warning("Warning: TFA is not enabled. Calling get_tfa is an expected behaviour.")
|
||||||
return None
|
|
||||||
return TOTP(self.data[self.current]["2fa"])
|
return TOTP(self.data[self.current]["2fa"])
|
||||||
|
|
||||||
def next_account(self):
|
def next_account(self):
|
||||||
|
@ -71,12 +71,11 @@ def send_wait_and_confirm(element, keys: str) -> None:
|
|||||||
|
|
||||||
|
|
||||||
# Wait for the presence of the element identifier or [timeout]s
|
# Wait for the presence of the element identifier or [timeout]s
|
||||||
def wait_until_visible(search_by: str, identifier: str, timeout: int = 20, browser=None, raise_error=True) -> bool:
|
def wait_until_visible(search_by: str, identifier: str, timeout: int = 20, browser=None) -> bool:
|
||||||
try:
|
try:
|
||||||
WebDriverWait(browser, timeout).until(
|
WebDriverWait(browser, timeout).until(
|
||||||
expected_conditions.visibility_of_element_located((search_by, identifier)), "element not found")
|
expected_conditions.visibility_of_element_located((search_by, identifier)), "element not found")
|
||||||
return True
|
return True
|
||||||
except TimeoutException as e:
|
except TimeoutException as e:
|
||||||
if raise_error:
|
|
||||||
error(f"element {identifier} not found after {timeout}s")
|
error(f"element {identifier} not found after {timeout}s")
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user