InPanel 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inpanel/__init__.py +29 -0
- inpanel/acme.py +289 -0
- inpanel/aliyuncs.py +269 -0
- inpanel/app.py +514 -0
- inpanel/apt.py +223 -0
- inpanel/base.py +200 -0
- inpanel/config.py +139 -0
- inpanel/data/config.ini +29 -0
- inpanel/data/history +5 -0
- inpanel/data/runlogs.ini +12 -0
- inpanel/data/update_info.ini +4 -0
- inpanel/dnf.py +225 -0
- inpanel/lib/__init__.py +9 -0
- inpanel/lib/async_process.py +98 -0
- inpanel/lib/filelock.py +82 -0
- inpanel/lib/magic.py +233 -0
- inpanel/lib/pxssh.py +310 -0
- inpanel/lib/pyDes.py +867 -0
- inpanel/mod/__init__.py +0 -0
- inpanel/mod/apt.py +316 -0
- inpanel/mod/certificate.py +268 -0
- inpanel/mod/config.py +372 -0
- inpanel/mod/cron.py +315 -0
- inpanel/mod/disk.py +322 -0
- inpanel/mod/dnf.py +239 -0
- inpanel/mod/file.py +722 -0
- inpanel/mod/firewall.py +199 -0
- inpanel/mod/firewall_base.py +137 -0
- inpanel/mod/firewall_firewalld.py +170 -0
- inpanel/mod/firewall_iptables.py +176 -0
- inpanel/mod/firewall_macos.py +213 -0
- inpanel/mod/firewall_ufw.py +128 -0
- inpanel/mod/ftp.py +231 -0
- inpanel/mod/httpd.py +1205 -0
- inpanel/mod/lighttpd.py +26 -0
- inpanel/mod/login.py +98 -0
- inpanel/mod/mysql.py +577 -0
- inpanel/mod/named.py +26 -0
- inpanel/mod/nginx.py +2327 -0
- inpanel/mod/package.py +33 -0
- inpanel/mod/package_apt.py +62 -0
- inpanel/mod/package_base.py +77 -0
- inpanel/mod/package_dnf.py +62 -0
- inpanel/mod/package_map.py +366 -0
- inpanel/mod/package_yum.py +64 -0
- inpanel/mod/php.py +289 -0
- inpanel/mod/process.py +291 -0
- inpanel/mod/proftpd.py +26 -0
- inpanel/mod/pureftpd.py +26 -0
- inpanel/mod/query.py +108 -0
- inpanel/mod/server.py +1319 -0
- inpanel/mod/service.py +262 -0
- inpanel/mod/setting.py +228 -0
- inpanel/mod/shell.py +78 -0
- inpanel/mod/ssh.py +280 -0
- inpanel/mod/system.py +220 -0
- inpanel/mod/task.py +1337 -0
- inpanel/mod/ufw.py +14 -0
- inpanel/mod/user.py +306 -0
- inpanel/mod/vsftpd.py +67 -0
- inpanel/mod/yum.py +243 -0
- inpanel/plugins/__init__.py +10 -0
- inpanel/plugins/__pycache__/__init__.cpython-313.pyc +0 -0
- inpanel/plugins/acme/static/index.html +10 -0
- inpanel/plugins/acme/static/index.js +13 -0
- inpanel/plugins/shadowsocks-libev/__pycache__/info.cpython-313.pyc +0 -0
- inpanel/plugins/shadowsocks-libev/info.py +73 -0
- inpanel/plugins/shadowsocks-libev/static/index.html +70 -0
- inpanel/plugins/shadowsocks-libev/static/index.js +18 -0
- inpanel/public/css/global.css +138 -0
- inpanel/public/favicon.ico +0 -0
- inpanel/public/images/alipay.jpg +0 -0
- inpanel/public/images/loading.gif +0 -0
- inpanel/public/images/weixin.jpg +0 -0
- inpanel/public/index.html +94 -0
- inpanel/public/js/controllers/controllers.js +566 -0
- inpanel/public/js/controllers/database.js +590 -0
- inpanel/public/js/controllers/ecs.js +624 -0
- inpanel/public/js/controllers/file.js +940 -0
- inpanel/public/js/controllers/plugins.js +105 -0
- inpanel/public/js/controllers/service.js +1460 -0
- inpanel/public/js/controllers/site.js +1241 -0
- inpanel/public/js/controllers/utils.js +2319 -0
- inpanel/public/js/core.js +221 -0
- inpanel/public/js/directives.js +784 -0
- inpanel/public/js/filters.js +395 -0
- inpanel/public/js/services.js +257 -0
- inpanel/public/lib/angular/1.0.2/angular-resource.min.js +10 -0
- inpanel/public/lib/angular/1.0.2/angular.min.js +158 -0
- inpanel/public/lib/bootstrap/css/bootstrap-theme.css +587 -0
- inpanel/public/lib/bootstrap/css/bootstrap-theme.css.map +1 -0
- inpanel/public/lib/bootstrap/css/bootstrap-theme.min.css +6 -0
- inpanel/public/lib/bootstrap/css/bootstrap-theme.min.css.map +1 -0
- inpanel/public/lib/bootstrap/css/bootstrap.css +6757 -0
- inpanel/public/lib/bootstrap/css/bootstrap.css.map +1 -0
- inpanel/public/lib/bootstrap/css/bootstrap.min.css +6 -0
- inpanel/public/lib/bootstrap/css/bootstrap.min.css.map +1 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
- inpanel/public/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
- inpanel/public/lib/bootstrap/img/glyphicons-halflings.png +0 -0
- inpanel/public/lib/bootstrap/js/bootstrap.js +2377 -0
- inpanel/public/lib/bootstrap/js/bootstrap.min.js +7 -0
- inpanel/public/lib/bootstrap/js/npm.js +13 -0
- inpanel/public/lib/codemirror/codemirror-compressed.js +1 -0
- inpanel/public/lib/codemirror/codemirror.css +173 -0
- inpanel/public/lib/jquery/jquery-1.12.4.min.js +5 -0
- inpanel/public/lib/md5/md5.js +379 -0
- inpanel/public/lib/md5/md5.min.js +1 -0
- inpanel/public/partials/database/index.html +172 -0
- inpanel/public/partials/database/mysql/dbedit.html +462 -0
- inpanel/public/partials/database/mysql/dbnew.html +348 -0
- inpanel/public/partials/database/mysql/useredit.html +310 -0
- inpanel/public/partials/database/mysql/usernew.html +97 -0
- inpanel/public/partials/directives/message.html +20 -0
- inpanel/public/partials/directives/navbar.html +25 -0
- inpanel/public/partials/directives/selector.html +57 -0
- inpanel/public/partials/directives/srvbase.html +72 -0
- inpanel/public/partials/directives/srvext.html +34 -0
- inpanel/public/partials/directives/srvfile.html +23 -0
- inpanel/public/partials/directives/srvinstall.html +34 -0
- inpanel/public/partials/directives/srvlog.html +23 -0
- inpanel/public/partials/directives/srvminiop.html +28 -0
- inpanel/public/partials/directives/srvuninstall.html +38 -0
- inpanel/public/partials/directives/srvupdate.html +30 -0
- inpanel/public/partials/ecs/account.html +156 -0
- inpanel/public/partials/ecs/ecs.html +198 -0
- inpanel/public/partials/ecs/index.html +40 -0
- inpanel/public/partials/ecs/setings.html +459 -0
- inpanel/public/partials/file/file.html +501 -0
- inpanel/public/partials/file/trash.html +95 -0
- inpanel/public/partials/ftp.html +36 -0
- inpanel/public/partials/log.html +83 -0
- inpanel/public/partials/login.html +79 -0
- inpanel/public/partials/logout.html +22 -0
- inpanel/public/partials/main.html +534 -0
- inpanel/public/partials/plugins/index.html +55 -0
- inpanel/public/partials/plugins/plugins.html +13 -0
- inpanel/public/partials/secure.html +13 -0
- inpanel/public/partials/service/apache.html +147 -0
- inpanel/public/partials/service/cron.html +71 -0
- inpanel/public/partials/service/index.html +293 -0
- inpanel/public/partials/service/iptables.html +40 -0
- inpanel/public/partials/service/lighttpd.html +63 -0
- inpanel/public/partials/service/mariadb.html +113 -0
- inpanel/public/partials/service/memcache.html +36 -0
- inpanel/public/partials/service/minio.html +44 -0
- inpanel/public/partials/service/mongodb.html +44 -0
- inpanel/public/partials/service/mysql.html +113 -0
- inpanel/public/partials/service/named.html +61 -0
- inpanel/public/partials/service/nginx.html +296 -0
- inpanel/public/partials/service/ntp.html +40 -0
- inpanel/public/partials/service/php.html +250 -0
- inpanel/public/partials/service/proftpd.html +59 -0
- inpanel/public/partials/service/pureftpd.html +59 -0
- inpanel/public/partials/service/redis.html +40 -0
- inpanel/public/partials/service/samba.html +58 -0
- inpanel/public/partials/service/sendmail.html +40 -0
- inpanel/public/partials/service/ssh.html +186 -0
- inpanel/public/partials/service/tomcat.html +65 -0
- inpanel/public/partials/service/vsftpd.html +195 -0
- inpanel/public/partials/setting.html +299 -0
- inpanel/public/partials/site/apache/site.html +277 -0
- inpanel/public/partials/site/index.html +344 -0
- inpanel/public/partials/site/nginx/site.html +558 -0
- inpanel/public/partials/sorry.html +19 -0
- inpanel/public/partials/storage/autofm.html +103 -0
- inpanel/public/partials/storage/backup.html +42 -0
- inpanel/public/partials/storage/index.html +360 -0
- inpanel/public/partials/storage/migrate.html +93 -0
- inpanel/public/partials/storage/movedata.html +98 -0
- inpanel/public/partials/storage/remote.html +77 -0
- inpanel/public/partials/utils/cron.html +486 -0
- inpanel/public/partials/utils/firewall.html +266 -0
- inpanel/public/partials/utils/index.html +193 -0
- inpanel/public/partials/utils/network.html +118 -0
- inpanel/public/partials/utils/process.html +239 -0
- inpanel/public/partials/utils/repository.html +373 -0
- inpanel/public/partials/utils/shell.html +28 -0
- inpanel/public/partials/utils/ssl.html +319 -0
- inpanel/public/partials/utils/time.html +109 -0
- inpanel/public/partials/utils/user.html +359 -0
- inpanel/public/robots.txt +2 -0
- inpanel/remote.py +109 -0
- inpanel/templates/file/preview.html +34 -0
- inpanel/templates/index.html +93 -0
- inpanel/utils.py +282 -0
- inpanel/web.py +1811 -0
- inpanel/yum.py +756 -0
- inpanel-1.2.1.dist-info/METADATA +399 -0
- inpanel-1.2.1.dist-info/RECORD +198 -0
- inpanel-1.2.1.dist-info/WHEEL +5 -0
- inpanel-1.2.1.dist-info/entry_points.txt +2 -0
- inpanel-1.2.1.dist-info/licenses/LICENSE +30 -0
- inpanel-1.2.1.dist-info/top_level.txt +1 -0
inpanel/dnf.py
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2020-2026 Jackson Dou
|
|
4
|
+
# All rights reserved.
|
|
5
|
+
#
|
|
6
|
+
# InPanel is distributed under the terms of The New BSD License.
|
|
7
|
+
# The full license can be found in 'LICENSE'.
|
|
8
|
+
|
|
9
|
+
'''Module for DNF(Yellow dog Updater, Modified) Repository Data'''
|
|
10
|
+
|
|
11
|
+
dnf_reporpms = {
|
|
12
|
+
'base': {
|
|
13
|
+
8: {
|
|
14
|
+
'x86_64': [
|
|
15
|
+
'https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/centos-release-8-5.2111.el8.x86_64.rpm',
|
|
16
|
+
'https://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8-5.2111.el8.x86_64.rpm'
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
9: {
|
|
20
|
+
'x86_64': [
|
|
21
|
+
'https://mirrors.aliyun.com/centos/9-stream/BaseOS/x86_64/os/Packages/centos-release-stream-9.0-2.el9.noarch.rpm',
|
|
22
|
+
'https://mirror.centos.org/centos/9-stream/BaseOS/x86_64/os/Packages/centos-release-stream-9.0-2.el9.noarch.rpm'
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
'epel': {
|
|
27
|
+
8: {
|
|
28
|
+
'x86_64': ['https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm']
|
|
29
|
+
},
|
|
30
|
+
9: {
|
|
31
|
+
'x86_64': ['https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm']
|
|
32
|
+
},
|
|
33
|
+
10: {
|
|
34
|
+
'x86_64': ['https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm']
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
'remi': {
|
|
38
|
+
8: {
|
|
39
|
+
'x86_64': ['https://rpms.remirepo.net/enterprise/remi-release-8.rpm']
|
|
40
|
+
},
|
|
41
|
+
9: {
|
|
42
|
+
'x86_64': ['https://rpms.remirepo.net/enterprise/remi-release-9.rpm']
|
|
43
|
+
},
|
|
44
|
+
10: {
|
|
45
|
+
'x86_64': ['https://rpms.remirepo.net/enterprise/remi-release-10.rpm']
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
'powertools': {
|
|
49
|
+
8: {
|
|
50
|
+
'x86_64': []
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
'crb': {
|
|
54
|
+
9: {
|
|
55
|
+
'x86_64': []
|
|
56
|
+
},
|
|
57
|
+
10: {
|
|
58
|
+
'x86_64': []
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
'mariadb': {
|
|
62
|
+
8: {
|
|
63
|
+
'x86_64': ['https://yum.mariadb.org/10.6/centos8-amd64/rpms/MariaDB-release-10.6-1.el8.noarch.rpm']
|
|
64
|
+
},
|
|
65
|
+
9: {
|
|
66
|
+
'x86_64': ['https://yum.mariadb.org/10.6/centos9-amd64/rpms/MariaDB-release-10.6-1.el9.noarch.rpm']
|
|
67
|
+
},
|
|
68
|
+
10: {
|
|
69
|
+
'x86_64': ['https://yum.mariadb.org/10.6/rhel10-amd64/rpms/MariaDB-release-10.6-1.el10.noarch.rpm']
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
'nginx': {
|
|
73
|
+
8: {
|
|
74
|
+
'x86_64': ['http://nginx.org/packages/centos/8/noarch/RPMS/nginx-release-centos-8-0.el8.ngx.noarch.rpm']
|
|
75
|
+
},
|
|
76
|
+
9: {
|
|
77
|
+
'x86_64': ['http://nginx.org/packages/centos/9/noarch/RPMS/nginx-release-centos-9-0.el9.ngx.noarch.rpm']
|
|
78
|
+
},
|
|
79
|
+
10: {
|
|
80
|
+
'x86_64': ['http://nginx.org/packages/centos/10/noarch/RPMS/nginx-release-centos-10-0.el10.ngx.noarch.rpm']
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
'nodejs': {
|
|
84
|
+
8: {
|
|
85
|
+
'x86_64': ['https://rpm.nodesource.com/pub_18.x/el/8/x86_64/nodesource-release-el8-1.noarch.rpm']
|
|
86
|
+
},
|
|
87
|
+
9: {
|
|
88
|
+
'x86_64': ['https://rpm.nodesource.com/pub_18.x/el/9/x86_64/nodesource-release-el9-1.noarch.rpm']
|
|
89
|
+
},
|
|
90
|
+
10: {
|
|
91
|
+
'x86_64': ['https://rpm.nodesource.com/pub_18.x/el/10/x86_64/nodesource-release-el10-1.noarch.rpm']
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
dnf_repoinstallcmds = {
|
|
97
|
+
'ius': 'curl https://setup.ius.io | sh',
|
|
98
|
+
'elastic': 'rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch && echo "[elasticsearch]\\nname=Elasticsearch repository for 8.x packages\\nbaseurl=https://artifacts.elastic.co/packages/8.x/yum\\ngpgcheck=1\\ngpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch\\nenabled=0\\nautorefresh=1\\ntype=rpm-md" > /etc/yum.repos.d/elasticsearch.repo'
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
dnf_repostr = {
|
|
102
|
+
'mariadb': {
|
|
103
|
+
'x86_64': '[mariadb]\n\
|
|
104
|
+
name=MariaDB\n\
|
|
105
|
+
baseurl=http://yum.mariadb.org/10.6/rhel$releasever-amd64\n\
|
|
106
|
+
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB\n\
|
|
107
|
+
gpgcheck=1',
|
|
108
|
+
},
|
|
109
|
+
'nginx-stable': {
|
|
110
|
+
'x86_64': '[nginx-stable]\n\
|
|
111
|
+
name=nginx stable repo\n\
|
|
112
|
+
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/\n\
|
|
113
|
+
gpgcheck=1\n\
|
|
114
|
+
enabled=1\n\
|
|
115
|
+
gpgkey=https://nginx.org/keys/nginx_signing.key\n\
|
|
116
|
+
module_hotfixes=true',
|
|
117
|
+
},
|
|
118
|
+
'nginx-mainline': {
|
|
119
|
+
'x86_64': '[nginx-mainline]\n\
|
|
120
|
+
name=nginx mainline repo\n\
|
|
121
|
+
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/\n\
|
|
122
|
+
gpgcheck=1\n\
|
|
123
|
+
enabled=0\n\
|
|
124
|
+
gpgkey=https://nginx.org/keys/nginx_signing.key\n\
|
|
125
|
+
module_hotfixes=true',
|
|
126
|
+
},
|
|
127
|
+
'zabbix': {
|
|
128
|
+
'x86_64': '[zabbix]\n\
|
|
129
|
+
name=Zabbix Official Repository - $basearch\n\nbaseurl=https://repo.zabbix.com/zabbix/6.4/rhel/$releasever/$basearch/\n\ngpgcheck=1\n\ngpgkey=https://repo.zabbix.com/zabbix-official-repo.key\n\nenabled=1',
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
dnf_pkg_alias = {
|
|
134
|
+
'nginx': ['nginx', 'nginx-stable'],
|
|
135
|
+
'tomcat': ['tomcat'],
|
|
136
|
+
'apache': ['httpd'],
|
|
137
|
+
'lighttpd': ['lighttpd'],
|
|
138
|
+
'vsftpd': ['vsftpd'],
|
|
139
|
+
'mysql': ['mysql-community-server'],
|
|
140
|
+
'mariadb': ['mariadb-server'],
|
|
141
|
+
'redis': ['redis'],
|
|
142
|
+
'memcache': ['memcached'],
|
|
143
|
+
'mongodb': ['mongodb-server'],
|
|
144
|
+
'php': ['php', 'php80', 'php81', 'php82', 'php83'],
|
|
145
|
+
'sendmail': ['sendmail'],
|
|
146
|
+
'ssh': ['openssh-server', 'openssh-clients'],
|
|
147
|
+
'iptables': ['iptables'],
|
|
148
|
+
'cron': ['crond'],
|
|
149
|
+
'ntp': ['chrony'],
|
|
150
|
+
'bind': ['bind'],
|
|
151
|
+
'docker': ['docker-ce'],
|
|
152
|
+
'pureftpd': ['pure-ftpd'],
|
|
153
|
+
'proftpd': ['proftpd'],
|
|
154
|
+
'GeoIP': ['GeoIP'],
|
|
155
|
+
'mono': ['mono-core'],
|
|
156
|
+
'ntfs-3g': ['ntfs-3g'],
|
|
157
|
+
'davfs2': ['davfs2'],
|
|
158
|
+
'nfs': ['nfs-utils'],
|
|
159
|
+
'cifs': ['cifs-utils'],
|
|
160
|
+
'samba': ['samba']
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
dnf_pkg_relatives = {
|
|
164
|
+
'nginx': {
|
|
165
|
+
'nginx': {'default': True, 'base': True},
|
|
166
|
+
'nginx-mod-http-geoip': {'default': False, 'isext': True},
|
|
167
|
+
'nginx-mod-http-image-filter': {'default': False, 'isext': True},
|
|
168
|
+
'nginx-mod-http-perl': {'default': False, 'isext': True},
|
|
169
|
+
'nginx-mod-http-xslt-filter': {'default': False, 'isext': True},
|
|
170
|
+
'nginx-mod-mail': {'default': False, 'isext': True},
|
|
171
|
+
'nginx-mod-stream': {'default': False, 'isext': True},
|
|
172
|
+
'nginx-module-njs': {'default': False, 'isext': True}
|
|
173
|
+
},
|
|
174
|
+
'httpd': {
|
|
175
|
+
'httpd': {'default': True, 'base': True},
|
|
176
|
+
'httpd-devel': {'default': False, 'isext': True},
|
|
177
|
+
'httpd-tools': {'default': False, 'isext': True},
|
|
178
|
+
'mod_ssl': {'default': True, 'isext': True}
|
|
179
|
+
},
|
|
180
|
+
'mariadb-server': {
|
|
181
|
+
'mariadb-server': {'default': True, 'base': True},
|
|
182
|
+
'mariadb': {'default': True, 'base': True},
|
|
183
|
+
'mariadb-common': {'default': True, 'base': True},
|
|
184
|
+
'mariadb-compat': {'default': True, 'base': True}
|
|
185
|
+
},
|
|
186
|
+
'redis': {
|
|
187
|
+
'redis': {'default': True, 'base': True}
|
|
188
|
+
},
|
|
189
|
+
'memcached': {
|
|
190
|
+
'memcached': {'default': True, 'base': True}
|
|
191
|
+
},
|
|
192
|
+
'php': {
|
|
193
|
+
'php': {'default': True, 'base': True},
|
|
194
|
+
'php-cli': {'default': True},
|
|
195
|
+
'php-common': {'default': True, 'base': True},
|
|
196
|
+
'php-fpm': {'default': True},
|
|
197
|
+
'php-gd': {'default': True, 'isext': True},
|
|
198
|
+
'php-mbstring': {'default': True, 'isext': True},
|
|
199
|
+
'php-mysqlnd': {'default': True, 'isext': True},
|
|
200
|
+
'php-pdo': {'default': True},
|
|
201
|
+
'php-soap': {'default': False, 'isext': True},
|
|
202
|
+
'php-xml': {'default': True, 'isext': True},
|
|
203
|
+
'php-zip': {'default': False, 'isext': True},
|
|
204
|
+
'php-devel': {'default': False, 'isext': True}
|
|
205
|
+
},
|
|
206
|
+
'php82': {
|
|
207
|
+
'php82': {'default': True, 'base': True},
|
|
208
|
+
'php82-cli': {'default': True},
|
|
209
|
+
'php82-common': {'default': True, 'base': True},
|
|
210
|
+
'php82-fpm': {'default': True},
|
|
211
|
+
'php82-gd': {'default': True, 'isext': True},
|
|
212
|
+
'php82-mbstring': {'default': True, 'isext': True},
|
|
213
|
+
'php82-mysqlnd': {'default': True, 'isext': True},
|
|
214
|
+
'php82-pdo': {'default': True},
|
|
215
|
+
'php82-soap': {'default': False, 'isext': True},
|
|
216
|
+
'php82-xml': {'default': True, 'isext': True},
|
|
217
|
+
'php82-zip': {'default': False, 'isext': True},
|
|
218
|
+
'php82-devel': {'default': False, 'isext': True}
|
|
219
|
+
},
|
|
220
|
+
'docker-ce': {
|
|
221
|
+
'docker-ce': {'default': True, 'base': True},
|
|
222
|
+
'docker-ce-cli': {'default': True, 'base': True},
|
|
223
|
+
'containerd.io': {'default': True, 'base': True}
|
|
224
|
+
}
|
|
225
|
+
}
|
inpanel/lib/__init__.py
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Adapted from here: https://gist.github.com/489093
|
|
2
|
+
# Original credit goes to pplante and copyright notice pasted below
|
|
3
|
+
|
|
4
|
+
# Copyright (c) 2010, Philip Plante of EndlessPaths.com
|
|
5
|
+
#
|
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
# furnished to do so, subject to the following conditions:
|
|
12
|
+
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
|
14
|
+
# all copies or substantial portions of the Software.
|
|
15
|
+
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
# THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
#
|
|
26
|
+
# from handlers.base import BaseHandler
|
|
27
|
+
#
|
|
28
|
+
# import tornado.web
|
|
29
|
+
# from tornado import gen
|
|
30
|
+
# from async_process import call_subprocess, on_subprocess_result
|
|
31
|
+
#
|
|
32
|
+
# class ShellHandler(BaseHandler):
|
|
33
|
+
# @tornado.gen.coroutine
|
|
34
|
+
# @gen.engine
|
|
35
|
+
# def get(self):
|
|
36
|
+
# self.write("Before sleep<br />")
|
|
37
|
+
# self.flush()
|
|
38
|
+
# response = yield gen.Task(call_subprocess, self, "ls /")
|
|
39
|
+
# self.write("Output is:\n%s" % (response.read(),))
|
|
40
|
+
# self.finish()
|
|
41
|
+
#
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# Modifications Copyright (c) 2012, Hily Jiang of vpsmate.org
|
|
45
|
+
# License remains as above
|
|
46
|
+
#
|
|
47
|
+
# Modify to:
|
|
48
|
+
# * prevent blocking and the zombie process
|
|
49
|
+
# * prevent process handup when command fail to run
|
|
50
|
+
# * add a callbackable decorator
|
|
51
|
+
#
|
|
52
|
+
# We change ioloop.READ event to ioloop.ERROR to make callback
|
|
53
|
+
# invoke after the process end. And it can prevent blocking when the
|
|
54
|
+
# process is running.
|
|
55
|
+
# We make a Popen.wait() at the end to prevent the zombie process.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
import logging
|
|
59
|
+
import shlex
|
|
60
|
+
import subprocess
|
|
61
|
+
import tornado.ioloop
|
|
62
|
+
|
|
63
|
+
__all__ = [
|
|
64
|
+
'call_subprocess',
|
|
65
|
+
'on_subprocess_result'
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
def call_subprocess(context, command, callback=None, shell=False):
|
|
69
|
+
context.ioloop = tornado.ioloop.IOLoop.instance()
|
|
70
|
+
if not shell: command = shlex.split(command)
|
|
71
|
+
try:
|
|
72
|
+
context.pipe = p = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True, shell=shell)
|
|
73
|
+
context.ioloop.add_handler(p.stdout.fileno(), context.async_callback(on_subprocess_result, context, callback), context.ioloop.ERROR)
|
|
74
|
+
except:
|
|
75
|
+
if callback: callback((-1, ''))
|
|
76
|
+
|
|
77
|
+
def on_subprocess_result(context, callback, fd, result):
|
|
78
|
+
try:
|
|
79
|
+
context.pipe.wait()
|
|
80
|
+
if callback:
|
|
81
|
+
callback((context.pipe.returncode, context.pipe.stdout.read()))
|
|
82
|
+
except Exception as e:
|
|
83
|
+
logging.error(e)
|
|
84
|
+
finally:
|
|
85
|
+
context.ioloop.remove_handler(fd)
|
|
86
|
+
|
|
87
|
+
def callbackable(func):
|
|
88
|
+
"""Make a function callbackable.
|
|
89
|
+
"""
|
|
90
|
+
def wrapper(*args, **kwds):
|
|
91
|
+
callback = kwds['callback']
|
|
92
|
+
if callback: del kwds['callback']
|
|
93
|
+
result = func(*args, **kwds)
|
|
94
|
+
if callback:
|
|
95
|
+
return callback(result)
|
|
96
|
+
else:
|
|
97
|
+
return result
|
|
98
|
+
return wrapper
|
inpanel/lib/filelock.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#-*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Code from: http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import time
|
|
7
|
+
import errno
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
class FileLockException(Exception):
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
class FileLock(object):
|
|
14
|
+
""" A file locking mechanism that has context-manager support so
|
|
15
|
+
you can use it in a with statement. This should be relatively cross
|
|
16
|
+
compatible as it doesn't rely on msvcrt or fcntl for the locking.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(self, file_name, timeout=10, delay=.05):
|
|
20
|
+
""" Prepare the file locker. Specify the file to lock and optionally
|
|
21
|
+
the maximum timeout and the delay between each attempt to lock.
|
|
22
|
+
"""
|
|
23
|
+
self.is_locked = False
|
|
24
|
+
self.lockfile = str(Path.cwd() / ("%s.lock" % file_name))
|
|
25
|
+
self.file_name = file_name
|
|
26
|
+
self.timeout = timeout
|
|
27
|
+
self.delay = delay
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def acquire(self):
|
|
31
|
+
""" Acquire the lock, if possible. If the lock is in use, it check again
|
|
32
|
+
every `wait` seconds. It does this until it either gets the lock or
|
|
33
|
+
exceeds `timeout` number of seconds, in which case it throws
|
|
34
|
+
an exception.
|
|
35
|
+
"""
|
|
36
|
+
start_time = time.time()
|
|
37
|
+
while True:
|
|
38
|
+
try:
|
|
39
|
+
self.fd = os.open(self.lockfile, os.O_CREAT|os.O_EXCL|os.O_RDWR)
|
|
40
|
+
break
|
|
41
|
+
except OSError as e:
|
|
42
|
+
if e.errno != errno.EEXIST:
|
|
43
|
+
raise
|
|
44
|
+
if (time.time() - start_time) >= self.timeout:
|
|
45
|
+
raise FileLockException("Timeout occured.")
|
|
46
|
+
time.sleep(self.delay)
|
|
47
|
+
self.is_locked = True
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def release(self):
|
|
51
|
+
""" Get rid of the lock by deleting the lockfile.
|
|
52
|
+
When working in a `with` statement, this gets automatically
|
|
53
|
+
called at the end.
|
|
54
|
+
"""
|
|
55
|
+
if self.is_locked:
|
|
56
|
+
os.close(self.fd)
|
|
57
|
+
os.unlink(self.lockfile)
|
|
58
|
+
self.is_locked = False
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def __enter__(self):
|
|
62
|
+
""" Activated when used in the with statement.
|
|
63
|
+
Should automatically acquire a lock to be used in the with block.
|
|
64
|
+
"""
|
|
65
|
+
if not self.is_locked:
|
|
66
|
+
self.acquire()
|
|
67
|
+
return self
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def __exit__(self, type, value, traceback):
|
|
71
|
+
""" Activated at the end of the with statement.
|
|
72
|
+
It automatically releases the lock if it isn't locked.
|
|
73
|
+
"""
|
|
74
|
+
if self.is_locked:
|
|
75
|
+
self.release()
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def __del__(self):
|
|
79
|
+
""" Make sure that the FileLock instance doesn't leave a lockfile
|
|
80
|
+
lying around.
|
|
81
|
+
"""
|
|
82
|
+
self.release()
|
inpanel/lib/magic.py
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"""
|
|
2
|
+
magic is a wrapper around the libmagic file identification library.
|
|
3
|
+
|
|
4
|
+
See README for more information.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
|
|
8
|
+
>>> import magic
|
|
9
|
+
>>> magic.from_file("testdata/test.pdf")
|
|
10
|
+
'PDF document, version 1.2'
|
|
11
|
+
>>> magic.from_file("testdata/test.pdf", mime=True)
|
|
12
|
+
'application/pdf'
|
|
13
|
+
>>> magic.from_buffer(open("testdata/test.pdf").read(1024))
|
|
14
|
+
'PDF document, version 1.2'
|
|
15
|
+
>>>
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
import ctypes
|
|
21
|
+
import ctypes.util
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
|
|
24
|
+
from ctypes import c_char_p, c_int, c_size_t, c_void_p
|
|
25
|
+
|
|
26
|
+
class MagicException(Exception): pass
|
|
27
|
+
|
|
28
|
+
class Magic:
|
|
29
|
+
"""
|
|
30
|
+
Magic is a wrapper around the libmagic C library.
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def __init__(self, mime=False, magic_file=None, mime_encoding=False):
|
|
35
|
+
"""
|
|
36
|
+
Create a new libmagic wrapper.
|
|
37
|
+
|
|
38
|
+
mime - if True, mimetypes are returned instead of textual descriptions
|
|
39
|
+
mime_encoding - if True, codec is returned
|
|
40
|
+
magic_file - use a mime database other than the system default
|
|
41
|
+
|
|
42
|
+
"""
|
|
43
|
+
flags = MAGIC_NONE
|
|
44
|
+
if mime:
|
|
45
|
+
flags |= MAGIC_MIME
|
|
46
|
+
elif mime_encoding:
|
|
47
|
+
flags |= MAGIC_MIME_ENCODING
|
|
48
|
+
|
|
49
|
+
self.cookie = magic_open(flags)
|
|
50
|
+
|
|
51
|
+
magic_load(self.cookie, magic_file)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def from_buffer(self, buf):
|
|
55
|
+
"""
|
|
56
|
+
Identify the contents of `buf`
|
|
57
|
+
"""
|
|
58
|
+
return magic_buffer(self.cookie, buf)
|
|
59
|
+
|
|
60
|
+
def from_file(self, filename):
|
|
61
|
+
"""
|
|
62
|
+
Identify the contents of file `filename`
|
|
63
|
+
raises IOError if the file does not exist
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
if not Path(filename).exists():
|
|
67
|
+
raise IOError("File does not exist: " + filename)
|
|
68
|
+
|
|
69
|
+
return magic_file(self.cookie, filename)
|
|
70
|
+
|
|
71
|
+
def __del__(self):
|
|
72
|
+
# during shutdown magic_close may have been cleared already
|
|
73
|
+
if self.cookie and magic_close:
|
|
74
|
+
magic_close(self.cookie)
|
|
75
|
+
self.cookie = None
|
|
76
|
+
|
|
77
|
+
_magic_mime = None
|
|
78
|
+
_magic = None
|
|
79
|
+
|
|
80
|
+
def _get_magic_mime():
|
|
81
|
+
global _magic_mime
|
|
82
|
+
if not _magic_mime:
|
|
83
|
+
_magic_mime = Magic(mime=True)
|
|
84
|
+
return _magic_mime
|
|
85
|
+
|
|
86
|
+
def _get_magic():
|
|
87
|
+
global _magic
|
|
88
|
+
if not _magic:
|
|
89
|
+
_magic = Magic()
|
|
90
|
+
return _magic
|
|
91
|
+
|
|
92
|
+
def _get_magic_type(mime):
|
|
93
|
+
if mime:
|
|
94
|
+
return _get_magic_mime()
|
|
95
|
+
else:
|
|
96
|
+
return _get_magic()
|
|
97
|
+
|
|
98
|
+
def from_file(filename, mime=False):
|
|
99
|
+
m = _get_magic_type(mime)
|
|
100
|
+
return m.from_file(filename)
|
|
101
|
+
|
|
102
|
+
def from_buffer(buffer, mime=False):
|
|
103
|
+
m = _get_magic_type(mime)
|
|
104
|
+
return m.from_buffer(buffer)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
libmagic = None
|
|
110
|
+
# Let's try to find magic or magic1
|
|
111
|
+
dll = ctypes.util.find_library('magic') or ctypes.util.find_library('magic1')
|
|
112
|
+
|
|
113
|
+
# This is necessary because find_library returns None if it doesn't find the library
|
|
114
|
+
if dll:
|
|
115
|
+
libmagic = ctypes.CDLL(dll)
|
|
116
|
+
|
|
117
|
+
if not libmagic or not libmagic._name:
|
|
118
|
+
import sys
|
|
119
|
+
platform_to_lib = {'darwin': ['/opt/local/lib/libmagic.dylib',
|
|
120
|
+
'/usr/local/lib/libmagic.dylib',
|
|
121
|
+
'/usr/local/Cellar/libmagic/5.10/lib/libmagic.dylib'],
|
|
122
|
+
'win32': ['magic1.dll']}
|
|
123
|
+
for dll in platform_to_lib.get(sys.platform, []):
|
|
124
|
+
try:
|
|
125
|
+
libmagic = ctypes.CDLL(dll)
|
|
126
|
+
except OSError:
|
|
127
|
+
pass
|
|
128
|
+
|
|
129
|
+
if not libmagic or not libmagic._name:
|
|
130
|
+
# It is better to raise an ImportError since we are importing magic module
|
|
131
|
+
raise ImportError('failed to find libmagic. Check your installation')
|
|
132
|
+
|
|
133
|
+
magic_t = ctypes.c_void_p
|
|
134
|
+
|
|
135
|
+
def errorcheck(result, func, args):
|
|
136
|
+
err = magic_error(args[0])
|
|
137
|
+
if err is not None:
|
|
138
|
+
raise MagicException(err)
|
|
139
|
+
else:
|
|
140
|
+
return result
|
|
141
|
+
|
|
142
|
+
magic_open = libmagic.magic_open
|
|
143
|
+
magic_open.restype = magic_t
|
|
144
|
+
magic_open.argtypes = [c_int]
|
|
145
|
+
|
|
146
|
+
magic_close = libmagic.magic_close
|
|
147
|
+
magic_close.restype = None
|
|
148
|
+
magic_close.argtypes = [magic_t]
|
|
149
|
+
|
|
150
|
+
magic_error = libmagic.magic_error
|
|
151
|
+
magic_error.restype = c_char_p
|
|
152
|
+
magic_error.argtypes = [magic_t]
|
|
153
|
+
|
|
154
|
+
magic_errno = libmagic.magic_errno
|
|
155
|
+
magic_errno.restype = c_int
|
|
156
|
+
magic_errno.argtypes = [magic_t]
|
|
157
|
+
|
|
158
|
+
magic_file = libmagic.magic_file
|
|
159
|
+
magic_file.restype = c_char_p
|
|
160
|
+
magic_file.argtypes = [magic_t, c_char_p]
|
|
161
|
+
magic_file.errcheck = errorcheck
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
_magic_buffer = libmagic.magic_buffer
|
|
165
|
+
_magic_buffer.restype = c_char_p
|
|
166
|
+
_magic_buffer.argtypes = [magic_t, c_void_p, c_size_t]
|
|
167
|
+
_magic_buffer.errcheck = errorcheck
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def magic_buffer(cookie, buf):
|
|
171
|
+
return _magic_buffer(cookie, buf, len(buf))
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
magic_load = libmagic.magic_load
|
|
175
|
+
magic_load.restype = c_int
|
|
176
|
+
magic_load.argtypes = [magic_t, c_char_p]
|
|
177
|
+
magic_load.errcheck = errorcheck
|
|
178
|
+
|
|
179
|
+
magic_setflags = libmagic.magic_setflags
|
|
180
|
+
magic_setflags.restype = c_int
|
|
181
|
+
magic_setflags.argtypes = [magic_t, c_int]
|
|
182
|
+
|
|
183
|
+
magic_check = libmagic.magic_check
|
|
184
|
+
magic_check.restype = c_int
|
|
185
|
+
magic_check.argtypes = [magic_t, c_char_p]
|
|
186
|
+
|
|
187
|
+
magic_compile = libmagic.magic_compile
|
|
188
|
+
magic_compile.restype = c_int
|
|
189
|
+
magic_compile.argtypes = [magic_t, c_char_p]
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
MAGIC_NONE = 0x000000 # No flags
|
|
194
|
+
|
|
195
|
+
MAGIC_DEBUG = 0x000001 # Turn on debugging
|
|
196
|
+
|
|
197
|
+
MAGIC_SYMLINK = 0x000002 # Follow symlinks
|
|
198
|
+
|
|
199
|
+
MAGIC_COMPRESS = 0x000004 # Check inside compressed files
|
|
200
|
+
|
|
201
|
+
MAGIC_DEVICES = 0x000008 # Look at the contents of devices
|
|
202
|
+
|
|
203
|
+
MAGIC_MIME = 0x000010 # Return a mime string
|
|
204
|
+
|
|
205
|
+
MAGIC_MIME_ENCODING = 0x000400 # Return the MIME encoding
|
|
206
|
+
|
|
207
|
+
MAGIC_CONTINUE = 0x000020 # Return all matches
|
|
208
|
+
|
|
209
|
+
MAGIC_CHECK = 0x000040 # Print warnings to stderr
|
|
210
|
+
|
|
211
|
+
MAGIC_PRESERVE_ATIME = 0x000080 # Restore access time on exit
|
|
212
|
+
|
|
213
|
+
MAGIC_RAW = 0x000100 # Don't translate unprintable chars
|
|
214
|
+
|
|
215
|
+
MAGIC_ERROR = 0x000200 # Handle ENOENT etc as real errors
|
|
216
|
+
|
|
217
|
+
MAGIC_NO_CHECK_COMPRESS = 0x001000 # Don't check for compressed files
|
|
218
|
+
|
|
219
|
+
MAGIC_NO_CHECK_TAR = 0x002000 # Don't check for tar files
|
|
220
|
+
|
|
221
|
+
MAGIC_NO_CHECK_SOFT = 0x004000 # Don't check magic entries
|
|
222
|
+
|
|
223
|
+
MAGIC_NO_CHECK_APPTYPE = 0x008000 # Don't check application type
|
|
224
|
+
|
|
225
|
+
MAGIC_NO_CHECK_ELF = 0x010000 # Don't check for elf details
|
|
226
|
+
|
|
227
|
+
MAGIC_NO_CHECK_ASCII = 0x020000 # Don't check for ascii files
|
|
228
|
+
|
|
229
|
+
MAGIC_NO_CHECK_TROFF = 0x040000 # Don't check ascii/troff
|
|
230
|
+
|
|
231
|
+
MAGIC_NO_CHECK_FORTRAN = 0x080000 # Don't check ascii/fortran
|
|
232
|
+
|
|
233
|
+
MAGIC_NO_CHECK_TOKENS = 0x100000 # Don't check ascii/tokens
|