From 7b459e879d05c76968021eb1ed88a8848a497e60 Mon Sep 17 00:00:00 2001 From: sanvu88 Date: Fri, 8 Dec 2023 10:46:17 +0700 Subject: [PATCH 1/2] Fix: Not load Vietnamese when select from menu --- internal/translation/translation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/translation/translation.go b/internal/translation/translation.go index 29d8c10f..ce4e4da8 100644 --- a/internal/translation/translation.go +++ b/internal/translation/translation.go @@ -13,7 +13,7 @@ var Dict map[string]pofile.Dict func init() { Dict = make(map[string]pofile.Dict) - langCode := []string{"zh_CN", "zh_TW", "ru_RU", "fr_FR", "es"} + langCode := []string{"zh_CN", "zh_TW", "ru_RU", "fr_FR", "es", "vi_VN"} for _, v := range langCode { handlePo(v) From 74428b45ca1024b3b37f7cc674128ffc3fd8b6aa Mon Sep 17 00:00:00 2001 From: sanvu88 Date: Wed, 13 Dec 2023 10:45:12 +0700 Subject: [PATCH 2/2] Add some Config Templates --- template/block/drupal_security.conf | 17 ++++ template/block/joomla_security.conf | 9 +++ template/block/security_headers.conf | 12 +++ template/block/wordpress_security.conf | 104 +++++++++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 template/block/drupal_security.conf create mode 100644 template/block/joomla_security.conf create mode 100644 template/block/security_headers.conf create mode 100644 template/block/wordpress_security.conf diff --git a/template/block/drupal_security.conf b/template/block/drupal_security.conf new file mode 100644 index 00000000..aa6e56e1 --- /dev/null +++ b/template/block/drupal_security.conf @@ -0,0 +1,17 @@ +# Nginx UI Template Start +name = "Drupal Security" +author = "@sanvu88" +description = { en = "Drupal Security Config", vi_VN = "Cấu hình bảo mật cho Drupal"} +# Nginx UI Template End + +location ~ ((^|/)\.|^.*\.yml$|^/sites/.*/private/|^/sites/[^/]+/[^/]*settings.*\.php$) { + return 444; +} + +location ~ ^/sites/[^/]+/files/.*\.php$ { + return 444; +} + +location ~ /vendor/.*\.php$ { + return 444; +} \ No newline at end of file diff --git a/template/block/joomla_security.conf b/template/block/joomla_security.conf new file mode 100644 index 00000000..7661bedb --- /dev/null +++ b/template/block/joomla_security.conf @@ -0,0 +1,9 @@ +# Nginx UI Template Start +name = "Joomla Security" +author = "@sanvu88" +description = { en = "Joomla Security Config", vi_VN = "Cấu hình bảo mật cho Joomla"} +# Nginx UI Template End + +location ~* /(images|cache|media|logs|tmp)/.*\.(gz|tar|bzip2|7z|php|php5|php7|log|error|py|pl|kid|love|cgi|shtml|phps|pht|jsp|asp|sh|bash)$ { + return 444; +} diff --git a/template/block/security_headers.conf b/template/block/security_headers.conf new file mode 100644 index 00000000..a4a23bba --- /dev/null +++ b/template/block/security_headers.conf @@ -0,0 +1,12 @@ +# Nginx UI Template Start +name = "Nginx Security Headers" +author = "@sanvu88" +description = { en = "Nginx Security Headers Config", vi_VN = "Cấu hình Headers tăng cường bảo mật"} +# Nginx UI Template End + +add_header X-XSS-Protection "1; mode=block" always; +add_header X-Content-Type-Options "nosniff" always; +add_header Referrer-Policy "no-referrer-when-downgrade" always; +add_header Content-Security-Policy "default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always; +add_header Permissions-Policy "interest-cohort=()" always; +add_header X-Frame-Options "SAMEORIGIN"; \ No newline at end of file diff --git a/template/block/wordpress_security.conf b/template/block/wordpress_security.conf new file mode 100644 index 00000000..25e973b0 --- /dev/null +++ b/template/block/wordpress_security.conf @@ -0,0 +1,104 @@ +# Nginx UI Template Start +name = "WordPress Security" +author = "@sanvu88" +description = { en = "WordPress Security Config", vi_VN = "Cấu hình bảo mật cho WordPress"} + +[variables.blockUserAPI] +type = "boolean" +name = { en = "Block WordPress User API", vi_VN = "Chặn truy cập danh sách user"} +value = true + +[variables.blockXMLRPC] +type = "boolean" +name = { en = "Block WordPress XMLRPC", vi_VN = "Chặn truy cập xmlrpc.php"} +value = true +# Nginx UI Template End + +{{- if .blockUserAPI }} +location ~* /wp-json/wp/v2/users { + return 444; +} +{{- end }} + +{{- if .blockXMLRPC }} +location = /xmlrpc.php { + return 444; +} +{{- end }} + +location ~* wp-admin/includes { return 444; } +location ~* wp-includes/theme-compat { return 444; } + +location /wp-includes/ { + location ~ \.(gz|tar|bzip2|7z|php|php5|php7|log|error|py|pl|kid|love|cgi|shtml|phps|pht|jsp|asp|sh|bash)$ { + access_log off; + log_not_found off; + return 444; + } +} + +location /wp-content/uploads/ { + location ~ \.(gz|tar|bzip2|7z|php|php5|php7|log|error|py|pl|kid|love|cgi|shtml|phps|pht|jsp|asp|sh|bash)$ { + access_log off; + log_not_found off; + return 444; + } +} + +location /wp-content/cache/ { + location ~ \.(php|php5|php7|log|error|py|pl|kid|love|cgi|shtml|phps|pht|jsp|asp|sh|bash)$ { + access_log off; + log_not_found off; + return 444; + } +} + +location /wp-content/plugins/ { + location ~ \.(htm|shtml|php|swf|phps|pht|log|error|py|pl|kid|love|cgi|jsp|asp|sh|bash)$ { + access_log off; + log_not_found off; + return 444; + } +} + +location /wp-content/plugins/onesignal-free-web-push-notifications/ { + access_log off; + log_not_found off; + allow all; +} + +location /wp-content/updraft/ { + access_log off; + log_not_found off; + return 444; +} + +location /wp-content/backups-dup-pro/ { + access_log off; + log_not_found off; + return 444; +} + +location /wp-snapshots/ { + access_log off; + log_not_found off; + return 444; +} + +location /wp-content/uploads/sucuri/ { + access_log off; + log_not_found off; + return 444; +} + +location /wp-content/uploads/nginx-helper/ { + access_log off; + log_not_found off; + return 444; +} + +location ~* ^/(?:wp-links-opml\.php|wp-config\.php|wp-config-sample\.php|readme\.html|license\.txt)$ { + access_log off; + log_not_found off; + return 444; +}