Skip to content

Commit

Permalink
Fix typos raised by codespell
Browse files Browse the repository at this point in the history
  • Loading branch information
TheophileDiot committed Oct 3, 2023
1 parent eea5dd9 commit 87ca176
Show file tree
Hide file tree
Showing 29 changed files with 105 additions and 103 deletions.
4 changes: 2 additions & 2 deletions docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Please contact us at [contact@bunkerity.com](mailto:contact@bunkerity.com) if yo

## Where to get community support ?

To get free community support, you can use the following medias :
To get free community support, you can use the following media :

- The #help channel of BunkerWeb in the [Discord server](https://discord.com/invite/fTf46FmtyD)
- The help category of [GitHub dicussions](https://github.com/bunkerity/bunkerweb/discussions)
- The help category of [GitHub discussions](https://github.com/bunkerity/bunkerweb/discussions)
- The [/r/BunkerWeb](https://www.reddit.com/r/BunkerWeb) subreddit
- The [Server Fault](https://serverfault.com/) and [Super User](https://superuser.com/) forums

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Concepts

<figure markdown>
![Overwiew](assets/img/concepts.svg){ align=center, width="600" }
![Overview](assets/img/concepts.svg){ align=center, width="600" }
</figure>

## Integrations
Expand Down
4 changes: 2 additions & 2 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ The first step is to install the plugin by putting the plugin files inside the c
When using the [Swarm integration](integrations.md#swarm), plugins must be written to the volume mounted on `/data/plugins` into the scheduler container.

!!! info "Swarm volume"
Configuring a Swarm volume that will persist when the scheduler service is running on different nodes is not covered is in this documentation. We will assume that you have a shared folder mounted on `/shared` accross all nodes.
Configuring a Swarm volume that will persist when the scheduler service is running on different nodes is not covered is in this documentation. We will assume that you have a shared folder mounted on `/shared` across all nodes.

The first thing to do is to create the plugins folder :

Expand Down Expand Up @@ -460,7 +460,7 @@ Some helpers modules provide common helpful helpers :
- `self.logger` : print logs
- `bunkerweb.utils` : various useful functions
- `bunkerweb.datastore` : access the global shared data on one instance (key/value store)
- `bunkerweb.clusterstore` : access a Redis data store shared beetween BunkerWeb instances (key/value store)
- `bunkerweb.clusterstore` : access a Redis data store shared between BunkerWeb instances (key/value store)

To access the functions, you first need to **require** the modules :

Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ BunkerWeb supports PHP using external or remote [PHP-FPM](https://www.php.net/ma
!!! warning "Feature is in beta"
This feature is not production-ready. Feel free to test it and report us any bug using [issues](https://github.com/bunkerity/bunkerweb/issues) in the GitHub repository.

By default, BunkerWeb will only listen on IPv4 adresses and won't use IPv6 for network communications. If you want to enable IPv6 support, you need to set `USE_IPV6=yes`. Please note that IPv6 configuration of your network and environment is out-of-the-scope of this documentation.
By default, BunkerWeb will only listen on IPv4 addresses and won't use IPv6 for network communications. If you want to enable IPv6 support, you need to set `USE_IPV6=yes`. Please note that IPv6 configuration of your network and environment is out-of-the-scope of this documentation.

=== "Docker"

Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,4 @@ If you have bots that need to access your website, the recommended way to avoid

## Timezone

When using container-based integrations, the timezone of the container may not match the one of the host machine. To resolve that, you can set the `TZ` environment variable to the timezone of your choice on your containers (e.g. `TZ=Europe/Paris`). You will find the list of timezone identifers [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
When using container-based integrations, the timezone of the container may not match the one of the host machine. To resolve that, you can set the `TZ` environment variable to the timezone of your choice on your containers (e.g. `TZ=Europe/Paris`). You will find the list of timezone identifiers [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
3 changes: 2 additions & 1 deletion examples/drupal/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
REVERSE_PROXY_URL: "/"
REVERSE_PROXY_HOST: "http://mydrupal"
CUSTOM_CONF_MODSEC_CRS_drupal: 'SecAction "id:900130,phase:1,nolog,pass,t:none,setvar:tx.crs_exclusions_drupal=1"'
# Onces the installation is done, you can remove these lines
# Once the installation is done, you can remove these lines
LIMIT_REQ_URL_1: "/core/install.php"
LIMIT_REQ_RATE_1: "5r/s"
labels:
Expand Down Expand Up @@ -75,6 +75,7 @@ volumes:
bw-data:
db-data:


networks:
bw-universe:
ipam:
Expand Down
3 changes: 2 additions & 1 deletion examples/prestashop/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
USE_REVERSE_PROXY: "yes"
REVERSE_PROXY_URL: "/"
REVERSE_PROXY_HOST: "http://myps"
# Onces the installation is done, you can remove these lines
# Once the installation is done, you can remove these lines
LIMIT_REQ_URL_1: "/install/index.php"
LIMIT_REQ_RATE_1: "8r/s"
labels:
Expand Down Expand Up @@ -85,6 +85,7 @@ volumes:
ps-data:
db-data:


networks:
bw-universe:
ipam:
Expand Down
2 changes: 1 addition & 1 deletion src/autoconf/IngressController.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def __watch(self, watch_type):
locked = False
continue
self._logger.info(
f"Catched kubernetes event ({watch_type}), deploying new configuration ...",
f"Caught kubernetes event ({watch_type}), deploying new configuration ...",
)
try:
ret = self.apply_config()
Expand Down
2 changes: 1 addition & 1 deletion src/autoconf/SwarmController.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __event(self, event_type):
self.__internal_lock.release()
locked = False
continue
self._logger.info(f"Catched Swarm event ({event_type}), deploying new configuration ...")
self._logger.info(f"Caught Swarm event ({event_type}), deploying new configuration ...")
if not self.apply_config():
self._logger.error("Error while deploying new configuration")
else:
Expand Down
4 changes: 2 additions & 2 deletions src/bw/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ log "ENTRYPOINT" "ℹ️" "Starting BunkerWeb v$(cat /usr/share/bunkerweb/VERSIO
# trap SIGTERM and SIGINT
function trap_exit() {
# shellcheck disable=SC2317
log "ENTRYPOINT" "ℹ️" "Catched stop operation, stopping nginx ..."
log "ENTRYPOINT" "ℹ️" "Caught stop operation, stopping nginx ..."
# shellcheck disable=SC2317
nginx -s stop
}
Expand All @@ -25,7 +25,7 @@ trap "trap_exit" TERM INT QUIT
# trap SIGHUP
function trap_reload() {
# shellcheck disable=SC2317
log "ENTRYPOINT" "ℹ️" "Catched reload operation"
log "ENTRYPOINT" "ℹ️" "Caught reload operation"
# shellcheck disable=SC2317
if [ -f /var/run/bunkerweb/nginx.pid ] ; then
# shellcheck disable=SC2317
Expand Down
2 changes: 1 addition & 1 deletion src/bw/lua/bunkerweb/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function plugin:initialize(id, ctx)
end
end
self.is_request = multisite
-- Store common objets
-- Store common objects
self.logger = logger:new(self.id)
local use_redis, err = utils.get_variable("USE_REDIS", false)
if not use_redis then
Expand Down
2 changes: 1 addition & 1 deletion src/common/core/blacklist/jobs/blacklist-download.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def check_line(kind: str, line: bytes) -> Tuple[bool, bytes]:
blacklist_path.joinpath(f"{kind}.list").unlink(missing_ok=True)
deleted, err = del_file_in_db(f"{kind}.list", db)
if not deleted:
logger.warning(f"Coudn't delete {kind}.list from cache : {err}")
logger.warning(f"Couldn't delete {kind}.list from cache : {err}")
if all_fresh:
_exit(0)

Expand Down
2 changes: 1 addition & 1 deletion src/common/core/greylist/jobs/greylist-download.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def check_line(kind: str, line: bytes) -> Tuple[bool, bytes]:
greylist_path.joinpath(f"{kind}.list").unlink(missing_ok=True)
deleted, err = del_file_in_db(f"{kind}.list", db)
if not deleted:
logger.warning(f"Coudn't delete {kind}.list from cache : {err}")
logger.warning(f"Couldn't delete {kind}.list from cache : {err}")
if all_fresh:
_exit(0)

Expand Down
2 changes: 1 addition & 1 deletion src/common/core/realip/jobs/realip-download.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def check_line(line):
tmp_realip_path.joinpath("combined.list").unlink(missing_ok=True)
deleted, err = del_file_in_db("combined.list", db)
if not deleted:
logger.warning(f"Coudn't delete combined.list from cache : {err}")
logger.warning(f"Couldn't delete combined.list from cache : {err}")
logger.info("RealIP list is already in cache, skipping download...")
_exit(0)

Expand Down
2 changes: 1 addition & 1 deletion src/common/core/whitelist/jobs/whitelist-download.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def check_line(kind: str, line: bytes) -> Tuple[bool, bytes]:
whitelist_path.joinpath(f"{kind}.list").unlink(missing_ok=True)
deleted, err = del_file_in_db(f"{kind}.list", db)
if not deleted:
logger.warning(f"Coudn't delete {kind}.list from cache : {err}")
logger.warning(f"Couldn't delete {kind}.list from cache : {err}")
if all_fresh:
_exit(0)

Expand Down
4 changes: 2 additions & 2 deletions src/common/db/Database.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def __init__(
with suppress(FileExistsError):
Path(dirname(sqlalchemy_string.split("///")[1])).mkdir(parents=True, exist_ok=True)
elif "+" in sqlalchemy_string and "+pymysql" not in sqlalchemy_string:
splitted = sqlalchemy_string.split("+")
sqlalchemy_string = f"{splitted[0]}:{':'.join(splitted[1].split(':')[1:])}"
split = sqlalchemy_string.split("+")
sqlalchemy_string = f"{split[0]}:{':'.join(split[1].split(':')[1:])}"

self.database_uri = sqlalchemy_string
error = False
Expand Down
4 changes: 2 additions & 2 deletions src/common/gen/Configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ def __load_variables(self, path: str) -> Dict[str, Any]:
line = line.strip()
if not line or line.startswith("#") or "=" not in line:
continue
splitted = line.split("=", 1)
variables[splitted[0]] = splitted[1]
split = line.split("=", 1)
variables[split[0]] = split[1]
return variables

def get_config(self) -> Dict[str, Any]:
Expand Down
46 changes: 23 additions & 23 deletions src/common/gen/save_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ def get_instance_configs_and_apis(instance: Any, db, _type="Docker"):
apis = []

for var in instance.attrs["Config"]["Env"] if _type == "Docker" else instance.attrs["Spec"]["TaskTemplate"]["ContainerSpec"]["Env"]:
splitted = var.split("=", 1)
if custom_confs_rx.match(splitted[0]):
custom_conf = custom_confs_rx.search(splitted[0]).groups()
split = var.split("=", 1)
if custom_confs_rx.match(split[0]):
custom_conf = custom_confs_rx.search(split[0]).groups()
custom_confs.append(
{
"value": f"# CREATED BY ENV\n{splitted[1]}",
"value": f"# CREATED BY ENV\n{split[1]}",
"exploded": (
custom_conf[0],
custom_conf[1],
Expand All @@ -47,14 +47,14 @@ def get_instance_configs_and_apis(instance: Any, db, _type="Docker"):
)
logger.info(f"Found custom conf env var {'for service ' + custom_conf[0] if custom_conf[0] else 'without service'} with type {custom_conf[1]} and name {custom_conf[2]}")
else:
tmp_config[splitted[0]] = splitted[1]
tmp_config[split[0]] = split[1]

if not db and splitted[0] == "DATABASE_URI":
db = Database(logger, sqlalchemy_string=splitted[1], pool=False)
elif splitted[0] == "API_HTTP_PORT":
api_http_port = splitted[1]
elif splitted[0] == "API_SERVER_NAME":
api_server_name = splitted[1]
if not db and split[0] == "DATABASE_URI":
db = Database(logger, sqlalchemy_string=split[1], pool=False)
elif split[0] == "API_HTTP_PORT":
api_http_port = split[1]
elif split[0] == "API_SERVER_NAME":
api_server_name = split[1]

apis.append(
API(
Expand Down Expand Up @@ -222,12 +222,12 @@ def get_instance_configs_and_apis(instance: Any, db, _type="Docker"):

for instance in docker_client.containers.list(filters={"label": "bunkerweb.INSTANCE"}):
for var in instance.attrs["Config"]["Env"]:
splitted = var.split("=", 1)
if custom_confs_rx.match(splitted[0]):
custom_conf = custom_confs_rx.search(splitted[0]).groups()
split = var.split("=", 1)
if custom_confs_rx.match(split[0]):
custom_conf = custom_confs_rx.search(split[0]).groups()
custom_confs.append(
{
"value": f"# CREATED BY ENV\n{splitted[1]}",
"value": f"# CREATED BY ENV\n{split[1]}",
"exploded": (
custom_conf[0],
custom_conf[1],
Expand All @@ -237,14 +237,14 @@ def get_instance_configs_and_apis(instance: Any, db, _type="Docker"):
)
logger.info(f"Found custom conf env var {'for service ' + custom_conf[0] if custom_conf[0] else 'without service'} with type {custom_conf[1]} and name {custom_conf[2]}")
else:
tmp_config[splitted[0]] = splitted[1]

if not db and splitted[0] == "DATABASE_URI":
db = Database(logger, sqlalchemy_string=splitted[1], pool=False)
elif splitted[0] == "API_HTTP_PORT":
api_http_port = splitted[1]
elif splitted[0] == "API_SERVER_NAME":
api_server_name = splitted[1]
tmp_config[split[0]] = split[1]

if not db and split[0] == "DATABASE_URI":
db = Database(logger, sqlalchemy_string=split[1], pool=False)
elif split[0] == "API_HTTP_PORT":
api_http_port = split[1]
elif split[0] == "API_SERVER_NAME":
api_server_name = split[1]

apis.append(
API(
Expand Down
2 changes: 1 addition & 1 deletion src/linux/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function reload()
log "SYSTEMCTL" "ℹ️" "BunkerWeb service reloaded ..."
}

# List of differents args
# List of different args
case $1 in
"start")
start
Expand Down
2 changes: 1 addition & 1 deletion src/scheduler/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# trap SIGTERM and SIGINT
function trap_exit() {
# shellcheck disable=SC2317
log "ENTRYPOINT" "ℹ️ " "Catched stop operation"
log "ENTRYPOINT" "ℹ️ " "Caught stop operation"
# shellcheck disable=SC2317
if [ -f "/var/run/bunkerweb/scheduler.pid" ] ; then
# shellcheck disable=SC2317
Expand Down
8 changes: 4 additions & 4 deletions src/ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def stop(status, _stop=True):


def handle_stop(signum, frame):
app.logger.info("Catched stop operation")
app.logger.info("Caught stop operation")
app.logger.info("Stopping web ui ...")
stop(0, False)

Expand Down Expand Up @@ -1330,13 +1330,13 @@ def logs_container(container_id):
)

for log in tmp_logs:
splitted = log.split(" ")
timestamp = splitted[0]
split = log.split(" ")
timestamp = split[0]

if to_date is not None and dateutil_parse(timestamp).timestamp() > to_date:
break

log = " ".join(splitted[1:])
log = " ".join(split[1:])
log_lower = log.lower()

if "[48;2" in log or not log.strip():
Expand Down
6 changes: 3 additions & 3 deletions src/ui/static/js/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ class Dropdown {
}

toggleSelectBtn(e) {
const attribut = e.target
const attribute = e.target
.closest("button")
.getAttribute(`data-${this.prefix}-setting-select`);
//toggle dropdown
const dropdownEl = document.querySelector(
`[data-${this.prefix}-setting-select-dropdown="${attribut}"]`,
`[data-${this.prefix}-setting-select-dropdown="${attribute}"]`,
);
const dropdownChevron = document.querySelector(
`svg[data-${this.prefix}-setting-select="${attribut}"]`,
`svg[data-${this.prefix}-setting-select="${attribute}"]`,
);
dropdownEl.classList.toggle("hidden");
dropdownEl.classList.toggle("flex");
Expand Down
6 changes: 3 additions & 3 deletions src/ui/static/js/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ class Dropdown {
}

toggleSelectBtn(e) {
const attribut = e.target
const attribute = e.target
.closest("button")
.getAttribute(`data-${this.prefix}-setting-select`);
//toggle dropdown
const dropdownEl = document.querySelector(
`[data-${this.prefix}-setting-select-dropdown="${attribut}"]`,
`[data-${this.prefix}-setting-select-dropdown="${attribute}"]`,
);
const dropdownChevron = document.querySelector(
`svg[data-${this.prefix}-setting-select="${attribut}"]`,
`svg[data-${this.prefix}-setting-select="${attribute}"]`,
);
dropdownEl.classList.toggle("hidden");
dropdownEl.classList.toggle("flex");
Expand Down
6 changes: 3 additions & 3 deletions src/ui/static/js/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ class Dropdown {
}

toggleSelectBtn(e) {
const attribut = e.target
const attribute = e.target
.closest("button")
.getAttribute(`data-${this.prefix}-setting-select`);
//toggle dropdown
const dropdownEl = document.querySelector(
`[data-${this.prefix}-setting-select-dropdown="${attribut}"]`
`[data-${this.prefix}-setting-select-dropdown="${attribute}"]`
);
const dropdownChevron = document.querySelector(
`svg[data-${this.prefix}-setting-select="${attribut}"]`
`svg[data-${this.prefix}-setting-select="${attribute}"]`
);
dropdownEl.classList.toggle("hidden");
dropdownEl.classList.toggle("flex");
Expand Down
Loading

0 comments on commit 87ca176

Please sign in to comment.