Просмотр исходного кода

Add EOL to a bunch of files (#4530)

* prettier complain if not end with newline

* a bunch of newlines.

the newlines were created with the following script:
<?php

declare(strict_types=1);

$dir = realpath(__DIR__ . '/..');
chdir($dir);
foreach ((new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS))) as $file) {
    if ($file->isDir()) {
        continue;
    }
    if ($file->isLink()) {
        continue;
    }
    $size = $file->getSize();
    if ($size === 0) {
        continue;
    }
    $path = $file->getPathname();
    $blacklist = array(
        '/.git/',
        '/node_modules/',
        '/vendor/',
        'rex:/\\.svg$/i'
    );
    foreach ($blacklist as $pattern) {
        $isBlacklisted = str_starts_with($pattern, 'rex:') ? preg_match(substr($pattern, strlen('rex:')), $path) : str_contains($path, $pattern);
        if ($isBlacklisted) {
            continue 2;
        }
    }
    $content = file_get_contents($path);
    // is binary?
    if(strlen($content) !== strcspn($content, "\x00\x01\x02\x03\x04\x05\x06\x07\x08")) {
        //var_dump("skipping binary file: {$path}");
        continue;
    }
    $lastByte = substr($content, -1);
    if ($lastByte === "\n") {
        continue;
    }
    var_dump($path, $lastByte);
    $content .= "\n";
    file_put_contents($path, $content, LOCK_EX);
}
?>

* prettier fix
divinity76 1 год назад
Родитель
Сommit
c68f540d8c
41 измененных файлов с 42 добавлено и 40 удалено
  1. 2 0
      .prettierrc.cjs
  2. 1 1
      install/common/dovecot/sieve/20-managesieve.conf
  3. 1 1
      install/common/dovecot/sieve/90-sieve-extprograms.conf
  4. 1 1
      install/common/templates/dns/office365.tpl
  5. 1 1
      install/common/templates/dns/zoho.tpl
  6. 1 1
      install/deb/apache2/hestia-event.conf
  7. 1 1
      install/deb/bind/named.conf.options
  8. 1 1
      install/deb/exim/limit.conf
  9. 1 1
      install/deb/exim/system.filter
  10. 1 1
      install/deb/fail2ban/action.d/hestia.conf
  11. 1 1
      install/deb/logrotate/dovecot
  12. 1 1
      install/deb/logrotate/hestia
  13. 1 1
      install/deb/logrotate/roundcube
  14. 1 1
      install/deb/templates/mail/apache2/default.stpl
  15. 1 1
      install/deb/templates/mail/apache2/default.tpl
  16. 1 1
      install/deb/templates/mail/apache2/disabled.stpl
  17. 1 1
      install/deb/templates/mail/apache2/disabled.tpl
  18. 1 1
      install/deb/templates/mail/apache2/rainloop.stpl
  19. 1 1
      install/deb/templates/mail/apache2/rainloop.tpl
  20. 1 1
      install/rpm/bind/named.conf.options
  21. 1 1
      install/rpm/dovecot/dovecot.repo
  22. 1 1
      install/rpm/fail2ban/action.d/hestia.conf
  23. 1 1
      install/rpm/hestia/hestia.repo
  24. 1 1
      install/rpm/httpd/hestia-event.conf
  25. 1 1
      install/rpm/logrotate/dovecot
  26. 1 1
      install/rpm/logrotate/hestia
  27. 1 1
      install/rpm/logrotate/httpd
  28. 1 1
      install/rpm/logrotate/roundcube
  29. 1 1
      install/rpm/mysql/mariadb-aarch64.repo
  30. 1 1
      install/rpm/mysql/mariadb-x86_64.repo
  31. 1 1
      install/rpm/mysql/mysql.repo
  32. 1 1
      install/rpm/nginx/nginx.repo
  33. 1 1
      install/rpm/php-fpm/multiphp.tpl
  34. 1 1
      install/rpm/templates/mail/apache2/default.stpl
  35. 1 1
      install/rpm/templates/mail/apache2/default.tpl
  36. 1 1
      install/rpm/templates/web/php-fpm/default.tpl
  37. 1 1
      install/rpm/templates/web/php-fpm/no-php.tpl
  38. 1 1
      install/rpm/templates/web/php-fpm/socket.tpl
  39. 1 1
      test/api.bats
  40. 1 1
      test/checks.bats
  41. 1 1
      web/robots.txt

+ 2 - 0
.prettierrc.cjs

@@ -9,6 +9,8 @@ module.exports = {
 	// PHP Settings
 	phpVersion: '8.2',
 	braceStyle: '1tbs',
+	endOfLine: 'lf',
+
 	// Overrides for some files
 	overrides: [
 		// JavaScript files

+ 1 - 1
install/common/dovecot/sieve/20-managesieve.conf

@@ -85,4 +85,4 @@ protocol sieve {
   #log_path = /var/log/dovecot-sieve-errors.log
   #info_log_path = /var/log/dovecot-sieve.log
 
-}
+}

+ 1 - 1
install/common/dovecot/sieve/90-sieve-extprograms.conf

@@ -41,4 +41,4 @@ plugin {
   #  user = vmail
   #  mode = 0600
   #}
-#}
+#}

+ 1 - 1
install/common/templates/dns/office365.tpl

@@ -19,4 +19,4 @@ ID='18' RECORD='enterpriseenrollment' TYPE='CNAME' PRIORITY='' VALUE='enterprise
 ID='19' RECORD='_sip._tls' TYPE='SRV' PRIORITY='100' VALUE='1 443 sipdir.online.lync.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
 ID='20' RECORD='_sipfederationtls._tcp' TYPE='SRV' PRIORITY='100' VALUE='1 5061 sipfed.online.lync.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
 ID='21' RECORD='login' TYPE='CNAME' PRIORITY='' VALUE='login.microsoftonline.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
-ID='22' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='mail.office365.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='22' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='mail.office365.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'

+ 1 - 1
install/common/templates/dns/zoho.tpl

@@ -12,4 +12,4 @@ ID='11' RECORD='www' TYPE='CNAME' PRIORITY='' VALUE='%domain%.' SUSPENDED='no' T
 ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mx.zoho.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
 ID='13' RECORD='@' TYPE='MX' PRIORITY='20' VALUE='mx2.zoho.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
 ID='14' RECORD='@' TYPE='MX' PRIORITY='50' VALUE='mx3.zoho.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
-ID='15' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% include:zoho.com -all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='15' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% include:zoho.com -all"' SUSPENDED='no' TIME='%time%' DATE='%date%'

+ 1 - 1
install/deb/apache2/hestia-event.conf

@@ -2,4 +2,4 @@
     <FilesMatch \.php$>
         SetHandler "proxy:fcgi://127.0.0.1:9000"
     </FilesMatch>
-</IfModule>
+</IfModule>

+ 1 - 1
install/deb/bind/named.conf.options

@@ -21,4 +21,4 @@ options {
         hostname none;
         server-id none;
         version none;
-};
+};

+ 1 - 1
install/deb/exim/limit.conf

@@ -1 +1 @@
-200
+200

+ 1 - 1
install/deb/exim/system.filter

@@ -13,4 +13,4 @@ then
     headers remove "Subject"
     headers add "Subject: *** VIRUS *** $h_old-subject"
     headers remove "Old-Subject"
-endif
+endif

+ 1 - 1
install/deb/fail2ban/action.d/hestia.conf

@@ -6,4 +6,4 @@ actionstart = /usr/local/hestia/bin/v-add-firewall-chain <name>
 actionstop = /usr/local/hestia/bin/v-delete-firewall-chain <name>
 actioncheck = iptables -n -L INPUT | grep -q 'fail2ban-<name>[ \t]'
 actionban = /usr/local/hestia/bin/v-add-firewall-ban <ip> <name>
-actionunban = /usr/local/hestia/bin/v-delete-firewall-ban <ip> <name>
+actionunban = /usr/local/hestia/bin/v-delete-firewall-ban <ip> <name>

+ 1 - 1
install/deb/logrotate/dovecot

@@ -9,4 +9,4 @@
     postrotate
     doveadm log reopen
     endscript
-}
+}

+ 1 - 1
install/deb/logrotate/hestia

@@ -4,4 +4,4 @@
     missingok
     notifempty
     create 0600 root root
-}
+}

+ 1 - 1
install/deb/logrotate/roundcube

@@ -4,4 +4,4 @@
     missingok
     notifempty
     create 644 www-data www-data
-}
+}

+ 1 - 1
install/deb/templates/mail/apache2/default.stpl

@@ -48,4 +48,4 @@
 
     IncludeOptional %home%/%user%/conf/mail/%root_domain%/%web_system%.ssl.conf_*
 
-</VirtualHost>
+</VirtualHost>

+ 1 - 1
install/deb/templates/mail/apache2/default.tpl

@@ -45,4 +45,4 @@
 
     IncludeOptional %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*
 
-</VirtualHost>
+</VirtualHost>

+ 1 - 1
install/deb/templates/mail/apache2/disabled.stpl

@@ -9,4 +9,4 @@ SSLVerifyClient none
 SSLCertificateFile         %home%/%user%/conf/mail/%root_domain%/ssl/%root_domain%.crt
 SSLCertificateKeyFile      %home%/%user%/conf/mail/%root_domain%/ssl/%root_domain%.key
 
-</VirtualHost>
+</VirtualHost>

+ 1 - 1
install/deb/templates/mail/apache2/disabled.tpl

@@ -4,4 +4,4 @@
     DocumentRoot /var/www/html/
     Alias /error/ /var/www/document_errors/
     #SuexecUserGroup %user% %group%
-</VirtualHost>
+</VirtualHost>

+ 1 - 1
install/deb/templates/mail/apache2/rainloop.stpl

@@ -28,4 +28,4 @@ SSLCertificateKeyFile      %home%/%user%/conf/mail/%root_domain%/ssl/%root_domai
 
 IncludeOptional %home%/%user%/conf/mail/%root_domain%/%web_system%.ssl.conf_*
 
-</VirtualHost>
+</VirtualHost>

+ 1 - 1
install/deb/templates/mail/apache2/rainloop.tpl

@@ -22,4 +22,4 @@
             AllowOverride None
     </Directory>
     IncludeOptional %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*
-</VirtualHost>
+</VirtualHost>

+ 1 - 1
install/rpm/bind/named.conf.options

@@ -21,4 +21,4 @@ options {
         hostname none;
         server-id none;
         version none;
-};
+};

+ 1 - 1
install/rpm/dovecot/dovecot.repo

@@ -3,4 +3,4 @@ name=Dovecot 2.3-latest RHEL $releasever - $basearch
 baseurl=https://repo.dovecot.org/ce-2.3-latest/rhel/$releasever/RPMS/$basearch
 gpgkey=https://repo.dovecot.org/DOVECOT-REPO-GPG
 gpgcheck=1
-enabled=1
+enabled=1

+ 1 - 1
install/rpm/fail2ban/action.d/hestia.conf

@@ -6,4 +6,4 @@ actionstart = /usr/local/hestia/bin/v-add-firewall-chain <name>
 actionstop = /usr/local/hestia/bin/v-delete-firewall-chain <name>
 actioncheck = iptables -n -L INPUT | grep -q 'fail2ban-<name>[ \t]'
 actionban = /usr/local/hestia/bin/v-add-firewall-ban <ip> <name>
-actionunban = /usr/local/hestia/bin/v-delete-firewall-ban <ip> <name>
+actionunban = /usr/local/hestia/bin/v-delete-firewall-ban <ip> <name>

+ 1 - 1
install/rpm/hestia/hestia.repo

@@ -3,4 +3,4 @@ name=HestiaCP Repository for RHEL $releasever - $basearch
 baseurl=https://rpm.hestiacp.com/rhel/$releasever/$basearch/
 gpgkey=https://rpm.hestiacp.com/RPM-GPG-KEY-HESTIACP
 gpgcheck=1
-enabled=1
+enabled=1

+ 1 - 1
install/rpm/httpd/hestia-event.conf

@@ -2,4 +2,4 @@
     <FilesMatch \.php$>
         SetHandler "proxy:fcgi://127.0.0.1:9000"
     </FilesMatch>
-</IfModule>
+</IfModule>

+ 1 - 1
install/rpm/logrotate/dovecot

@@ -9,4 +9,4 @@
     postrotate
     doveadm log reopen
     endscript
-}
+}

+ 1 - 1
install/rpm/logrotate/hestia

@@ -4,4 +4,4 @@
     missingok
     notifempty
     create 0600 root root
-}
+}

+ 1 - 1
install/rpm/logrotate/httpd

@@ -7,4 +7,4 @@
         /sbin/service httpd reload > /dev/null 2>/dev/null || true
         [ ! -f /run/nginx.pid ] || kill -USR1 `cat /run/nginx.pid`
     endscript
-}
+}

+ 1 - 1
install/rpm/logrotate/roundcube

@@ -4,4 +4,4 @@
     missingok
     notifempty
     create 644 www-data www-data
-}
+}

+ 1 - 1
install/rpm/mysql/mariadb-aarch64.repo

@@ -4,4 +4,4 @@ baseurl = https://ftp.osuosl.org/pub/mariadb/yum/10.6/rhel$releasever-$basearch
 module_hotfixes=1
 gpgkey=https://ftp.osuosl.org/pub/mariadb/yum/RPM-GPG-KEY-MariaDB
 gpgcheck=1
-enabled=1
+enabled=1

+ 1 - 1
install/rpm/mysql/mariadb-x86_64.repo

@@ -4,4 +4,4 @@ baseurl = https://ftp.osuosl.org/pub/mariadb/yum/10.6/rhel$releasever-amd64
 module_hotfixes=1
 gpgkey=https://ftp.osuosl.org/pub/mariadb/yum/RPM-GPG-KEY-MariaDB
 gpgcheck=1
-enabled=1
+enabled=1

+ 1 - 1
install/rpm/mysql/mysql.repo

@@ -4,4 +4,4 @@ baseurl = http://repo.mysql.com/yum/mysql-8.0-community/el/$releasever/$basearch
 module_hotfixes=1
 gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
 gpgcheck=1
-enabled=1
+enabled=1

+ 1 - 1
install/rpm/nginx/nginx.repo

@@ -3,4 +3,4 @@ name=Nginx Repository for RHEL $releasever - $basearch
 baseurl=https://nginx.org/packages/rhel/$releasever/$basearch/
 gpgkey=https://nginx.org/keys/nginx_signing.key
 gpgcheck=1
-enabled=1
+enabled=1

+ 1 - 1
install/rpm/php-fpm/multiphp.tpl

@@ -23,4 +23,4 @@ php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f admin@%domain%
 env[PATH] = /usr/local/bin:/usr/bin:/bin
 env[TMP] = /home/%user%/tmp
 env[TMPDIR] = /home/%user%/tmp
-env[TEMP] = /home/%user%/tmp
+env[TEMP] = /home/%user%/tmp

+ 1 - 1
install/rpm/templates/mail/apache2/default.stpl

@@ -50,4 +50,4 @@
 
     IncludeOptional %home%/%user%/conf/mail/%root_domain%/%web_system%.ssl.conf_*
 
-</VirtualHost>
+</VirtualHost>

+ 1 - 1
install/rpm/templates/mail/apache2/default.tpl

@@ -45,4 +45,4 @@
 
     IncludeOptional %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*
 
-</VirtualHost>
+</VirtualHost>

+ 1 - 1
install/rpm/templates/web/php-fpm/default.tpl

@@ -24,4 +24,4 @@ env[HOSTNAME] = $HOSTNAME
 env[PATH] = /usr/local/bin:/usr/bin:/bin
 env[TMP] = /home/%user%/tmp
 env[TMPDIR] = /home/%user%/tmp
-env[TEMP] = /home/%user%/tmp
+env[TEMP] = /home/%user%/tmp

+ 1 - 1
install/rpm/templates/web/php-fpm/no-php.tpl

@@ -24,4 +24,4 @@
 ;env[PATH] = /usr/local/bin:/usr/bin:/bin
 ;env[TMP] = /home/%user%/tmp
 ;env[TMPDIR] = /home/%user%/tmp
-;env[TEMP] = /home/%user%/tmp
+;env[TEMP] = /home/%user%/tmp

+ 1 - 1
install/rpm/templates/web/php-fpm/socket.tpl

@@ -24,4 +24,4 @@ env[HOSTNAME] = $HOSTNAME
 env[PATH] = /usr/local/bin:/usr/bin:/bin
 env[TMP] = /home/%user%/tmp
 env[TMPDIR] = /home/%user%/tmp
-env[TEMP] = /home/%user%/tmp
+env[TEMP] = /home/%user%/tmp

+ 1 - 1
test/api.bats

@@ -148,4 +148,4 @@ function setup() {
 
 @test "[Success][ Hash ] Delete user" {
     run curl -k -s -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "hash=$apikey&cmd=v-delete-user&arg1=hestiatest" "https://$server:$port/api/index.php"
-}
+}

+ 1 - 1
test/checks.bats

@@ -385,4 +385,4 @@ r' "key"
 1eshutdown
 r' "key"
     assert_failure $E_INVALID
-}
+}

+ 1 - 1
web/robots.txt

@@ -1,2 +1,2 @@
 User-agent: *
-Disallow: /
+Disallow: /