Skip to content

Commit fef128f

Browse files
dgibbs64Copilot
andauthored
fix (alerts): Alerts on update uses the old game server version not the new one (#4854)
* feat: refactor update comparison output for consistency and clarity - Replaced direct echo statements with fn_print functions for uniformity in output formatting across multiple update scripts. - Ensured lockfile creation uses the correct syntax for variable expansion. - Moved lock file to the same location to ensure monitor doesnt reboot at the wrong time - Updated remote build information display to enhance readability and maintain consistency in logging. - Removed unnecessary echo commands to streamline the output process. * Refactor remote build version handling across multiple modules - Updated variable names from 'remotebuildversion' to 'remotebuild' for consistency. - Adjusted logic to check for remote build availability using the new variable name. - Modified output messages to reflect the change in variable naming. - Ensured all modules (update_mc.sh, update_mcb.sh, update_mta.sh, update_pmc.sh, update_ts3.sh, update_ut99.sh, update_vints.sh, update_xnt.sh) are aligned with the new naming convention for better readability and maintainability. * fix(alert): resolve issue with servername not always being listed in title * Moved `info_distro.sh`, `info_game.sh`, and `info_messages.sh` calls to the top of the `fn_alert_log` function for better clarity. * Updated `alerticon` assignment to maintain consistency in alert information handling. * fix(alert_discord): remove "More info" field from Discord alert JSON * Eliminated the "More info" field to streamline the alert message. * This change enhances the clarity of the alert by focusing on essential information. * fix(alert): improve update alert messaging for clarity * Updated alert messages in `fn_alert_update` and `fn_alert_update_failed` for better readability. * Changed alert action from `update-request` to `update-restart-request` in `fn_monitor_check_update_source`. * remove inline * fix(alert): Correct grammar in update alert message * Changed "an LinuxGSM update" to "a LinuxGSM update" for grammatical accuracy. * typo * fix(alert_discord): Add inline property to "Is my Game Server Online?" field * Ensures proper formatting of the Discord alert message. * Improves the display of the server status information. * fix(pd): increase timeout for termbin.com connection * fix(alert_discord): reorder fields in Discord alert JSON * Changed the order of fields in the Discord alert JSON structure. * Updated the "More info" and "Is my Game Server Online?" fields for better clarity. * revert back to factorio.com Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Standardizes alert messages across platforms Ensures consistency in alert messages across Discord, NTFY, Pushover, Rocketchat, Slack, and Telegram. Updates Discord alerts to include server hostname and time, removes redundant formatting. Standardizes plain-text alert formatting for NTFY. Refactors Pushover messages to use consistent HTML formatting. Streamlines Rocketchat and Slack messages by removing duplicate server info and adding optional link support. * Removes Hostname from alert messages Removes the Hostname field from various alert messages (Discord, Gotify, IFTTT, ntfy, Pushbullet, Pushover, Rocketchat, Slack, Telegram). The hostname was deemed redundant or unnecessary in the context of these alerts. Relates to #4696 * Configures shellcheckrc filename Configures the Super-Linter action to use `.shellcheckrc` as the BASH_FILE_NAME. This ensures that shellcheck uses the correct configuration file for bash script linting. Fixes #4696 * Disables shellcheck errors and removes variable Disables specific shellcheck errors to allow certain coding patterns and removes an unused variable from the super-linter workflow. This improves the linter's signal-to-noise ratio and reduces unnecessary checks. Relates to #4696 * Fixes and improves server list validation scripts Addresses issues in the server list validation scripts: - Fixes potential issues with parsing curl custom arguments in telegram alerts. - Corrects the shortname array generation. - Implements more robust checks for validating game icons. - Ensures the consistency of server counts across different CSV files. * Fixes glibc check and mod selection logic Corrects glibc version comparison to properly handle version strings. Improves mod installation and removal by validating user input against available options, providing a more robust selection process. This prevents errors caused by invalid mod names and enhances the user experience. Updates arithmetic expression syntax for better compatibility. * Fixes cache control for dev-debug mode Updates the handling of cache control headers in dev-debug mode. The `nocache` variable is changed to an array to correctly pass multiple headers to `curl`. This resolves issues with cached versions of files being used when dev-debug is enabled, ensuring that the latest versions are always fetched. Fixes #4696 * Allows spaces in steamcmdcommand variable Parses steamcmdcommand as an array to allow spaces in the variable. This prevents issues when the user wants to pass arguments with spaces to the steamcmd executable. * Addresses various script improvements Addresses multiple improvements across various scripts: - Fixes Valheim unstripped_corlib override by commenting out the lines in the config files. - Improves process identification for source and goldsrc engines using `pgrep`. - Enhances backup file identification using `find` with `-maxdepth 1` and `-type f`. - Fixes glibc version comparison logic in multiple files. - Improves UT2K4 key installation script by using printf for writing the key to the file. - Corrects the mod info extraction logic to correctly identify mod entries. - Improves amxmodx file installation/removal logic to prevent duplicate entries. - Fixes server info retrieval to handle spaces in the server list. Relates to #4696 * Fixes mono repo install exit code check Corrects the mono repo install exit code check to use the dedicated monorepoexitcode variable, ensuring accurate error detection. Updates the exit trap to preserve the original exit status, preventing potential loss of information when handling script termination. * Refactors and reorders core modules Improves module loading by reordering and refactoring the core modules. This change addresses inconsistencies and improves the overall structure of how core modules are handled within the system. Some fix scripts were renamed to match the module name. * Makes scripts executable Changes file permissions to make shell scripts executable. This ensures that the scripts can be run directly. Addresses a pre-existing issue. Related to #4696 * Adds explicit permissions to workflows Specifies explicit permissions for GitHub Actions workflows to enhance security and control access to resources. This ensures that each workflow only has the necessary permissions, following the principle of least privilege. * Fixes output redirection and URL parsing Corrects output redirection in GitHub Actions workflows by enclosing the $GITHUB_OUTPUT variable in quotes, preventing potential issues with variable expansion. Ensures proper URL parsing in workflows by enclosing the URL within quotes, addressing potential parsing errors. Fixes #4696 * Applies code formatting for consistency Applies Prettier formatting to the codebase for improved readability and consistency. Addresses minor code style inconsistencies across several files. * Fixes minor formatting and logic issues Addresses various minor issues including: - Standardizes indentation in `.editorconfig` for different file types. - Simplifies Prettier configuration. - Updates image links in `README.md`. - Ensures newline character at end of `.csv` files. - Corrects a conditional statement in `command_fastdl.sh`. - Corrects a conditional statement in `info_messages.sh`. - Updates server query protocols in `query_gsquery.py`. * Configures and disables linters Adds YAML linting configuration and disables unnecessary linters to streamline the CI/CD process and reduce noise from irrelevant checks. * Improves documentation and linting Updates documentation links to be enclosed in angle brackets, preventing markdown rendering issues. Configures markdownlint to align with repository standards and avoid common false positives. The updated links in the documentation ensure they are correctly interpreted by markdown parsers, improving user experience. The markdownlint configuration fine-tunes linting rules to better match the project's existing style and conventions, reducing noise from irrelevant warnings. * Fixes typos and improves code consistency Addresses various typos and inconsistencies across multiple files, enhancing code readability and maintainability. Adds codespell and flake8 configurations for linting. Relates to #4696 * Excludes workflow files from Prettier formatting Prevents Prettier from formatting workflow files due to GitHub token restrictions, as the token used by the Prettier auto-commit action lacks permissions to update files within the `.github/workflows/` directory. * chore(prettier): format code * Updates Super-Linter configuration Improves Super-Linter's reliability by switching to linting the entire codebase instead of relying on git history. This change also addresses potential transient fetch failures from GitHub. Additionally, this commit expands the ignored paths in codespell and disables some linters to improve performance and reduce false positives. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: dgibbs64 <dgibbs64@users.noreply.github.com>
1 parent e1cbee0 commit fef128f

File tree

186 files changed

+1155
-1097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+1155
-1097
lines changed

.devcontainer/devcontainer.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"name": "BASH Dev Container",
3-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4-
"features": {
5-
"ghcr.io/devcontainers-community/npm-features/prettier:1": {
6-
"plugins": "prettier-plugin-sh"
7-
},
8-
"ghcr.io/devcontainers-extra/features/actionlint:1": {},
9-
"ghcr.io/devcontainers-extra/features/checkov:1": {},
10-
"ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {},
11-
"ghcr.io/devcontainers-extra/features/shellcheck:1": {},
12-
"ghcr.io/devcontainers-extra/features/yamllint:2": {},
13-
"ghcr.io/devcontainers/features/github-cli:1": {}
14-
},
15-
"customizations": {
16-
"vscode": {
17-
"extensions": [
18-
"DavidAnson.vscode-markdownlint",
19-
"editorconfig.editorconfig",
20-
"esbenp.prettier-vscode",
21-
"github.vscode-github-actions",
22-
"GitHub.vscode-pull-request-github",
23-
"redhat.vscode-yaml",
24-
"timonwong.shellcheck",
25-
"yzhang.markdown-all-in-one"
26-
]
27-
}
28-
},
29-
"postCreateCommand": "npm init -y >/dev/null 2>&1 || true && npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template"
2+
"name": "BASH Dev Container",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4+
"features": {
5+
"ghcr.io/devcontainers-community/npm-features/prettier:1": {
6+
"plugins": "prettier-plugin-sh"
7+
},
8+
"ghcr.io/devcontainers-extra/features/actionlint:1": {},
9+
"ghcr.io/devcontainers-extra/features/checkov:1": {},
10+
"ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {},
11+
"ghcr.io/devcontainers-extra/features/shellcheck:1": {},
12+
"ghcr.io/devcontainers-extra/features/yamllint:2": {},
13+
"ghcr.io/devcontainers/features/github-cli:1": {}
14+
},
15+
"customizations": {
16+
"vscode": {
17+
"extensions": [
18+
"DavidAnson.vscode-markdownlint",
19+
"editorconfig.editorconfig",
20+
"esbenp.prettier-vscode",
21+
"github.vscode-github-actions",
22+
"GitHub.vscode-pull-request-github",
23+
"redhat.vscode-yaml",
24+
"timonwong.shellcheck",
25+
"yzhang.markdown-all-in-one"
26+
]
27+
}
28+
},
29+
"postCreateCommand": "npm init -y >/dev/null 2>&1 || true && npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template"
3030
}

.editorconfig

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ insert_final_newline = true
1212
trim_trailing_whitespace = true
1313

1414
# BASH Files
15-
[*.{.sh}]
15+
[*.sh]
1616
indent_size = 4
1717
indent_style = tab
18+
19+
# JSON Files (Biome formatting)
20+
[*.json]
21+
indent_style = tab
22+
indent_size = 2
23+
24+
# Steam appmanifest files (Valve ACF format)
25+
[*.acf]
26+
indent_style = tab
27+
indent_size = 4
28+
29+
# Python
30+
[*.py]
31+
indent_style = space
32+
indent_size = 4

.github/linters/.codespellrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[codespell]
2+
# Skip data tables that contain many short server identifiers (e.g. "fof", "nd")
3+
skip =
4+
lgsm/data/*.csv,
5+
package-lock.json,
6+
*/package-lock.json,
7+
node_modules,
8+
*/node_modules/*
9+
10+
# Ignore common identifiers/acronyms and extensions used throughout LinuxGSM
11+
ignore-words-list = distroname,fof,nd,sav,parms,ThirdParty

.github/linters/.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 120

.github/linters/.markdown-lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Configuration for markdownlint (used by Super Linter)
2+
3+
# MD041: README starts with HTML badges in this repo.
4+
MD041: false
5+
6+
# MD051: GitHub heading anchor generation can differ (emoji, punctuation).
7+
MD051: false
8+
9+
# MD013: The project documentation frequently contains long URLs/commands.
10+
MD013: false
11+
12+
# MD033: The main README uses inline HTML for badges.
13+
MD033: false
14+
15+
# Match existing list formatting in this repo.
16+
MD007:
17+
indent: 4
18+
19+
MD030:
20+
ul_single: 3
21+
ol_single: 2
22+
ul_multi: 3
23+
ol_multi: 2

.github/linters/.shellcheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
disable=SC2154,SC2034

.github/linters/.yaml-lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
extends: default
2+
3+
rules:
4+
document-start: disable
5+
truthy: disable
6+
7+
line-length:
8+
max: 200
9+
level: warning
10+
allow-non-breakable-words: true
11+
allow-non-breakable-inline-mappings: true
12+
13+
braces:
14+
min-spaces-inside: 0
15+
max-spaces-inside: 1
16+
min-spaces-inside-empty: 0
17+
max-spaces-inside-empty: 0
18+
19+
empty-lines:
20+
max: 2
21+
max-start: 0
22+
max-end: 0
23+
24+
comments:
25+
min-spaces-from-content: 1

.github/pull_request_template.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@ Fixes #[issue]
66

77
## Type of change
88

9-
- [ ] Bug fix (a change which fixes an issue).
10-
- [ ] New feature (a change which adds functionality).
11-
- [ ] New Server (new server added).
12-
- [ ] Refactor (restructures existing code).
13-
- [ ] Comment update (typo, spelling, explanation, examples, etc).
9+
- [ ] Bug fix (a change which fixes an issue).
10+
- [ ] New feature (a change which adds functionality).
11+
- [ ] New Server (new server added).
12+
- [ ] Refactor (restructures existing code).
13+
- [ ] Comment update (typo, spelling, explanation, examples, etc).
1414

1515
## Checklist
1616

1717
PR will not be merged until all steps are complete.
1818

19-
- [ ] This pull request links to an issue.
20-
- [ ] This pull request uses the `develop` branch as its base.
21-
- [ ] This pull request subject follows the Conventional Commits standard.
22-
- [ ] This code follows the style guidelines of this project.
23-
- [ ] I have performed a self-review of my code.
24-
- [ ] I have checked that this code is commented where required.
25-
- [ ] I have provided a detailed enough description of this PR.
26-
- [ ] I have checked if documentation needs updating.
19+
- [ ] This pull request links to an issue.
20+
- [ ] This pull request uses the `develop` branch as its base.
21+
- [ ] This pull request subject follows the Conventional Commits standard.
22+
- [ ] This code follows the style guidelines of this project.
23+
- [ ] I have performed a self-review of my code.
24+
- [ ] I have checked that this code is commented where required.
25+
- [ ] I have provided a detailed enough description of this PR.
26+
- [ ] I have checked if documentation needs updating.
2727

2828
## Documentation
2929

3030
If documentation does need updating either update it by creating a PR (preferred) or request a documentation update.
3131

32-
- User docs: https://github.com/GameServerManagers/LinuxGSM-Docs
33-
- Dev docs: https://github.com/GameServerManagers/LinuxGSM-Dev-Docs
32+
- User docs: <https://github.com/GameServerManagers/LinuxGSM-Docs>
33+
- Dev docs: <https://github.com/GameServerManagers/LinuxGSM-Dev-Docs>
3434

3535
**Thank you for your Pull Request!**

.github/workflows/action-super-linter.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ jobs:
2727
- name: Checkout code
2828
uses: actions/checkout@v6
2929
with:
30-
# super-linter needs the full git history to get the
31-
# list of files that changed across commits
32-
fetch-depth: 0
30+
# Shallow clone reduces transient fetch failures (HTTP 500) from GitHub.
31+
# We lint the whole codebase instead of relying on git history.
32+
fetch-depth: 1
33+
fetch-tags: false
3334
persist-credentials: false
3435

3536
- name: Install Prettier plugins (for summary formatting)
@@ -48,6 +49,7 @@ jobs:
4849
VALIDATE_JSON_PRETTIER: false
4950
VALIDATE_MARKDOWN_PRETTIER: false
5051
VALIDATE_NATURAL_LANGUAGE: false
52+
VALIDATE_PYTHON_RUFF_FORMAT: false
5153
VALIDATE_SHELL_SHFMT: false
5254
VALIDATE_TRIVY: false
5355
VALIDATE_YAML_PRETTIER: false

.github/workflows/add-to-project.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
- opened
66
- labeled
77

8+
permissions: {}
9+
810
jobs:
911
add-to-project:
1012
if: github.repository_owner == 'GameServerManagers'

0 commit comments

Comments
 (0)