Ris
Никуда не торопимся.
Завтра напишите, если найдёте.
Содержимое файла \vesta-master\install\rhel\7\templates\web\nginx\php-fpm\instantcms2.stpl такое:
server { listen %ip%:%web_ssl_port% ssl; server_name %domain_idn% %alias_idn%; root %sdocroot%; index index.php index.html index.htm; ssl_certificate %ssl_pem%; ssl_certificate_key %ssl_key%; location / { try_files $uri $uri/ /index.php?$args; location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ { expires max; } # deny running scripts inside writable directories location ~* /(cache|static|upload)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ { return 403; error_page 403 /403_error.html; } location ~ [^/]\.php(/|$) { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass %backend_lsnr%; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location /cache { location ~* \.(js|css|xml)$ { allow all; } deny all; } deny all; } location /templates { location ~ \.(js|css|scss|xml|png|gif|jpg|jpeg|ico|bmp|map|eot|svg|ttf|woff|woff2)$ { allow all; } } location /wysiwyg { autoindex off; } location /.htaccess { return 403; } location /credits.txt { return 403; } location /readme.txt { return 403; } location ~ ^/license.(.*).txt$ { return 403; } } error_page 403 /error/403.html; error_page 404 /error/404.html; error_page 500 502 503 504 /error/50x.html; location /error/ { alias %home%/%user%/web/%domain%/document_errors/; } location ~* "/\.(htaccess|htpasswd)$" { deny all; return 404; } location /vstats/ { alias %home%/%user%/web/%domain%/stats/; include %home%/%user%/conf/web/%domain%.auth*; } include /etc/nginx/conf.d/phpmyadmin.inc*; include /etc/nginx/conf.d/phppgadmin.inc*; include /etc/nginx/conf.d/webmail.inc*; include %home%/%user%/conf/web/snginx.%domain%.conf*; }
Не вдруг. Совершенно точно не знал. Теперь знаю. Спасибо!если вдруг не знаете
sudo nginx -t #
nginx: [warn] the "ssl" directive is deprecated, use the "listen… ssl" directive instead in /home/******/conf/web/******.ru.nginx.ssl.conf:10
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Я просто конвертировал на сайте winginx.com/ru/htaccess php_flag engine 0 из .htaccess этих дирректорий. Убираем?Фрагменты вида
location /upload {
fastcgi_param PHP_FLAG "engine=on";
}
вроде разрешают выполнять код PHP в данной директории. Нам это надо?
Или fastcgi_param PHP_FLAG "engine=off"; ?
---------------------------------------------------------------------------------------------------------------------------------------
Сделал так:
server { listen %ip%:%web_ssl_port% ssl; server_name %domain_idn% %alias_idn%; root %sdocroot%; index index.php index.html index.htm; ssl_certificate %ssl_pem%; ssl_certificate_key %ssl_key%; location / { try_files $uri $uri/ /index.php?$args; location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ { expires max; } # deny running scripts inside writable directories location ~* /(cache|static|upload)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ { return 403; error_page 403 /403_error.html; } location ~ [^/]\.php(/|$) { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass %backend_lsnr%; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location /cache { location ~* \.(js|css|xml)$ { allow all; } deny all; } location /static { fastcgi_param PHP_FLAG "engine=off"; } deny all; } location /templates { location ~ \.(js|css|scss|xml|png|gif|jpg|jpeg|ico|bmp|map|eot|svg|ttf|woff|woff2)$ { allow all; } } location /upload { fastcgi_param PHP_FLAG "engine=off"; } location /wysiwyg { autoindex off; } location /.htaccess { return 403; } location /credits.txt { return 403; } location /readme.txt { return 403; } location ~ ^/license.(.*).txt$ { return 403; } } error_page 403 /error/403.html; error_page 404 /error/404.html; error_page 500 502 503 504 /error/50x.html; location /error/ { alias %home%/%user%/web/%domain%/document_errors/; } location ~* "/\.(htaccess|htpasswd)$" { deny all; return 404; } location /vstats/ { alias %home%/%user%/web/%domain%/stats/; include %home%/%user%/conf/web/%domain%.auth*; } include /etc/nginx/conf.d/phpmyadmin.inc*; include /etc/nginx/conf.d/phppgadmin.inc*; include /etc/nginx/conf.d/webmail.inc*; include %home%/%user%/conf/web/snginx.%domain%.conf*; }
sudo nginx -t #
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Наваял что-то этакое:
server { listen %ip%:%web_port%; server_name %domain_idn% %alias_idn%; root %docroot%; index index.php index.html index.htm; access_log /var/log/nginx/domains/%domain%.log combined; access_log /var/log/nginx/domains/%domain%.bytes bytes; error_log /var/log/nginx/domains/%domain%.error.log error; location / { try_files $uri $uri/ /index.php?$args; location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ { expires max; } # deny running scripts inside writable directories location ~* /(cache|static|upload)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ { return 403; error_page 403 /403_error.html; } location ~ [^/]\.php(/|$) { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass %backend_lsnr%; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location /cache { location ~* \.(js|css|xml)$ { allow all; } deny all; } location /static { fastcgi_param PHP_FLAG "engine=on"; } location /system { deny all; } location /templates { location ~ \.(js|css|scss|xml|png|gif|jpg|jpeg|ico|bmp|map|eot|svg|ttf|woff|woff2)$ { allow all; } } location /upload { fastcgi_param PHP_FLAG "engine=on"; } location /wysiwyg { autoindex off; } location /.htaccess { return 403; } location /credits.txt { return 403; } location /readme.txt { return 403; } location ~ ^/license.(.*).txt$ { return 403; } } error_page 403 /error/403.html; error_page 404 /error/404.html; error_page 500 502 503 504 /error/50x.html; location /error/ { alias %home%/%user%/web/%domain%/document_errors/; } location ~* "/\.(htaccess|htpasswd)$" { deny all; return 404; } location /vstats/ { alias %home%/%user%/web/%domain%/stats/; include %home%/%user%/conf/web/%domain%.auth*; } include /etc/nginx/conf.d/phpmyadmin.inc*; include /etc/nginx/conf.d/phppgadmin.inc*; include /etc/nginx/conf.d/webmail.inc*; include %home%/%user%/conf/web/nginx.%domain%.conf*; }
Методики проверки правильности настроек не знаю.
При выборе в качестве web-сервера php-fpm, в настройках сайта можно выбрать шаблон для разных CMS.
Если раньше мне приходилось каждый раз дописывать в конфиг nginx в location одну строку
try_files $uri $uri/ /index.php?$args;
то теперь я просто выбираю конфиг для joomla и всё работает. И не слетает каждый раз при обновлении сертификата SSL.
Вот шаблон конфига для джумлы:
server { listen %ip%:%web_port%; server_name %domain_idn% %alias_idn%; root %docroot%; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$args; location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ { expires max; } # deny running scripts inside writable directories location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ { return 403; error_page 403 /403_error.html; } location ~ [^/]\.php(/|$) { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass %backend_lsnr%; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } } error_page 403 /error/404.html; error_page 404 /error/404.html; error_page 500 502 503 504 /error/50x.html; location /error/ { alias %home%/%user%/web/%domain%/document_errors/; } location ~* "/\.(htaccess|htpasswd)$" { deny all; return 404; } location /vstats/ { alias %home%/%user%/web/%domain%/stats/; include %home%/%user%/conf/web/%domain%.auth*; } include /etc/nginx/conf.d/phpmyadmin.inc*; include /etc/nginx/conf.d/phppgadmin.inc*; include /etc/nginx/conf.d/webmail.inc*; include %home%/%user%/conf/web/nginx.%domain%.conf*; }
Разработчики весты — вполне адекватные люди, всегда откликаются на запросы пользователей и вряд ли будут против расширения функционала своей web-панели.
И для InstantCMS наличие шаблона настроек для самой популярной web-панели будет только на пользу.
Адрес, откуда движок будет обновляться. Когда придет время…Дякую. Що це за переменна private $update_info_url = 'https://upd.instantcms.ru/info/%s'; ?
Вот решение:
github.com/instantsoft/icms2/commit/13975153c8893e6105685510beb8a270ccce5fc5
Сделайте вот так у себя и у того парня и попробуйте снова принять дружбу.
$is_textarea_editor = !$this->options['editor'] || $this->options['editor'] == 'markitup'; $content_html = cmsEventsManager::hook('html_filter', [ 'text' => $content, 'is_auto_br' => $is_textarea_editor, 'build_smiles' => $is_textarea_editor ]);
А вот если выбран какой-либо пресет, сделанный из маркитапа — в опциях будет цифра и никаких смайлов не будет.
Возможное решение — получить имя редактора и проверять уже его:
$wysiwygs_preset = is_numeric($this->options['editor']) ? $this->controller_wysiwygs->getEditorParams($options = [$this->options['editor']]) : $this->options['editor']; $is_textarea_editor = !$this->options['editor'] || $wysiwygs_preset == 'markitup'; $content_html = cmsEventsManager::hook('html_filter', [ 'text' => $content, 'is_auto_br' => $is_textarea_editor, 'build_smiles' => $is_textarea_editor ]);
Идите сюда:Ну как на пикабу. Идут посты лентой. Тот что заинтересовал открывается вниз спойлером. Прочел, листаешь дальше. В ВК тоже длинные посты так усекаются
/forum/125
И ищите разработчика, который сможет изменить стиль отображения списка.
В языковых файлах редактора.где само слово "спойлер" заменить/убрать?
Можно найти поиском по тексту. Например так:
Не понял вопроса. Что за лента? Что за новое окно?А можно сделать так в ленте? чтобы посты шли лентой, а интересный открывался без нового окна
Вебмастеру на заметку:Результат WP развалился в средине теста, instantcms упал вместе с сервером
Любая соцсеть на любом движке падает, если не зарегистрировать пользователя с ником "Цукерберг" и не выдать ему права администратора.
Типы контента — Статьи — Поля — Текст статьи — Редактор HTML — выбираете ваш пресет.
Потому что нет нормального решения.Искал на просторах сайт решение данной проблемы, но к сажалению не нашёл.
Потому, что неавторизованным гостям запрещена загрузка файлов.После установки галочки над аватаром "обязательно" — выдаёт ошибку при регистрации.
Есть не очень хороший, с точки зрения безопасности, метод. Убрать из загрузки файлов проверку на авторизованность.
В двух файлах \system\controllers\images\actions\upload.php и \system\controllers\images\actions\upload_with_preset.php удалить (или закомментировать) вот это:
if (!$this->cms_user->is_logged) { 'success' => false, 'error' => 'auth error' )); }