Skip to content

Commit

Permalink
Merge pull request #1176 from zabbix/fix_style_trunk
Browse files Browse the repository at this point in the history
Fix style trunk
  • Loading branch information
dotneft authored Feb 14, 2024
2 parents 31562d2 + 907baa6 commit adce128
Show file tree
Hide file tree
Showing 29 changed files with 96 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
<!--- Paste verbatim command output between quotes -->
```paste below

```
```
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
Expand Down
61 changes: 41 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.3
hooks:
- id: gitleaks
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-yaml
- id: check-symlinks
- id: pretty-format-json
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.3
hooks:
- id: gitleaks
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: end-of-file-fixer
exclude: |
(?x)(
^env_vars/\.MYSQL |
^env_vars/\.POSTGRES
)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: |
(?x)(
.*\.patch$
)
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-symlinks
# - id: pretty-format-json
- id: check-added-large-files
#- repo: https://github.com/adrienverge/yamllint.git
# rev: v1.21.0 # or higher tag
# hooks:
# - id: yamllint
# args: [--format, parsable, --strict]
#- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
# rev: 0.2.3
# hooks:
# - id: yamlfmt
# args: [--mapping, '2', --sequence, '1', --offset, '0', --colons, --width, '400']
10 changes: 5 additions & 5 deletions Dockerfiles/agent/windows/docker-entrypoint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Update-Config-Var {
if (-not(Test-Path -Path $ConfigPath -PathType Leaf)) {
throw "**** Configuration file '$ConfigPath' does not exist"
}

if ($MaskList.Contains($VarName) -eq $true -And [string]::IsNullOrWhitespace($VarValue) -ne $true) {
Write-Host -NoNewline "** Updating '$ConfigPath' parameter ""$VarName"": '****'. Enable DEBUG_MODE to view value ..."
}
Expand All @@ -50,12 +50,12 @@ function Update-Config-Var {

if ([string]::IsNullOrWhitespace($VarValue)) {
if ((Get-Content $ConfigPath | %{$_ -match "^$VarName="}) -contains $true) {
(Get-Content $ConfigPath) |
(Get-Content $ConfigPath) |
Where-Object {$_ -notmatch "^$VarName=" } |
Set-Content $ConfigPath
}

Write-Host "removed"
Write-Host "removed"
return
}

Expand All @@ -64,7 +64,7 @@ function Update-Config-Var {
Write-Host "undefined"
return
}

if ($VarName -match '^TLS.*File$') {
$VarValue="$ZabbixUserHomeDir\enc\$VarValue"
}
Expand All @@ -75,7 +75,7 @@ function Update-Config-Var {
Write-Host updated
}
elseif ((Get-Content $ConfigPath | select-string -pattern "^[#;] $VarName=").length -gt 0) {
(Get-Content $ConfigPath) |
(Get-Content $ConfigPath) |
Foreach-Object {
$_
if ($_ -match "^[#;] $VarName=") {
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/agent2/rhel/licenses/apache-2.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
10 changes: 5 additions & 5 deletions Dockerfiles/agent2/windows/docker-entrypoint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Update-Config-Var {
if (-not(Test-Path -Path $ConfigPath -PathType Leaf)) {
throw "**** Configuration file '$ConfigPath' does not exist"
}

if ($MaskList.Contains($VarName) -eq $true -And [string]::IsNullOrWhitespace($VarValue) -ne $true) {
Write-Host -NoNewline "** Updating '$ConfigPath' parameter ""$VarName"": '****'. Enable DEBUG_MODE to view value ..."
}
Expand All @@ -50,12 +50,12 @@ function Update-Config-Var {

if ([string]::IsNullOrWhitespace($VarValue)) {
if ((Get-Content $ConfigPath | %{$_ -match "^$VarName="}) -contains $true) {
(Get-Content $ConfigPath) |
(Get-Content $ConfigPath) |
Where-Object {$_ -notmatch "^$VarName=" } |
Set-Content $ConfigPath
}

Write-Host "removed"
Write-Host "removed"
return
}

Expand All @@ -64,7 +64,7 @@ function Update-Config-Var {
Write-Host "undefined"
return
}

if ($VarName -match '^TLS.*File$') {
$VarValue="$ZabbixUserHomeDir\enc\$VarValue"
}
Expand All @@ -75,7 +75,7 @@ function Update-Config-Var {
Write-Host updated
}
elseif ((Get-Content $ConfigPath | select-string -pattern "^[#;] $VarName=").length -gt 0) {
(Get-Content $ConfigPath) |
(Get-Content $ConfigPath) |
Foreach-Object {
$_
if ($_ -match "^[#;] $VarName=") {
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/build-base/windows/modbus.vs16.sln
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6CF51673-664F-4C9F-B3FE-991FF423F3B6}
EndGlobalSection
EndGlobal
EndGlobal
2 changes: 1 addition & 1 deletion Dockerfiles/build-base/windows/modbus.vs16.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Dockerfiles/build-base/windows/modbus.vs16.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>
13 changes: 0 additions & 13 deletions Dockerfiles/build-mysql/alpine/conf/agent2_build.patch

This file was deleted.

13 changes: 0 additions & 13 deletions Dockerfiles/build-pgsql/alpine/conf/agent2_build.patch

This file was deleted.

13 changes: 0 additions & 13 deletions Dockerfiles/build-sqlite3/alpine/conf/agent2_build.patch

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfiles/proxy-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ This variable is port Zabbix server listening on. By default, value is `10051`.
This variable is IP or DNS name of MySQL server. By default, value is 'mysql-server'

### `DB_SERVER_PORT`

This variable is port of MySQL server. By default, value is '3306'.

### `MYSQL_USER`, `MYSQL_PASSWORD`, `MYSQL_USER_FILE`, `MYSQL_PASSWORD_FILE`
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/server-pgsql/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ apply_db_scripts() {
}

create_db_schema_postgresql() {
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")

if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/server-pgsql/centos/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ apply_db_scripts() {
}

create_db_schema_postgresql() {
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")

if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/server-pgsql/ol/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ apply_db_scripts() {
}

create_db_schema_postgresql() {
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")

if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ apply_db_scripts() {
}

create_db_schema_postgresql() {
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
DBVERSION_TABLE_EXISTS=$(psql_query "SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid =
c.relnamespace WHERE n.nspname = '$DB_SERVER_SCHEMA' AND c.relname = 'dbversion'" "${DB_SERVER_DBNAME}")

if [ -n "${DBVERSION_TABLE_EXISTS}" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<IfModule !mpm_netware_module>
PidFile "/tmp/httpd.pid"
</IfModule>
</IfModule>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<IfModule !mpm_netware_module>
PidFile "/tmp/httpd.pid"
</IfModule>
</IfModule>
2 changes: 1 addition & 1 deletion Dockerfiles/web-apache-mysql/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ RUN set -eux && \
rm -rf /var/lib/apt/lists/*

EXPOSE 8080/TCP 8443/TCP

WORKDIR /usr/share/zabbix

COPY ["docker-entrypoint.sh", "/usr/bin/"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<IfModule !mpm_netware_module>
PidFile "/tmp/httpd.pid"
</IfModule>
</IfModule>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<IfModule !mpm_netware_module>
PidFile "/tmp/httpd.pid"
</IfModule>
</IfModule>
2 changes: 1 addition & 1 deletion Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ prepare_zbx_web_config() {
export ZBX_DB_CA_FILE=${ZBX_DB_CA_FILE}
: ${ZBX_DB_VERIFY_HOST:="false"}
export ZBX_DB_VERIFY_HOST=${ZBX_DB_VERIFY_HOST,,}

export ZBX_VAULT=${ZBX_VAULT}
export ZBX_VAULTURL=${ZBX_VAULTURL}
export ZBX_VAULTDBPATH=${ZBX_VAULTDBPATH}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

2 changes: 1 addition & 1 deletion Dockerfiles/web-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Please use official documentation for [``zabbix_web_service.conf``](https://www.
## Allowed volumes for the Zabbix web service container

### ``/var/lib/zabbix/enc``

The volume is used to store TLS related files. These file names are specified using ``ZBX_TLSCAFILE``, ``ZBX_TLSCERTFILE`` and ``ZBX_TLSKEY_FILE`` variables.

# The image variants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Pin-Priority: 300
# named dependencies:
Package: chromium*
Pin: origin "ftp.debian.org"
Pin-Priority: 700
Pin-Priority: 700
Loading

0 comments on commit adce128

Please sign in to comment.