Skip to content

Commit

Permalink
Merge branch 'servicing' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristan Kenney committed Jul 31, 2023
2 parents 9ebaebb + c9bddaa commit f374353
Show file tree
Hide file tree
Showing 119 changed files with 2,932 additions and 5,585 deletions.
18 changes: 18 additions & 0 deletions .drone.yml
Expand Up @@ -28,6 +28,14 @@ steps:
- npm ci
- npm run build
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
- name: Reset Web templates
commands:
- rm /usr/local/hestia/data/templates/web/nginx/php-fpm/*.*
- rm /usr/local/hestia/data/templates/web/nginx/*.*
- rm /usr/local/hestia/data/templates/web/apache2/php-fpm/*.*
- rm /usr/local/hestia/data/templates/web/apache2/*.*
- rm /usr/local/hestia/data/templates/web/php-fpm/*.*
- /usr/local/hestia/bin/v-update-web-templates
- name: Run system / user tests
commands:
- bats ./test/test.bats
Expand All @@ -44,6 +52,7 @@ trigger:
- refs/heads/release
- refs/heads/prerelease
- refs/heads/servicing
- refs/heads/tests/*
- refs/heads/main
- refs/pull/*/head

Expand Down Expand Up @@ -77,6 +86,14 @@ steps:
- npm ci
- npm run build
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
- name: Reset Web templates
commands:
- rm /usr/local/hestia/data/templates/web/nginx/php-fpm/*.*
- rm /usr/local/hestia/data/templates/web/nginx/*.*
- rm /usr/local/hestia/data/templates/web/apache2/php-fpm/*.*
- rm /usr/local/hestia/data/templates/web/apache2/*.*
- rm /usr/local/hestia/data/templates/web/php-fpm/*.*
- /usr/local/hestia/bin/v-update-web-templates
- name: Run system / user tests
commands:
- bats ./test/test.bats
Expand All @@ -97,6 +114,7 @@ trigger:
- refs/heads/release
- refs/heads/prerelease
- refs/heads/servicing
- refs/heads/tests/*
- refs/heads/main
- refs/pull/*/head

Expand Down
6 changes: 2 additions & 4 deletions .eslintrc.cjs
@@ -1,18 +1,16 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:editorconfig/noconflict',
'plugin:import/recommended',
'prettier',
],
plugins: ['editorconfig', '@typescript-eslint', 'import'],
plugins: ['editorconfig', 'import'],
ignorePatterns: ['*.cjs'],
env: {
browser: true,
Expand All @@ -22,7 +20,7 @@ module.exports = {
Alpine: 'readonly',
},
rules: {
'@typescript-eslint/no-unused-vars': [
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/crowdin.yml
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
if: github.repository == 'hestiacp/hestiacp'
- name: crowdin action
uses: crowdin/github-action@v1
uses: crowdin/github-action@ecdf564895766b8a6b4b581559b3c6cd955467d1 # v1
if: github.repository == 'hestiacp/hestiacp'
with:
upload_sources: true
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/lint.yml
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3

- name: Run markdownlint
uses: DavidAnson/markdownlint-cli2-action@v11
uses: DavidAnson/markdownlint-cli2-action@8f3516061301755c97ff833a8e933f09282cc5b5 # v11
with:
globs: |
*.md
Expand All @@ -26,10 +26,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0
with:
severity: error

Expand All @@ -38,10 +38,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
with:
node-version: 16

Expand All @@ -56,10 +56,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
with:
node-version: 16

Expand All @@ -74,10 +74,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
with:
node-version: 16

Expand Down
7 changes: 7 additions & 0 deletions .vscode/settings.json
Expand Up @@ -2,5 +2,12 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[php]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// Optional nesting patterns, set explorer.fileNesting.enabled to true to enable
"explorer.fileNesting.patterns": {
"*.css": "${capture}.css.map",
"*.js": "${capture}.js.map",
"package.json": ".editorconfig, .eslint*, .lintstaged*, .markdownlint-cli2*, .prettier*, .stylelint*, jsconfig.json, package-lock.json",
"readme*": "changelog*, contributing*, license*, security*"
}
}
28 changes: 28 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,34 @@

All notable changes to this project will be documented in this file.

## [1.8.4] - Service release

### Bugfixes

- Fixed an issue where logs entries would be duplicated when calling return_hash (#3869)
- Modified installer behavior so that firewall rules are only added for necessary services (#3871)
- Minor adjustments to styling and classes (#3843)
- Improved robustness of v-list-sys-themes (#3842)
- Minor updates to v-update-mail-domain-ssl (#3850)
- Changed default PHP-FPM version to 8.2 (#3861)
- Minor updates to v-generate-password-hash (#3874)
- Fixed an issue that would occur during installation if Cloudflare IP address range could not be updated (#3876)
- Fixed multiple PHP warnings and 500 error when mail was not installed (#3841, #3877)

### Dependencies

- Removed typescript from the project for simplicity (#3821)
- Removed PostCSS and move to Lightning CSS (#3820)
- Updated translations (#3878)
- Updated dependency eslint to v8.46.0 (#3881)
- Updated dependency esbuild to v0.18.16 (#3826)
- Updated dependency stylelint to v15.10.2 (#3829)
- Updated dependency chart.js to v4.3.2 (#3866)
- Updated dependency hestiacp/phpquoteshellarg to v1.0.1 (#3827)
- Pinned dependency @fortawesome/fontawesome-free to 6.4.0 (#3862)
- Updated renovate config (#3840)
- Updated all non-major dependencies (#3880)

## [1.8.3] - Service release

- [UI] Fixed an issue where the wrong user type icon was displayed the top menu bar (#3810)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@

<h2 align="center">A lightweight and powerful control panel for the modern web</h2>

<p align="center"><strong>Latest stable release:</strong> Version 1.8.3 | <a href="https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md">View Changelog</a></p>
<p align="center"><strong>Latest stable release:</strong> Version 1.8.4 | <a href="https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md">View Changelog</a></p>

<p align="center">
<a href="https://www.hestiacp.com/">HestiaCP.com</a> |
Expand Down
17 changes: 12 additions & 5 deletions bin/v-check-user-password
Expand Up @@ -95,7 +95,9 @@ if [ "$method" = "yescrypt" ]; then

if [ $? -ne 0 ]; then
echo "Error: password missmatch"
echo "$date $time $user $ip46 failed to login" >> $HESTIA/log/auth.log
if [ -z "$return_hash" ]; then
echo "$date $time $user $ip46 failed to login" >> $HESTIA/log/auth.log
fi
exit 9
fi
else
Expand All @@ -104,7 +106,9 @@ else
hash=$($BIN/v-generate-password-hash "$method" "$salt" <<< "$password")
if [[ -z "$hash" ]]; then
echo "Error: password missmatch"
echo "$date $time $user $ip46 failed to login" >> $HESTIA/log/auth.log
if [ -z "$return_hash" ]; then
echo "$date $time $user $ip46 failed to login" >> $HESTIA/log/auth.log
fi
exit 9
fi
fi
Expand All @@ -113,7 +117,9 @@ fi
result=$(grep "^$user:$hash:" /etc/shadow 2> /dev/null)
if [[ -z "$result" ]]; then
echo "Error: password missmatch"
echo "$date $time $user $ip46 failed to login" >> $HESTIA/log/auth.log
if [ -z "$return_hash" ]; then
echo "$date $time $user $ip46 failed to login" >> $HESTIA/log/auth.log
fi
exit 9
fi

Expand All @@ -123,8 +129,9 @@ fi

if [ -n "$return_hash" ]; then
echo $hash
else
# If return_hash is pressent it will log a second time
echo "$date $time $user $ip46 successfully logged in" >> $HESTIA/log/auth.log
fi
# Logging
echo "$date $time $user $ip46 successfully logged in" >> $HESTIA/log/auth.log

exit
25 changes: 10 additions & 15 deletions bin/v-generate-password-hash
Expand Up @@ -10,39 +10,34 @@

// Checking arguments
if ((empty($argv[1])) || (empty($argv[2]))) {
echo "Error: not enought arguments\n";
echo "Usage: " . $argv[0] ." HASH_METHOD SALT PASSWORD\n";
$errstr = "Error: not enought arguments\n";
$errstr .= "Usage: " . $argv[0] ." HASH_METHOD SALT PASSWORD (or the password can be sent in STDIN)\n";
fwrite(STDERR, $errstr);
exit(1);
}

$crypt = $argv[1];
$salt = $argv[2];
if (empty($argv[3])) {
$password = file_get_contents("php://stdin");
$password = str_replace("\n",'',$password);
$password = str_replace("\n", '', $password);
} else {
$password = $argv[3];
}

// Generating MD5 hash
if ($crypt == 'md5' ) {
$hash = crypt($password, '$1$'.$salt.'$');
}

// Generating SHA-512 hash
if ($crypt == 'sha-512' ) {
} elseif ($crypt == 'sha-512' ) {
$hash = crypt($password, '$6$rounds=5000$'.$salt.'$');
$hash = str_replace('$rounds=5000','',$hash);
}

// Generating base64 hash
if ($crypt == 'htpasswd' ) {
} elseif ($crypt == 'htpasswd' ) {
$hash = crypt($password, base64_encode($password));
}

// Generating DES hash
if ($crypt == 'des' ) {
} elseif ($crypt == 'des' ) {
$hash = crypt($password, $salt);
} else {
fwrite(STDERR, "Error: argument #1 (HASH_METHOD) is invalid. It must be one of 'md5', 'sha-512', 'htpasswd', 'des'\n");
exit(1);
}

// Printing result
Expand Down
45 changes: 30 additions & 15 deletions bin/v-list-sys-themes
Expand Up @@ -22,6 +22,35 @@ source $HESTIA/func/main.sh
# load config file
source_conf "$HESTIA/conf/hestia.conf"

# Define array for available themes
available_themes=()

# Function to process CSS theme files
get_themes() {
# Retrieve list of system themes
if [ -d "$HESTIA_THEMES" ]; then
for file in "$HESTIA_THEMES"/*.min.css; do
filename=$(basename "$file" .min.css)
available_themes+=("${filename%.*}")
done
fi

# Check for existence of custom themes folder and iterate through items
if [ -d "$HESTIA_THEMES_CUSTOM" ] && [ "$(ls -A "$HESTIA_THEMES_CUSTOM")" ]; then
for file in "$HESTIA_THEMES_CUSTOM"/*.css; do
filename=$(basename "$file" .css)
available_themes+=("${filename%.*}")
done
fi

# Sort theme list alphabetically
IFS=$'\n' available_themes=($(sort <<< "${available_themes[*]}"))
unset IFS

# Get count of themes (for proper JSON formatting)
theme_count="${#available_themes[@]}"
}

# JSON list function
json_list() {
i=1
Expand Down Expand Up @@ -65,21 +94,7 @@ csv_list() {
# Action #
#----------------------------------------------------------#

# Parse system provided themes
provided_themes=$(ls -v $HESTIA/web/css/themes | grep '\.min.css' | sed 's/\.min.css$//')

# Parse custom themes
if [ -d "$HESTIA/web/css/themes/custom" ]; then
custom_themes=$(ls -v $HESTIA/web/css/themes/custom/ | grep '\.css' | sed 's/\.css$//')
fi

# Create array with all available themes
for theme in $provided_themes $custom_themes; do
available_themes+=("$theme")
done

# Get count of themes (for proper JSON formatting)
theme_count="${#available_themes[@]}"
get_themes

# Listing data
case $format in
Expand Down
4 changes: 4 additions & 0 deletions bin/v-update-mail-domain-ssl
Expand Up @@ -85,6 +85,10 @@ fi
# Hestia #
#----------------------------------------------------------#

# Restarting mail server
$BIN/v-restart-mail "$restart"
check_result $? "Mail restart failed" > /dev/null

# Restarting web server
$BIN/v-restart-web "$restart"
check_result $? "Web restart failed" > /dev/null
Expand Down
5 changes: 3 additions & 2 deletions bin/v-update-web-templates
Expand Up @@ -52,8 +52,9 @@ done

versions_list=$(ls -d /etc/php/*)
for php_ver in $versions_list; do
[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue
cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl ${WEBTPL}/php-fpm/PHP-${php_ver/\./_}.tpl
version=$(echo $php_ver | sed 's/.*\///')
[ ! -d "/etc/php/$version/fpm/pool.d/" ] && continue
cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl ${WEBTPL}/php-fpm/PHP-${version/\./_}.tpl
done

if [ -n "$awstats_patch" ]; then
Expand Down

0 comments on commit f374353

Please sign in to comment.