Updater / Run pre-commit-config and apply it

This commit is contained in:
Théophile Diot 2024-03-25 12:59:43 +00:00
parent 46d12b1cb9
commit 3d27b5e78d
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06
9 changed files with 15 additions and 14 deletions

View file

@ -17,7 +17,7 @@ repos:
- id: check-case-conflict
- repo: https://github.com/psf/black
rev: 6fdf8a4af28071ed1d079c01122b34c5d587207a # frozen: 24.2.0
rev: 552baf822992936134cbd31a38f69c8cfe7c0f05 # frozen: 24.3.0
hooks:
- id: black
name: Black Python Formatter
@ -50,7 +50,7 @@ repos:
args: ["--max-line-length=160", "--ignore=E266,E402,E501,E722,W503"]
- repo: https://github.com/dosisod/refurb
rev: a9a4edd45687e664dee0905ba1c848bda227d1d6 # frozen: v1.28.0
rev: 2e31f0033b6c00bf99912fc6a8b5fd00460c9ba0 # frozen: v2.0.0
hooks:
- id: refurb
name: Refurb Python Refactoring Tool
@ -72,6 +72,6 @@ repos:
- id: gitleaks
- repo: https://github.com/koalaman/shellcheck-precommit
rev: 3f77b826548d8dc2d26675f077361c92773b50a7 # frozen: v0.9.0
rev: 2491238703a5d3415bb2b7ff11388bf775372f29 # frozen: v0.10.0
hooks:
- id: shellcheck

View file

@ -18,3 +18,4 @@ src/ui/static/js/utils/purify/*
src/ui/templates/*
src/common/core/*/ui/*
datepicker-foundation.css
examples/

View file

@ -102,10 +102,10 @@ for pro in glob(f"v{version}/*/plugin.json"):
core_settings[pro_plugin["name"]]["is_pro"] = True
# Print plugins and their settings
for name, data in dict(sorted(core_settings.items())).items():
for data in dict(sorted(core_settings.items())).values():
pro_crown = ""
if "is_pro" in data:
pro_crown = f" <img src='/assets/img/pro-icon.svg' alt='crow pro icon' height='32px' width='32px'> (PRO)\n"
pro_crown = " <img src='/assets/img/pro-icon.svg' alt='crow pro icon' height='32px' width='32px'> (PRO)\n"
print(f"## {data['name']}{pro_crown}\n", file=doc)
print(f"{stream_support(data['stream'])}\n", file=doc)
print(f"{data['description']}\n", file=doc)

View file

@ -626,4 +626,4 @@ List of settings :
- Accepted values for `REPORTING_SCHEDULE` are `daily`, `weekly`and `monthly`.
- If no `REPORTING_SMTP_FROM_USER` and `REPORTING_SMTP_FROM_PASSWORD` are set, the plugin will try to send the email without authentication.
- If `REPORTING_SMTP_FROM_USER` isn't set but `REPORTING_SMTP_FROM_PASSWORD` is set, the plugin will use the `REPORTING_SMTP_FROM_EMAIL` as the username.
- If the job fails, the plugin will retry sending the report in the next execution.
- If the job fails, the plugin will retry sending the report in the next execution.

View file

@ -58,7 +58,7 @@ def certbot_new(domains: str, email: str, use_letsencrypt_staging: bool = False)
stdin=DEVNULL,
stderr=PIPE,
universal_newlines=True,
env=environ.copy() | {"PYTHONPATH": join(sep, "usr", "share", "bunkerweb", "deps", "python")},
env=environ | {"PYTHONPATH": join(sep, "usr", "share", "bunkerweb", "deps", "python")},
)
while process.poll() is None:
if process.stderr:
@ -124,7 +124,7 @@ try:
stdout=PIPE,
stderr=STDOUT,
text=True,
env=environ.copy() | {"PYTHONPATH": join(sep, "usr", "share", "bunkerweb", "deps", "python")},
env=environ | {"PYTHONPATH": join(sep, "usr", "share", "bunkerweb", "deps", "python")},
check=False,
)
stdout = proc.stdout

View file

@ -63,7 +63,7 @@ try:
stdin=DEVNULL,
stderr=PIPE,
universal_newlines=True,
env=environ.copy() | {"PYTHONPATH": join(sep, "usr", "share", "bunkerweb", "deps", "python")},
env=environ | {"PYTHONPATH": join(sep, "usr", "share", "bunkerweb", "deps", "python")},
)
while process.poll() is None:
if process.stderr:

View file

@ -252,7 +252,7 @@ if __name__ == "__main__":
env["DATABASE_URI"] = db.database_uri
# Instantiate scheduler
SCHEDULER = JobScheduler(env | environ.copy(), logger, INTEGRATION, db=db)
SCHEDULER = JobScheduler(env | environ, logger, INTEGRATION, db=db)
if INTEGRATION in ("Docker", "Swarm", "Kubernetes", "Autoconf"):
# Automatically setup the scheduler apis
@ -370,7 +370,7 @@ if __name__ == "__main__":
logger.info("Running plugins download jobs ...")
# Update the environment variables of the scheduler
SCHEDULER.env = env | environ.copy()
SCHEDULER.env = env | environ
if not SCHEDULER.run_single("download-plugins"):
logger.warning("download-plugins job failed at first start, plugins settings set by the user may not be up to date ...")
if not SCHEDULER.run_single("download-pro-plugins"):
@ -454,7 +454,7 @@ if __name__ == "__main__":
if RUN_JOBS_ONCE:
# Update the environment variables of the scheduler
SCHEDULER.env = env | environ.copy()
SCHEDULER.env = env | environ
SCHEDULER.setup()
# Only run jobs once

View file

@ -271,7 +271,7 @@ class Instances:
def reload_instances(self) -> Union[list[str], str]:
not_reloaded: list[str] = []
for instance in self.get_instances():
if instance.health is False:
if not instance.health:
not_reloaded.append(instance.name)
continue

View file

@ -51,7 +51,7 @@ try:
try:
assert_button_click(DRIVER, f"//form[starts-with(@id, 'form-instance-')]//button[@value='{action}']")
log_info(f"Clicked on stop button, waiting 5s ...")
log_info("Clicked on stop button, waiting 5s ...")
sleep(5)
safe_get_element(DRIVER, By.XPATH, "//form[starts-with(@id, 'form-instance-')]", error=True)
log_exception("Instance was not stopped successfully, exiting ...")