Compare commits

..

653 commits

Author SHA1 Message Date
Rafael G. Martins
873693b2ed
Merge pull request #2302 from pdapnz/fix_bug_url_parsing
fix bug https://github.com/outroll/vesta/issues/2301
2025-04-25 13:41:17 +10:00
Rafael G. Martins
2a91899846
Update README.md to use HTTPS
Updating readme as new Vesta server requires HTTPS, otherwise installers get a 301 redirect.
2024-07-02 13:34:58 +10:00
pdapnz
2a6852b805
fix bug https://github.com/outroll/vesta/issues/2301 2024-04-18 12:52:49 +03:00
Rafael G. Martins
f978badd95
Add community notice to readme 2024-02-26 13:42:55 +11:00
Anton Reutov
73d60c4591
Merge pull request #2271 from makss/fix/sys_temp_dir
Added sys_temp_dir to all apache/php-fpm configs
2022-12-08 13:41:08 +03:00
Anton Reutov
93f4b6c182
Merge pull request #2272 from makss/fix/lang_ru
Fix lang file: Remove duplicate line
2022-12-08 12:54:44 +03:00
makss
343a877f06 Remove duplicate line 2022-12-08 04:11:11 +02:00
makss
1d7978ae2c fix align 2022-12-08 02:35:36 +02:00
makss
762d7586e0 Added sys_temp_dir for php-fpm 2022-12-08 02:22:23 +02:00
makss
564af6aa2d Added sys_temp_dir for pma 2022-12-08 02:13:23 +02:00
makss
8f6ac637d8 Added sys_temp_dir in all apache2 templates 2022-12-08 02:03:15 +02:00
Anton Reutov
e6df9a65a2
1.0.0-7 2022-10-11 22:49:28 +03:00
Anton Reutov
ffd180b4f7
1.0.0-7 2022-10-11 22:47:22 +03:00
Anton Reutov
371cc02eda
1.0.0-7 2022-10-11 22:44:36 +03:00
Anton Reutov
94d60267a8
Merge pull request #2268 from serghey-rodin/feature/r-1.0.0.7
Release UI 1.0.0.7
2022-10-11 10:59:25 +03:00
Alexander
c053bb4c1c Fixed FM event listeners. 2022-10-10 20:21:54 +03:00
Alexander
4c78719897 Release UI 1.0.0.7 2022-10-04 22:32:09 +03:00
Anton Reutov
765a67a6eb
Merge pull request #2267 from akbarali1/master
Update Lang uz.php
2022-09-29 17:47:46 +03:00
Akbarali
99cb78ce81
Merge branch 'serghey-rodin:master' into master 2022-09-29 19:26:17 +05:00
Akbarali
56c66fdef0 Update uz.php 2022-09-29 19:23:21 +05:00
Anton Reutov
a2ebd2efdc
Merge pull request #2266 from akbarali1/master
Added Uzbek language
2022-09-28 14:53:21 +03:00
Akbarali
c28f745069 adding uzbek lang 2022-09-28 10:34:48 +05:00
Anton Reutov
1a37b33eb2
Choose php version 2022-09-15 21:01:39 +03:00
Anton Reutov
ee48d9a406
Merge pull request #2253 from kingofkya/master
Add a templet for freescout helpdesk software
2022-07-29 12:30:09 +03:00
Anton Reutov
b4dab88694
Merge pull request #2257 from serghey-rodin/fix/edit-server
Fixed incorrect mail url in response.
2022-07-29 12:29:30 +03:00
Anton Reutov
51e468c22f
Merge pull request #2258 from divinity76/patch-5
fix xss / GH-2252
2022-07-27 13:46:51 +03:00
divinity76
7c4e9bad7d
JSON not JS brainfart 2022-07-23 09:29:12 +02:00
divinity76
0682f7b10c
fix xss / GH-2252
ref https://github.com/serghey-rodin/vesta/issues/2252
2022-07-23 09:26:16 +02:00
Alexander
1ce9ec299c Fixed incorrect mail url in response. 2022-07-21 22:11:36 +03:00
Anton Reutov
e527827174
Merge pull request #2256 from serghey-rodin/feature/reset-mail
Added mail reset in API
2022-07-19 21:43:29 +03:00
Alexander
6714e1d35d Added mail reset in API 2022-07-19 20:02:53 +03:00
Anton Reutov
d386c3598c
Fix for Sed Injection Vulnerability
Thanks to @hestiacp and @jaapmarcus for fix.
2022-07-18 13:08:50 +03:00
Anton Reutov
39561c32c1
Fix for Sed Injection Vulnerability
Thanks to @hestiacp and @jaapmarcus for fix.
2022-07-18 13:06:39 +03:00
Travis Kneale
8bc587db41
freescout templetes
Add config for https://freescout.net/
2022-06-13 22:57:15 -07:00
Travis Kneale
da853d78cb
freescout templete
Add config for https://freescout.net/
2022-06-13 22:56:08 -07:00
Anton Reutov
956bc6697c
1.0.0-6 2022-02-24 12:00:41 +03:00
Anton
8efaf5fe93 react build 1.0.0.6 2022-02-23 18:49:31 +03:00
Anton Reutov
0b95fc283e
1.0.0-6 2022-01-16 03:23:18 +03:00
Anton Reutov
969dc68561
1.0.0-6 2022-01-16 03:22:32 +03:00
Alexander Osinskii
653348242f
Merge pull request #2220 from serghey-rodin/release/1.0.0-6-ui
UI 1.0.0-6 release.
2021-12-30 22:02:52 +00:00
Alexander Osinskii
64ddc9cfe8
Merge pull request #2221 from serghey-rodin/release/1.0.0-6-api
API 1.0.0-6 release.
2021-12-30 22:02:37 +00:00
Alexander
b7bdfd2d87 API 1.0.0-6 release. 2021-12-30 21:58:29 +00:00
Alexander
0420ecc0e6 UI 1.0.0-6 release. 2021-12-30 21:53:38 +00:00
Anton Reutov
22f3dd11e2
Merge pull request #2203 from devius/master
Fix existing translations for Georgian Language.
2021-12-03 13:34:32 +03:00
devius
df5962fc2e fix minor typos. 2021-12-03 04:01:14 +04:00
devius
c863a592a5 Fix existing strings and add new ones missing. 2021-12-03 03:59:46 +04:00
Serghey Rodin
067d43b418 react build 1.0.0.5 2021-11-23 00:45:37 +02:00
Alexander Osinskii
2f3041bf05
Merge pull request #2185 from serghey-rodin/feature/responsive-design
Added new responsive design features.
2021-11-22 23:45:51 +02:00
Alexander Osinskii
5dc474846b
Merge pull request #2184 from serghey-rodin/feature/disk-percentage-values
Added disk and bandwidth percentage values to the session response.
2021-11-22 23:45:44 +02:00
Alexander
4871bd1326 Removed desktop toolbar scrollbar. 2021-11-22 23:44:41 +02:00
Alexander
7ebcab3cbf Added new responsive design features. 2021-11-22 23:18:15 +02:00
Alexander
cae9a1550d Added disk and bandwidth percentage values to the session response. 2021-11-22 23:14:32 +02:00
Anton Reutov
7d317c4fe8
1.0.0-5 2021-11-22 02:57:10 +03:00
Anton Reutov
84bc07d8f1
1.0.0-5 2021-11-22 00:33:21 +03:00
Anton Reutov
97f558465e
Avoiding error if unzip destination exists 2021-11-21 21:18:47 +03:00
Serghey Rodin
f8936c6847
Merge pull request #2182 from misterV12/patch-1
Dont match wildcard "*domains" and "databases*" while restoring
2021-11-20 17:35:36 +02:00
misterV12
1dee07c3f1
Dont match wildcard "*domains" and "databases*" while restoring 2021-11-20 15:41:22 +01:00
Anton Reutov
2e7083668c Set correct quotation marks 2021-11-13 16:59:39 +03:00
Anton Reutov
bf65cae7f9
Fix for "chmod: changing permissions" 2021-11-13 11:42:53 +03:00
Anton Reutov
c7bef6bf33
1.0.0-5 2021-11-09 20:37:32 +03:00
Anton Reutov
bb4fc4c47d
1.0.0-5 2021-11-09 20:35:32 +03:00
Anton Reutov
e2e3d1d113
Merge pull request #1663 from serghey-rodin/dpeca-patch-exim-1
Tell Exim to not to deny emails if ClamAV is unavailable or busy
2021-11-07 01:03:38 +03:00
Anton Reutov
bdf140d3c9
Merge pull request #1665 from serghey-rodin/dpeca-patch-exim-3
Block .jar extension in email attachments in Exim
2021-11-07 00:55:15 +03:00
Alexander Osinskii
f53183cb7f
Merge pull request #2147 from serghey-rodin/feature/static-media
Removed unused static media.
2021-11-06 18:29:17 +02:00
Alexander Osinskii
1c46ce5cf7
Merge pull request #2146 from serghey-rodin/feature/api-enhancements
Added few auxiliary values from user session. Improved user, web and …
2021-11-06 18:29:06 +02:00
Alexander Osinskii
89b3328a0d
Merge pull request #2145 from serghey-rodin/feature/improved-panel-and-fm
FM progress bar while uploading. Minor CPanel improvements as well as…
2021-11-06 18:28:50 +02:00
Alexander
0c656b0c20 Removed unused static media. 2021-11-06 17:51:56 +02:00
Alexander
c308a42d2f Added few auxiliary values from user session. Improved user, web and server api endpoints. 2021-11-06 17:50:50 +02:00
Alexander
5b2c180d86 FM progress bar while uploading. Minor CPanel improvements as well as performance. 2021-11-06 17:47:44 +02:00
dpeca
eb5a045252
Hot fix for CentOS 6 for "systemctl"
Because I made this issue :)
2021-11-04 13:59:10 +01:00
Serghey Rodin
09e87f4af6 set rel date: Mon Nov 1 2021 2021-11-02 00:14:47 +02:00
Serghey Rodin
8ec606d5f6 fix dates in rpm history definition 2021-11-01 23:49:52 +02:00
Serghey Rodin
354bacf1f3 Merge branch 'master' of github.com:serghey-rodin/vesta 2021-11-01 23:43:46 +02:00
Serghey Rodin
c5612c827a update static react build 2021-11-01 23:41:59 +02:00
Serghey Rodin
a60b158049
Merge pull request #2129 from serghey-rodin/Skamasle-patch-10
NGINX wont start in debian 9
2021-11-01 23:38:45 +02:00
Serghey Rodin
790cd631a6 1.0.0-4 2021-11-01 23:38:15 +02:00
Serghey Rodin
32a6be9adf
Merge pull request #2128 from serghey-rodin/feature/improved-le-and-csr
Improved LE support and CSR is now generted in modal window with cert…
2021-11-01 23:33:35 +02:00
Maksim Usmanov | Maks
51a95b9d72
NGINX wont start in debian 9 2021-11-01 22:31:26 +01:00
Alexander
62d9652437 Improved LE support and CSR is now generted in modal window with cert prepopulating feature. 2021-11-01 23:29:05 +02:00
Anton Reutov
8f8dbd5b25
Update nginx.conf 2021-11-02 00:24:51 +03:00
Anton Reutov
60f75bc739
Update nginx.conf 2021-11-02 00:22:48 +03:00
Anton Reutov
fc2403dc2f
Update nginx.conf 2021-11-02 00:16:17 +03:00
Serghey Rodin
ddee8801a4
Merge pull request #2112 from serghey-rodin/feature/restart-system
Added system reboot endpoint.
2021-11-01 00:24:55 +02:00
Serghey Rodin
52a5425a94
Merge pull request #2111 from serghey-rodin/feature/improved-web-and-server
Improved server sys tab and web backend template.
2021-11-01 00:24:11 +02:00
Alexander
85ee500306 Added system reboot endpoint. 2021-11-01 00:22:15 +02:00
Serghey Rodin
85fb81f6d2 fix WEB_BACKEND/PROXY_SYSTEM switch 2021-11-01 00:17:22 +02:00
Alexander
f012520f0e Improved server sys tab and web backend template. 2021-11-01 00:16:35 +02:00
Serghey Rodin
96124cca25 add missing static files 2021-10-31 23:50:23 +02:00
Serghey Rodin
185f70651e 1.0.0-3 2021-10-31 23:46:12 +02:00
Serghey Rodin
612b8cbfc0 latest UI build 2021-10-31 23:43:14 +02:00
Serghey Rodin
d67ea881fc
Merge pull request #2109 from serghey-rodin/feature/improved-react-ui
Improved new react ui and added view for CSR generation.
2021-10-31 23:32:13 +02:00
Serghey Rodin
604f1948e4
Merge pull request #2108 from serghey-rodin/feature/updated-api-responses
Updated and improved API respones.
2021-10-31 23:31:37 +02:00
Alexander
e66ec829f7 Improved new react ui and added view for CSR generation. 2021-10-31 23:27:00 +02:00
Serghey Rodin
334ee00d25
Merge pull request #2090 from mix5003/exclude-react-build
exclude react build tool from git
2021-10-31 23:25:35 +02:00
Alexander
859e65647f Updated and improved API respones. 2021-10-31 23:24:42 +02:00
Serghey Rodin
387e6c8e0a revert back react handler 2021-10-31 21:46:06 +02:00
mix5003
ec355d8137 exclude react build 2021-10-31 16:59:51 +07:00
Serghey Rodin
b543c0c2f3 partially revert pr changes 2021-10-30 22:51:04 +03:00
Serghey Rodin
ed94787cd0
Merge pull request #2078 from mix5003/fix-v-ssl
Fix Edit Web page error
2021-10-30 22:49:13 +03:00
Serghey Rodin
5f86fab58b add backup validation for scheduled restore 2021-10-30 22:26:42 +03:00
mix5003
335fd746db fix ca name 2021-10-30 21:54:23 +07:00
mix5003
43a6fc23ef fix can not save proxy template 2021-10-30 21:28:08 +07:00
mix5003
57401060c8 fix can not edit proxy template 2021-10-30 21:05:45 +07:00
mix5003
b539119ead fix incorrect field name 2021-10-30 20:41:31 +07:00
Serghey Rodin
2c79b0874b hotfix: update package name condition 2021-10-30 16:39:10 +03:00
mix5003
fabe2f1ec7 fix incorrect v_ssl field name 2021-10-30 20:22:55 +07:00
Anton Reutov
06a97a5551
Merge pull request #2074 from mix5003/fix-fi
fix incorrect open if
2021-10-30 16:02:27 +03:00
Serghey Rodin
b0bcc43154 add %global debug_package %{nil} in vesta-softaculous spec 2021-10-30 13:46:50 +03:00
Serghey Rodin
b8083e008d add %global debug_package %{nil} in vesta-ioncube spec 2021-10-30 13:28:07 +03:00
Serghey Rodin
539a926026 add %global debug_package %{nil} 2021-10-30 12:36:39 +03:00
mix5003
1738423829 fix fi 2021-10-30 08:56:54 +07:00
Serghey Rodin
474257fd72 add ZEND_EXTRA_LIBS='-lresolv' 2021-10-29 18:39:08 +03:00
Serghey Rodin
8f10e5f94d add zip support for built-in php 2021-10-29 16:45:28 +03:00
Serghey Rodin
6e4c59ab0d update notifications 2021-10-29 14:37:29 +03:00
Serghey Rodin
781933ea48 new vesta logo 2021-10-29 13:55:35 +03:00
Serghey Rodin
a7c5714d85
Merge pull request #2073 from serghey-rodin/feature/react-ui-and-api
Feature/react UI and api
2021-10-29 13:46:52 +03:00
Alexander
1ab9e12f2c Updated react ui. 2021-10-29 13:07:10 +03:00
Alexander
0bb63b01c4 Removed server side pages rendering. 2021-10-29 13:02:40 +03:00
Serghey Rodin
be834ddd17 add react static build 2021-10-29 11:30:04 +03:00
Serghey Rodin
93e9fe9f99 disable old php api 2021-10-29 11:29:30 +03:00
Serghey Rodin
08513755b2 move react sources to src dir 2021-10-29 10:38:02 +03:00
Serghey Rodin
8e97eb2dad improved package check 2021-10-29 10:33:52 +03:00
Serghey Rodin
926376295a delete clamd.scan index.php 2021-10-28 23:30:21 +03:00
Serghey Rodin
718e458fc9 Merge branch 'master' of github.com:serghey-rodin/vesta 2021-10-28 23:29:24 +03:00
Serghey Rodin
dbbbe94d8f set version to 1.0.0 2021-10-28 23:28:57 +03:00
Serghey Rodin
bfc94fbd10 added dns record and user search 2021-10-28 23:22:31 +03:00
Serghey Rodin
fb9d3fddb0
Merge pull request #1988 from serghey-rodin/Skamasle-patch-9
Fix reset password from CLI / roundcube
2021-10-28 23:13:05 +03:00
Serghey Rodin
5f0856f1c4
Merge pull request #1975 from Daniyal-Javani/fix-ftp-restore-path
Fix ftp restore path
2021-10-28 23:09:26 +03:00
Serghey Rodin
70748e302e
Merge pull request #1798 from cmstew/cmstew-amazon-linux-clamd-patch
cmstew amazon linux clamd patch
2021-10-28 23:07:04 +03:00
Serghey Rodin
7444a6b0a9
Merge pull request #1791 from henri-hulski/backend_port
Increment backend port also when commented
2021-10-28 23:01:19 +03:00
Serghey Rodin
638ef7de51
Merge pull request #2040 from AiratHalitov/mem-rrd-patch
Update v-update-sys-rrd-mem
2021-10-28 22:56:40 +03:00
Serghey Rodin
3431bbbd8f
Merge pull request #2069 from lotarbo/patch-1
refactor: drop TLSv1.1 support in rhel 7
2021-10-28 22:53:56 +03:00
Serghey Rodin
f832525f65
Merge pull request #2071 from serghey-rodin/feature/new-react-ui
Updated react UI and UX part.
2021-10-28 22:52:55 +03:00
Serghey Rodin
350c6fc9c9
Merge pull request #2072 from serghey-rodin/feature/new-api-interface
Integrated new api interface.
2021-10-28 22:52:47 +03:00
Alexander
2ecb3a10ac Fixed cron autoupdates and firewall banlist. 2021-10-28 22:51:42 +03:00
Alexander
7540c9881d Fixed Packages, Firewall and Server tabs. 2021-10-28 22:36:05 +03:00
Alexander
b7cf917141 Fixed bulk actions and few minor UX bugs. 2021-10-28 11:01:06 +03:00
Alexander
2a12fec5ea Updated services and fixed minor bugs. 2021-10-28 10:55:00 +03:00
Alexander
4306a4fb4f Integrated new api interface. 2021-10-27 11:20:24 +03:00
Alexander
91e7d9ff4a Updated react UI and UX part. 2021-10-27 11:13:28 +03:00
Anton Reutov
4a9bfc94ad
Merge pull request #2068 from jaapmarcus/vesta-ioncube-missing
Vesta-ioncube is missing
2021-10-23 13:47:27 +03:00
Serghey Rodin
c520eb283a
Merge pull request #2070 from serghey-rodin/release/react-integration
React integration ready for v1.0.0 release.
2021-10-22 17:57:08 +03:00
Alexander
095e2e9e4a React integration ready for v1.0.0 release. 2021-10-22 17:55:25 +03:00
Bogdan Lotarev
bfe31a82df refactor: drop TLSv1.1 support in rhel 7 2021-10-19 20:05:16 +03:00
Serghey Rodin
67f2ad0c99
Merge pull request #2067 from serghey-rodin/react-integration
React js integration with vesta control panel.
2021-10-14 14:49:30 +03:00
Jaap Marcus
b6e7c18e29
Vesta-ioncube is missing
Added check for vesta-ioncube
2021-10-13 11:52:52 +02:00
Alexander
c12c21ec8b React js integration with vesta control panel. 2021-10-12 21:36:52 +03:00
Serghey Rodin
4c6dd0d719
Merge pull request #2063 from graileanu/fix-poweredby
Vestacp.com link by https & solve wording confusion causing people to send abuse requests
2021-10-07 20:42:37 +03:00
Grigore Raileanu
382732f87f Replaced http by https & changed wording 2021-09-23 17:56:05 +03:00
Anton Reutov
1308b508ff SSL for hostname 2021-08-26 21:37:11 +03:00
Anton Reutov
4feb62c4c8 SSL for hostname 2021-08-26 21:36:15 +03:00
Anton Reutov
404b405656 SSL for hostname 2021-08-26 21:35:12 +03:00
Anton Reutov
1ed1505169 SSL for hostname 2021-08-26 21:33:46 +03:00
Anton Reutov
aab2b4d31d Change default vesta port 2021-08-26 18:54:16 +03:00
Anton Reutov
3f5246b144 Change default vesta port 2021-08-26 18:47:53 +03:00
Anton Reutov
1ba4238b84 Update vst-install-debian.sh 2021-08-26 18:45:15 +03:00
Anton Reutov
47dab17c48 Change default vesta port 2021-08-26 12:53:11 +03:00
Anton Reutov
6b7dc97731 Change default vesta port 2021-08-25 23:03:07 +03:00
Anton Reutov
960e3a20df GUI Change default vesta port 2021-08-24 17:33:24 +03:00
Anton Reutov
7a6dc72f29 GUI Change default vesta port 2021-08-24 17:28:47 +03:00
Anton Reutov
402a69049c
Merge pull request #1790 from molny/master
Check missing 'gnupg' package on latest fresh Ubuntu versions
2021-08-23 18:02:13 +03:00
Anton Reutov
450fa0d7d0
Update vst-install-ubuntu.sh 2021-08-23 18:01:15 +03:00
Anton Reutov
6225820910
Fix for "Broken or Risky Cryptographic Algorithm"
Fix for reflected XSS vulnerability, found by Brian Semrau
2021-08-16 14:59:41 +03:00
Anton Reutov
2fc0dc34fe
Fix for "Broken or Risky Cryptographic Algorithm" 2021-08-16 14:56:37 +03:00
Anton Reutov
6fdfef4e88
Fix for possible file inclusion vulnerability in i18n.php 2021-08-16 12:36:08 +03:00
Anton Reutov
df9377519e
Merge pull request #1785 from JOduMonT/master
add nginx template for invoice ninja
2021-08-14 23:23:08 +03:00
Anton Reutov
e01adf78f8
Added ''LE SSL for hostname'' to section about the software being installed 2021-08-14 20:04:21 +03:00
Anton Reutov
a6884ad898
Added ''LE SSL for hostname'' to section about the software being installed 2021-08-14 20:01:30 +03:00
Anton Reutov
3a0bcfea66
Added ''LE SSL for hostname'' to section about the software being installed 2021-08-14 19:59:19 +03:00
Anton Reutov
cc2d60bf05
Added ''LE SSL for hostname'' to section about the software being installed 2021-08-14 19:57:06 +03:00
Anton Reutov
b4ec733dcc
Installing gnupg 2021-08-13 21:47:09 +03:00
Anton Reutov
14a9fa4f8b
Merge pull request #1799 from cmstew/auto-hostname-ssl
Setting lets encrypt hostname ssl auto-renewal during install
2021-08-13 21:09:20 +03:00
Anton Reutov
0403b0c4a3
fix backend_template for nginx 2021-08-12 20:03:19 +03:00
Anton Reutov
b1ca176d44
fix backend_template for nginx 2021-08-12 20:01:41 +03:00
Anton Reutov
d0e9395c9f
fix backend_template for nginx 2021-08-12 20:00:44 +03:00
Anton Reutov
4affb916ef
Merge pull request #1826 from webkmua/fix-package-backend
fix backend_template save after package change
2021-08-12 19:52:49 +03:00
Anton Reutov
9aeef63ff4
Merge pull request #1987 from clarkchentw/clarkchentw-patch-1
Fix curl call
2021-08-09 21:49:05 +03:00
Anton Reutov
a6cb9df163
TLS 1.0 drop & TLS 1.3 addition #1643 2021-08-05 19:29:37 +03:00
Anton Reutov
d20a682c1d
TLS 1.0 drop & TLS 1.3 addition #1643 2021-08-05 19:12:11 +03:00
Anton Reutov
6aaf189547
TLS 1.0 drop & TLS 1.3 addition #1643 2021-08-05 18:58:36 +03:00
Anton Reutov
cc97aeef02
Merge pull request #1643 from ioannidesalex/patch-62
TLS 1.0 drop & TLS 1.3 addition
2021-08-05 18:56:58 +03:00
Anton Reutov
10a59574d7
Merge pull request #1913 from kgrzelak/patch-1
Update v-list-web-domain-ssl
2021-08-04 22:01:56 +03:00
Anton Reutov
9f26aa785e
Merge pull request #1907 from AltiUP/patch-1
Update v-add-web-domain-ftp
2021-08-04 18:33:54 +03:00
Anton Reutov
29bdd18e95
Merge pull request #1949 from NIKTONIKTO717/patch-2
Update vst-install-rhel.sh
2021-08-03 17:04:41 +03:00
Anton Reutov
88e54a8671
sed nginx no #2009 2021-08-02 16:18:48 +03:00
Anton Reutov
f3872ada4a
sed nginx no #2009 2021-08-02 16:15:43 +03:00
Anton Reutov
06ff183f21
sed nginx no 2021-08-02 16:11:10 +03:00
Anton Reutov
b0f65509e0
Merge pull request #1978 from olympy/fix-renew-ssl-on-domain-match
Fix issue #1977 / Letsencrypt ssl certificate update fails
2021-08-02 14:26:46 +03:00
Anton Reutov
78133f35aa
Update vsftpd.conf to support TLS connections 2021-08-01 15:23:41 +03:00
Anton Reutov
350a19edb1
Merge pull request #2017 from dynanode/patch-3
Update vsftpd.conf to support TLS connections
2021-08-01 15:21:32 +03:00
Anton Reutov
98fd0827be
Merge pull request #1993 from BorysVrublevskyi/cs-cart_template
cs-cart template for nginx php-fpm ubuntu 18.04
2021-07-30 16:55:52 +03:00
Anton Reutov
a8ff57047c
Merge pull request #2034 from Ham3D/add_single_page_applications_support
add single page applications support
2021-07-30 15:17:11 +03:00
Anton Reutov
9d2c0ca64c
Changes to Cloudflare Infrastructure IPs List 2021-07-30 14:51:17 +03:00
Anton Reutov
55e58f5cce
Changes to Cloudflare Infrastructure IPs List 2021-07-30 14:48:55 +03:00
Anton Reutov
ffe3e1bbd9
Changes to Cloudflare Infrastructure IPs List 2021-07-30 14:47:41 +03:00
Anton Reutov
2a2cfee433
Merge pull request #2051 from byronjumbo/patch-2
[Action May Be Required] Changes to Cloudflare Infrastructure IPs Lis…
2021-07-30 14:42:16 +03:00
Anton Reutov
76072b7398
Change default vesta port 2021-07-29 20:29:51 +03:00
Anton Reutov
b378cf18ed
Update postinst 2021-07-29 16:47:04 +03:00
Anton Reutov
d68ac3993c
stopped to renew LE if domain is not exits more 2021-07-28 20:30:03 +03:00
Anton Reutov
0cdb05bb03
send email function to full backup 2021-07-28 20:24:25 +03:00
Anton Reutov
cde1cd6651
stopped to renew LE if domain is not exit more 2021-07-28 20:12:07 +03:00
Anton Reutov
0fcbadda78
Grep carefully for 'END CERTIFICATE' 2021-07-28 19:43:04 +03:00
Anton Reutov
d97adaeb6a
Disabling login with 'root' 2021-07-28 14:19:12 +03:00
Anton Reutov
6b3cd17202
Fixing Apache status public access 2021-07-28 11:22:31 +03:00
Anton Reutov
c582ff3766
Checking period value in /list/rrd/ 2021-07-27 22:19:45 +03:00
Anton Reutov
374d6c6b19
htmlentities() for token 2021-07-27 22:01:10 +03:00
Anton Reutov
1c801b2d60
Fix for downloading backup of other users 2021-07-27 21:50:33 +03:00
Anton Reutov
1ff5208968
Preventing admin to do loginas action without token 2021-07-27 20:58:34 +03:00
Anton Reutov
b123fa2178
Making sure chmod and chown does not follow symlinks 2021-07-27 15:38:29 +03:00
Anton Reutov
393c81d46c
Making sure chmod and chown does not follow symlinks 2021-07-27 15:27:20 +03:00
Anton Reutov
93eec18723
Making sure chmod and chown does not follow symlinks 2021-07-27 15:21:52 +03:00
Anton Reutov
45b13a2105
Making sure chmod and chown does not follow symlinks 2021-07-27 15:10:04 +03:00
Anton Reutov
f41ad21e1e
Update main.sh 2021-07-27 15:06:11 +03:00
Anton Reutov
8a60b257a2
Preventing uploads from other origin 2021-07-27 14:56:35 +03:00
Anton Reutov
ea1e22613e
Restrict v-make-tmp-file to tmp folder 2021-07-27 14:42:25 +03:00
Anton Reutov
bbe06d10b6
Checking licence format 2021-07-27 14:36:41 +03:00
Anton Reutov
3c31647926
Validate user input on domain 2021-07-27 14:35:40 +03:00
Anton Reutov
10bedc72f1
Merge pull request #2059 from zidingz/patch-1
Create SECURITY.md
2021-07-26 17:14:35 +03:00
Ziding Zhang
102ecb2c32
Create SECURITY.md
For your consideration: a quick instruction for future security researchers.
2021-07-26 15:08:34 +01:00
Anton Reutov
d0a21b4859
Ensure HTML will not be displayed in list log page 2021-07-26 17:08:17 +03:00
Anton Reutov
5f92fc5380
Added interface validation 2021-07-26 16:50:25 +03:00
Anton Reutov
a4e4542a6d
Checking licence format 2021-07-26 16:41:04 +03:00
Anton Reutov
c6b79fe5da
Check if it's vesta package 2021-07-26 14:59:10 +03:00
Byron Jumbo
04bf5fc042
[Action May Be Required] Changes to Cloudflare Infrastructure IPs Listed on cloudflare.com/ips
If your security model relies on allowing a list of trusted Cloudflare IPs from cloudflare.com/ips (or via API) on your origin, please make the following changes to your allow list by May 7, 2021. This change is safe to make today.

Remove:
104.16.0.0/12

Add:
104.16.0.0/13
104.24.0.0/14
2021-04-09 08:51:52 -05:00
Made I.T
bba7400b8a
Fix duplicated DNS records in DNS cluster 2020-12-10 12:13:46 +01:00
Airat Halitov
fb7f6254fa
Update v-update-sys-rrd-mem 2020-12-04 17:27:25 +05:00
Anton Reutov
1b85b7b313
Merge pull request #2030 from myrevery/patch-1
Update cn.php
2020-10-25 23:40:53 +03:00
dpeca
d7de756d70
Merge pull request #2039 from moucho/acme_v2_GET
Deprecate GET acme v2
2020-10-25 02:20:11 +02:00
moucho
2dc4adb08e Deprecate GET acme v2 2020-10-22 13:48:45 +02:00
Hamed hojjati
246ea6888d add single page applications support 2020-10-01 11:15:23 +03:30
myrevery
8d5c2e2e8e
Update cn.php
Refine some details.
2020-09-03 12:49:00 -07:00
Anton Reutov
af94a23962
Merge pull request #2029 from myrevery/patch-1
Update cn.php
2020-08-26 16:22:54 +03:00
myrevery
ce5d209c13
Update cn.php 2020-08-25 14:58:01 -07:00
dpeca
ef0f62a59b
Also checking "" in order to detect manually chunked record
And removing brackets, since they are not necessary when whole record is in one line
2020-08-23 19:44:12 +02:00
dpeca
311827c4b3
Not chunking already manually chunked TXT records 2020-08-19 14:52:45 +02:00
dpeca
f74301b19f
Split long TXT entries into 255 chunks 2020-08-19 12:44:46 +02:00
dpeca
ccea621787
Merge pull request #1947 from dawindk/patch-1
Only exclude logs folder from root, not in public_html
2020-08-19 11:07:55 +02:00
dpeca
c171d5e68e
Merge pull request #1969 from joshbmarshall/joshbmarshall-patch-1
Bugfix deleting a PostgreSQL database
2020-08-19 11:06:39 +02:00
dynanode
3b96845f8a
Update vsftpd.conf to support TLS connections
Updated config to support TLS 1.2 connections to vsftpd only.
2020-06-25 13:59:51 +02:00
dpeca
e0ebf729f3
Avoid Let's Encrypt domain validation timeout 2020-06-23 20:20:11 +02:00
dpeca
83d0b9ed90
Allow quick restarting of nginx
It can occur if domain has many aliases, and acme-challenge should be added many times

This fix will prevent this error:
```
May 14 21:39:08 server systemd[1]: nginx.service: Start request repeated too quickly.
May 14 21:39:08 server systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
```
2020-06-23 20:14:55 +02:00
dpeca
d9e9c64369
Fixing NS parameters in v-add-dns-on-web-alias 2020-06-23 20:10:54 +02:00
dpeca
8d9e349b23
Dont match subdomains while restoring domain 2020-06-23 20:08:59 +02:00
dpeca
a9e46047e9
Reset UPDATE_SSL_SCRIPT 2020-06-23 20:04:30 +02:00
dpeca
c377e19df8 Adding escapeshellarg on few more places in php code 2020-06-23 19:06:25 +02:00
dpeca
b6cadcd992 Fixing unnecessary slash in nginx configs for phpmyadmin and roundcube 2020-06-23 18:01:38 +02:00
Borys Vrublevskyi
37fc05081b cs-cart template for nginx php-fpm ubuntu 18.04 2020-04-16 16:47:23 +03:00
dpeca
cfc46bb2a9
Importing system enviroment in v-change-user-password
Thanks to @ScIT-Raphael for discovering this bug
2020-04-11 02:16:24 +02:00
dpeca
cc8a3e0c58
Correcting FTP link in v-backup-user 2020-04-09 20:53:27 +02:00
Maksim Usmanov | Maks
ce417f65a2
Fix reset password from CLI / roundcube
This will fix bug when change password from cli

$quota is not defined
I not know if there is any function to get quota with a single comand, so I get alredy defined quota

With out this vesta will reset quota or not asign nothing in passwd file when quota password was reset
2020-04-05 13:26:45 +02:00
Clark Chen
7177dbb4e7
Fill missing get data (module) 2020-03-30 16:55:13 +08:00
Clark Chen
e4710ae715
Fix curl call
curl wasn't called properly, due to '&' character exist in url without quote around it
2020-03-30 16:50:07 +08:00
Clark Chen
e75b62efad
Fix curl call
curl wasn't called properly, due to '&' character exist in url without quote around it
2020-03-30 16:48:22 +08:00
dpeca
58807feb80
Adding port to reset password link 2020-03-29 18:13:22 +02:00
dpeca
c915bff32e
Forbid changing root password 2020-03-24 20:40:47 +01:00
dpeca
00e1f46276
Limiting /etc/sudoers for Ubuntu 2020-03-23 19:34:39 +01:00
dpeca
c9844805a4
Limiting /etc/sudoers for Ubuntu 2020-03-23 19:31:42 +01:00
dpeca
c3c4de43d6
Preventing manipulation with $_SERVER['HTTP_HOST'] 2020-03-23 17:28:55 +01:00
dpeca
a5712542d7 Temporary fix for parsing backup conf 2020-03-23 01:21:57 +01:00
olymp
dae2eb0854 Letsencrypt ssl certificate update fails when you have domains like example.com and example.com.ua (beginning matches)
issue #1977 https://github.com/serghey-rodin/vesta/issues/1977
2020-02-23 12:50:32 +02:00
Daniyal Javani
993796fcf2 fix ftp restore path 2020-02-05 10:53:17 +03:30
Josh Marshall
99abd5ed05
Bugfix deleting a PostgreSQL database
Was just a typo
2020-01-09 00:52:10 +10:00
Anton Reutov
931fb5beeb
Merge pull request #1944 from nothinux/i18n-php
update id.php
2019-10-21 13:25:31 +03:00
NIKTONIKTO717
949c011321
Update vst-install-rhel.sh
I only tried to fix bug #1933
2019-10-09 15:23:39 +02:00
David Olsen
9d2ca4b592
Only exclude logs folder from root, not in webdata
Restoring should not exclude logs in any folder down the tree. This causes errors when restoring wordpress with certain plugins that have folders named "logs". This change aligns the restore with the backup function https://github.com/serghey-rodin/vesta/blob/master/bin/v-backup-user#L226

You could also omit the exclusion entirely, as this folder you are excluding should never be in the backup.
2019-10-07 10:40:56 +02:00
dpeca
f0782d1f82
Fixing broken autoreply output
Broken in 0831a198b8 (diff-f07da7937954ae08bdb2e7379655ae29)
@sergio-nadal
2019-10-03 16:15:36 +02:00
Alexandr Loskutov
d0ca10a5d3
Merge pull request #1945 from robindirksen1/patch-7
Update nl.php
2019-10-01 23:52:17 +03:00
Robin Dirksen
ec8631b2d2
Update nl.php 2019-10-01 16:28:03 +02:00
Taufik Mulyana
9947b17144 update id.php 2019-10-01 21:18:38 +07:00
T. Mulyana
6645586fb2
Merge pull request #1 from serghey-rodin/master
update
2019-10-01 20:42:54 +07:00
Serghey Rodin
270d29ff06 added month to the release log date 2019-09-29 00:17:54 +03:00
Serghey Rodin
52c32962a8 Release 0.9.8-26 2019-09-29 00:09:07 +03:00
Serghey Rodin
ae328a0935 added support for HTTP/2 Let's Encrypt servers 2019-09-24 01:08:17 +03:00
dpeca
84ef0a118f
Changing /usr/local/vesta to $VESTA 2019-08-24 16:13:03 +02:00
dpeca
e82ad200b7
Translated added string in sr.php 2019-08-18 16:37:00 +02:00
Serghey Rodin
868dd8b146 Release 0.9.8-25 2019-08-15 21:42:57 +03:00
Serghey Rodin
26c0d3c3f2 fixed delimiter format for plain output 2019-08-08 19:59:21 +03:00
Serghey Rodin
743476ad73 added sudo call for directory creation and restore 2019-08-08 19:58:35 +03:00
Serghey Rodin
015acfc168
Merge pull request #1896 from millsy/master
Switched to egrep to support optional comma in renewal
2019-08-08 14:24:36 +03:00
Serghey Rodin
8728f4b00d deleted merge artifacts 2019-08-08 14:20:35 +03:00
Luka Paunović
02955ddb47 Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
25e66d471e Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
b16e9b1d4d Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
6d09433447 Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
f23697217b Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
9ab4927ec2 Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
ea2f42e689 Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
8d3473c914 Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
aa8ba1aff1 Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
c83a925c9a Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
ed8d38228b Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
0d66d22150 Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
bebd854b60 Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
7f8313b48f Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
fe6f93faba Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
57fb5a759f Update config.inc.php 2019-08-08 14:18:31 +03:00
Luka Paunović
cb8cd40b13 Update config.inc.conf 2019-08-08 14:18:31 +03:00
Luka Paunović
a745eb02d8 Update config.inc.conf 2019-08-08 14:18:31 +03:00
Luka Paunović
880496962a Update config.inc.conf 2019-08-08 14:15:57 +03:00
Luka Paunović
3e2178bb6e Update config.inc.conf 2019-08-08 14:15:57 +03:00
Serghey Rodin
9ba24729a6 Merge branch 'lukapaunovic-patch-2' 2019-08-08 14:15:18 +03:00
Serghey Rodin
1a02521f76 Resolved merge conflict with tmp dir. 2019-08-08 14:13:35 +03:00
Serghey Rodin
5c61b3efb1
Merge pull request #1919 from dbannik/fix-add-sftp-backup
fixed add sftp server backup
2019-08-08 14:04:26 +03:00
Serghey Rodin
72fe886a84 Merge branch 'master' of github.com:serghey-rodin/vesta 2019-08-08 13:55:11 +03:00
Serghey Rodin
0340652bf6
Merge pull request #1920 from kovalets/patch-3
Create vsftpd.conf on RHEL 8
2019-08-08 13:53:38 +03:00
Serghey Rodin
b17b4b205d removed unnecessary single quotes for security reasons / thanks to Andrea Cardaci 2019-08-07 18:46:40 +03:00
Serghey Rodin
c9bf443c6a added user format valdation 2019-07-31 00:46:04 +03:00
Serghey Rodin
bb44f4197b hardering user validation 2019-07-30 18:32:30 +03:00
Sergey Kovalets
dbb8b8c674
Create vsftpd.conf 2019-07-26 02:23:40 +03:00
Serghey Rodin
f0b47b3220 rfc2324 partial support: any attempt to brew coffee with a teapot should result in the error code 418 - I'm a teapot 2019-07-22 16:55:55 +03:00
Dmitry Bannik
d74ac9980a
fixed add sftp server backup 2019-07-20 02:39:15 +03:00
Alexandr Loskutov
9de1d46bb6
Merge pull request #1914 from myrevery/patch-1
Update cn.php
2019-07-15 23:22:56 +03:00
myrevery
9c42ce85de
Update cn.php
Refine some details.
2019-07-15 06:17:02 -07:00
Krzysztof Grzelak
a9ddd4159c
Update v-list-web-domain-ssl
Adding certificate support from CloudFlare
2019-07-11 21:30:00 +02:00
Anton Reutov
f9c9ec6fed
Merge pull request #1910 from TimoStramann/patch-2
vBulletin 5 templates added for Debian/Ubuntu
2019-07-04 11:12:16 +03:00
Timo Stramann
ce6640010b
vBulletin 5 template based on default tpl 2019-07-04 02:55:47 +02:00
Timo Stramann
81842cc878
vBulletin 5 template based on default tpl 2019-07-04 02:55:10 +02:00
Timo Stramann
ef36a47ce0
vBulletin 5 template based on default stpl 2019-07-04 02:53:49 +02:00
Timo Stramann
8d83d0235e
vBulletin 5 template based on default tpl 2019-07-04 02:53:03 +02:00
Timo Stramann
de51aa4692
vBulletin 5 template based on default tpl 2019-07-04 02:52:16 +02:00
Timo Stramann
0829d631c9
vBulletin 5 template based on default stpl 2019-07-04 02:47:02 +02:00
Alexandr Loskutov
36c12c618b
Merge pull request #1902 from darkworks/urdu_translation
Update ur.php
2019-06-28 17:32:40 +03:00
Alexandr Loskutov
cbb5356a07
Merge pull request #1898 from myrevery/patch-1
Update cn.php
2019-06-28 17:30:42 +03:00
CLSII
6d6e3f3723
Update v-add-web-domain-ftp
Modification of the useradd request to find the right user group --> For the group it is : (id -g $user)
2019-06-27 21:34:20 +02:00
darkworks
0b0bcf6b15
Use Web Domain SSL Certificate -> ur.php
updated ur.php translation
2019-06-20 23:11:23 +05:00
darkworks
b67c0f88e4
Merge pull request #2 from serghey-rodin/master
update 6 20 2019
2019-06-20 22:30:39 +05:00
darkworks
bf030103da
Merge pull request #1 from darkworks/darkworks-yum_check
check for yum properly.
2019-06-20 22:24:22 +05:00
myrevery
a6028ee4e9
Update cn.php
Refine some details.
2019-06-10 16:10:32 +08:00
Chris Mills
9bceb01622 Switched to egrep to support optional comma in renewal 2019-06-06 06:07:44 +01:00
Serghey Rodin
a6d498e7e2 added net-tools package for ifconfig command 2019-05-23 00:12:42 +03:00
Serghey Rodin
58e9615d94
Merge pull request #1887 from Myself5/master
v-backup-user: Properly fix userdata backup exclusions
2019-05-23 00:08:06 +03:00
Serghey Rodin
7d48d5585f
Merge pull request #1888 from millsy/master
Renewal of cert not removing domain from alias list
2019-05-23 00:04:44 +03:00
Serghey Rodin
c2abcf3dc9
Merge pull request #1892 from romkoll/patch-2
Fix v-unsuspend-mail-account
2019-05-23 00:03:06 +03:00
Serghey Rodin
9c108786e6
Merge pull request #1867 from moucho/domain_idn
Fix Let's Encrypt for IDN domains
2019-05-23 00:02:07 +03:00
Roman
a716a3f2cb
Fix v-unsuspend-mail-account
Fix 'Malformed value "unlimitedM"' after unsuspend mail account
2019-05-22 20:10:15 +03:00
Chris Mills
a78c7ffc92 Renewal of cert not removing domain from alias list 2019-05-17 09:49:58 +01:00
Christian Oder
d24f68a370
v-backup-user: Properly fix userdata backup exclusions
So far, no exclusions have been accounted for as fargs has not been passed.
Rework the logic for fargs parsing based on domain exclusions and pass fargs to the tar command.

Also add --anchored based on 37c69b8f4c
2019-05-15 17:07:53 +02:00
Serghey Rodin
e087a04f00
Merge pull request #1854 from anthonyrossbach/patch-1
Fixes for dumps of large databases
2019-05-14 12:38:21 +03:00
Serghey Rodin
7726ed8956
Merge pull request #1690 from chkhanu/fix-invalid-extension-replace
Fix invalid extension replace in add_web_config
2019-05-14 12:21:14 +03:00
Serghey Rodin
46db88d266
Merge pull request #1885 from noogen/master
fix typo of extra L issue #1509
2019-05-14 12:15:24 +03:00
Serghey Rodin
3e922f8cfe
Merge pull request #1540 from darkworks/darkworks-yum_check
check for yum properly.
2019-05-14 12:11:29 +03:00
noogen
d856c1e080 fix typo of extra L issue #1509 2019-05-14 03:38:36 -05:00
Serghey Rodin
20c7764485
Merge pull request #1575 from moucho/backups
Don't exclude "logs" folder recursively on backups
2019-05-14 11:14:16 +03:00
Serghey Rodin
56ee371a88
Merge pull request #1431 from somthanat/master
#1429 fix php open_basedir error when using public_shtml as a document root
2019-05-14 11:09:48 +03:00
Serghey Rodin
390daf416c
Merge pull request #1463 from serghey-rodin/madeITBelgium-patch-1462
Fix http2 templates #1462
2019-05-14 11:08:25 +03:00
Serghey Rodin
e6cc11a27b
Merge pull request #1454 from EmanH/patch-1
644 chmod should only apply to files
2019-05-14 11:02:18 +03:00
Serghey Rodin
faf7612c7e
Merge pull request #1349 from serghey-rodin/add-caa-record
Add CAA DNS record
2019-05-14 10:57:13 +03:00
Serghey Rodin
1e157d4c29
Merge pull request #1751 from hacktivista/fix/v-update-sys-ip-non-existent-files
Fix v-update-sys-ip: verify if primary IP exists
2019-05-14 10:38:38 +03:00
Serghey Rodin
46d080cd8a
Merge pull request #1750 from hacktivista/fix/debian-chown-admin
Don't chown $VESTA/data/sessions admin:admin previous to user admin creation
2019-05-14 10:36:09 +03:00
Serghey Rodin
63b8ef22f6
Merge pull request #1859 from lukapaunovic/patch-1
Fix for issue #1286
2019-05-14 10:33:55 +03:00
Serghey Rodin
3069003941
Merge pull request #1846 from dreiggy/dreiggy-patch-v-list-mail-domain-dkim-dns-newline-remove
Remove \n from dkim txt output
2019-05-14 10:30:55 +03:00
Serghey Rodin
0f08d77fd5
Merge pull request #1858 from SteenSchutt/master
Prevent v-backup-user from excluding folders named logs further down the tree
2019-05-14 10:28:05 +03:00
Serghey Rodin
855ba537cd
Merge pull request #1838 from pablobae/br2-fix-firewall-update-check-ssh-custom-port-rules-config-file
Update v-update-firewall
2019-05-14 10:26:04 +03:00
Serghey Rodin
d4bde98d2e
Merge pull request #1862 from noogen/master
fix typo and allow user to login on pgsql restore
2019-05-14 10:24:18 +03:00
Serghey Rodin
7f82e42cc2
Merge pull request #1870 from skullwritter/patch-11
correcting wildcat
2019-05-14 10:23:33 +03:00
Serghey Rodin
e57f620a86
Merge pull request #1875 from serghey-rodin/Skamasle-patch-6
Fix Nginx exclusion
2019-05-14 10:20:26 +03:00
Serghey Rodin
8dd0ef30fe
Merge pull request #1876 from serghey-rodin/Skamasle-patch-7
Fix for nginx exclude
2019-05-14 10:20:08 +03:00
Serghey Rodin
698f9783b4
Merge pull request #1884 from pasuder/master
Fix update of SSL for LetsEncrypt certs
2019-05-14 10:18:42 +03:00
Paweł Suder
d563dcd12b Fix update of SSL for LetsEncrypt certs
Due to missing /g in sed for parsing aliases from certificate SAN
field there was an issue with doubled alias which is also common
name of issued certficiate.
2019-05-14 08:59:43 +02:00
Serghey Rodin
f50d8b7d84 added port 654321 to run openssl key-pair test 2019-05-08 22:47:30 +03:00
Maksim Usmanov | Maks
3acd228169
Fix for nginx exclude
There are some ways to fix this

First put nginx at the beginig or modify this line

software=$(echo "$software" | sed -e "s/^nginx//")
Replacing it by this one:
software=$(echo "$software" | sed -e "s/nginx//")
Or by this:
software=$(echo "$software" | sed -e "s/ nginx//")
2019-04-28 16:03:54 +02:00
Maksim Usmanov | Maks
a62095aa13
Fix Nginx exclusion
This fix 706 in bugs.vesta and #1820 ( same issue )
2019-04-28 15:57:49 +02:00
Skull Writter
f492c1ee2a
correcting wildcat
check if alias is the letsencrypt wildcard domain, if not, make the normal checks
2019-04-23 14:11:31 +00:00
Anton Reutov
0031c93535
Merge pull request #1865 from sergio-nadal/security-fixes
Security fixes - CSRF / Command Injection / XSS
2019-04-22 19:48:00 +03:00
Anton Reutov
9b5ac54d93
Merge pull request #1868 from moucho/spanish
Updated Spanish translation
2019-04-22 15:50:23 +03:00
moucho
5df4dc819f Updated Spanish translation 2019-04-22 14:47:32 +02:00
moucho
0713570b87 Fix Let's Encrypt for IDN domains 2019-04-21 18:28:34 +02:00
Sergio
7226a8991f Fix some XSS. 2019-04-21 02:18:24 +02:00
Sergio
0831a198b8 Fixed several Command Injection. 2019-04-21 01:51:29 +02:00
Sergio
7603cdea7a Add the validation of the CSRF token. It is missing in some cases when it is sent by GET or POST. 2019-04-21 00:11:36 +02:00
Anton Reutov
2da2c539f1
Merge pull request #1864 from moucho/Spanish
Spanish translation update
2019-04-20 15:00:20 +03:00
moucho
97a3b40047 Spanish translation update 2019-04-20 13:47:38 +02:00
Serghey Rodin
af37f5cbef fix backport apt name 2019-04-20 03:07:10 +03:00
Serghey Rodin
35df8ba980 Jessie backports 2019-04-20 00:08:37 +03:00
Serghey Rodin
82b635f8da Print the file name for each match 2019-04-18 15:03:03 +03:00
Serghey Rodin
25706abfb3 replaced rdomain with domain variable 2019-04-17 23:28:40 +03:00
Serghey Rodin
425e9f2483 18$ instead of 21$ 2019-04-16 12:53:58 +03:00
Serghey Rodin
bef5f87618 version up 2019-04-16 12:16:03 +03:00
noogen
483c4b943b fix typo and allow user to login on pgsql restore 2019-04-15 17:29:31 -05:00
Serghey Rodin
703a66eb57 gzip_vary duplicate 2019-04-15 21:00:12 +03:00
Serghey Rodin
e1fb811caf ubuntu 18.10 support 2019-04-15 14:08:16 +03:00
Serghey Rodin
e674bf14fd Release 0.9.8-24 2019-04-15 13:48:23 +03:00
Serghey Rodin
70319b6a94 full pma install 2019-04-15 13:33:09 +03:00
Serghey Rodin
ab95d5d88d removing single quote from escapeshellarg calls 2019-04-15 10:51:40 +03:00
Serghey Rodin
c28c5d29a3 setting content type to fix possible XSS attack vector 2019-04-12 17:21:28 +03:00
Luka Paunović
f0c328375f
Update v-change-sys-service-config 2019-04-11 19:02:36 +02:00
Luka Paunović
3cbaab38bf
Fix for issue #1286
Fix for issue #1286
2019-04-11 19:00:56 +02:00
Steen Schütt
b650ae5bd5
Merge pull request #1 from SteenSchutt/SteenSchutt-patch-1
Prevent v-backup-user from excluding folders named logs further down …
2019-04-10 14:43:46 +02:00
Steen Schütt
a981ddb468
Prevent v-backup-user from excluding folders named logs further down the tree
This change will fix issues with files like `public_html/wp-content/plugins/sitepress-multilingual-cms/classes/logs/interface-wpml-log.php` from being excluded, but still exclude the intended main logs directory. Fixes a semi-widespread issue with VestaCP and WPML.
2019-04-10 14:42:10 +02:00
Anthony Rossbach
8f2fdfb8d3
Fixes for dumps of large databases 2019-04-08 21:47:22 -07:00
Anton Reutov
576a0003da
Merge pull request #1850 from myrevery/patch-1
Update cn.php
2019-03-31 12:16:00 +03:00
myrevery
a181433231
Update cn.php
Refine some details.
Format code and translate new keywords.
2019-03-31 05:50:02 +08:00
Olgerdas
a420465b39
Remove \n from dkim txt output
Some DNS providers (like cloudflare) do not allow in dkim txt record \n char. Fix is removing new line symbols (\n).
2019-03-27 19:35:10 +02:00
Anton Reutov
2bde9c6e47
Merge pull request #1841 from lukapaunovic/patch-1
Fixing blowfish_secret length (too short) [phpMyAdmin]
2019-03-23 15:01:44 +03:00
Luka Paunović
891dac76fc
Update vst-install-rhel.sh 2019-03-21 21:26:05 +01:00
Luka Paunović
a67674c1f2
Fixed
fixed
2019-03-21 21:25:27 +01:00
Luka Paunović
5d9265f84f
Fixing blowfish_secret length (too short)
Fixing blowfish_secret length (too short)
2019-03-21 16:52:59 +01:00
Luka Paunović
aeee40865e
Fixing blowfish_secret length (too short)
phpMyAdmin "screams", we should be using length of 32 characters for blowfish_secret.
2019-03-21 16:50:29 +01:00
Anton Reutov
678c385a81
Merge pull request #1549 from asfihani/master
Add Wordpress WP Super Cache plugin template support
2019-03-20 12:46:38 +03:00
Anton Reutov
1637f737e1
Merge pull request #1711 from clarkchentw/patch-2
Traditional Chinese - TW, update to match en.php
2019-03-20 12:44:20 +03:00
Anton Reutov
90b30a437b
Merge pull request #1683 from crackerizer/drupal-nginx
Reworked on Drupal's nginx template
2019-03-20 12:41:55 +03:00
pablobae
1f40804735 Update v-update-firewall
Check sshcustom port  is not needed anymore, because after merging pull 1819, the rules file already contains the ssh port correctly (it's not hardcoded anymore.

Also, if these lines are not removed, we have change ssh port, and we try to add a new rule with port 22 (v-add-firewall-rule DROP 0.0.0.0/0 22 tcp ssh) , these lines will change port 22 to current ssh port on rules.conf file, and we will be blocked.
2019-03-14 16:07:44 +01:00
Serghey Rodin
180d910131 inverted trigger condition 2019-03-14 14:58:19 +02:00
Serghey Rodin
6a9b7d3507 Use Web Domain SSL Certificate -> i18n 2019-03-14 14:34:38 +02:00
Serghey Rodin
80ebfc0daa frontend: user domain vesta ssl certificate support 2019-03-14 00:44:32 +02:00
Serghey Rodin
8edf965375 backend: user domain vesta ssl certificate support 2019-03-14 00:44:06 +02:00
Anton Reutov
f456afec60
Merge pull request #1835 from myrevery/patch-1
Update cn.php
2019-03-11 13:12:53 +03:00
myrevery
2959165e1a
Update cn.php
Refine some details.
2019-03-11 06:43:33 +08:00
Serghey Rodin
c1b775443d added scripts to copy web domain ssl to vesta and exim 2019-03-03 23:25:16 +02:00
dpeca
eb03d7bab2
Added unzip to Debian installer
Needed for FileManager
2019-03-02 23:24:02 +01:00
Serghey Rodin
c5cff5bcd6 Merge branch 'master' of github.com:serghey-rodin/vesta 2019-02-28 23:47:18 +02:00
Serghey Rodin
a7b54d6000 Function to search avaiable SSL certificates that could be used as main cert 2019-02-28 23:47:07 +02:00
Anton Reutov
66473a41d9
Merge pull request #1819 from pablobae/pablobae-patch1
Update v-add-firewall-chain getting ssh port from ssh config file (not hardcoded)
2019-02-28 23:02:59 +03:00
Anton Reutov
ae1ec05e66
fix for the use of a deprecated directive in nginx 2019-02-28 15:25:54 +03:00
Anton Reutov
452a7ad62e
fix for the use of a deprecated directive in nginx 2019-02-28 15:25:48 +03:00
Anton Reutov
12bc7ab544
fix for the use of a deprecated directive in nginx 2019-02-28 15:25:42 +03:00
Anton Reutov
b7a2728ab0
fix for the use of a deprecated directive in nginx 2019-02-28 15:25:40 +03:00
Anton Reutov
12fdd9713e
fix for the use of a deprecated directive in nginx 2019-02-28 15:24:14 +03:00
Anton Reutov
3912de3ed0
fix for the use of a deprecated directive in nginx 2019-02-28 15:23:55 +03:00
Anton Reutov
b3b1ec3c2e
fix for the use of a deprecated directive in nginx 2019-02-28 15:23:50 +03:00
Anton Reutov
4d5ecf05e7
fix for the use of a deprecated directive in nginx 2019-02-28 15:23:46 +03:00
Anton Reutov
d353421ff4
fix for the use of a deprecated directive in nginx 2019-02-28 15:22:28 +03:00
Anton Reutov
20027824cf
fix for the use of a deprecated directive in nginx 2019-02-28 15:22:17 +03:00
Anton Reutov
eae7202f52
fix for the use of a deprecated directive in nginx 2019-02-28 15:22:09 +03:00
Anton Reutov
caf0890ca1
fix for the use of a deprecated directive in nginx 2019-02-28 15:22:01 +03:00
Anton Reutov
c1d1f13a04
fix for the use of a deprecated directive in nginx 2019-02-28 15:20:06 +03:00
Anton Reutov
a38770a081
fix for the use of a deprecated directive in nginx 2019-02-28 15:19:47 +03:00
Anton Reutov
470b88c764
fix for the use of a deprecated directive in nginx 2019-02-28 15:19:32 +03:00
Anton Reutov
a90c85e6b5
fix for the use of a deprecated directive in nginx 2019-02-28 15:18:46 +03:00
Anton Reutov
f85989fdbf
fix for the use of a deprecated directive in nginx 2019-02-28 15:18:03 +03:00
Anton Reutov
4a04783d66
fix for the use of a deprecated directive in nginx 2019-02-28 15:15:20 +03:00
Anton Reutov
b1e826b0a6
fix for the use of a deprecated directive in nginx 2019-02-28 15:15:03 +03:00
Anton Reutov
19bd87334b
fix for the use of a deprecated directive in nginx 2019-02-28 15:14:51 +03:00
Anton Reutov
e39623308e
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:53 +03:00
Anton Reutov
c11a1b165b
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:49 +03:00
Anton Reutov
579ed37114
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:48 +03:00
Anton Reutov
49ab4c345c
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:45 +03:00
Anton Reutov
00ab9be534
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:43 +03:00
Anton Reutov
a4b8ebcf88
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:41 +03:00
Anton Reutov
cd3ccf5370
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:38 +03:00
Anton Reutov
5230c3d3b0
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:35 +03:00
Anton Reutov
bbf745e049
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:31 +03:00
Anton Reutov
8cbba0ed3e
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:29 +03:00
Anton Reutov
1ede3c055c
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:26 +03:00
Anton Reutov
c28167f37a
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:24 +03:00
Anton Reutov
cf2dc9ccbd
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:20 +03:00
Anton Reutov
6c6520a18c
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:16 +03:00
Anton Reutov
ada32d5535
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:11 +03:00
Anton Reutov
1806c2a3d6
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:09 +03:00
Anton Reutov
dca488c0f7
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:06 +03:00
Anton Reutov
58ddfd4b4d
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:04 +03:00
Anton Reutov
f64e745e20
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:02 +03:00
Anton Reutov
8ef8d8b722
fix for the use of a deprecated directive in nginx 2019-02-28 15:05:00 +03:00
Anton Reutov
d449784697
fix for the use of a deprecated directive in nginx 2019-02-28 15:04:58 +03:00
Anton Reutov
68230531b3
fix for the use of a deprecated directive in nginx 2019-02-28 15:04:53 +03:00
Anton Reutov
37acc7bf31
fix for the use of a deprecated directive in nginx 2019-02-28 15:04:49 +03:00
Anton Reutov
faa9d4aa62
fix for the use of a deprecated directive in nginx 2019-02-28 15:04:45 +03:00
Anton Reutov
75283ef755
fix for the use of a deprecated directive in nginx 2019-02-28 14:50:10 +03:00
Anton Reutov
b289a46cfb
fix for the use of a deprecated directive in nginx 2019-02-28 14:50:05 +03:00
Anton Reutov
4f086744be
fix for the use of a deprecated directive in nginx 2019-02-28 14:50:00 +03:00
Anton Reutov
40a8461b28
fix for the use of a deprecated directive in nginx 2019-02-28 14:49:56 +03:00
Anton Reutov
f36148ca01
fix for the use of a deprecated directive in nginx 2019-02-28 14:47:36 +03:00
Anton Reutov
0226e7b862
fix for the use of a deprecated directive in nginx 2019-02-28 14:47:33 +03:00
Anton Reutov
064a16043d
fix for the use of a deprecated directive in nginx 2019-02-28 14:47:31 +03:00
Anton Reutov
48f61fcc2c
fix for the use of a deprecated directive in nginx 2019-02-28 14:47:29 +03:00
Anton Reutov
3188ae9999
fix for the use of a deprecated directive in nginx 2019-02-28 14:42:44 +03:00
Anton Reutov
01d9626b6c
fix for the use of a deprecated directive in nginx 2019-02-28 14:42:38 +03:00
Anton Reutov
3ed733669e
fix for the use of a deprecated directive in nginx 2019-02-28 14:41:55 +03:00
Anton Reutov
4ed0ca484c
fix for the use of a deprecated directive in nginx 2019-02-28 14:41:35 +03:00
Anton Reutov
dc3dec644d
fix for the use of a deprecated directive in nginx 2019-02-28 14:40:06 +03:00
Anton Reutov
6bb56a8742
fix for the use of a deprecated directive in nginx 2019-02-28 14:39:37 +03:00
Anton Reutov
5ea43b6df6
fix for the use of a deprecated directive in nginx 2019-02-28 14:39:05 +03:00
Anton Reutov
7a1cdc689e
fix for the use of a deprecated directive in nginx 2019-02-28 14:13:15 +03:00
Anton Reutov
232dbf0d09
fix for the use of a deprecated directive in nginx 2019-02-28 14:11:55 +03:00
Anton Reutov
5b4d89b47f
fix for the use of a deprecated directive in nginx 2019-02-28 14:11:21 +03:00
Anton Reutov
6a5061a7a9
fix for the use of a deprecated directive in nginx 2019-02-28 14:11:03 +03:00
Anton Reutov
7aa71c6ca0
fix for the use of a deprecated directive in nginx 2019-02-28 14:10:11 +03:00
Anton Reutov
b22802478d
fix for the use of a deprecated directive in nginx 2019-02-28 14:07:33 +03:00
Anton Reutov
21ce107c68
fix for the use of a deprecated directive in nginx 2019-02-28 14:07:07 +03:00
Anton Reutov
edb3fcc2df
fix for the use of a deprecated directive in nginx 2019-02-28 14:06:25 +03:00
Anton Reutov
372770931c
fix for the use of a deprecated directive in nginx 2019-02-28 14:05:12 +03:00
Anton Reutov
a09f097b3b
Merge pull request #1810 from ifaist0s/master
Proposed fix for the use of a deprecated directive in nginx
2019-02-28 13:54:13 +03:00
Serghey Rodin
f4d3f7a85f Full PMA&Roundcube installs + dovecot namespace hotfix 2019-02-27 14:03:51 +02:00
Serghey Rodin
090875a173 Merge branch 'master' of github.com:serghey-rodin/vesta 2019-02-27 13:56:14 +02:00
Anton Reutov
43fe755f0b
Merge pull request #1822 from fifi/fix-german-translation
fix german translation, forwarded mail
2019-02-25 22:36:02 +03:00
Anton Reutov
ba6491b23f
Merge pull request #1815 from mdandidarmawan/master
Fixing Typo error on Lets Encrypt validation
2019-02-25 17:21:15 +03:00
Anton Reutov
b510f55e88
a new pricing for FileManager & SFTP chroot plugin
a new pricing for FileManager & SFTP chroot plugin
2019-02-25 16:08:40 +03:00
Serghey Rodin
bf5aa0fd6e auto subscribe mail dirs 2019-02-23 11:30:28 +02:00
Serghey Rodin
d05a02e0b6 hotfix for dovecot namespace on ubuntu 18.04 2019-02-21 15:56:34 +02:00
Serghey Rodin
561d7e9f01 force flag isn't required when admin group exists since it's there by default 2019-02-20 18:01:06 +02:00
Serghey Rodin
7d11db2dd2 Merge branch 'master' of github.com:serghey-rodin/vesta 2019-02-20 15:51:04 +02:00
Roman
e0a3439415 fix backend_template save after package change 2019-02-20 05:00:59 +02:00
dpeca
d15e103704
Allow admins to run custom script after SSL is put to any domain
Useful if you have separated SSLs for each IP address.

If admin add to vesta.conf this:
UPDATE_SSL_SCRIPT='/usr/local/bin/update_ssl_script.sh'
that script will be called after each domain get new SSL or renew old SSL.

Then admin can write custom script that will, for example, copy new SSL to some file that is needed for dovecot or exim, for example...
Passed parameters are $user and $domain ($1 and $2), so custom script can check what domain got new SSL, and then to run custom task...
2019-02-14 18:29:56 +01:00
Serghey Rodin
6b2f651418 protection in case there are two or more ips with the same nat association 2019-02-14 17:47:58 +02:00
Serghey Rodin
0d9218e9fc in case there is no conf 2019-02-14 13:24:18 +02:00
Marcus Viefeld
bad8ee8042 fix german translation, forwarded mail 2019-02-14 05:41:16 +01:00
Alexandr Loskutov
3c8c2f2cfb
Merge pull request #1821 from RJuho/finnish_translation
Finnish translation update
2019-02-12 23:28:36 +02:00
Juho Räsänen
1725a61491 Finnish translation updated and some changes
New strings translated and some small changes.
2019-02-12 22:05:47 +02:00
Juho Räsänen
d60c2655ec
Merge pull request #1 from serghey-rodin/master
Bringing fork up to date
2019-02-12 22:01:27 +02:00
Alexandr Loskutov
0bb74cd2bb
Merge pull request #1818 from devius/patch-3
Add missing translations
2019-02-09 20:32:32 +02:00
pablobae
d334ddc501
Update v-add-firewall-chain
Obtains the SSH port from the service configuration file (originally it was hardcoded). This allow the correct creation of ssh chain when this service has a custom port.
2019-02-07 16:49:43 +01:00
devius
2d96e3631f
Add missing translations
I have found and translated last missing Georgian versions for strings
2019-02-06 17:23:58 +04:00
Dandi Darmawan
c1fc0208f7
Fixing Typo
check_result $E_CONNECT "Let's Encrypt vvalidation status $status"  > check_result $E_CONNECT "Let's Encrypt validation status $status"
2019-01-24 18:16:01 +07:00
ifaist0s
6c072a91c4
Use of deprecated directive
FIX: [warn] 31172#31172: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead
CAUSE: http://hg.nginx.org/nginx/rev/46c0c7ef4913
2019-01-22 12:59:33 +02:00
ifaist0s
a72ecfbcfb
Use of deprecated directive
FIX: [warn] 31172#31172: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead
CAUSE: http://hg.nginx.org/nginx/rev/46c0c7ef4913
2019-01-22 12:58:48 +02:00
ifaist0s
45a6824990
Use of deprecated directive
FIX: [warn] 31172#31172: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead
CAUSE: http://hg.nginx.org/nginx/rev/46c0c7ef4913
2019-01-22 12:52:36 +02:00
ifaist0s
18ec586831
Use of deprecated directive
FIX: [warn] 31172#31172: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead
CAUSE: http://hg.nginx.org/nginx/rev/46c0c7ef4913
2019-01-22 12:51:59 +02:00
cmstew
7f833efcde
Update vst-install-amazon.sh
apparently the /var/run/clamav folder is still required for the sock file
2019-01-05 13:08:59 -07:00
cmstew
3881e36967
Update vst-install-amazon.sh
Keep /etc/clamd.conf as main file and link to it instead of using /etc/clamd.d/scan.conf.
2019-01-05 13:02:23 -07:00
cmstew
9f671ccf90
Update vst-install-amazon.sh
- Cleaned up changes
- Removed unnecessary clamd code from Centos installer
2019-01-02 08:18:06 -07:00
cmstew
be300fd82e
Update vst-install-rhel.sh
Changed hostname variable to match rest of script
2019-01-01 12:07:49 -07:00
cmstew
5852424830
Update vst-install-amazon.sh
Changed hostname variable to match rest of script
2019-01-01 12:07:43 -07:00
cmstew
bdb0959e1b
Update vst-install-debian.sh
Changed hostname variable to match rest of script
2019-01-01 12:07:34 -07:00
cmstew
d8f372d99c
Update vst-install-ubuntu.sh
Changed hostname variable to match rest of script
2019-01-01 12:07:30 -07:00
cmstew
3b58b4a8b7
Update vst-install-ubuntu.sh
missed a change
2018-12-31 19:10:18 -07:00
cmstew
c79785c790
Update vst-install-debian.sh
missed a change
2018-12-31 19:10:11 -07:00
cmstew
13e2f473e2
Update vst-install-amazon.sh
missed a change
2018-12-31 19:10:05 -07:00
cmstew
f8734d15e9
Update vst-install-ubuntu.sh
- Added to help function for ssl
- Added argument for enabling Let's Encrypt SSL
- Added set_default_value 'ssl' 'no'
- Install Let's Encrypt on hostname, update certificate, and enable auto-renew if 'ssl' argument is 'yes'
2018-12-31 15:48:29 -07:00
cmstew
7c9afbca32
Update vst-install-debian.sh
- Added to help function for ssl
- Added argument for enabling Let's Encrypt SSL
- Added set_default_value 'ssl' 'no'
- Install Let's Encrypt on hostname, update certificate, and enable auto-renew if 'ssl' argument is 'yes'
2018-12-31 15:48:25 -07:00
cmstew
1dae236693
Update vst-install-amazon.sh
- Added to help function for ssl
- Added argument for enabling Let's Encrypt SSL
- Added set_default_value 'ssl' 'no'
- Install Let's Encrypt on hostname, update certificate, and enable auto-renew if 'ssl' argument is 'yes'
2018-12-31 15:48:18 -07:00
cmstew
6689e5c839
Update vst-install-rhel.sh
- Added to help function for ssl
- Added argument for enabling Let's Encrypt SSL
- Added set_default_value 'ssl' 'no'
- Install Let's Encrypt on hostname, update certificate, and enable auto-renew if 'ssl' argument is 'yes'
2018-12-31 15:42:01 -07:00
cmstew
fb13db40ce
Update vst-install-amazon.sh
cleaned up changes for clamd on amazon linux
2018-12-29 12:47:58 -07:00
cmstew
57429a3203
Update vst-install-amazon.sh
Added backup of /etc/clamd.d/scan.conf after installing clamd because the file is not there before.
2018-12-28 15:59:21 -07:00
cmstew
b1e0e6a2a5
Fix clamd for Amazon Linux 2018-12-28 14:57:38 -07:00
cmstew
8d48fca193
Added clamd.scan 2018-12-28 13:53:19 -07:00
cmstew
041fd2914f
Create clamd.scan index page 2018-12-28 13:51:41 -07:00
dpeca
0d85c88d18
Bringing back Better handling of calm-down routine while LE renewing
Accidentally overwritten in f8b4d42b74 commit
Original commit: 3d8b6a87a7

Calming down is because https://github.com/serghey-rodin/vesta/issues/1193 issue
2018-12-27 21:10:17 +01:00
dpeca
8010f5d802
CentOS7: Register /sbin/nologin and /usr/sbin/nologin
Fix for https://github.com/serghey-rodin/vesta/issues/1437
2018-12-27 20:56:14 +01:00
Serghey Rodin
f8b4d42b74 Let's Encrypt v2 with wildcard support 2018-12-26 12:54:33 +02:00
Marcos
635107b804 Merge branch 'backups' of github.com:moucho/vesta into backups 2018-12-24 17:51:15 +01:00
Marcos
49f69ce60d Fix conflicts 2018-12-24 17:51:07 +01:00
Marcos
daa33140f4
Merge branch 'master' into backups 2018-12-24 17:46:08 +01:00
Marcos
73cb7667cd Fix conflict 2018-12-24 17:44:23 +01:00
dpeca
4327a3d1bc
Syntax error fix in v-add-letsencrypt-user 2018-12-21 17:28:12 +01:00
Henri Hulski
95a345f2dc Increment backend port also when commented
This allows to grep the incremented port also for other backends then php-fpm with `%backend_lsnr%` in the web template.
2018-12-17 19:41:37 +01:00
Maxim Nosovets
cb67641bed Check missing 'gnupg' package on latest fresh Ubuntu versions 2018-12-14 15:20:14 +02:00
dpeca
3d8b6a87a7
Better handling of calm-down routine while LE renewing
Sleep is because https://github.com/serghey-rodin/vesta/issues/1193
2018-12-10 14:31:10 +01:00
dpeca
58c6ca95b1
Fix for suspended domain checking while LE renewing
Logic should be inversed...
If you grep for suspended=no, then variable is NOT empty if it's NOT suspended
Which means it's empty only if it's suspended.
So we must grep for suspended=yes if we consider not-empty result as suspended domain.
@skullwritter 

This bug totally brakes LE renewing :)
2018-12-10 14:15:46 +01:00
JOduMonT
965e23f30c template for mautic 2018-12-05 07:29:14 +01:00
JOduMonT
dccd29f455 add template for invoice ninja 2018-12-05 07:02:13 +01:00
Serghey Rodin
320455f7c9 ACME v2 support - list user/ typo 2018-12-04 16:30:42 +02:00
Serghey Rodin
d2d399676f ACME v2 support - list user 2018-12-04 16:27:22 +02:00
Serghey Rodin
41bfca0b21 ACME v2 support 2018-12-04 16:21:46 +02:00
Anton Reutov
9f9ee14559
Change monthly price for File Manager and SFTP 2018-11-30 17:29:33 +02:00
Anton Reutov
2d0e09e7ca
Azerbaijani language support 2018-11-30 00:55:27 +02:00
Anton Reutov
44eabb4e9d
Azerbaijani language support 2018-11-30 00:54:45 +02:00
Anton Reutov
c29c7cc8e6
Azerbaijani language support 2018-11-30 00:52:49 +02:00
Anton Reutov
2a8188a207
Create az.php
Azerbaijani language support
2018-11-30 00:44:32 +02:00
Serghey Rodin
59695acd10 universe repository check 2018-11-29 13:40:15 +02:00
Serghey Rodin
6b590a6c93 New version of Softaculous: 5.1.2 2018-11-27 15:30:59 +02:00
Anton Reutov
6a8f77db18
Merge pull request #1696 from prodimon/bugfix-nginx-templates
bugfix nginx templates
2018-11-25 01:51:14 +02:00
Anton Reutov
46bfba0cae
Merge pull request #1721 from moucho/suspend_mail_domain
Suspend Domain Alert wrong
2018-11-24 23:06:58 +02:00
Anton Reutov
15a6808733
Merge pull request #1733 from skullwritter/patch-8
supose fix to #1526
2018-11-24 22:44:48 +02:00
Anton Reutov
c5ba8b5b65
Update v-update-user-counters 2018-11-24 22:43:21 +02:00
Anton Reutov
e1ca04c77c
Merge pull request #1666 from prodimon/fix-tar-exclude-folder
Fix editing backup exclusions
2018-11-23 17:45:19 +02:00
Anton Reutov
04e4b37f01
Merge pull request #1781 from serghey-rodin/madeITBelgium-patch-6
Fix quotes in cronjob CMD
2018-11-23 13:34:00 +02:00
Made I.T
aa83fa85f8
Fix quotes in cronjob CMD 2018-11-22 10:19:23 +01:00
Dmitry Bannik
eb29a1f374
Merge branch 'master' into fix-tar-exclude-folder 2018-11-21 04:46:41 +03:00
Serghey Rodin
00bc162fe6 removed duplicate loop 2018-11-20 11:20:21 +02:00
Serghey Rodin
0437c4ac3e fix backup exlustions for files 2018-11-14 17:53:48 +02:00
dpeca
2044890bae
Merge pull request #1776 from lukapaunovic/patch-44
Update nginx.conf
2018-11-14 13:08:29 +01:00
dpeca
8c52faab65
Merge pull request #1775 from lukapaunovic/patch-38
Update nginx.conf
2018-11-14 13:08:13 +01:00
dpeca
64ad51376d
Merge pull request #1774 from lukapaunovic/patch-42
Update nginx.conf
2018-11-14 13:07:57 +01:00
dpeca
784f075fa8
Merge pull request #1773 from lukapaunovic/patch-41
Update nginx.conf
2018-11-14 13:07:29 +01:00
dpeca
1369a12204
Merge pull request #1772 from lukapaunovic/patch-40
Update nginx.conf
2018-11-14 13:07:03 +01:00
dpeca
a697ae70f6
Merge pull request #1771 from lukapaunovic/patch-39
Update nginx.conf
2018-11-14 13:06:41 +01:00
dpeca
0a9aaa1042
Merge pull request #1770 from lukapaunovic/patch-37
Update nginx.conf
2018-11-14 13:05:45 +01:00
dpeca
59f29ce2f3
Merge pull request #1769 from lukapaunovic/patch-36
Update nginx.conf
2018-11-14 13:05:23 +01:00
dpeca
768df7293d
Merge pull request #1768 from lukapaunovic/patch-35
Update nginx.conf
2018-11-14 13:04:15 +01:00
dpeca
995f9f8eba
Merge pull request #1767 from lukapaunovic/patch-34
Update nginx.conf
2018-11-14 13:03:32 +01:00
dpeca
c8039a8ed9
Merge pull request #1766 from lukapaunovic/patch-33
Update nginx.conf
2018-11-14 13:03:02 +01:00
dpeca
ff0e5a00d4
Merge pull request #1765 from lukapaunovic/patch-32
Update nginx.conf
2018-11-14 13:02:45 +01:00
dpeca
05d77009e3
Merge pull request #1764 from lukapaunovic/patch-31
Update nginx.conf
2018-11-14 13:02:27 +01:00
dpeca
4edcd354ae
Merge pull request #1763 from lukapaunovic/patch-30
Update nginx.conf
2018-11-14 13:02:02 +01:00
dpeca
483c4b6c7a
Merge pull request #1762 from lukapaunovic/patch-29
Update nginx.conf
2018-11-14 13:01:38 +01:00
dpeca
12e1c00806
Merge pull request #1761 from lukapaunovic/patch-28
Update nginx.conf
2018-11-14 13:01:11 +01:00
dpeca
37a2216c74
Merge pull request #1777 from lukapaunovic/patch-43
Update nginx.conf
2018-11-14 13:00:48 +01:00
dpeca
d38c252089
Merge pull request #1760 from lukapaunovic/patch-26
vary
2018-11-14 12:59:51 +01:00
dpeca
b8ae9fc2bd
Merge pull request #1759 from lukapaunovic/patch-27
Update nginx.conf
2018-11-14 12:59:27 +01:00
Luka Paunović
e672970103
Update nginx.conf
vary on
2018-11-14 00:25:12 +01:00
Luka Paunović
c82e50056d
Update nginx.conf
vary on
2018-11-14 00:24:58 +01:00
Luka Paunović
13d713ecc8
Update nginx.conf 2018-11-14 00:24:42 +01:00
Luka Paunović
0f1fb8aa43
Update nginx.conf 2018-11-14 00:24:25 +01:00
Luka Paunović
d6e0b4e18f
Update nginx.conf
vary on
2018-11-14 00:24:17 +01:00
Luka Paunović
936b225b30
Update nginx.conf
vary on
2018-11-14 00:24:02 +01:00
Luka Paunović
ccc4e5a262
Update nginx.conf
vary on
2018-11-14 00:23:45 +01:00
Luka Paunović
ef422f62f6
Update nginx.conf
vary on
2018-11-14 00:23:19 +01:00
Luka Paunović
46b7d8438f
Update nginx.conf
vary on
2018-11-14 00:23:06 +01:00
Luka Paunović
433166a477
Update nginx.conf
vary on
2018-11-14 00:22:32 +01:00
Luka Paunović
61c439554e
Update nginx.conf
vary on
2018-11-14 00:21:38 +01:00
Luka Paunović
151f82e519
Update nginx.conf
vary on
2018-11-14 00:21:12 +01:00
Luka Paunović
4073325014
Update nginx.conf
vary on
2018-11-14 00:20:21 +01:00
Luka Paunović
812e001723
Update nginx.conf
vary on
2018-11-14 00:18:06 +01:00
Luka Paunović
49cf569729
Update nginx.conf
vary on
2018-11-14 00:17:31 +01:00
Luka Paunović
4d70c416ca
Update nginx.conf
vary on
2018-11-14 00:17:02 +01:00
Luka Paunović
a3982fd477
Update nginx.conf
vary on
2018-11-14 00:16:24 +01:00
Luka Paunović
591bfdaad1
Update nginx.conf 2018-11-14 00:14:39 +01:00
Luka Paunović
e799566c6b
vary
vary, causes page speed issues
2018-11-14 00:14:04 +01:00
dpeca
f64909e9a9
Merge pull request #1749 from serghey-rodin/madeITBelgium-patch-5
Fix default www & edit alias
2018-11-10 20:48:28 +01:00
Hacktivista
9abd3baf2e Fix v-update-sys-ip: verify if primary IP exists
Fixes the following errors on new installations:

> mv: cannot move '/usr/local/vesta/data/ips/' to a subdirectory of itself, '/usr/local/vesta/data/ips/x.x.x.x'
> sed: can't read /usr/local/vesta/data/users/*/dns/*.conf: No such file or directory
> sed: -e expression #1, char 0: no previous regular expression
> sed: -e expression #1, char 0: no previous regular expression
2018-11-09 20:02:47 -03:00
Hacktivista
0760e6a2e6 Don't chown $VESTA/data/sessions admin:admin previous to user admin creation
Fixes `chown: invalid user: 'admin:admin'` on Debian installations, line not present in other distros install scripts
2018-11-09 20:01:10 -03:00
dpeca
b9210522f5
Ubuntu 18.04 dovecot namespace inbox fix
Fix based on https://github.com/serghey-rodin/vesta/pull/1669/files
2018-11-09 17:47:05 +01:00
dpeca
e92d7a0960
Merge pull request #1669 from luizjrdeveloper/master
Fix Dovecot Connection
2018-11-09 17:37:49 +01:00
Made I.T
2dc406aae4
Fix dubble www 2018-11-08 16:33:34 +01:00
Made I.T
381bc48e96
Fix dubble www 2018-11-08 16:32:31 +01:00
dpeca
2996b8afc8
Merge pull request #1734 from skullwritter/patch-9
Fix for LE renewal if domain is suspended
2018-11-07 20:47:10 +01:00
Alexandr Loskutov
c32fa673e1 Fix Dovecot namespace inbox=yes for CentOS 7
Co-Authored-By: dpeca <dpeca@users.noreply.github.com>
2018-11-04 08:21:36 +02:00
dpeca
5170e5f5aa
Dovecot fix namespace inbox=yes only for Debian9 2018-11-04 03:35:17 +01:00
Alexandr Loskutov
8a1f8349ec
Merge pull request #1747 from tomivs/spanish-translation
Spanish translation improvements
2018-10-31 23:00:51 +02:00
dpeca
f9a15564e2
Escaping quotas in JSON output of v-list-web-domain-ssl 2018-10-31 17:07:01 +01:00
Tomás Vielma
6a753f65f2 Spanish translation improvements 2018-10-31 10:29:25 -04:00
Skull Writter
fa331e6ef2
removed dns and mail support - checking le 2018-10-30 16:25:24 -01:00
dpeca
76319e5a1b
Avoid user backup if user is not created from Vesta 2018-10-28 03:29:50 +01:00
dpeca
5ab9fc5f4a
Avoid user stats for the user that is not created from Vesta 2018-10-28 00:31:34 +02:00
dpeca
21dd9fae6d
Avoid listing user that is not created from Vesta 2018-10-28 00:23:12 +02:00
dpeca
32e970d111
Fix for dovecot namespace inbox=yes 2018-10-26 18:02:24 +02:00
Skull Writter
06f670046b
Fix: #1731
Now checks if the domain is suspended (WEB or EMAIL or DNS) if so, continue to the next domain
2018-10-25 19:44:46 +00:00
Skull Writter
50205c99ec
supose fix to #1526
i cannot see any diference, but on debian it apears that there is an diference.
maybe because the system has tis var exported? (DISK)
2018-10-25 19:20:08 +00:00
Alexandr Loskutov
20735121f7
Merge pull request #1728 from moucho/spanish
spanish revision
2018-10-19 07:19:38 +03:00
Marcos
b9252066e1 spanish revision 2018-10-19 01:54:22 +02:00
Serghey Rodin
8e37c4fa0f switch from c.vestacp.com to local configs 2018-10-18 17:46:34 +03:00
Serghey Rodin
cbbf27fc46 Additional argument check for remote hosts 2018-10-18 14:36:17 +03:00
Serghey Rodin
9a0bbbfd45 Merge branch 'master' of github.com:serghey-rodin/vesta 2018-10-18 14:20:30 +03:00
Serghey Rodin
32fbc253a9 Additional argument check for remote hosts 2018-10-18 14:20:14 +03:00
Serghey Rodin
14c093a6a1
Merge pull request #1727 from serghey-rodin/madeITBelgium-patch-4
Fix bug in password reset
2018-10-18 12:21:00 +03:00
Made I.T
f6f6f9cfbb
Fix bug in password reset 2018-10-18 10:01:35 +02:00
Serghey Rodin
defba72215 added missing month in spec file 2018-10-18 00:27:22 +03:00
Serghey Rodin
83bd1f679f added missing month in spec file 2018-10-18 00:23:56 +03:00
marcos
a12466f5cc suspend_message 2018-10-14 15:31:38 +02:00
Clark Chen
c7f6bf4e28
Traditional Chinese - TW, update to match en.php
This update the file to match 100% as en.php, also corrected some term in the file
2018-09-17 22:02:04 -05:00
Clark Chen
a54771261d
Traditional Chinese - TW, update to match en.php
This update the file to match 100% as en.php, also corrected some term in the file
2018-09-17 21:59:22 -05:00
Clark Chen
74334fae11
Traditional Chinese - TW, update to match en.php
This update the file to match 100% as en.php, also corrected some term in the file
2018-09-17 21:57:06 -05:00
Dmitry Bannik
d6c79c7d7e bugfix nginx templates 2018-09-03 21:57:45 +03:00
Chernyavskiy Leonid
ebc67f6478 Fix invalid extension replace in add_web_config
Do not use globbing, because it kills too many characters.
Use conditionals and search at the end of the line instead.
2018-08-24 14:05:58 +07:00
Phinitnan Chanasabaeng
287da0f336 Reworked on Drupal's nginx template. 2018-08-11 16:01:41 +07:00
Phinitnan Chanasabaeng
d2d6b85d43 Fixed missing NGINX rewrite rule for Drupal 7 & 8 2018-08-07 14:02:36 +07:00
Luiz Junior
47a22f4a25
Fix dovecot
namespace inbox {
2018-07-31 10:46:54 -03:00
Luiz Junior
4a27e61d60
Fix Dovecot Connection
Fix dovecot Connection
2018-07-31 10:32:47 -03:00
Dmitry Bannik
98542d69bc Fix editing backup exclusions 2018-07-27 23:59:53 +03:00
dpeca
847e4f223b
Block .jar extension in email attachments in Exim
I saw .jar files that contains viruses that ClamAV not detected at all.
Not sure if @serghey-rodin think this is OK idea, so let he decide.
2018-07-27 17:39:38 +02:00
dpeca
33ba05c35b
Tell Exim to not to deny emails if ClamAV is unavailable or busy
Not sure if @serghey-rodin think this is OK idea, so let he decide.
I had a situation when company sent too much attachments, ClamAV didn't so fast to scan them all immediately, and therefore became unavailable, so Exim started to deny messages, which caused very bad situation in company.
With this "patch" Exim will not deny emails if ClamAV is unavailable or busy.
2018-07-27 17:27:56 +02:00
Alexandros Ioannides
979d6e7083
TLS 1.0 drop & TLS 1.3 addition 2018-07-03 23:57:11 +03:00
Marcos
37c69b8f4c Don't exclude "logs" folder recursively 2018-05-21 03:41:46 +02:00
Asfihani
17f198cc36 Add Wordpress WP Super Cache plugin template support 2018-04-17 16:44:12 +07:00
asfihani
3f9f8d9467
Add wp super cache support 2018-04-17 16:27:38 +07:00
asfihani
3742d5f13d
Add wp super cache support 2018-04-17 16:23:36 +07:00
darkworks
acf3e0be13
check for yum properly.
check for yum properly.
2018-04-10 19:53:27 +05:00
info@madeit.be
40011f8f75 #1462 2018-01-31 10:46:18 +00:00
Emmanuel Higgins
4b1b1e3299
644 chmod should only apply to files 2018-01-25 19:30:38 +11:00
Somthanat Wongsa
c28dcc1037 fix php open_basedir error when using public_shtml as a document root 2018-01-06 13:20:16 +07:00
Made I.T
3d6eb2c8ea
Update v-add-dns-record 2017-11-27 11:42:49 +01:00
Made I.T
d9686a59f2
Add CAA record to web template 2017-11-27 11:17:47 +01:00
Made I.T
2397137578
Add CAA record to is_dns_type_format_valid 2017-11-27 11:16:52 +01:00
1713 changed files with 83246 additions and 17303 deletions

3
.gitignore vendored
View file

@ -4,3 +4,6 @@
*.gz
.vscode
.DS_Store
src/react/node_modules
src/react/build
/.idea

View file

@ -1,6 +1,8 @@
[Vesta Control Panel](http://vestacp.com/)
==================================================
Vesta is back under active development as of 25 February 2024. We are commited to open source, and will engage with the community to identify the new roadmap for Vesta. Stay tuned!
[![Join the chat at https://gitter.im/vesta-cp/Lobby](https://badges.gitter.im/vesta-cp/Lobby.svg)](https://gitter.im/vesta-cp/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* Vesta is an open source hosting control panel.
@ -16,7 +18,7 @@ ssh root@your.server
Download the installation script, and run it:
```bash
curl http://vestacp.com/pub/vst-install.sh | bash
curl https://vestacp.com/pub/vst-install.sh | bash
```
How to install (3 step)
@ -29,7 +31,7 @@ ssh root@your.server
Download the installation script:
```bash
curl -O http://vestacp.com/pub/vst-install.sh
curl -O https://vestacp.com/pub/vst-install.sh
```
Then run it:
```bash
@ -38,5 +40,5 @@ bash vst-install.sh
License
----------------------------
Vesta is licensed under [GPL v3 ](https://github.com/serghey-rodin/vesta/blob/master/LICENSE) license
Vesta is licensed under [GPL v3 ](https://github.com/outroll/vesta/blob/master/LICENSE) license

5
SECURITY.md Normal file
View file

@ -0,0 +1,5 @@
# Security Policy
## Reporting a Vulnerability
Please report security issues to dev@vestacp.com

View file

@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
# Checking arg number
check_args '2' "$#" 'MODULE LICENSE'
is_user_format_valid "$license" "license"
#----------------------------------------------------------#
# Action #
@ -35,7 +35,7 @@ check_args '2' "$#" 'MODULE LICENSE'
# Activating license
v_host='https://vestacp.com/checkout'
answer=$(curl -s $v_host/activate.php?licence_key=$license&module=$module)
answer=$(curl -s "$v_host/activate.php?licence_key=$license&module=$module")
check_result $? "cant' connect to vestacp.com " $E_CONNECT
# Checking server answer

View file

@ -38,8 +38,7 @@ EOF
sftpc() {
expect -f "-" <<EOF "$@"
set count 0
spawn /usr/bin/sftp -o StrictHostKeyChecking=no -o \
Port=$port $user@$host
spawn /usr/bin/sftp -o StrictHostKeyChecking=no -o Port=$port $user@$host
expect {
"password:" {
send "$password\r"
@ -94,12 +93,14 @@ EOF
if [ "$type" != 'local' ];then
check_args '4' "$#" "TYPE HOST USERNAME PASSWORD [PATH] [PORT]"
is_format_valid 'host'
is_format_valid 'user' 'host' 'path' 'port'
is_password_valid
if [ "$type" = 'sftp' ]; then
which expect >/dev/null 2>&1
check_result $? "expect command not found" $E_NOTEXIST
fi
host "$host" >/dev/null 2>&1
check_result $? "host connection failed" "$E_CONNECT"
fi

View file

@ -55,7 +55,7 @@ if [ "$domain_lvl" -eq 1 ] || [ "${#top_domain}" -le '6' ]; then
fi
# Adding top-level domain and then its sub
$BIN/v-add-dns-domain $user $top_domain $ip '' '' '' '' '' $restart >> /dev/null
$BIN/v-add-dns-domain $user $top_domain $ip '' '' '' '' '' '' '' '' $restart >> /dev/null
# Checking top-level domain
if [ ! -e "$USER_DATA/dns/$top_domain.conf" ]; then

View file

@ -45,10 +45,12 @@ if [[ $rtype =~ NS|CNAME|MX|PTR|SRV ]]; then
fi
fi
dvalue=${dvalue//\"/}
if [ $rtype != "CAA" ]; then
dvalue=${dvalue//\"/}
if [[ "$dvalue" =~ [\;[:space:]] ]]; then
dvalue='"'"$dvalue"'"'
if [[ "$dvalue" =~ [\;[:space:]] ]]; then
dvalue='"'"$dvalue"'"'
fi
fi
# Additional argument formatting

View file

@ -22,7 +22,7 @@ protocol=$(echo $protocol|tr '[:lower:]' '[:upper:]')
iptables="/sbin/iptables"
# Get vesta port by reading nginx.conf
vestaport=$(grep 'listen' /usr/local/vesta/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
vestaport=$(grep 'listen' $VESTA/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
if [ -z "$vestaport" ]; then
vestaport=8083
fi
@ -47,7 +47,13 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
# Checking known chains
case $chain in
SSH) port=22; protocol=TCP ;;
SSH) # Get ssh port by reading ssh config file.
sshport=$(grep '^Port ' /etc/ssh/sshd_config | head -1 | cut -d ' ' -f 2)
if [ -z "$sshport" ]; then
sshport=22
fi
port=$sshport;
protocol=TCP ;;
FTP) port=21; protocol=TCP ;;
MAIL) port='25,465,587,2525,110,995,143,993'; protocol=TCP ;;
DNS) port=53; protocol=UDP ;;

View file

@ -1,13 +1,8 @@
#!/bin/bash
# info: adding letsencrypt ssl cetificate for domain
# options: USER DOMAIN [ALIASES] [RESTART] [NOTIFY]
# info: check letsencrypt domain
# options: USER DOMAIN [ALIASES]
#
# The function turns on SSL support for a domain. Parameter ssl_dir is a path
# to directory where 2 or 3 ssl files can be found. Certificate file
# domain.tld.crt and its key domain.tld.key are mandatory. Certificate
# authority domain.tld.ca file is optional. If home directory parameter
# (ssl_home) is not set, https domain uses public_shtml as separate
# documentroot directory.
# The function check and validates domain with Let's Encript
#----------------------------------------------------------#
@ -18,8 +13,9 @@
user=$1
domain=$2
aliases=$3
restart=$4
notify=$5
# LE API
API='https://acme-v02.api.letsencrypt.org'
# Includes
source $VESTA/func/main.sh
@ -27,98 +23,346 @@ source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
# Additional argument formatting
format_domain_idn
format_identifier_idn() {
identifier_idn=$identifier
if [[ "$identifier_idn" = *[![:ascii:]]* ]]; then
identifier_idn=$(idn -t --quiet -a $identifier_idn)
fi
}
# encode base64
encode_base64() {
cat |base64 |tr '+/' '-_' |tr -d '\r\n='
}
# Let's Encrypt v2 curl function
query_le_v2() {
protected='{"nonce": "'$3'",'
protected=''$protected' "url": "'$1'",'
protected=''$protected' "alg": "RS256", "kid": "'$KID'"}'
content="Content-Type: application/jose+json"
payload_=$(echo -n "$2" |encode_base64)
protected_=$(echo -n "$protected" |encode_base64)
signature_=$(printf "%s" "$protected_.$payload_" |\
openssl dgst -sha256 -binary -sign $USER_DATA/ssl/user.key |\
encode_base64)
post_data='{"protected":"'"$protected_"'",'
post_data=$post_data'"payload":"'"$payload_"'",'
post_data=$post_data'"signature":"'"$signature_"'"}'
# Save http response to file passed as "$4" arg or print to stdout if not provided
# http response headers are always sent to stdout
local save_to_file=${4:-"/dev/stdout"}
curl --silent --dump-header /dev/stdout --data "$post_data" "$1" --header "$content" --output "$save_to_file"
}
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN [ALIASES] [RESTART] [NOTIFY]'
is_format_valid 'user' 'domain'
check_args '2' "$#" 'USER DOMAIN [ALIASES]'
is_format_valid 'user' 'domain' 'aliases'
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
is_system_enabled "$WEB_SSL" 'SSL_SUPPORT'
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
is_object_unsuspended 'web' 'DOMAIN' "$domain"
get_domain_values 'web'
echo "-----------------------------------------------------------------------------------" >> /usr/local/vesta/log/letsencrypt.log
echo "[$(date)] : v-add-letsencrypt-domain $domain [$aliases]" >> /usr/local/vesta/log/letsencrypt.log
# check if alias is the letsencrypt wildcard domain, if not, make the normal checks
if [[ "$aliases" != "*.$domain" ]]; then
for alias in $(echo "$aliases" |tr ',' '\n' |sort -u); do
check_alias="$(echo $ALIAS |tr ',' '\n' |grep ^$alias$)"
if [ -z "$check_alias" ]; then
echo "[$(date)] : EXIT=domain alias $alias doesn't exist" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_NOTEXIST "domain alias $alias doesn't exist"
fi
done
fi;
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Parsing domain data
get_domain_values 'web'
# Registering LetsEncrypt user account
echo "[$(date)] : v-add-letsencrypt-user $user" >> /usr/local/vesta/log/letsencrypt.log
$BIN/v-add-letsencrypt-user $user
echo "[$(date)] : result: $?" >> /usr/local/vesta/log/letsencrypt.log
if [ "$?" -ne 0 ]; then
touch $VESTA/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
send_notice "LETSENCRYPT" "Account registration failed"
echo "[$(date)] : EXIT=LE account registration" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "LE account registration" >/dev/null
fi
# Parsing LetsEncrypt account data
source $USER_DATA/ssl/le.conf
email=$EMAIL
# Validating domain and aliases
i=1
for alias in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
$BIN/v-check-letsencrypt-domain $user $alias
if [ "$?" -ne 0 ]; then
touch $VESTA/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
send_notice "LETSENCRYPT" "$alias validation failed"
check_result $E_INVALID "LE domain validation" >/dev/null
# Checking wildcard alias
if [ "$aliases" = "*.$domain" ]; then
echo "[$(date)] : Checking wildcard alias" >> /usr/local/vesta/log/letsencrypt.log
wildcard='yes'
proto="dns-01"
if [ ! -e "$VESTA/data/users/$user/dns/$domain.conf" ]; then
echo "[$(date)] : EXIT=DNS domain $domain doesn't exist" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_NOTEXIST "DNS domain $domain doesn't exist"
fi
else
proto="http-01"
fi
# Requesting nonce / STEP 1
echo "[$(date)] : --- Requesting nonce / STEP 1 ---" >> /usr/local/vesta/log/letsencrypt.log
echo "[$(date)] : curl -s -I \"$API/directory\"" >> /usr/local/vesta/log/letsencrypt.log
answer=$(curl -s -I "$API/directory")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt nonce request status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt nonce request status $status"
fi
# Placing new order / STEP 2
echo "[$(date)] : --- Placing new order / STEP 2 ---" >> /usr/local/vesta/log/letsencrypt.log
url="$API/acme/new-order"
payload='{"identifiers":['
for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
format_identifier_idn
payload=$payload'{"type":"dns","value":"'$identifier_idn'"},'
done
payload=$(echo "$payload"|sed "s/,$//")
payload=$payload']}'
echo "[$(date)] : payload=$payload" >> /usr/local/vesta/log/letsencrypt.log
echo "[$(date)] : query_le_v2 \"$url\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
answer=$(query_le_v2 "$url" "$payload" "$nonce")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
authz=$(echo "$answer" |grep "acme/authz" |cut -f2 -d '"')
echo "[$(date)] : authz=$authz" >> /usr/local/vesta/log/letsencrypt.log
finalize=$(echo "$answer" |grep 'finalize":' |cut -f4 -d '"')
echo "[$(date)] : finalize=$finalize" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer" |grep HTTP/ |tail -n1 |cut -f2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 201 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt new auth status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt new auth status $status"
fi
# Requesting authorization token / STEP 3
echo "[$(date)] : --- Requesting authorization token / STEP 3 ---" >> /usr/local/vesta/log/letsencrypt.log
for auth in $authz; do
payload=''
echo "[$(date)] : for auth=$auth" >> /usr/local/vesta/log/letsencrypt.log
echo "[$(date)] : query_le_v2 \"$auth\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
answer=$(query_le_v2 "$auth" "$payload" "$nonce")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
url=$(echo "$answer" |grep -A3 $proto |grep '"url"' |cut -f 4 -d \")
echo "[$(date)] : url=$url" >> /usr/local/vesta/log/letsencrypt.log
token=$(echo "$answer" |grep -A3 $proto |grep token |cut -f 4 -d \")
echo "[$(date)] : token=$token" >> /usr/local/vesta/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt acme/authz bad status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt acme/authz bad status $status"
fi
# Checking LE limits per account
if [ "$i" -gt 100 ]; then
touch $VESTA/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
send_notice 'LETSENCRYPT' 'Limit of domains per account is reached'
check_result $E_LIMIT "LE can't sign more than 100 domains"
# Configuring challenge / STEP 4
echo "[$(date)] : --- Configuring challenge / STEP 4 ---" >> /usr/local/vesta/log/letsencrypt.log
echo "[$(date)] : wildcard=$wildcard" >> /usr/local/vesta/log/letsencrypt.log
if [ "$wildcard" = 'yes' ]; then
record=$(printf "%s" "$token.$THUMB" |\
openssl dgst -sha256 -binary |encode_base64)
old_records=$($BIN/v-list-dns-records $user $domain plain|grep 'TXT')
old_records=$(echo "$old_records" |grep _acme-challenge |cut -f 1)
for old_record in $old_records; do
$BIN/v-delete-dns-record "$user" "$domain" "$old_record"
done
$BIN/v-add-dns-record "$user" "$domain" "_acme-challenge" "TXT" "$record"
exitstatus=$?
echo "[$(date)] : v-add-dns-record \"$user\" \"$domain\" \"_acme-challenge\" \"TXT\" \"$record\"" >> /usr/local/vesta/log/letsencrypt.log
if [ "$exitstatus" -ne 0 ]; then
echo "[$(date)] : EXIT=DNS _acme-challenge record wasn't created" >> /usr/local/vesta/log/letsencrypt.log
fi
check_result $exitstatus "DNS _acme-challenge record wasn't created"
else
if [ "$WEB_SYSTEM" = 'nginx' ] || [ ! -z "$PROXY_SYSTEM" ]; then
if [ -f "/usr/local/vesta/web/inc/nginx_proxy" ]; then
# if vesta is behind main nginx
well_known="$HOMEDIR/$user/web/$domain/public_html/.well-known"
acme_challenge="$well_known/acme-challenge"
mkdir -p $acme_challenge
echo "$token.$THUMB" > $acme_challenge/$token
echo "[$(date)] : in $acme_challenge/$token we put: $token.$THUMB" >> /usr/local/vesta/log/letsencrypt.log
chown -R $user:$user $well_known
else
# default nginx method
conf="$HOMEDIR/$user/conf/web/nginx.$domain.conf_letsencrypt"
sconf="$HOMEDIR/$user/conf/web/snginx.$domain.conf_letsencrypt"
# if [ ! -e "$conf" ]; then
echo 'location ~ "^/\.well-known/acme-challenge/(.*)$" {' \
> $conf
echo ' default_type text/plain;' >> $conf
echo ' return 200 "$1.'$THUMB'";' >> $conf
echo '}' >> $conf
# fi
echo "[$(date)] : in $conf we put: $THUMB" >> /usr/local/vesta/log/letsencrypt.log
if [ ! -e "$sconf" ]; then
ln -s "$conf" "$sconf"
fi
echo "[$(date)] : v-restart-proxy" >> /usr/local/vesta/log/letsencrypt.log
$BIN/v-restart-proxy
if [ -z "$PROXY_SYSTEM" ]; then
# apache-less variant
echo "[$(date)] : v-restart-web" >> /usr/local/vesta/log/letsencrypt.log
$BIN/v-restart-web
fi
exitstatus=$?
if [ "$exitstatus" -ne 0 ]; then
echo "[$(date)] : EXIT=Proxy restart failed = $exitstatus" >> /usr/local/vesta/log/letsencrypt.log
fi
check_result $exitstatus "Proxy restart failed" >/dev/null
fi
else
well_known="$HOMEDIR/$user/web/$domain/public_html/.well-known"
acme_challenge="$well_known/acme-challenge"
mkdir -p $acme_challenge
echo "$token.$THUMB" > $acme_challenge/$token
chown -R $user:$user $well_known
echo "[$(date)] : in $acme_challenge/$token we put: $token.$THUMB" >> /usr/local/vesta/log/letsencrypt.log
# $BIN/v-restart-web
# check_result $? "Web restart failed" >/dev/null
fi
fi
# Requesting ACME validation / STEP 5
echo "[$(date)] : --- Requesting ACME validation / STEP 5 ---" >> /usr/local/vesta/log/letsencrypt.log
validation_check=$(echo "$answer" |grep '"valid"')
echo "[$(date)] : validation_check=$validation_check" >> /usr/local/vesta/log/letsencrypt.log
if [[ ! -z "$validation_check" ]]; then
validation='valid'
else
validation='pending'
fi
# Doing pol check on status
i=1
while [ "$validation" = 'pending' ]; do
echo "[$(date)] : - Doing pol check on status" >> /usr/local/vesta/log/letsencrypt.log
payload='{}'
echo "[$(date)] : query_le_v2 \"$url\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
answer=$(query_le_v2 "$url" "$payload" "$nonce")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
validation=$(echo "$answer"|grep -A1 $proto |tail -n1|cut -f4 -d \")
echo "[$(date)] : validation=$validation" >> /usr/local/vesta/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt validation status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt validation status $status"
fi
i=$((i + 1))
if [ "$i" -gt 10 ]; then
echo "[$(date)] : EXIT=Let's Encrypt domain validation timeout" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt domain validation timeout"
fi
sleeping=$((i*2))
echo "[$(date)] : sleep $sleeping (i=$i)" >> /usr/local/vesta/log/letsencrypt.log
sleep $sleeping
done
if [ "$validation" = 'invalid' ]; then
echo "[$(date)] : EXIT=Let's Encrypt domain verification failed" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt domain verification failed"
fi
i=$((i++))
done
# Generating CSR
ssl_dir=$($BIN/v-generate-ssl-cert "$domain" "$email" "US" "California" \
# Generating new ssl certificate
ssl_dir=$($BIN/v-generate-ssl-cert "$domain" "info@$domain" "US" "California"\
"San Francisco" "Vesta" "IT" "$aliases" |tail -n1 |awk '{print $2}')
# Signing CSR
crt=$($BIN/v-sign-letsencrypt-csr $user $domain $ssl_dir)
if [ "$?" -ne 0 ]; then
touch $VESTA/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
send_notice "LETSENCRYPT" "$alias validation failed"
check_result "$E_INVALID" "LE $domain validation"
fi
echo "$crt" > $ssl_dir/$domain.crt
# Sending CSR to finalize order / STEP 6
echo "[$(date)] : --- Sending CSR to finalize order / STEP 6 ---" >> /usr/local/vesta/log/letsencrypt.log
# Dowloading CA certificate
le_certs='https://letsencrypt.org/certs'
x1='lets-encrypt-x1-cross-signed.pem.txt'
x3='lets-encrypt-x3-cross-signed.pem.txt'
issuer=$(openssl x509 -text -in $ssl_dir/$domain.crt |grep "Issuer:")
if [ -z "$(echo $issuer|grep X3)" ]; then
curl -s $le_certs/$x1 > $ssl_dir/$domain.ca
else
curl -s $le_certs/$x3 > $ssl_dir/$domain.ca
csr=$(openssl req -in $ssl_dir/$domain.csr -outform DER |encode_base64)
payload='{"csr":"'$csr'"}'
echo "[$(date)] : query_le_v2 \"$finalize\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
answer=$(query_le_v2 "$finalize" "$payload" "$nonce")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
certificate=$(echo "$answer"|grep 'certificate":' |cut -f4 -d '"')
echo "[$(date)] : certificate=$certificate" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then
echo "[$(date)] : EXIT=Let's Encrypt finalize bad status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt finalize bad status $status"
fi
# Downloading signed certificate / STEP 7
echo "[$(date)] : --- Downloading signed certificate / STEP 7 ---" >> /usr/local/vesta/log/letsencrypt.log
echo "[$(date)] : query_le_v2 \"$certificate\" \"\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
answer=$(query_le_v2 "$certificate" "" "$nonce" "$ssl_dir/$domain.pem")
echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then
[ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
echo "[$(date)] : EXIT=Let's Encrypt downloading signed cert failed status: $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_NOTEXIST "Let's Encrypt downloading signed cert failed status: $status"
fi
# Splitting up downloaded pem
# echo "[$(date)] : - Splitting up downloaded pem" >> /usr/local/vesta/log/letsencrypt.log
crt_end=$(grep -n 'END CERTIFICATE' $ssl_dir/$domain.pem |head -n1 |cut -f1 -d:)
# echo "[$(date)] : crt_end=$crt_end" >> /usr/local/vesta/log/letsencrypt.log
head -n $crt_end $ssl_dir/$domain.pem > $ssl_dir/$domain.crt
pem_lines=$(wc -l $ssl_dir/$domain.pem |cut -f 1 -d ' ')
# echo "[$(date)] : pem_lines=$pem_lines" >> /usr/local/vesta/log/letsencrypt.log
ca_end=$(grep -n 'BEGIN CERTIFICATE' $ssl_dir/$domain.pem |tail -n1 |cut -f 1 -d :)
# echo "[$(date)] : ca_end=$ca_end" >> /usr/local/vesta/log/letsencrypt.log
ca_end=$(( pem_lines - crt_end + 1 ))
# echo "[$(date)] : ca_end=$ca_end" >> /usr/local/vesta/log/letsencrypt.log
tail -n $ca_end $ssl_dir/$domain.pem > $ssl_dir/$domain.ca
# Temporary fix for double "END CERTIFICATE"
if [[ $(head -n 1 $ssl_dir/$domain.ca) = "-----END CERTIFICATE-----" ]]; then
sed -i '1,2d' $ssl_dir/$domain.ca
fi
# Adding SSL
ssl_home=$(search_objects 'web' 'LETSENCRYPT' 'yes' 'SSL_HOME')
$BIN/v-delete-web-domain-ssl $user $domain >/dev/null 2>&1
echo "[$(date)] : v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home" >> /usr/local/vesta/log/letsencrypt.log
$BIN/v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home
if [ "$?" -ne '0' ]; then
exitstatus=$?
echo "[$(date)] : v-add-web-domain-ssl status: $exitstatus" >> /usr/local/vesta/log/letsencrypt.log
if [ "$exitstatus" -ne '0' ]; then
touch $VESTA/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
echo "[$(date)] : EXIT=$domain certificate installation failed" >> /usr/local/vesta/log/letsencrypt.log
send_notice 'LETSENCRYPT' "$domain certificate installation failed"
check_result $? "SSL install" >/dev/null
check_result $exitstatus "SSL install" >/dev/null
fi
# Adding LE autorenew cronjob
@ -135,24 +379,20 @@ if [ -z "$LETSENCRYPT" ]; then
fi
update_object_value 'web' 'DOMAIN' "$domain" '$LETSENCRYPT' 'yes'
reset_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT'
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Restarting web
$BIN/v-restart-web $restart
if [ "$?" -ne 0 ]; then
send_notice 'LETSENCRYPT' "web server needs to be restarted manually"
fi
# Notifying user
send_notice 'LETSENCRYPT' "$domain SSL has been installed successfully"
# Deleteing task from queue
touch $VESTA/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
# Notifying user
send_notice 'LETSENCRYPT' "$domain SSL has been installed successfully"
echo "[$(date)] : EXIT=***** $domain SSL has been installed successfully *****" >> /usr/local/vesta/log/letsencrypt.log
# Logging
log_event "$OK" "$ARGUMENTS"

View file

@ -1,8 +1,8 @@
#!/bin/bash
# info: register letsencrypt user account
# options: USER [EMAIL]
# options: USER
#
# The function creates and register LetsEncript account key
# The function creates and register LetsEncript account
#----------------------------------------------------------#
@ -11,8 +11,9 @@
# Argument definition
user=$1
email=$2
key_size=4096
# LE API
API='https://acme-v02.api.letsencrypt.org'
# Includes
source $VESTA/func/main.sh
@ -23,15 +24,38 @@ encode_base64() {
cat |base64 |tr '+/' '-_' |tr -d '\r\n='
}
# Let's Encrypt v2 curl function
query_le_v2() {
protected='{"nonce": "'$3'",'
protected=''$protected' "url": "'$1'",'
protected=''$protected' "alg": "RS256", "jwk": '$jwk'}'
content="Content-Type: application/jose+json"
payload_=$(echo -n "$2" |encode_base64)
protected_=$(echo -n "$protected" |encode_base64)
signature_=$(printf "%s" "$protected_.$payload_" |\
openssl dgst -sha256 -binary -sign $USER_DATA/ssl/user.key |\
encode_base64)
post_data='{"protected":"'"$protected_"'",'
post_data=$post_data'"payload":"'"$payload_"'",'
post_data=$post_data'"signature":"'"$signature_"'"}'
curl -s -i -d "$post_data" "$1" -H "$content"
}
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'USER [EMAIL]'
check_args '1' "$#" 'USER'
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"
if [ -e "$USER_DATA/ssl/le.conf" ]; then
source "$USER_DATA/ssl/le.conf"
fi
if [ ! -z "$KID" ]; then
exit
fi
@ -40,57 +64,57 @@ fi
# Action #
#----------------------------------------------------------#
api='https://acme-v01.api.letsencrypt.org'
if [ -z "$email" ]; then
email=$(get_user_value '$CONTACT')
# Defining user email
if [[ -z "$EMAIL" ]]; then
EMAIL=$(get_user_value '$CONTACT')
fi
agreement=$(curl -s -I "$api/terms" |grep Location |cut -f 2 -d \ |tr -d '\r\n')
# Defining user agreement
agreement=''
# Generating key
key="$USER_DATA/ssl/user.key"
if [ ! -e "$key" ]; then
openssl genrsa -out $key $key_size >/dev/null 2>&1
chmod 600 $key
# Generating user key
KEY="$USER_DATA/ssl/user.key"
if [ ! -e "$KEY" ]; then
openssl genrsa -out $KEY 4096 >/dev/null 2>&1
chmod 600 $KEY
fi
# Defining key exponent
exponent=$(openssl pkey -inform pem -in "$key" -noout -text_pub |\
grep Exponent: |cut -f 2 -d '(' |cut -f 1 -d ')' |sed -e 's/x//' |\
xxd -r -p |encode_base64)
if [ -z "$EXPONENT" ]; then
EXPONENT=$(openssl pkey -inform pem -in "$KEY" -noout -text_pub |\
grep Exponent: |cut -f 2 -d '(' |cut -f 1 -d ')' |sed -e 's/x//' |\
xxd -r -p |encode_base64)
fi
# Defining key modulus
modulus=$(openssl rsa -in "$key" -modulus -noout |\
sed -e 's/^Modulus=//' |xxd -r -p |encode_base64)
if [ -z "$MODULUS" ]; then
MODULUS=$(openssl rsa -in "$KEY" -modulus -noout |\
sed -e 's/^Modulus=//' |xxd -r -p |encode_base64)
fi
# Defining key thumb
thumb='{"e":"'$exponent'","kty":"RSA","n":"'"$modulus"'"}'
thumb="$(echo -n "$thumb" |openssl dgst -sha256 -binary |encode_base64)"
# Defining JWK
jwk='{"e":"'$EXPONENT'","kty":"RSA","n":"'"$MODULUS"'"}'
# Defining JWK header
header='{"e":"'$exponent'","kty":"RSA","n":"'"$modulus"'"}'
header='{"alg":"RS256","jwk":'"$header"'}'
# Defining key thumbnail
if [ -z "$THUMB" ]; then
THUMB="$(echo -n "$jwk" |openssl dgst -sha256 -binary |encode_base64)"
fi
# Requesting nonce
nonce=$(curl -s -I "$api/directory" |grep Nonce |cut -f 2 -d \ |tr -d '\r\n')
protected=$(echo -n '{"nonce":"'"$nonce"'"}' |encode_base64)
# Defining registration query
query='{"resource":"new-reg","contact":["mailto:'"$email"'"],'
query=$query'"agreement":"'$agreement'"}'
payload=$(echo -n "$query" |encode_base64)
signature=$(printf "%s" "$protected.$payload" |\
openssl dgst -sha256 -binary -sign "$key" |encode_base64)
data='{"header":'"$header"',"protected":"'"$protected"'",'
data=$data'"payload":"'"$payload"'","signature":"'"$signature"'"}'
# Requesting ACME nonce
nonce=$(curl -s -I "$API/directory" |grep -i nonce |cut -f2 -d\ |tr -d '\r\n')
# Sending request to LetsEncrypt API
answer=$(curl -s -i -d "$data" "$api/acme/new-reg")
status=$(echo "$answer" |grep HTTP/1.1 |tail -n1 |cut -f2 -d ' ')
# Creating ACME account
url="$API/acme/new-acct"
payload='{"termsOfServiceAgreed": true}'
answer=$(query_le_v2 "$url" "$payload" "$nonce")
kid=$(echo "$answer" |grep -i location: |cut -f2 -d ' '|tr -d '\r')
# Checking http answer status
if [[ "$status" -ne "201" ]] && [[ "$status" -ne "409" ]]; then
check_result $E_CONNECT "LetsEncrypt account registration $status"
# Checking answer status
status=$(echo "$answer" |grep HTTP/ |tail -n1 |cut -f2 -d ' ')
if [[ "${status:0:2}" -ne "20" ]]; then
check_result $E_CONNECT "Let's Encrypt acc registration failed $status"
fi
@ -99,12 +123,17 @@ fi
#----------------------------------------------------------#
# Adding le.conf
echo "EMAIL='$email'" > $USER_DATA/ssl/le.conf
echo "EXPONENT='$exponent'" >> $USER_DATA/ssl/le.conf
echo "MODULUS='$modulus'" >> $USER_DATA/ssl/le.conf
echo "THUMB='$thumb'" >> $USER_DATA/ssl/le.conf
chmod 660 $USER_DATA/ssl/le.conf
if [ ! -e "$USER_DATA/ssl/le.conf" ]; then
echo "EXPONENT='$EXPONENT'" > $USER_DATA/ssl/le.conf
echo "MODULUS='$MODULUS'" >> $USER_DATA/ssl/le.conf
echo "THUMB='$THUMB'" >> $USER_DATA/ssl/le.conf
echo "EMAIL='$EMAIL'" >> $USER_DATA/ssl/le.conf
echo "KID='$kid'" >> $USER_DATA/ssl/le.conf
chmod 660 $USER_DATA/ssl/le.conf
else
sed -i '/^KID=/d' $USER_DATA/ssl/le.conf
echo "KID='$kid'" >> $USER_DATA/ssl/le.conf
fi
# Logging
log_event "$OK" "$ARGUMENTS"

106
bin/v-add-sys-mail-ssl Executable file
View file

@ -0,0 +1,106 @@
#!/bin/bash
# info: copy mail ssl certificate
# options: USER DOMAIN [RESTART]
#
# The function copies user domain SSL to mail SSL directory
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
user=$1
domain=$2
restart=$3
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN [RESTART]'
is_format_valid 'user' 'domain'
is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
is_object_value_exist 'web' 'DOMAIN' "$domain" '$SSL'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Defining certificate location
dom_crt="/home/$user/conf/web/ssl.$domain.pem"
dom_key="/home/$user/conf/web/ssl.$domain.key"
vst_crt="$VESTA/ssl/mail.crt"
vst_key="$VESTA/ssl/mail.key"
# Checking certificate
if [ ! -e "$dom_crt" ] || [ ! -e "$dom_key" ]; then
check_result $E_NOTEXIST "$domain certificate doesn't exist"
fi
# Checking difference
diff $dom_crt $vst_crt >/dev/null 2>&1
if [ $? -ne 0 ]; then
rm -f $vst_crt.old $vst_key.old
mv $vst_crt $vst_crt.old >/dev/null 2>&1
mv $vst_key $vst_key.old >/dev/null 2>&1
cp $dom_crt $vst_crt 2>/dev/null
cp $dom_key $vst_key 2>/dev/null
chown root:mail $vst_crt $vst_key
else
restart=no
fi
# Updating mail certificate
case $MAIL_SYSTEM in
exim) conf='/etc/exim/exim.conf';;
exim4) conf='/etc/exim4/exim4.conf.template';;
esac
if [ -e "$conf" ]; then
sed -e "s|^tls_certificate.*|tls_certificate = $vst_crt|" \
-e "s|^tls_privatekey.*|tls_privatekey = $vst_key|" -i $conf
fi
# Updating imap certificate
conf="/etc/dovecot/conf.d/10-ssl.conf"
if [ ! -z "$IMAP_SYSTEM" ] && [ -e "$conf" ]; then
sed -e "s|ssl_cert.*|ssl_cert = <$vst_crt|" \
-e "s|ssl_key.*|ssl_key = <$vst_key|" -i $conf
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Restarting services
if [ "$restart" != 'no' ]; then
if [ ! -z "$MAIL_SYSTEM" ]; then
$BIN/v-restart-service $MAIL_SYSTEM
fi
if [ ! -z "$IMAP_SYSTEM" ]; then
$BIN/v-restart-service $IMAP_SYSTEM
fi
fi
# Updating vesta.conf
if [ -z "$(grep MAIL_CERTIFICATE $VESTA/conf/vesta.conf)" ]; then
echo "MAIL_CERTIFICATE='$user:$domain'" >> $VESTA/conf/vesta.conf
else
sed -i "s/MAIL_CERTIFICATE.*/MAIL_CERTIFICATE='$user:$domain'/g" \
$VESTA/conf/vesta.conf
fi
# Logging
log_event "$OK" "$ARGUMENTS"
exit

97
bin/v-add-sys-vesta-ssl Executable file
View file

@ -0,0 +1,97 @@
#!/bin/bash
# info: add vesta ssl certificate
# options: USER DOMAIN [RESTART]
#
# The function copies user domain SSL to vesta SSL directory
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
user=$1
domain=$2
restart=$3
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN [RESTART]'
is_format_valid 'user' 'domain'
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
is_object_value_exist 'web' 'DOMAIN' "$domain" '$SSL'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Defining certificate location
dom_crt="/home/$user/conf/web/ssl.$domain.pem"
dom_key="/home/$user/conf/web/ssl.$domain.key"
vst_crt="$VESTA/ssl/certificate.crt"
vst_key="$VESTA/ssl/certificate.key"
# Checking certificate
if [ ! -e "$dom_crt" ] || [ ! -e "$dom_key" ]; then
check_result $E_NOTEXIST "$domain certificate doesn't exist"
fi
# Checking difference
diff $dom_crt $vst_crt >/dev/null 2>&1
if [ $? -ne 0 ]; then
rm -f $vst_crt.old $vst_key.old
mv $vst_crt $vst_crt.old
mv $vst_key $vst_key.old
cp $dom_crt $vst_crt 2>/dev/null
cp $dom_key $vst_key 2>/dev/null
chown root:mail $vst_crt $vst_key
else
restart=no
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Restarting services
if [ "$restart" != 'no' ]; then
if [ ! -z "$MAIL_SYSTEM" ] && [ -z "$MAIL_CERTIFICATE" ]; then
$BIN/v-restart-service $MAIL_SYSTEM
fi
if [ ! -z "$IMAP_SYSTEM" ] && [ -z "$MAIL_CERTIFICATE" ]; then
$BIN/v-restart-service $IMAP_SYSTEM
fi
if [ ! -z "$FTP_SYSTEM" ]; then
$BIN/v-restart-service "$FTP_SYSTEM"
fi
if [ -e "/var/run/vesta-nginx.pid" ]; then
kill -HUP $(cat /var/run/vesta-nginx.pid)
else
service vesta restart
fi
fi
# Updating vesta.conf
if [ -z "$(grep VESTA_CERTIFICATE $VESTA/conf/vesta.conf)" ]; then
echo "VESTA_CERTIFICATE='$user:$domain'" >> $VESTA/conf/vesta.conf
else
sed -i "s/VESTA_CERTIFICATE.*/VESTA_CERTIFICATE='$user:$domain'/g" \
$VESTA/conf/vesta.conf
fi
# Logging
log_event "$OK" "$ARGUMENTS"
exit

View file

@ -48,6 +48,8 @@ is_object_unsuspended 'user' 'USER' "$user"
is_package_full 'WEB_DOMAINS' 'WEB_ALIASES'
is_domain_new 'web' "$domain,$aliases"
is_dir_symlink $HOMEDIR/$user/web
if_dir_exists $HOMEDIR/$user/web/$domain
is_dir_symlink $HOMEDIR/$user/web/$domain
if [ ! -z "$ip" ]; then
is_ip_valid "$ip" "$user"
else
@ -63,7 +65,7 @@ fi
source $USER_DATA/user.conf
# Creating domain directories
mkdir -p $HOMEDIR/$user/web/$domain \
sudo -u $user mkdir -p $HOMEDIR/$user/web/$domain \
$HOMEDIR/$user/web/$domain/public_html \
$HOMEDIR/$user/web/$domain/public_shtml \
$HOMEDIR/$user/web/$domain/document_errors \
@ -80,7 +82,7 @@ ln -f -s /var/log/$WEB_SYSTEM/domains/$domain.*log \
$HOMEDIR/$user/web/$domain/logs/
# Adding domain skeleton
cp -r $WEBTPL/skel/* $HOMEDIR/$user/web/$domain/ >/dev/null 2>&1
sudo -u $user cp -r $WEBTPL/skel/* $HOMEDIR/$user/web/$domain/ >/dev/null 2>&1
for file in $(find "$HOMEDIR/$user/web/$domain/" -type f); do
sed -i "s/%domain%/$domain/g" $file
done
@ -89,9 +91,9 @@ done
chown -R $user:$user $HOMEDIR/$user/web/$domain
chown root:$user /var/log/$WEB_SYSTEM/domains/$domain.* $conf
chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.*
chmod 751 $HOMEDIR/$user/web/$domain $HOMEDIR/$user/web/$domain/*
chmod 551 $HOMEDIR/$user/web/$domain/stats $HOMEDIR/$user/web/$domain/logs
chmod 644 $HOMEDIR/$user/web/$domain/public_*html/*
sudo -u $user chmod 751 $HOMEDIR/$user/web/$domain $HOMEDIR/$user/web/$domain/*
sudo -u $user chmod 551 $HOMEDIR/$user/web/$domain/stats $HOMEDIR/$user/web/$domain/logs
sudo -u $user chmod 644 $HOMEDIR/$user/web/$domain/public_*html/*.*
# Addding PHP-FPM backend
if [ ! -z "$WEB_BACKEND" ]; then
@ -113,9 +115,12 @@ if [ "$aliases" = 'none' ]; then
ALIAS=''
else
ALIAS="www.$domain"
if [ ! -z "$aliases" ]; then
ALIAS="$ALIAS,$aliases"
if [ -z "$aliases" ]; then
ALIAS="www.$domain"
else
ALIAS="$aliases"
fi
ip_alias=$(get_ip_alias $domain)
if [ ! -z "$ip_alias" ]; then
ALIAS="$ALIAS,$ip_alias"

View file

@ -46,7 +46,7 @@ fi
# Allocating backend port
backend_port=9000
ports=$(grep -v '^;' $pool/* 2>/dev/null |grep listen |grep -o :[0-9].*)
ports=$(grep listen $pool/* 2>/dev/null |grep -o :[0-9].*)
ports=$(echo "$ports" |sed "s/://" |sort -n)
for port in $ports; do
if [ "$backend_port" -eq "$port" ]; then

View file

@ -84,7 +84,7 @@ fi
/usr/sbin/useradd $ftp_user \
-s $shell \
-o -u $(id -u $user) \
-g $(id -u $user) \
-g $(id -g $user) \
-M -d "$ftp_path_a" > /dev/null 2>&1
# Set ftp user password

View file

@ -120,6 +120,22 @@ check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
# Updating system ssl dependencies
if [ ! -z "$VESTA_CERTIFICATE" ]; then
crt_user=$(echo "$VESTA_CERTIFICATE" |cut -f 1 -d :)
crt_domain=$(echo "$VESTA_CERTIFICATE" |cut -f 2 -d :)
if [ "$user" = "$crt_user" ] && [ "$domain" = "$crt_domain" ]; then
$BIN/v-add-sys-vesta-ssl $user $domain >/dev/null 2>&1
fi
fi
if [ ! -z "$MAIL_CERTIFICATE" ]; then
crt_user=$(echo "$MAIL_CERTIFICATE" |cut -f 1 -d :)
crt_domain=$(echo "$MAIL_CERTIFICATE" |cut -f 2 -d :)
if [ "$user" = "$crt_user" ] && [ "$domain" = "$crt_domain" ]; then
$BIN/v-add-sys-mail-ssl $user $domain >/dev/null 2>&1
fi
fi
if [ ! -z "$UPDATE_HOSTNAME_SSL" ] && [ "$UPDATE_HOSTNAME_SSL" = "yes" ]; then
hostname=$(hostname)
if [ "$hostname" = "$domain" ]; then
@ -127,6 +143,12 @@ if [ ! -z "$UPDATE_HOSTNAME_SSL" ] && [ "$UPDATE_HOSTNAME_SSL" = "yes" ]; then
fi
fi
UPDATE_SSL_SCRIPT=''
source $VESTA/conf/vesta.conf
if [ ! -z "$UPDATE_SSL_SCRIPT" ]; then
eval "$UPDATE_SSL_SCRIPT $user $domain"
fi
# Logging
log_history "enabled ssl support for $domain"
log_event "$OK" "$ARGUMENTS"

View file

@ -216,24 +216,32 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
cp $USER_DATA/ssl/$domain.* vesta/
fi
# Changin dir to documentroot
cd $HOMEDIR/$user/web/$domain
# Define exclude arguments
exlusion=$(echo -e "$WEB" |tr ',' '\n' |grep "^$domain:")
set -f
fargs=()
fargs+=(--exclude='logs/*')
fargs+=(--exclude='./logs/*')
if [ ! -z "$exlusion" ]; then
xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
for xpath in $xdirs; do
fargs+=(--exclude=$xpath/*)
echo "$(date "+%F %T") excluding directory $xpath"
msg="$msg\n$(date "+%F %T") excluding directory $xpath"
if [ -d "$xpath" ]; then
fargs+=(--exclude=$xpath/*)
echo "$(date "+%F %T") excluding directory $xpath"
msg="$msg\n$(date "+%F %T") excluding directory $xpath"
else
echo "$(date "+%F %T") excluding file $xpath"
msg="$msg\n$(date "+%F %T") excluding file $xpath"
fargs+=(--exclude=$xpath)
fi
done
fi
set +f
# Backup files
cd $HOMEDIR/$user/web/$domain
tar -cpf- * ${fargs[@]} |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
tar --anchored -cpf- ${fargs[@]} * |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
done
# Print total
@ -452,11 +460,15 @@ if [ "$USER" != '*' ]; then
fi
fargs=()
for xpath in $(echo "$USER" |tr ',' '\n'); do
fargs+=(-not)
fargs+=(-path)
fargs+=("./$xpath*")
echo "$(date "+%F %T") excluding directory $xpath" |\
if [ -d "$xpath" ]; then
fargs+=(--exclude=$xpath/*)
echo "$(date "+%F %T") excluding directory $xpath" |\
tee -a $BACKUP/$user.log
else
echo "$(date "+%F %T") excluding file $xpath" |\
tee -a $BACKUP/$user.log
fargs+=(--exclude=$xpath)
fi
done
IFS=$'\n'
@ -467,11 +479,12 @@ if [ "$USER" != '*' ]; then
exclusion=$(echo "$USER" |tr ',' '\n' |grep "^$udir$")
if [ -z "$exclusion" ]; then
((i ++))
udir_list="$udir_list $udir"
udir_str=$(echo "$udir" |sed -e "s|'|\\\'|g")
udir_list="$udir_list $udir_str"
echo -e "$(date "+%F %T") adding $udir" |tee -a $BACKUP/$user.log
# Backup files and dirs
tar -cpf- $udir |gzip -$BACKUP_GZIP - > $tmpdir/user_dir/$udir.tar.gz
tar --anchored -cpf- ${fargs[@]} $udir |gzip -$BACKUP_GZIP - > $tmpdir/user_dir/$udir.tar.gz
fi
done
set +f
@ -582,7 +595,7 @@ ftp_backup() {
fi
# Debug info
echo -e "$(date "+%F %T") Remote: ftp://$HOST$BPATH/$user.$backup_new_date.tar"
echo -e "$(date "+%F %T") Remote: ftp://$HOST/$BPATH/$user.$backup_new_date.tar"
# Checking ftp connection
fconn=$(ftpc)

View file

@ -28,6 +28,9 @@ if [ -z "$BACKUP_SYSTEM" ]; then
exit
fi
for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
if [ ! -f "$VESTA/data/users/$user/user.conf" ]; then
continue;
fi
check_suspend=$(grep "SUSPENDED='no'" $VESTA/data/users/$user/user.conf)
log=$VESTA/log/backup.log
if [ ! -z "$check_suspend" ]; then

View file

@ -52,8 +52,11 @@ salt=$(generate_password "$PW_MATRIX" "8")
md5="{MD5}$($BIN/v-generate-password-hash md5 $salt <<<$password)"
if [[ "$MAIL_SYSTEM" =~ exim ]]; then
quota=$(grep $account $VESTA/data/users/${user}/mail/${domain}.conf)
quota=$(echo $quota | awk '{ print $7 }' | sed -e "s/'//g" )
quota=$(echo $quota | cut -d "=" -f 2 | sed -e "s/unlimited/0/g")
sed -i "/^$account:/d" $HOMEDIR/$user/conf/mail/$domain/passwd
str="$account:$md5:$user:mail::$HOMEDIR/$user:$quota"
str="$account:$md5:$user:mail::$HOMEDIR/$user:${quota}M"
echo $str >> $HOMEDIR/$user/conf/mail/$domain/passwd
fi

View file

@ -28,6 +28,7 @@ PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
check_args '2' "$#" 'KEY VALUE'
is_format_valid 'key'
format_no_quotes "$value" 'value'
#----------------------------------------------------------#
# Action #

View file

@ -63,6 +63,7 @@ case $service in
spamd) dst=$($BIN/v-list-sys-spamd-config plain);;
spamassassin) dst=$($BIN/v-list-sys-spamd-config plain);;
clamd) dst=$($BIN/v-list-sys-clamd-config plain);;
clamd.scan) dst=$($BIN/v-list-sys-clamd-config plain);;
cron) dst='/etc/crontab';;
crond) dst='/etc/crontab';;
fail2ban) dst='/etc/fail2ban/jail.local';;
@ -95,13 +96,21 @@ if [ "$update" = 'yes' ] && [ "$restart" != 'no' ]; then
if [ "$service" = 'php' ]; then
if [ "$WEB_SYSTEM" = "nginx" ]; then
service=$(ls /etc/init.d/php*fpm* |cut -f 4 -d / |sed -n 1p)
if [ $(ps --no-headers -o comm 1) == systemd ]; then
service=$(systemctl | grep -o -E "php.*fpm.*\.service")
service=${service//.service/}
else
service=$(ls /etc/init.d/php*fpm* |cut -f 4 -d /)
fi
else
service=$WEB_SYSTEM
fi
fi
service $service restart >/dev/null 2>&1
for single_service in $service; do
service $single_service restart >/dev/null 2>&1
done <<< "$service"
if [ $? -ne 0 ]; then
for config in $dst; do
cat $config.vst.back > $config

View file

@ -16,16 +16,12 @@ force=$3
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
is_package_avalable() {
usr_data=$(cat $USER_DATA/user.conf)
IFS=$'\n'
for key in $usr_data; do
eval ${key%%=*}=${key#*=}
done
source $USER_DATA/user.conf
WEB_DOMAINS='0'
DATABASES='0'
MAIL_DOMAINS='0'
@ -33,9 +29,13 @@ is_package_avalable() {
DISK_QUOTA='0'
BANDWIDTH='0'
pkg_data=$(cat $VESTA/data/packages/$package.pkg |grep -v TIME |\
grep -v DATE)
eval $pkg_data
pkg_data=$(cat $VESTA/data/packages/$package.pkg| egrep -v "TIME|DATE")
IFS=$'\n'
for str in $pkg_data; do
key=$(echo $str |cut -f 1 -d =)
value=$(echo $str |cut -f 2 -d \')
eval $key="$value"
done
# Checking usage agains package limits
if [ "$WEB_DOMAINS" != 'unlimited' ]; then
@ -73,11 +73,22 @@ is_package_avalable() {
check_result $E_LIMIT "Package doesn't cover BANDWIDTH usage"
fi
fi
# Checking templates
is_web_template_valid $WEB_TEMPLATE
is_dns_template_valid $DNS_TEMPLATE
is_proxy_template_valid $PROXY_TEMPLATE
}
change_user_package() {
eval $(cat $USER_DATA/user.conf)
eval $(cat $VESTA/data/packages/$package.pkg |egrep -v "TIME|DATE")
source $USER_DATA/user.conf
pkg_data=$(cat $VESTA/data/packages/$package.pkg| egrep -v "TIME|DATE")
IFS=$'\n'
for str in $pkg_data; do
key=$(echo $str |cut -f 1 -d =)
value=$(echo $str |cut -f 2 -d \')
eval $key="$value"
done
echo "FNAME='$FNAME'
LNAME='$LNAME'
PACKAGE='$package'
@ -156,7 +167,7 @@ fi
change_user_package
# Update user shell
shell_conf=$(echo "$pkg_data" | grep 'SHELL' | cut -f 2 -d \')
shell_conf=$(echo "$pkg_data" |grep 'SHELL' |cut -f 2 -d \')
shell=$(grep -w "$shell_conf" /etc/shells |head -n1)
/usr/bin/chsh -s "$shell" "$user" &>/dev/null

View file

@ -13,6 +13,10 @@
user=$1
password=$2; HIDE=2
# Importing system enviroment as we run this script
# mostly by cron wich not read it by itself
source /etc/profile
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
@ -22,6 +26,9 @@ source $VESTA/conf/vesta.conf
# Verifications #
#----------------------------------------------------------#
if [ "$user" = "root" ]; then
check_result $E_FORBIDEN "Changing root password is forbiden"
fi
check_args '2' "$#" 'USER PASSWORD'
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"

60
bin/v-change-vesta-port Normal file
View file

@ -0,0 +1,60 @@
#!/bin/bash
# info: change vesta port
# options: port
#
# Function will change vesta port
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
port=$1
if [ -z "$VESTA" ]; then
VESTA="/usr/local/vesta"
fi
# Get current vesta port by reading nginx.conf
oldport=$(grep 'listen' $VESTA/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
if [ -z "$oldport" ]; then
oldport=8083
fi
# Includes
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
# Checking permissions
if [ "$(id -u)" != '0' ]; then
check_result $E_FORBIDEN "You must be root to execute this script"
fi
check_args '1' "$#" 'PORT'
is_int_format_valid "$port" 'port number'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
sed -i "s|$oldport;|$port;|g" $VESTA/nginx/conf/nginx.conf
if [ -f "/etc/roundcube/plugins/password/config.inc.php" ]; then
sed -i "s|'$oldport'|'$port'|g" /etc/roundcube/plugins/password/config.inc.php
fi
sed -i "s|'$oldport'|'$port'|g" $VESTA/data/firewall/rules.conf
$VESTA/bin/v-update-firewall
systemctl restart fail2ban.service
sed -i "s| $oldport | $port |g" /etc/iptables.rules
systemctl restart vesta
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
exit 0;

View file

@ -52,7 +52,7 @@ rm -f $pool/$backend_type.conf
# Allocating backend port
backend_port=9000
ports=$(grep -v '^;' $pool/* 2>/dev/null |grep listen |grep -o :[0-9].*)
ports=$(grep listen $pool/* 2>/dev/null |grep -o :[0-9].*)
ports=$(echo "$ports" |sed "s/://" |sort -n)
for port in $ports; do
if [ "$backend_port" -eq "$port" ]; then

View file

@ -1,162 +0,0 @@
#!/bin/bash
# info: check letsencrypt domain
# options: USER DOMAIN
#
# The function check and validates domain with LetsEncript
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
user=$1
domain=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# encode base64
encode_base64() {
cat |base64 |tr '+/' '-_' |tr -d '\r\n='
}
# Additional argument formatting
format_domain_idn
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN'
is_format_valid 'user' 'domain'
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
if [ ! -e "$USER_DATA/ssl/le.conf" ]; then
check_result $E_NOTEXIST "LetsEncrypt key doesn't exist"
fi
rdomain=$(egrep "'$domain'|'$domain,|,$domain,|,$domain'" $USER_DATA/web.conf)
if [ -z "$rdomain" ]; then
check_result $E_NOTEXIST "domain $domain doesn't exist"
fi
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
source $USER_DATA/ssl/le.conf
api='https://acme-v01.api.letsencrypt.org'
r_domain=$(echo "$rdomain" |cut -f 2 -d \')
key="$USER_DATA/ssl/user.key"
exponent="$EXPONENT"
modulus="$MODULUS"
thumb="$THUMB"
# Defining JWK header
header='{"e":"'$exponent'","kty":"RSA","n":"'"$modulus"'"}'
header='{"alg":"RS256","jwk":'"$header"'}'
# Requesting nonce
nonce=$(curl -s -I "$api/directory" |grep Nonce |cut -f2 -d \ |tr -d '\r\n')
protected=$(echo -n '{"nonce":"'"$nonce"'"}' |encode_base64)
# Defining ACME query (request challenge)
query='{"resource":"new-authz","identifier"'
query=$query':{"type":"dns","value":"'"$domain_idn"'"}}'
payload=$(echo -n "$query" |encode_base64)
signature=$(printf "%s" "$protected.$payload" |\
openssl dgst -sha256 -binary -sign "$key" |encode_base64)
data='{"header":'"$header"',"protected":"'"$protected"'",'
data=$data'"payload":"'"$payload"'","signature":"'"$signature"'"}'
# Sending request to LetsEncrypt API
answer=$(curl -s -i -d "$data" "$api/acme/new-authz")
# Checking http answer status
status=$(echo "$answer" |grep HTTP/1.1 |tail -n1 |cut -f2 -d ' ')
if [[ "$status" -ne "201" ]]; then
check_result $E_CONNECT "LetsEncrypt challenge request $status"
fi
# Parsing domain nonce,token and uri
nonce=$(echo "$answer" |grep Nonce |cut -f2 -d \ |tr -d '\r\n')
protected=$(echo -n '{"nonce":"'"$nonce"'"}' |encode_base64)
token=$(echo "$answer" |grep -A 3 http-01 |grep token |cut -f 4 -d \")
uri=$(echo "$answer" |grep -A 3 http-01 |grep uri |cut -f 4 -d \")
# Adding location wrapper for request challenge
if [ "$WEB_SYSTEM" = 'nginx' ] || [ "$PROXY_SYSTEM" = 'nginx' ]; then
conf="$HOMEDIR/$user/conf/web/nginx.$r_domain.conf_letsencrypt"
sconf="$HOMEDIR/$user/conf/web/snginx.$r_domain.conf_letsencrypt"
if [ ! -e "$conf" ]; then
echo 'location ~ "^/\.well-known/acme-challenge/(.*)$" {' > $conf
echo ' default_type text/plain;' >> $conf
echo ' return 200 "$1.'$thumb'";' >> $conf
echo '}' >> $conf
fi
if [ ! -e "$sconf" ]; then
ln -s "$conf" "$sconf"
fi
else
acme="$HOMEDIR/$user/web/$r_domain/public_html/.well-known/acme-challenge"
if [ ! -d "$acme" ]; then
mkdir -p $acme
fi
echo "$token.$thumb" > $acme/$token
chown -R $user:$user $HOMEDIR/$user/web/$r_domain/public_html/.well-known
fi
# Restarting web server
if [ -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-web
check_result $? "Proxy restart failed" >/dev/null
else
$BIN/v-restart-proxy
$BIN/v-restart-web
check_result $? "Web restart failed" >/dev/null
fi
# Defining ACME query (request validation)
query='{"resource":"challenge","type":"http-01","keyAuthorization"'
query=$query':"'$token.$thumb'","token":"'$token'"}'
payload=$(echo -n "$query" |encode_base64)
signature=$(printf "%s" "$protected.$payload" |\
openssl dgst -sha256 -binary -sign "$key" |encode_base64)
data='{"header":'"$header"',"protected":"'"$protected"'",'
data=$data'"payload":"'"$payload"'","signature":"'"$signature"'"}'
# Sending request to LetsEncrypt API
answer=$(curl -s -i -d "$data" "$uri")
# Checking domain validation status
i=1
status=$(echo $answer |tr ',' '\n' |grep status |cut -f 4 -d \")
location=$(echo "$answer" |grep Location: |awk '{print $2}' |tr -d '\r\n')
while [ "$status" = 'pending' ]; do
answer=$(curl -s -i "$location")
detail="$(echo $answer |tr ',' '\n' |grep detail |cut -f 4 -d \")"
status=$(echo "$answer" |tr ',' '\n' |grep status |cut -f 4 -d \")
sleep 1
i=$((i + 1))
if [ "$i" -gt 60 ]; then
check_result $E_CONNECT "$detail"
fi
done
if [ "$status" = 'invalid' ]; then
detail="$(echo $answer |tr ',' '\n' |grep detail |cut -f 4 -d \")"
check_result $E_CONNECT "$detail"
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
exit

View file

@ -35,7 +35,7 @@ check_args '2' "$#" 'MODULE LICENSE'
# Activating license
v_host='https://vestacp.com/checkout'
answer=$(curl -s $v_host/cancel.php?licence_key=$license)
answer=$(curl -s "$v_host/cancel.php?licence_key=$license&module=$module")
check_result $? "cant' connect to vestacp.com " $E_CONNECT
# Checking server answer

View file

@ -56,7 +56,7 @@ fi
# Deleting dkim dns record
if [ "$DKIM" = 'yes' ] && [ -e "$USER_DATA/dns/$domain.conf" ]; then
records=$($BIN/v-list-dns-records $user $domain plain)
dkim_records=$(echo "$records" |grep -w '_domainkey' | cut -f 1 -d ' ')
dkim_records=$(echo "$records" |grep -w '_domainkey' |cut -f 1)
for id in $dkim_records; do
$BIN/v-delete-dns-record $user $domain $id
done

75
bin/v-delete-sys-mail-ssl Executable file
View file

@ -0,0 +1,75 @@
#!/bin/bash
# info: delete sys vesta user ssl certificate
# options: NONE
#
# The script disables user domain ssl synchronization
#----------------------------------------------------------#
# Variable & Function #
#----------------------------------------------------------#
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
vst_crt="$VESTA/ssl/certificate.crt"
vst_key="$VESTA/ssl/certificate.key"
# Updating mail certificate
case $MAIL_SYSTEM in
exim) conf='/etc/exim/exim.conf';;
exim4) conf='/etc/exim4/exim4.conf.template';;
esac
if [ -e "$conf" ]; then
sed -e "s|^tls_certificate.*|tls_certificate = $vst_crt|" \
-e "s|^tls_privatekey.*|tls_privatekey = $vst_key|" -i $conf
fi
# Updating imap certificate
conf="/etc/dovecot/conf.d/10-ssl.conf"
if [ ! -z "$IMAP_SYSTEM" ] && [ -e "$conf" ]; then
sed -e "s|ssl_cert.*|ssl_cert = <$vst_crt|" \
-e "s|ssl_key.*|ssl_key = <$vst_key|" -i $conf
fi
# Moving old certificates
if [ -e "$VESTA/ssl/mail.crt" ]; then
mv -f $VESTA/ssl/mail.crt $VESTA/ssl/mail.crt.old
fi
if [ -e "VESTA/ssl/mail.key" ]; then
mv $VESTA/ssl/mail.key VESTA/ssl/mail.key.old
fi
# Updating vesta.conf value
sed -i "/MAIL_CERTIFICATE=/ d" $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Restarting services
if [ "$restart" != 'no' ]; then
if [ ! -z "$MAIL_SYSTEM" ]; then
$BIN/v-restart-service $MAIL_SYSTEM
fi
if [ ! -z "$IMAP_SYSTEM" ]; then
$BIN/v-restart-service $IMAP_SYSTEM
fi
fi
# Logging
log_event "$OK" "$ARGUMENTS"
exit

37
bin/v-delete-sys-vesta-ssl Executable file
View file

@ -0,0 +1,37 @@
#!/bin/bash
# info: delete sys vesta user ssl certificate
# options: NONE
#
# The script disables user domain ssl synchronization
#----------------------------------------------------------#
# Variable & Function #
#----------------------------------------------------------#
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Updating vesta.conf value
sed -i "/VESTA_CERTIFICATE=/ d" $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
exit

View file

@ -32,6 +32,8 @@ case $system in
DNS_REC) is_format_valid 'id' ;;
*) is_format_valid 'object'
esac
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"

View file

@ -57,7 +57,13 @@ fi
# Deleting old certificate
tmpdir=$(mktemp -p $HOMEDIR/$user/web/$domain/private -d)
rm -f $HOMEDIR/$user/conf/web/ssl.$domain.*
# remove certificate files - do not use wildcard, as this might remove other domains
rm -f $HOMEDIR/$user/conf/web/ssl.$domain.ca
rm -f $HOMEDIR/$user/conf/web/ssl.$domain.crt
rm -f $HOMEDIR/$user/conf/web/ssl.$domain.key
rm -f $HOMEDIR/$user/conf/web/ssl.$domain.pem
mv $USER_DATA/ssl/$domain.* $tmpdir
chown -R $user:$user $tmpdir

View file

@ -82,7 +82,7 @@ fi
# Extracting ziped archive
if [ ! -z "$(echo $src_file |grep -i '.zip')" ]; then
sudo -u $user mkdir -p "$dst_dir" >/dev/null 2>&1
sudo -u $user unzip "$src_file" -d "$dst_dir" >/dev/null 2>&1
sudo -u $user unzip -o "$src_file" -d "$dst_dir" >/dev/null 2>&1
rc=$?
fi

View file

@ -67,7 +67,7 @@ fi
args_usage='DOMAIN EMAIL COUNTRY STATE CITY ORG UNIT [ALIASES] [FORMAT]'
check_args '7' "$#" "$args_usage"
is_format_valid 'domain_alias' 'format'
is_format_valid 'domain' 'alias' 'format'
#----------------------------------------------------------#

View file

@ -50,7 +50,7 @@ if [ "$flush" = 'records' ]; then
fi
# Flush domain
if [ "$flush" ! = 'no' ]; then
if [ "$flush" != 'no' ]; then
sed -i "/DOMAIN='$DOMAIN'/d" $USER_DATA/dns.conf 2> /dev/null
fi

View file

@ -71,6 +71,7 @@ csv_list() {
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN [FORMAT]'
is_format_valid 'user' 'domain'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'dns' 'DOMAIN' "$domain"

View file

@ -23,7 +23,8 @@ json_list() {
"EMAIL": "'$EMAIL'",
"EXPONENT": "'$EXPONENT'",
"MODULUS": "'$MODULUS'",
"THUMB: "'$THUMB'"
"THUMB": "'$THUMB'",
"KID": "'$KID'"
}'
echo '}'
}
@ -35,17 +36,18 @@ shell_list() {
echo "THUMB: $THUMB"
echo "EXPONENT: $EXPONENT"
echo "MODULUS: $MODULUS"
echo "KID: $KID"
}
# PLAIN list function
plain_list() {
echo -e "$user\t$EMAIL\t$EXPONENT\t$MODULUS\t$THUMB"
echo -e "$user\t$EMAIL\t$EXPONENT\t$MODULUS\t$THUMB\t$KID"
}
# CSV list function
csv_list() {
echo "USER,EMAIL,EXPONENT,MODULUS,THUMB"
echo "$user,$EMAIL,$EXPONENT,$MODULUS,$THUMB"
echo "USER,EMAIL,EXPONENT,MODULUS,THUMB,KID"
echo "$user,$EMAIL,$EXPONENT,$MODULUS,$THUMB,$KID"
}
@ -54,6 +56,7 @@ csv_list() {
#----------------------------------------------------------#
check_args '1' "$#" 'USER [FORMAT]'
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"
if [ ! -e "$USER_DATA/ssl/le.conf" ]; then
check_result $E_NOTEXIST "LetsEncrypt user account doesn't exist"

View file

@ -57,6 +57,7 @@ csv_list() {
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN [FORMAT]'
is_format_valid 'user' 'domain'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'mail' 'DOMAIN' "$domain"
@ -67,7 +68,7 @@ is_object_valid 'mail' 'DOMAIN' "$domain"
# Parsing domain keys
if [ -e "$USER_DATA/mail/$domain.pub" ]; then
pub=$(cat $USER_DATA/mail/$domain.pub |grep -v "KEY-----")
pub=$(cat $USER_DATA/mail/$domain.pub |grep -v "KEY-----" |tr -d "\n\r")
pub=$(echo "$pub" |sed ':a;N;$!ba;s/\n/\\n/g')
else
pub="DKIM-SUPPORT-IS-NOT-ACTIVATED"

View file

@ -51,7 +51,9 @@ json_list() {
"MAIL_URL": "'$MAIL_URL'",
"DB_PMA_URL": "'$DB_PMA_URL'",
"DB_PGA_URL": "'$DB_PGA_URL'",
"SOFTACULOUS": "'$SOFTACULOUS'"
"SOFTACULOUS": "'$SOFTACULOUS'",
"MAIL_CERTIFICATE": "'$MAIL_CERTIFICATE'",
"VESTA_CERTIFICATE": "'$VESTA_CERTIFICATE'"
}
}'
}
@ -138,6 +140,12 @@ shell_list() {
if [ ! -z "$LANGUAGE" ] && [ "$LANGUAGE" != 'en' ]; then
echo "Language: $LANGUAGE"
fi
if [ ! -z "$MAIL_CERTIFICATE" ]; then
echo "Mail SSL: $MAIL_CERTIFICATE"
fi
if [ ! -z "$VESTA_CERTIFICATE" ]; then
echo "Vesta SSL: $VESTA_CERTIFICATE"
fi
echo "Version: $VERSION"
}
@ -151,7 +159,8 @@ plain_list() {
echo -ne "$CRON_SYSTEM\t$DISK_QUOTA\t$FIREWALL_SYSTEM\t"
echo -ne "$FIREWALL_EXTENSION\t$FILEMANAGER_KEY\t$SFTPJAIL_KEY\t"
echo -ne "$REPOSITORY\t$VERSION\t$LANGUAGE\t$BACKUP_GZIP\t$BACKUP\t"
echo -e "$MAIL_URL\t$DB_PMA_URL\t$DB_PGA_URL"
echo -ne "$MAIL_URL\t$DB_PMA_URL\t$DB_PGA_URL\t$MAIL_CERTIFICATE\t"
echo -e "$VESTA_CERTIFICATE"
}
@ -165,7 +174,8 @@ csv_list() {
echo -n "'CRON_SYSTEM','DISK_QUOTA','FIREWALL_SYSTEM',"
echo -n "'FIREWALL_EXTENSION','FILEMANAGER_KEY','SFTPJAIL_KEY',"
echo -n "'REPOSITORY','VERSION','LANGUAGE','BACKUP_GZIP','BACKUP',"
echo -n "'MAIL_URL','DB_PMA_URL','DB_PGA_URL'"
echo -n "'MAIL_URL','DB_PMA_URL','DB_PGA_URL', 'SOFTACULOUS',"
echo -n "'MAIL_CERTIFICATE','VESTA_CERTIFICATE'"
echo
echo -n "'$WEB_SYSTEM','$WEB_RGROUPS','$WEB_PORT','$WEB_SSL',"
echo -n "'$WEB_SSL_PORT','$WEB_BACKEND','$PROXY_SYSTEM','$PROXY_PORT',"
@ -176,6 +186,7 @@ csv_list() {
echo -n "'$FIREWALL_EXTENSION','$FILEMANAGER_KEY','$SFTPJAIL_KEY',"
echo -n "'$REPOSITORY','$VERSION','$LANGUAGE','$BACKUP_GZIP','$BACKUP',"
echo -n "'$MAIL_URL','$DB_PMA_URL','$DB_PGA_URL', '$SOFTACULOUS'"
echo -n "'$MAIL_CERTIFICATE','$VESTA_CERTIFICATE'"
echo
}
@ -187,7 +198,7 @@ csv_list() {
# Listing data
case $format in
json) json_list ;;
plain) shell_list ;;
plain) plain_list ;;
csv) csv_list ;;
shell) shell_list ;;
esac

135
bin/v-list-sys-mail-ssl Executable file
View file

@ -0,0 +1,135 @@
#!/bin/bash
# info: list mail ssl certificate
# options: [FORMAT]
#
# The function of obtaining mail ssl files.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
format=${1-shell}
# Includes
source $VESTA/func/main.sh
# JSON list function
json_list() {
echo '{'
echo -e "\t\"MAIL\": {"
echo " \"CRT\": \"$crt\","
echo " \"KEY\": \"$key\","
echo " \"CA\": \"$ca\","
echo " \"SUBJECT\": \"$subj\","
echo " \"ALIASES\": \"$alt_dns\","
echo " \"NOT_BEFORE\": \"$before\","
echo " \"NOT_AFTER\": \"$after\","
echo " \"SIGNATURE\": \"$signature\","
echo " \"PUB_KEY\": \"$pub_key\","
echo " \"ISSUER\": \"$issuer\""
echo -e "\t}\n}"
}
# SHELL list function
shell_list() {
if [ ! -z "$crt" ]; then
echo -e "$crt"
fi
if [ ! -z "$key" ]; then
echo -e "\n$key"
fi
if [ ! -z "$crt" ]; then
echo
echo
echo "SUBJECT: $subj"
if [ ! -z "$alt_dns" ]; then
echo "ALIASES: ${alt_dns//,/ }"
fi
echo "VALID FROM: $before"
echo "VALID TIL: $after"
echo "SIGNATURE: $signature"
echo "PUB_KEY: $pub_key"
echo "ISSUER: $issuer"
fi
}
# PLAIN list function
plain_list() {
if [ ! -z "$crt" ]; then
echo -e "$crt"
fi
if [ ! -z "$key" ]; then
echo -e "\n$key"
fi
if [ ! -z "$ca" ]; then
echo -e "\n$ca"
fi
if [ ! -z "$crt" ]; then
echo "$subj"
echo "${alt_dns//,/ }"
echo "$before"
echo "$after"
echo "$signature"
echo "$pub_key"
echo "$issuer"
fi
}
# CSV list function
csv_list() {
echo -n "CRT,KEY,CA,SUBJECT,ALIASES,NOT_BEFORE,NOT_AFTER,SIGNATURE,"
echo "PUB_KEY,ISSUER"
echo -n "\"$crt\",\"$key\",\"$ca\",\"$subj\",\"${alt_dns//,/ }\","
echo "\"$before\",\"$after\",\"$signature\",\"$pub_key\",\"$issuer\""
}
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Parsing SSL certificate
if [ ! -e "$VESTA/ssl/mail.crt" ] || [ ! -e "$VESTA/ssl/mail.key" ]; then
exit
fi
crt=$(cat $VESTA/ssl/mail.crt |sed ':a;N;$!ba;s/\n/\\n/g')
key=$(cat $VESTA/ssl/mail.key |sed ':a;N;$!ba;s/\n/\\n/g')
# Parsing SSL certificate details without CA
info=$(openssl x509 -text -in $VESTA/ssl/mail.crt)
subj=$(echo "$info" |grep Subject: |cut -f 2 -d =)
before=$(echo "$info" |grep Before: |sed -e "s/.*Before: //")
after=$(echo "$info" |grep "After :" |sed -e "s/.*After : //")
signature=$(echo "$info" |grep "Algorithm:" |head -n1 )
signature=$(echo "$signature"| sed -e "s/.*Algorithm: //")
pub_key=$(echo "$info" |grep Public-Key: |cut -f2 -d \( | tr -d \))
issuer=$(echo "$info" |grep Issuer: |sed -e "s/.*Issuer: //")
alt_dns=$(echo "$info" |grep DNS |sed -e 's/DNS:/\n/g' |tr -d ',')
alt_dns=$(echo "$alt_dns" |tr -d ' ' |sed -e "/^$/d")
alt_dns=$(echo "$alt_dns" |sed -e ':a;N;$!ba;s/\n/,/g')
# Listing data
case $format in
json) json_list ;;
plain) plain_list ;;
csv) csv_list ;;
shell) shell_list ;;
esac
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit

View file

@ -154,6 +154,7 @@ csv_list() {
#----------------------------------------------------------#
check_args '1' "$#" 'USER [FORMAT]'
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"

View file

@ -75,6 +75,7 @@ csv_list() {
#----------------------------------------------------------#
check_args '2' "$#" 'USER BACKUP [FORMAT]'
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'backup' 'BACKUP' "$backup"

View file

@ -22,7 +22,7 @@ json_list() {
i=1
objects=$(grep BACKUP $USER_DATA/backup.conf |wc -l)
echo "{"
while read str; do
while read -r str; do
eval $str
echo -n ' "'$BACKUP'": {
"TYPE": "'$TYPE'",

View file

@ -22,6 +22,7 @@ json_list() {
echo '{'
echo ' "'$PACKAGE'": {
"WEB_TEMPLATE": "'$WEB_TEMPLATE'",
"BACKEND_TEMPLATE": "'$BACKEND_TEMPLATE'",
"PROXY_TEMPLATE": "'$PROXY_TEMPLATE'",
"DNS_TEMPLATE": "'$DNS_TEMPLATE'",
"WEB_DOMAINS": "'$WEB_DOMAINS'",
@ -47,6 +48,7 @@ json_list() {
shell_list() {
echo "PACKAGE: $PACKAGE"
echo "WEB TEMPLATE: $WEB_TEMPLATE"
echo "BACKEND_TEMPLATE: $BACKEND_TEMPLATE"
echo "PROXY TEMPLATE: $PROXY_TEMPLATE"
echo "DNS TEMPLATE: $DNS_TEMPLATE"
echo "WEB DOMAINS: $WEB_DOMAINS"
@ -68,7 +70,7 @@ shell_list() {
# PLAIN list function
plain_list() {
echo -ne "$PACKAGE\t$WEB_TEMPLATE\t$PROXY_TEMPLATE\t$DNS_TEMPLATE\t"
echo -ne "$PACKAGE\t$WEB_TEMPLATE\t$BACKEND_TEMPLATE\t$PROXY_TEMPLATE\t$DNS_TEMPLATE\t"
echo -ne "$WEB_DOMAINS\t$WEB_ALIASES\t$DNS_DOMAINS\t$DNS_RECORDS\t"
echo -ne "$MAIL_DOMAINS\t$MAIL_ACCOUNTS\t$DATABASES\t$CRON_JOBS\t"
echo -e "$DISK_QUOTA\t$BANDWIDTH\t$NS\t$SHELL\t$BACKUPS\t$TIME\t$DATE"
@ -76,11 +78,11 @@ plain_list() {
# CSV list function
csv_list() {
echo -n "PACKAGE,WEB_TEMPLATE,PROXY_TEMPLATE,DNS_TEMPLATE,"
echo -n "PACKAGE,WEB_TEMPLATE,BACKEND_TEMPLATE,PROXY_TEMPLATE,DNS_TEMPLATE,"
echo -n "WEB_DOMAINS,WEB_ALIASES,DNS_DOMAINS,DNS_RECORDS,"
echo -n "MAIL_DOMAINS,MAIL_ACCOUNTS,DATABASES,CRON_JOBS,"
echo "DISK_QUOTA,BANDWIDTH,NS,SHELL,BACKUPS,TIME,DATE"
echo -n "$PACKAGE,$WEB_TEMPLATE,$PROXY_TEMPLATE,$DNS_TEMPLATE,"
echo -n "$PACKAGE,$WEB_TEMPLATE,$BACKEND_TEMPLATE,$PROXY_TEMPLATE,$DNS_TEMPLATE,"
echo -n "$WEB_DOMAINS,$WEB_ALIASES,$DNS_DOMAINS,$DNS_RECORDS,"
echo -n "$MAIL_DOMAINS,$MAIL_ACCOUNTS,$DATABASES,$CRON_JOBS,"
echo "$DISK_QUOTA,$BANDWIDTH,\"$NS\",$SHELL,$BACKUPS,$TIME,$DATE"

View file

@ -27,6 +27,7 @@ json_list() {
source $VESTA/data/packages/$package
echo -n ' "'$PACKAGE'": {
"WEB_TEMPLATE": "'$WEB_TEMPLATE'",
"BACKEND_TEMPLATE": "'$BACKEND_TEMPLATE'",
"PROXY_TEMPLATE": "'$PROXY_TEMPLATE'",
"DNS_TEMPLATE": "'$DNS_TEMPLATE'",
"WEB_DOMAINS": "'$WEB_DOMAINS'",
@ -65,7 +66,7 @@ shell_list() {
package_data=$(cat $VESTA/data/packages/$package)
package_data=$(echo "$package_data" |sed -e 's/unlimited/unlim/g')
eval $package_data
echo -n "$PACKAGE $WEB_TEMPLATE $WEB_DOMAINS $DNS_DOMAINS "
echo -n "$PACKAGE $WEB_TEMPLATE $BACKEND_TEMPLATE $WEB_DOMAINS $DNS_DOMAINS "
echo "$MAIL_DOMAINS $DATABASES $SHELL $DISK_QUOTA $BANDWIDTH"
done
}
@ -75,7 +76,7 @@ plain_list() {
for package in $packages; do
source $VESTA/data/packages/$package
PACKAGE=${package/.pkg/}
echo -ne "$PACKAGE\t$WEB_TEMPLATE\t$PROXY_TEMPLATE\t$DNS_TEMPLATE\t"
echo -ne "$PACKAGE\t$WEB_TEMPLATE\t$BACKEND_TEMPLATE\t$PROXY_TEMPLATE\t$DNS_TEMPLATE\t"
echo -ne "$WEB_DOMAINS\t$WEB_ALIASES\t$DNS_DOMAINS\t$DNS_RECORDS\t"
echo -ne "$MAIL_DOMAINS\t$MAIL_ACCOUNTS\t$DATABASES\t$CRON_JOBS\t"
echo -e "$DISK_QUOTA\t$BANDWIDTH\t$NS\t$SHELL\t$BACKUPS\t$TIME\t$DATE"
@ -84,13 +85,13 @@ plain_list() {
# CSV list function
csv_list() {
echo -n "PACKAGE,WEB_TEMPLATE,PROXY_TEMPLATE,DNS_TEMPLATE,"
echo -n "PACKAGE,WEB_TEMPLATE,BACKEND_TEMPLATE,PROXY_TEMPLATE,DNS_TEMPLATE,"
echo -n "WEB_DOMAINS,WEB_ALIASES,DNS_DOMAINS,DNS_RECORDS,"
echo -n "MAIL_DOMAINS,MAIL_ACCOUNTS,DATABASES,CRON_JOBS,"
echo "DISK_QUOTA,BANDWIDTH,NS,SHELL,BACKUPS,TIME,DATE"
for package in $packages; do
PACKAGE=${package/.pkg/}
echo -n "$PACKAGE,$WEB_TEMPLATE,$PROXY_TEMPLATE,$DNS_TEMPLATE,"
echo -n "$PACKAGE,$WEB_TEMPLATE,$BACKEND_TEMPLATE,$PROXY_TEMPLATE,$DNS_TEMPLATE,"
echo -n "$WEB_DOMAINS,$WEB_ALIASES,$DNS_DOMAINS,$DNS_RECORDS,"
echo -n "$MAIL_DOMAINS,$MAIL_ACCOUNTS,$DATABASES,$CRON_JOBS,"
echo "$DISK_QUOTA,$BANDWIDTH,\"$NS\",$SHELL,$BACKUPS,$TIME,$DATE"

View file

@ -115,6 +115,7 @@ csv_list() {
#----------------------------------------------------------#
check_args '1' "$#" 'USER [FORMAT]'
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"

View file

@ -15,9 +15,14 @@ format=${1-shell}
# JSON list function
json_list() {
echo '{'
object_count=$(grep '@' /etc/passwd |wc -l)
i=1
while read USER; do
if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
continue;
fi
if [ $i -gt 1 ]; then
echo ","
fi
source $VESTA/data/users/$USER/user.conf
echo -n ' "'$USER'": {
"FNAME": "'$FNAME'",
@ -74,14 +79,8 @@ json_list() {
"TIME": "'$TIME'",
"DATE": "'$DATE'"
}'
if [ "$i" -lt "$object_count" ]; then
echo ','
else
echo
fi
((i++))
done < <(grep '@' /etc/passwd |cut -f1 -d:)
echo '}'
}
@ -90,6 +89,9 @@ shell_list() {
echo "USER PKG WEB DNS MAIL DB DISK BW SPND DATE"
echo "---- --- --- --- --- -- ---- -- ---- ----"
while read USER; do
if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
continue;
fi
source $VESTA/data/users/$USER/user.conf
echo -n "$USER $PACKAGE $U_WEB_DOMAINS $U_DNS_DOMAINS $U_MAIL_DOMAINS"
echo " $U_DATABASES $U_DISK $U_BANDWIDTH $SUSPENDED $DATE"
@ -99,6 +101,9 @@ shell_list() {
# PLAIN list function
plain_list() {
while read USER; do
if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
continue;
fi
source $VESTA/data/users/$USER/user.conf
echo -ne "$USER\t$FNAME\t$LNAME\t$PACKAGE\t$WEB_TEMPLATE\t"
echo -ne "$BACKEND_TEMPLATE\t$PROXY_TEMPLATE\t$DNS_TEMPLATE\t"
@ -131,6 +136,9 @@ csv_list() {
echo -n "U_MAIL_DOMAINS,U_MAIL_DKIM,U_MAIL_ACCOUNTS,U_DATABASES"
echo "U_CRON_JOBS,U_BACKUPS,LANGUAGE,TIME,DATE"
while read USER; do
if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
continue;
fi
source $VESTA/data/users/$USER/user.conf
echo -n "$USER,\"$FNAME\",\"$LNAME\",$PACKAGE,$WEB_TEMPLATE,"
echo -n "$BACKEND_TEMPLATE,$PROXY_TEMPLATE,$DNS_TEMPLATE,"
@ -151,6 +159,9 @@ csv_list() {
# Raw list function
raw_list() {
while read USER; do
if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
continue;
fi
echo $VESTA/data/users/$USER/user.conf
cat $VESTA/data/users/$USER/user.conf
done < <(grep '@' /etc/passwd |cut -f1 -d:)

View file

@ -110,6 +110,7 @@ csv_list() {
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN [FORMAT]'
is_format_valid 'user' 'domain'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"

View file

@ -19,6 +19,7 @@ source $VESTA/func/main.sh
# JSON list function
json_list() {
issuer=$(echo "$issuer" |sed -e 's/"/\\"/g' -e "s/%quote%/'/g")
echo '{'
echo -e "\t\"$domain\": {"
echo " \"CRT\": \"$crt\","
@ -97,6 +98,7 @@ csv_list() {
#----------------------------------------------------------#
check_args '2' "$#" 'USER DOMAIN [FORMAT]'
is_format_valid 'user' 'domain'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
@ -110,7 +112,7 @@ if [ -e "$USER_DATA/ssl/$domain.crt" ]; then
crt=$(cat $USER_DATA/ssl/$domain.crt |sed ':a;N;$!ba;s/\n/\\n/g')
info=$(openssl x509 -text -in $USER_DATA/ssl/$domain.crt)
subj=$(echo "$info" |grep Subject: |cut -f 2 -d =)
subj=$(echo "$info" |grep Subject: |cut -f 2 -d =|cut -f 2 -d \")
before=$(echo "$info" |grep Before: |sed -e "s/.*Before: //")
after=$(echo "$info" |grep "After :" |sed -e "s/.*After : //")
signature=$(echo "$info" |grep "Algorithm:" |head -n1 )

View file

@ -100,6 +100,7 @@ csv_list() {
#----------------------------------------------------------#
check_args '1' "$#" 'USER [FORMAT]'
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"

View file

@ -50,7 +50,13 @@ if [ -z "$PROXY_SYSTEM" ] || [ "$PROXY_SYSTEM" = 'remote' ]; then
fi
# Restart system
service $PROXY_SYSTEM restart >/dev/null 2>&1
if [ ! -f "/etc/debian_version" ]; then
service $PROXY_SYSTEM restart >/dev/null 2>&1
else
systemctl reset-failed $PROXY_SYSTEM
systemctl restart $PROXY_SYSTEM > /dev/null 2>&1
fi
if [ $? -ne 0 ]; then
send_email_report
check_result $E_RESTART "$PROXY_SYSTEM restart failed"

View file

@ -56,6 +56,7 @@ ftpc() {
quote USER $USERNAME
quote PASS $PASSWORD
binary
lcd $BACKUP
$1
$2
$3
@ -289,7 +290,7 @@ if [ "$web" != 'no' ] && [ ! -z "$WEB_SYSTEM" ]; then
if [ -z "$web" ] || [ "$web" = '*' ]; then
domains="$backup_domains"
else
echo "$web" |tr ',' '\n' > $tmpdir/selected.txt
echo "$web" | tr ',' '\n' | sed -e "s/^/^/" > $tmpdir/selected.txt
domains=$(echo "$backup_domains" |egrep -f $tmpdir/selected.txt)
fi
@ -406,15 +407,21 @@ if [ "$web" != 'no' ] && [ ! -z "$WEB_SYSTEM" ]; then
fi
# Restoring web domain data
tar -xzpf $tmpdir/web/$domain/domain_data.tar.gz \
-C $HOMEDIR/$user/web/$domain/
if [ "$?" -ne 0 ]; then
rm -rf $tmpdir
error="can't unpack $domain data tarball"
echo "$error" |$SENDMAIL -s "$subj" $email $notify
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe
check_result "$E_PARSING" "$error"
chown $user $tmpdir
chmod u+w $HOMEDIR/$user/web/$domain
sudo -u $user tar -xzpf $tmpdir/web/$domain/domain_data.tar.gz \
-C $HOMEDIR/$user/web/$domain/ --exclude=./logs/* \
2> $HOMEDIR/$user/web/$domain/restore_errors.log
if [ -e "$HOMEDIR/$user/web/$domain/restore_errors.log" ]; then
chown $user:$user $HOMEDIR/$user/web/$domain/restore_errors.log
fi
#if [ "$?" -ne 0 ]; then
# rm -rf $tmpdir
# error="can't unpack $domain data tarball"
# echo "$error" |$SENDMAIL -s "$subj" $email $notify
# sed -i "/ $user /d" $VESTA/data/queue/backup.pipe
# check_result "$E_PARSING" "$error"
#fi
# Applying Fix for tar < 1.24
find $HOMEDIR/$user/web/$domain -type d \
@ -452,7 +459,7 @@ if [ "$dns" != 'no' ] && [ ! -z "$DNS_SYSTEM" ]; then
if [ -z "$dns" ] || [ "$dns" = '*' ]; then
domains="$backup_domains"
else
echo "$dns" |tr ',' '\n' > $tmpdir/selected.txt
echo "$dns" | tr ',' '\n' | sed -e "s/^/^/" > $tmpdir/selected.txt
domains=$(echo "$backup_domains" |egrep -f $tmpdir/selected.txt)
fi
@ -532,7 +539,7 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
if [ -z "$mail" ] || [ "$mail" = '*' ]; then
domains="$backup_domains"
else
echo "$mail" |tr ',' '\n' > $tmpdir/selected.txt
echo "$mail" | tr ',' '\n' | sed -e "s/^/^/" > $tmpdir/selected.txt
domains=$(echo "$backup_domains" |egrep -f $tmpdir/selected.txt)
fi
@ -586,13 +593,15 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
# Rebuilding mail config
rebuild_mail_domain_conf
domain_idn=$domain
format_domain_idn
# Restoring emails
if [ -e "$tmpdir/mail/$domain/accounts.tar.gz" ]; then
tar -xzpf $tmpdir/mail/$domain/accounts.tar.gz \
chown $user $tmpdir
chmod u+w $HOMEDIR/$user/mail/$domain_idn
sudo -u $user tar -xzpf $tmpdir/mail/$domain/accounts.tar.gz \
-C $HOMEDIR/$user/mail/$domain_idn/
if [ "$?" -ne 0 ]; then
rm -rf $tmpdir
@ -627,7 +636,7 @@ if [ "$db" != 'no' ] && [ ! -z "$DB_SYSTEM" ]; then
if [ -z "$db" ] || [ "$db" = '*' ]; then
databases="$backup_databases"
else
echo "$db" |tr ',' '\n' > $tmpdir/selected.txt
echo "$db" |tr ',' '\n' | sed -e "s/$/$/" > $tmpdir/selected.txt
databases=$(echo "$backup_databases" |egrep -f $tmpdir/selected.txt)
fi

View file

@ -23,6 +23,19 @@ udir=$8
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# Check backup ownership function
is_backup_available() {
passed=false
if [[ $2 =~ ^$1.[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]_[0-9][0-9]-[0-9][0-9]-[0-9][0-9].tar$ ]]; then
passed=true
elif [[ $2 =~ ^$1.[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].tar$ ]]; then
passed=true
fi
if [ $passed = false ]; then
check_result $E_FORBIDEN "permission denied"
fi
}
#----------------------------------------------------------#
# Verifications #
@ -34,6 +47,7 @@ is_system_enabled "$BACKUP_SYSTEM" 'BACKUP_SYSTEM'
is_object_valid 'user' 'USER' "$user"
is_backup_enabled
is_backup_scheduled 'restore'
is_backup_available "$user" "$backup"
#----------------------------------------------------------#

View file

@ -84,6 +84,22 @@ OLD_IFS=$IFS
IFS=$'\n'
# User loop
search_user=$(ls -1 $VESTA/data/users |grep $object)
for user in $search_user; do
if [ -e "$VESTA/data/users/$user/user.conf" ]; then
source $VESTA/data/users/$user/user.conf
((i ++))
type=$(echo $type|cut -f1 -d \.)
str="ID='$i' USER='$user' TYPE='user' KEY='$user'"
str="$str RESULT='$user' ALIAS=''"
str="$str LINK='$user' PARENT=''"
str="$str SUSPENDED='$SUSPENDED' TIME='$TIME'"
str="$str DATE='$DATE'"
echo $str >> $conf
fi
done
# User data loop
for user in $(ls $VESTA/data/users/); do
# Search query
search=$(grep "$object" \
@ -94,7 +110,7 @@ for user in $(ls $VESTA/data/users/); do
$VESTA/data/users/$user/mail/*.conf \
$VESTA/data/users/$user/db.conf \
$VESTA/data/users/$user/cron.conf 2> /dev/null)
for row in $search; do
# Initialise variable
key=''
@ -154,12 +170,13 @@ for user in $(ls $VESTA/data/users/); do
# DNS Records
if [ "$type" = 'dns' ]; then
if [ -n "$(echo $RECORD |grep $object)" ]; then
if [ -n "$(echo $RECORD $VALUE |grep $object)" ]; then
dom="$(echo $row|cut -f 1 -d :|cut -f 9 -d /|sed 's/.conf//')"
key="RECORD"
result="$RECORD.$DOMAIN"
result="$RECORD.$dom"
suspended=$SUSPENDED
object_link=$ID
object_parent=$DOMAIN
object_parent=$dom
object_time=$TIME
object_date=$DATE
((i ++))

93
bin/v-search-ssl-certificates Executable file
View file

@ -0,0 +1,93 @@
#!/bin/bash
# info: search ssl certificates
# options: [FORMAT]
#
# The function to obtain the list of available ssl certificates.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
format=${1-shell}
# Includes
source $VESTA/func/main.sh
# JSON list function
json_list() {
IFS=$'\n'
objects=$(echo "$search_cmd" |wc -l)
i=1
echo '['
for str in $search_cmd; do
eval $str
if [ "$i" -lt "$objects" ]; then
echo -e "\t\"$USER:$DOMAIN\","
else
echo -e "\t\"$USER:$DOMAIN\""
fi
(( ++i))
done
echo "]"
}
# SHELL list function
shell_list() {
IFS=$'\n'
echo "USER DOMAIN"
echo "---- ------"
for str in $search_cmd; do
eval $str
echo "$USER $DOMAIN"
done
}
# PLAIN list function
plain_list() {
IFS=$'\n'
for str in $search_cmd; do
eval $str
echo -e "$USER\t$DOMAIN"
done
}
# CSV list function
csv_list() {
IFS=$'\n'
echo "USER,DOMAIN"
for str in $search_cmd; do
eval $str
echo "$USER,$DOMAIN"
done
}
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
search_cmd=$(grep -H "SSL='yes'" $VESTA/data/users/*/web.conf |\
cut -f 1 -d ' ' |\
sed -e "s|$VESTA/data/users/|USER='|" -e "s|/web.conf:|' |")
# Listing data
case $format in
json) json_list ;;
plain) plain_list ;;
csv) csv_list ;;
shell) shell_list |column -t ;;
esac
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit

View file

@ -1,110 +0,0 @@
#!/bin/bash
# info: sing letsencrypt csr
# options: USER DOMAIN CSR_DIR [FORMAT]
#
# The function signs certificate request using LetsEncript API
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
user=$1
domain=$2
csr="$3/$domain.csr"
format=$4
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
# encode base64
encode_base64() {
cat |base64 |tr '+/' '-_' |tr -d '\r\n='
}
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '3' "$#" 'USER DOMAIN CSR'
is_format_valid 'user' 'domain'
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
if [ ! -e "$USER_DATA/ssl/le.conf" ]; then
check_result $E_NOTEXIST "LetsEncrypt key doesn't exist"
fi
check_domain=$(grep -w "$domain'" $USER_DATA/web.conf)
if [ -z "$check_domain" ]; then
check_result $E_NOTEXIST "domain $domain doesn't exist"
fi
if [ ! -e "$csr" ]; then
check_result $E_NOTEXIST "$csr doesn't exist"
fi
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
source $USER_DATA/ssl/le.conf
api='https://acme-v01.api.letsencrypt.org'
key="$USER_DATA/ssl/user.key"
exponent="$EXPONENT"
modulus="$MODULUS"
thumb="$THUMB"
# Defining JWK header
header='{"e":"'$exponent'","kty":"RSA","n":"'"$modulus"'"}'
header='{"alg":"RS256","jwk":'"$header"'}'
# Requesting nonce
nonce=$(curl -s -I "$api/directory" |grep Nonce |cut -f2 -d \ |tr -d '\r\n')
protected=$(echo -n '{"nonce":"'"$nonce"'"}' |encode_base64)
# Defining ACME query (request challenge)
csr=$(openssl req -in $csr -outform DER |encode_base64)
query='{"resource":"new-cert","csr":"'$csr'"}'
payload=$(echo -n "$query" |encode_base64)
signature=$(printf "%s" "$protected.$payload" |\
openssl dgst -sha256 -binary -sign "$key" |encode_base64)
data='{"header":'"$header"',"protected":"'"$protected"'",'
data=$data'"payload":"'"$payload"'","signature":"'"$signature"'"}'
# Sending request to LetsEncrypt API
answer=$(mktemp)
curl -s -d "$data" "$api/acme/new-cert" -o $answer
if [ ! -z "$(grep Error $answer)" ]; then
detail="$(cat $answer |tr ',' '\n' |grep detail |cut -f 4 -d \")"
detail=$(echo "$detail" |awk -F "::" '{print $2}')
rm $answer
check_result $E_LIMIT "$detail"
fi
# Printing certificate
crt=$(cat "$answer" |openssl base64 -e)
rm $answer
if [ "$format" != 'json' ]; then
echo "-----BEGIN CERTIFICATE-----"
echo "$crt"
echo "-----END CERTIFICATE-----"
else
echo -e "{\n\t\"$domain\": {\n\t\t\"CRT\":\""
echo -n '-----BEGIN CERTIFICATE-----\n'
echo -n "$crt" |sed ':a;N;$!ba;s/\n/\\n/g'
echo -n '-----END CERTIFICATE-----'
echo -e "\"\n\t\t}\n\t}"
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
exit

View file

@ -48,6 +48,9 @@ is_object_suspended "mail/$domain" 'ACCOUNT' "$account"
if [[ "$MAIL_SYSTEM" =~ exim ]]; then
md5=$(get_object_value "mail/$domain" 'ACCOUNT' "$account" '$MD5')
quota=$(get_object_value "mail/$domain" 'ACCOUNT' "$account" '$QUOTA')
if [ "$quota" = 'unlimited' ]; then
quota=0
fi
sed -i "/^$account:/d" $HOMEDIR/$user/conf/mail/$domain/passwd
str="$account:$md5:$user:mail::$HOMEDIR/$user:$quota"
echo $str >> $HOMEDIR/$user/conf/mail/$domain/passwd

View file

@ -51,11 +51,6 @@ if [ $? -ne 0 ]; then
conntrack_ftp='no'
fi
# Checking custom OpenSSH port
sshport=$(grep '^Port ' /etc/ssh/sshd_config | head -1 | cut -d ' ' -f 2)
if [[ "$sshport" =~ ^[0-9]+$ ]] && [ "$sshport" -ne "22" ]; then
sed -i "s/PORT='22'/PORT=\'$sshport\'/" $rules
fi
# Creating temporary file
tmp=$(mktemp)

View file

@ -22,46 +22,63 @@ source $VESTA/conf/vesta.conf
# Action #
#----------------------------------------------------------#
# Defining user list
users=$($BIN/v-list-users | tail -n+3 | awk '{ print $1 }')
lecounter=0
hostname=$(hostname)
# Checking users
for user in $users; do
echo "[$(date)] : -----------------------------------------------------------------------------------" >> /usr/local/vesta/log/letsencrypt_cron.log
# Checking user certificates
for user in $($BIN/v-list-users plain |cut -f 1); do
USER_DATA=$VESTA/data/users/$user
# Checking user certificates
lecounter=0
for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do
crt="$VESTA/data/users/$user/ssl/$domain.crt"
crt_data=$(openssl x509 -text -in "$crt")
expire=$(echo "$crt_data" |grep "Not After")
expire=$(echo "$expire" |cut -f 2,3,4 -d :)
expire=$(date -d "$expire" +%s)
now=$(date +%s)
expire=$((expire - now))
expire=$((expire / 86400))
domain=$(basename $crt |sed -e "s/.crt$//")
if [[ "$expire" -lt 31 ]]; then
aliases=$(echo "$crt_data" |grep DNS:)
aliases=$(echo "$aliases" |sed -e "s/DNS://g" -e "s/,//")
aliases=$(echo "$aliases" |tr ' ' '\n' |sed "/^$/d")
aliases=$(echo "$aliases" |grep -v "^$domain$")
if [ ! -z "$aliases" ]; then
aliases=$(echo "$aliases" |sed -e ':a;N;$!ba;s/\n/,/g')
msg=$($BIN/v-add-letsencrypt-domain $user $domain $aliases)
if [ $? -ne 0 ]; then
echo "$domain $msg"
fi
else
msg==$($BIN/v-add-letsencrypt-domain $user $domain)
if [ $? -ne 0 ]; then
echo "$domain $msg"
fi
for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do
limit_check=1
fail_counter=$(get_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT')
if [[ "$hostname" = "$domain" ]]; then
if [[ "$fail_counter" -eq 7 ]]; then
limit_check=0
fi
if [[ "$fail_counter" -eq 8 ]]; then
fail_counter=$(alter_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT')
send_email_to_admin "LetsEncrypt renewing hostname $hostname" "Warning: hostname $domain failed for LetsEncrypt renewing"
fi
fi
if [[ "$fail_counter" -ge 7 ]] && [[ "$limit_check" -eq 1 ]]; then
# echo "$domain failed $fail_counter times for LetsEncrypt renewing, skipping"
echo "[$(date)] : $domain failed $fail_counter times for LetsEncrypt renewing, skipping" >> /usr/local/vesta/log/letsencrypt_cron.log
continue;
fi
crt_data=$(openssl x509 -text -in $USER_DATA/ssl/$domain.crt)
not_after=$(echo "$crt_data" |grep "Not After" |cut -f 2,3,4 -d :)
expiration=$(date -d "$not_after" +%s)
now=$(date +%s)
seconds_valid=$((expiration - now))
days_valid=$((seconds_valid / 86400))
if [[ "$days_valid" -lt 31 ]]; then
if [ $lecounter -gt 0 ]; then
sleep 10
sleep 120
fi
((lecounter++))
aliases=$(echo "$crt_data" |grep DNS:)
aliases=$(echo "$aliases" |sed -e "s/DNS://g" -e "s/,//g")
aliases=$(echo "$aliases" |tr ' ' '\n' |sed "/^$/d")
aliases=$(echo "$aliases" |egrep -v "^$domain,?$")
aliases=$(echo "$aliases" |sed -e ':a;N;$!ba;s/\n/,/g')
msg=$($BIN/v-add-letsencrypt-domain $user $domain $aliases)
if [ $? -ne 0 ]; then
if [[ $msg == *"is suspended" ]]; then
echo "[$(date)] : SUSPENDED: $domain $msg" >> /usr/local/vesta/log/letsencrypt_cron.log
else
echo "[$(date)] : $domain $msg" >> /usr/local/vesta/log/letsencrypt_cron.log
echo "$domain $msg"
fail_counter=$(alter_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT')
echo "[$(date)] : fail_counter = $fail_counter" >> /usr/local/vesta/log/letsencrypt_cron.log
echo "fail_counter = $fail_counter"
fi
fi
fi
done
done

View file

@ -44,7 +44,7 @@ if [[ "$ip_num" -eq '1' ]] && [[ "$v_ip_num" -eq 1 ]]; then
fi
# Updating configs
if [ ! -z "$new" ]; then
if [ ! -z "$old" ]; then
mv $VESTA/data/ips/$old $VESTA/data/ips/$new
# Updating PROXY

View file

@ -61,13 +61,13 @@ fi
# Parsing data
if [ "$period" = 'daily' ]; then
mem=$(free -m)
used=$(echo "$mem" |grep Mem |awk '{print $3}')
used=$(echo "$mem" |awk '(NR == 2)' |awk '{print $3}')
if [ -z "$(echo "$mem" | grep available)" ]; then
free=$(echo "$mem" |grep buffers/cache |awk '{print $4}')
free=$(echo "$mem" |grep buff/cache |awk '{print $4}')
else
free=$(echo "$mem" |grep Mem |awk '{print $7}')
free=$(echo "$mem" |awk '(NR == 2)' |awk '{print $7}')
fi
swap=$(echo "$mem" |grep Swap |awk '{print $3}')
swap=$(echo "$mem" |awk '(NR == 3)' |awk '{print $3}')
# Updating rrd
rrdtool update $RRD/mem/mem.rrd N:$used:$swap:$free

View file

@ -85,7 +85,7 @@ for host in $hosts; do
# Parsing data
q='SELECT SUM(xact_commit + xact_rollback), SUM(numbackends)
FROM pg_stat_database;'
status=$($sql plsql -d postgres -c "$q" 2>/dev/null); code="$?"
status=$($sql psql -d postgres -c "$q" 2>/dev/null); code="$?"
if [ '0' -ne "$code" ]; then
active=0
slow=0

View file

@ -28,12 +28,32 @@ source $VESTA/conf/vesta.conf
# Checking arg number
check_args '1' "$#" 'PACKAGE'
valid=0
if [ "$package" = "vesta" ]; then
valid=1
fi
if [ "$package" = "vesta-nginx" ]; then
valid=1
fi
if [ "$package" = "vesta-php" ]; then
valid=1
fi
if [ "$package" = "vesta-ioncube" ]; then
valid=1
fi
if [ "$package" = "vesta-softaculous" ]; then
valid=1
fi
if [ $valid -eq 0 ]; then
echo "Package $package is not valid"
exit 1
fi
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ -d "/etc/sysconfig" ]; then
if [ -n "$(command -v yum)" ]; then
# Clean yum chache
yum -q clean all

View file

@ -53,6 +53,7 @@ for user in $user_list; do
IP_OWNED=0
U_USERS=0
U_DISK=0
DISK=0
U_DISK_DIRS=$(get_user_value '$U_DISK_DIRS')
if [ -z "$U_DISK_DIRS" ]; then
U_DISK_DIRS=0

View file

@ -67,6 +67,9 @@ TOTAL_USERS=0
# Updating user stats
for user in $user_list; do
if [ ! -f "$VESTA/data/users/$user/user.conf" ]; then
continue;
fi
USER_DATA=$VESTA/data/users/$user
source $USER_DATA/user.conf
next_month=$(date +'%m/01/%y' -d '+ 1 month')

View file

@ -55,14 +55,14 @@ mysql_query() {
mysql_dump() {
err="/tmp/e.mysql"
mysqldump --defaults-file=$mycnf --single-transaction -r $1 $2 2> $err
mysqldump --defaults-file=$mycnf --single-transaction --max_allowed_packet=100M -r $1 $2 2> $err
if [ '0' -ne "$?" ]; then
rm -rf $tmpdir
if [ "$notify" != 'no' ]; then
echo -e "Can't dump database $database\n$(cat $err)" |\
$SENDMAIL -s "$subj" $email
fi
echo "Error: dump $database failed"
echo "Error: dump $database failed\n$(cat $err)"
log_event "$E_DB" "$ARGUMENTS"
exit $E_DB
fi
@ -322,7 +322,7 @@ delete_pgsql_database() {
psql_connect $HOST
query="REVOKE ALL PRIVILEGES ON DATABASE $database FROM $DBUSER"
psql_qyery "$query" > /dev/null
psql_query "$query" > /dev/null
query="DROP DATABASE $database"
psql_query "$query" > /dev/null

View file

@ -215,7 +215,11 @@ add_web_config() {
fi
fi
trigger="${2/.*pl/.sh}"
trigger="${2/%.tpl/.sh}"
if [[ "$2" =~ stpl$ ]]; then
trigger="${2/%.stpl/.sh}"
fi
if [ -x "$WEBTPL/$1/$WEB_BACKEND/$trigger" ]; then
$WEBTPL/$1/$WEB_BACKEND/$trigger \
$user $domain $local_ip $HOMEDIR \
@ -285,8 +289,10 @@ del_web_config() {
if [[ "$2" =~ stpl$ ]]; then
conf="$HOMEDIR/$user/conf/web/s$1.conf"
fi
get_web_config_lines $WEBTPL/$1/$WEB_BACKEND/$2 $conf
sed -i "$top_line,$bottom_line d" $conf
if [ -e "$conf" ]; then
get_web_config_lines $WEBTPL/$1/$WEB_BACKEND/$2 $conf
sed -i "$top_line,$bottom_line d" $conf
fi
fi
# clean-up for both config styles if there is no more domains
web_domain=$(grep DOMAIN $USER_DATA/web.conf |wc -l)
@ -337,7 +343,7 @@ is_web_domain_cert_valid() {
check_result $E_FORBIDEN "SSL Key is protected (remove pass_phrase)"
fi
openssl s_server -quiet -cert $ssl_dir/$domain.crt \
openssl s_server -port 654321 -quiet -cert $ssl_dir/$domain.crt \
-key $ssl_dir/$domain.key >> /dev/null 2>&1 &
pid=$!
sleep 0.5
@ -406,6 +412,24 @@ update_domain_zone() {
VALUE=$(idn --quiet -a -t "$VALUE")
fi
# Split long TXT entries into 255 chunks
if [ "$TYPE" = 'TXT' ]; then
txtlength=${#VALUE}
if [ $txtlength -gt 255 ]; then
already_chunked=0
if [[ $VALUE == *"\" \""* ]] || [[ $VALUE == *"\"\""* ]]; then
already_chunked=1
fi
if [ $already_chunked -eq 0 ]; then
if [[ ${VALUE:0:1} = '"' ]]; then
txtlength=$(( $txtlength - 2 ))
VALUE=${VALUE:1:txtlength}
fi
VALUE=$(echo $VALUE | fold -w 255 | xargs -I '$' echo -n '"$"')
fi
fi
fi
if [ "$SUSPENDED" != 'yes' ]; then
eval echo -e "\"$fields\""|sed "s/%quote%/'/g" >> $zn_conf
fi

View file

@ -141,7 +141,7 @@ get_real_ip() {
else
nat=$(grep -H "^NAT='$1'" $VESTA/data/ips/*)
if [ ! -z "$nat" ]; then
echo "$nat" |cut -f 1 -d : |cut -f 7 -d /
echo "$nat" |cut -f 1 -d : |cut -f 7 -d / |head -n 1
fi
fi
}

View file

@ -35,6 +35,7 @@ E_DB=17
E_RRD=18
E_UPDATE=19
E_RESTART=20
E_TEAPOT=418
# Event string for logger
for ((I=1; I <= $# ; I++)); do
@ -212,7 +213,8 @@ is_object_new() {
# Check if object is valid
is_object_valid() {
if [ $2 = 'USER' ]; then
if [ ! -d "$VESTA/data/users/$3" ]; then
user_vst_dir=$(basename $3)
if [ ! -d "$VESTA/data/users/$user_vst_dir" ]; then
check_result $E_NOTEXIST "$1 $3 doesn't exist"
fi
else
@ -294,6 +296,20 @@ is_dir_symlink() {
fi
}
# Check if file exists
if_file_exists() {
if [[ -f "$1" ]]; then
check_result $E_FORBIDEN "$1 file exists"
fi
}
# Check if directory exists
if_dir_exists() {
if [[ -d "$1" ]]; then
check_result $E_FORBIDEN "$1 directory exists"
fi
}
# Get object value
get_object_value() {
object=$(grep "$2='$3'" $USER_DATA/$1.conf)
@ -659,7 +675,7 @@ is_dbuser_format_valid() {
# DNS record type validator
is_dns_type_format_valid() {
known_dnstype='A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF,TLSA'
known_dnstype='A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF,TLSA,CAA'
if [ -z "$(echo $known_dnstype |grep -w $1)" ]; then
check_result $E_INVALID "invalid dns record type format :: $1"
fi
@ -815,6 +831,23 @@ is_format_valid_shell() {
exit $E_INVALID
fi
}
format_no_quotes() {
exclude="['|\"]"
if [[ "$1" =~ $exclude ]]; then
check_result "$E_INVALID" "Invalid $2 contains qoutes (\" or ') :: $1"
fi
is_no_new_line_format "$1"
}
is_no_new_line_format() {
test=$(echo "$1" | head -n1 );
if [[ "$test" != "$1" ]]; then
check_result "$E_INVALID" "invalid value :: $1"
fi
}
# Format validation controller
is_format_valid() {
for arg_name in $*; do
@ -823,6 +856,7 @@ is_format_valid() {
case $arg_name in
account) is_user_format_valid "$arg" "$arg_name";;
action) is_fw_action_format_valid "$arg";;
alias) is_alias_format_valid "$arg" ;;
aliases) is_alias_format_valid "$arg" ;;
antispam) is_boolean_format_valid "$arg" 'antispam' ;;
antivirus) is_boolean_format_valid "$arg" 'antivirus' ;;
@ -848,6 +882,7 @@ is_format_valid() {
host) is_object_format_valid "$arg" "$arg_name" ;;
hour) is_cron_format_valid "$arg" $arg_name ;;
id) is_int_format_valid "$arg" 'id' ;;
interface) is_interface_format_valid "$arg" ;;
ip) is_ip_format_valid "$arg" ;;
ip_name) is_domain_format_valid "$arg" 'IP name';;
ip_status) is_ip_status_format_valid "$arg" ;;
@ -933,7 +968,85 @@ format_aliases() {
aliases=$(echo "$aliases" |tr -s '.')
aliases=$(echo "$aliases" |sed -e "s/[.]*$//g")
aliases=$(echo "$aliases" |sed -e "s/^[.]*//")
aliases=$(echo "$aliases" |grep -v www.$domain |sed -e "/^$/d")
aliases=$(echo "$aliases" |sed -e "/^$/d")
aliases=$(echo "$aliases" |tr '\n' ',' |sed -e "s/,$//")
fi
}
alter_web_counter() {
user=$1
domain=$2
USER_DATA=$VESTA/data/users/$user
varc=$3
vard="\$${varc}"
counter=$(get_object_value 'web' 'DOMAIN' "$domain" "$vard")
if [ -z "$counter" ]; then
add_object_key "web" 'DOMAIN' "$domain" "$varc" "TIME"
counter=0
fi
((counter++))
backup_counter=$counter
update_object_value 'web' 'DOMAIN' "$domain" "$vard" "$counter"
counter=$backup_counter
echo $counter
}
reset_web_counter() {
user=$1
domain=$2
USER_DATA=$VESTA/data/users/$user
varc=$3
vard="\$${varc}"
update_object_value 'web' 'DOMAIN' "$domain" "$vard" "0"
}
get_web_counter() {
user=$1
domain=$2
USER_DATA=$VESTA/data/users/$user
varc=$3
vard="\$${varc}"
counter=$(get_object_value 'web' 'DOMAIN' "$domain" "$vard")
if [ -z "$counter" ]; then
counter=0
fi
echo $counter
}
# Simple chmod wrapper that skips symlink files after glob expand
# Taken from HestiaCP
no_symlink_chmod() {
local filemode=$1; shift;
for i in "$@"; do
[[ -L ${i} ]] && continue
chmod "${filemode}" "${i}"
done
}
# $1 = subject
# $2 = body
send_email_to_admin() {
email=$(grep CONTACT /usr/local/vesta/data/users/admin/user.conf)
email=$(echo "$email" | cut -f 2 -d "'")
if [ -z "$email" ]; then
if [ ! -z "$NOTIFY_ADMIN_FULL_BACKUP" ]; then
email=$NOTIFY_ADMIN_FULL_BACKUP
fi
fi
if [ -z "$email" ]; then
return;
fi
echo "$2" | $SENDMAIL -s "$1" "$email" 'yes'
}

View file

@ -51,7 +51,7 @@ rebuild_user_conf() {
mkdir -p $HOMEDIR/$user/conf
chmod a+x $HOMEDIR/$user
chmod a+x $HOMEDIR/$user/conf
chown $user:$user $HOMEDIR/$user
chown --no-dereference $user:$user $HOMEDIR/$user
chown root:root $HOMEDIR/$user/conf
# Update disk pipe
@ -80,7 +80,7 @@ rebuild_user_conf() {
chmod 751 $HOMEDIR/$user/conf/web
chmod 751 $HOMEDIR/$user/web
chmod 771 $HOMEDIR/$user/tmp
chown $user:$user $HOMEDIR/$user/web
chown --no-dereference $user:$user $HOMEDIR/$user/web
if [ -z "$create_user" ]; then
$BIN/v-rebuild-web-domains $user $restart
fi
@ -152,7 +152,7 @@ rebuild_web_domain_conf() {
prepare_web_domain_values
# Rebuilding domain directories
mkdir -p $HOMEDIR/$user/web/$domain \
sudo -u $user mkdir -p $HOMEDIR/$user/web/$domain \
$HOMEDIR/$user/web/$domain/public_html \
$HOMEDIR/$user/web/$domain/public_shtml \
$HOMEDIR/$user/web/$domain/document_errors \
@ -178,14 +178,15 @@ rebuild_web_domain_conf() {
# Propagating html skeleton
if [ ! -e "$WEBTPL/skel/document_errors/" ]; then
cp -r $WEBTPL/skel/document_errors/ $HOMEDIR/$user/web/$domain/
sudo -u $user cp -r $WEBTPL/skel/document_errors/ \
$HOMEDIR/$user/web/$domain/
fi
# Set folder permissions
chmod 551 $HOMEDIR/$user/web/$domain \
no_symlink_chmod 551 $HOMEDIR/$user/web/$domain \
$HOMEDIR/$user/web/$domain/stats \
$HOMEDIR/$user/web/$domain/logs
chmod 751 $HOMEDIR/$user/web/$domain/private \
no_symlink_chmod 751 $HOMEDIR/$user/web/$domain/private \
$HOMEDIR/$user/web/$domain/cgi-bin \
$HOMEDIR/$user/web/$domain/public_html \
$HOMEDIR/$user/web/$domain/public_shtml \
@ -193,7 +194,7 @@ rebuild_web_domain_conf() {
chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.*
# Set ownership
chown $user:$user $HOMEDIR/$user/web/$domain \
chown --no-dereference $user:$user $HOMEDIR/$user/web/$domain \
$HOMEDIR/$user/web/$domain/private \
$HOMEDIR/$user/web/$domain/cgi-bin \
$HOMEDIR/$user/web/$domain/public_html \
@ -600,7 +601,7 @@ rebuild_pgsql_database() {
exit $E_CONNECT
fi
query="CREATE ROLE $DBUSER"
query="CREATE ROLE $DBUSER WITH LOGIN"
psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
query="UPDATE pg_authid SET rolpassword='$MD5' WHERE rolname='$DBUSER'"
@ -617,7 +618,7 @@ rebuild_pgsql_database() {
query="GRANT ALL PRIVILEGES ON DATABASE $DB TO $DBUSER"
psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
query="GRANT CONNECT ON DATABASE template1 to $dbuser"
query="GRANT CONNECT ON DATABASE template1 to $DBUSER"
psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
}

View file

@ -50,6 +50,7 @@ http {
# Compression
gzip on;
gzip_vary on;
gzip_comp_level 9;
gzip_min_length 512;
gzip_buffers 8 64k;

View file

@ -1,5 +1,5 @@
location /phpmyadmin {
alias /usr/share/phpmyadmin/;
alias /usr/share/phpmyadmin;
location ~ /(libraries|setup) {
return 404;

View file

@ -1,5 +1,5 @@
location /phppgadmin {
alias /usr/share/phppgadmin/;
alias /usr/share/phppgadmin;
location ~ ^/phppgadmin/(.*\.php)$ {
alias /usr/share/phppgadmin/$1;

View file

@ -1,5 +1,5 @@
location /webmail {
alias /var/lib/roundcube/;
alias /var/lib/roundcube;
location ~ /(config|temp|logs) {
return 404;

View file

@ -15,6 +15,7 @@ Alias /phpmyadmin /usr/share/phpmyadmin
php_admin_flag allow_url_fopen Off
php_value include_path .
php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
php_admin_value sys_temp_dir /var/lib/phpmyadmin/tmp
php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext
</IfModule>

View file

@ -137,6 +137,13 @@ if (!empty($dbname)) {
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
/*
* Temp dir for faster beahivour
*
*/
$cfg['TempDir'] = '/tmp';
/* Support additional configurations */
foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename)
{

View file

@ -15,8 +15,9 @@
AllowOverride All
SSLRequireSSL
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value open_basedir %sdocroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain_idn%"
</Directory>

View file

@ -16,6 +16,7 @@
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain_idn%"
</Directory>

View file

@ -17,6 +17,7 @@
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %sdocroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
</Directory>
<Directory %home%/%user%/web/%domain%/stats>

View file

@ -16,6 +16,7 @@
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
</Directory>
<Directory %home%/%user%/web/%domain%/stats>

View file

@ -22,8 +22,9 @@
php_admin_flag mysql.allow_persistent off
php_admin_flag safe_mode off
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain_idn%"
php_admin_value open_basedir %docroot%:%home%/%user%/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail:/etc/roundcube:/var/lib/roundcube
php_admin_value open_basedir %sdocroot%:%home%/%user%/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail:/etc/roundcube:/var/lib/roundcube
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
</Directory>
<Directory %home%/%user%/web/%domain%/stats>

View file

@ -14,7 +14,6 @@
<Directory %docroot%>
AllowOverride All
Options +Includes -Indexes +ExecCGI
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value upload_max_filesize 10M
php_admin_value max_execution_time 20
php_admin_value post_max_size 8M
@ -24,6 +23,7 @@
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain_idn%"
php_admin_value open_basedir %docroot%:%home%/%user%/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail:/etc/roundcube:/var/lib/roundcube
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
</Directory>
<Directory %home%/%user%/web/%domain%/stats>

View file

@ -15,8 +15,9 @@
SSLRequireSSL
AllowOverride All
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value open_basedir %sdocroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
Action phpcgi-script /cgi-bin/php
<Files *.php>

View file

@ -16,6 +16,7 @@
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
Action phpcgi-script /cgi-bin/php
<Files *.php>

View file

@ -15,8 +15,9 @@
SSLRequireSSL
AllowOverride All
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value open_basedir %sdocroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
<Files *.php>
SetHandler fcgid-script

View file

@ -16,6 +16,7 @@
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value sys_temp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
<Files *.php>
SetHandler fcgid-script

View file

@ -1,7 +1,6 @@
server {
listen %ip%:%proxy_ssl_port%;
listen %ip%:%proxy_ssl_port% ssl;
server_name %domain_idn% %alias_idn%;
ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;

View file

@ -1,7 +1,6 @@
server {
listen %ip%:%proxy_ssl_port%;
listen %ip%:%proxy_ssl_port% ssl;
server_name %domain_idn% %alias_idn%;
ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;

View file

@ -1,7 +1,6 @@
server {
listen %ip%:%proxy_ssl_port%;
listen %ip%:%proxy_ssl_port% ssl;
server_name %domain_idn% %alias_idn%;
ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@ -31,7 +30,7 @@ server {
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
disable_symlinks if_not_owner from=%docroot%;
disable_symlinks if_not_owner from=%sdocroot%;
include %home%/%user%/conf/web/snginx.%domain%.conf*;
}

View file

@ -1,17 +1,16 @@
server {
listen %ip%:%proxy_ssl_port% http2;
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/httpd/domains/%domain%.error.log error;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
location / {
proxy_pass https://%ip%:%web_ssl_port%;
location ~* ^.+\.(%proxy_extentions%)$ {
root %sdocroot%;
access_log /var/log/httpd/domains/%domain%.log combined;
access_log /var/log/httpd/domains/%domain%.bytes bytes;
access_log /var/log/%web_system%/domains/%domain%.log combined;
access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
expires max;
try_files $uri @fallback;
}

View file

@ -1,14 +1,14 @@
server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
error_log /var/log/httpd/domains/%domain%.error.log error;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
location / {
proxy_pass http://%ip%:%web_port%;
location ~* ^.+\.(%proxy_extentions%)$ {
root %docroot%;
access_log /var/log/httpd/domains/%domain%.log combined;
access_log /var/log/httpd/domains/%domain%.bytes bytes;
access_log /var/log/%web_system%/domains/%domain%.log combined;
access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
expires max;
try_files $uri @fallback;
}

View file

@ -10,63 +10,53 @@ server {
ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
location / {
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
}
location / {
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ ^/sites/.*/files/imagecache/ {
try_files $uri @rewrite;
}
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
location ~ ^/sites/.*/files/imagecache/ {
try_files $uri @rewrite;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
}
}
error_page 403 /error/404.html;

View file

@ -7,62 +7,52 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
location / {
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location / {
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
try_files $uri @rewrite;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ ^/sites/.*/files/imagecache/ {
try_files $uri @rewrite;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
location ~ ^/sites/.*/files/imagecache/ {
try_files $uri @rewrite;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
}
}
error_page 403 /error/404.html;

View file

@ -11,62 +11,56 @@ server {
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location / {
try_files $uri /index.php?$query_string;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
try_files $uri /index.php?$query_string;
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
}
}
error_page 403 /error/404.html;

View file

@ -7,62 +7,56 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
location = /favicon.ico {
log_not_found off;
access_log off;
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
location ~ \..*/.*\.php$ {
return 403;
location / {
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
location / {
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
try_files $uri /index.php?$query_string;
}
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}
location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
}
}
error_page 403 /error/404.html;

View file

@ -11,63 +11,62 @@ server {
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
location = /favicon.ico {
log_not_found off;
access_log off;
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
location / {
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
try_files $uri /index.php?$query_string;
}
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
}
}
error_page 403 /error/404.html;
error_page 404 /error/404.html;

View file

@ -7,64 +7,63 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
location ~ \..*/.*\.php$ {
return 403;
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location / {
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
location / {
try_files $uri /index.php?$query_string;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /vendor/.*\.php$ {
deny all;
return 404;
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
try_files $uri /index.php?$query_string;
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include /etc/nginx/fastcgi_params;
}
}
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
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;

View file

@ -3,7 +3,7 @@ server {
server_name %domain_idn% %alias_idn%;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
root %docroot%;
root %sdocroot%;
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;

View file

@ -1,7 +1,7 @@
server {
listen %ip%:%web_ssl_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%;
root %sdocroot%;
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;

View file

@ -0,0 +1,89 @@
server {
listen %ip%:%web_ssl_port%;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
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;
ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
set $cache_uri $request_uri;
if ($request_method = POST) {
set $cache_uri 'null cache';
}
if ($query_string != "") {
set $cache_uri 'null cache';
}
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php
|wp-.*.php|/feed/|index.php|wp-comments-popup.php
|wp-links-opml.php|wp-locations.php |sitemap(_index)?.xml
|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $cache_uri 'null cache';
}
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+
|wp-postpass|wordpress_logged_in|woocommerce_cart_hash|woocommerce_items_in_cart|wp_woocommerce_session_") {
set $cache_uri 'null cache';
}
location / {
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index-https.html $uri $uri/ /index.php?$args;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
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;
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/snginx.%domain%.conf*;
}

Some files were not shown because too many files have changed in this diff Show more