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.
Files changed (198) hide show
  1. inpanel/__init__.py +29 -0
  2. inpanel/acme.py +289 -0
  3. inpanel/aliyuncs.py +269 -0
  4. inpanel/app.py +514 -0
  5. inpanel/apt.py +223 -0
  6. inpanel/base.py +200 -0
  7. inpanel/config.py +139 -0
  8. inpanel/data/config.ini +29 -0
  9. inpanel/data/history +5 -0
  10. inpanel/data/runlogs.ini +12 -0
  11. inpanel/data/update_info.ini +4 -0
  12. inpanel/dnf.py +225 -0
  13. inpanel/lib/__init__.py +9 -0
  14. inpanel/lib/async_process.py +98 -0
  15. inpanel/lib/filelock.py +82 -0
  16. inpanel/lib/magic.py +233 -0
  17. inpanel/lib/pxssh.py +310 -0
  18. inpanel/lib/pyDes.py +867 -0
  19. inpanel/mod/__init__.py +0 -0
  20. inpanel/mod/apt.py +316 -0
  21. inpanel/mod/certificate.py +268 -0
  22. inpanel/mod/config.py +372 -0
  23. inpanel/mod/cron.py +315 -0
  24. inpanel/mod/disk.py +322 -0
  25. inpanel/mod/dnf.py +239 -0
  26. inpanel/mod/file.py +722 -0
  27. inpanel/mod/firewall.py +199 -0
  28. inpanel/mod/firewall_base.py +137 -0
  29. inpanel/mod/firewall_firewalld.py +170 -0
  30. inpanel/mod/firewall_iptables.py +176 -0
  31. inpanel/mod/firewall_macos.py +213 -0
  32. inpanel/mod/firewall_ufw.py +128 -0
  33. inpanel/mod/ftp.py +231 -0
  34. inpanel/mod/httpd.py +1205 -0
  35. inpanel/mod/lighttpd.py +26 -0
  36. inpanel/mod/login.py +98 -0
  37. inpanel/mod/mysql.py +577 -0
  38. inpanel/mod/named.py +26 -0
  39. inpanel/mod/nginx.py +2327 -0
  40. inpanel/mod/package.py +33 -0
  41. inpanel/mod/package_apt.py +62 -0
  42. inpanel/mod/package_base.py +77 -0
  43. inpanel/mod/package_dnf.py +62 -0
  44. inpanel/mod/package_map.py +366 -0
  45. inpanel/mod/package_yum.py +64 -0
  46. inpanel/mod/php.py +289 -0
  47. inpanel/mod/process.py +291 -0
  48. inpanel/mod/proftpd.py +26 -0
  49. inpanel/mod/pureftpd.py +26 -0
  50. inpanel/mod/query.py +108 -0
  51. inpanel/mod/server.py +1319 -0
  52. inpanel/mod/service.py +262 -0
  53. inpanel/mod/setting.py +228 -0
  54. inpanel/mod/shell.py +78 -0
  55. inpanel/mod/ssh.py +280 -0
  56. inpanel/mod/system.py +220 -0
  57. inpanel/mod/task.py +1337 -0
  58. inpanel/mod/ufw.py +14 -0
  59. inpanel/mod/user.py +306 -0
  60. inpanel/mod/vsftpd.py +67 -0
  61. inpanel/mod/yum.py +243 -0
  62. inpanel/plugins/__init__.py +10 -0
  63. inpanel/plugins/__pycache__/__init__.cpython-313.pyc +0 -0
  64. inpanel/plugins/acme/static/index.html +10 -0
  65. inpanel/plugins/acme/static/index.js +13 -0
  66. inpanel/plugins/shadowsocks-libev/__pycache__/info.cpython-313.pyc +0 -0
  67. inpanel/plugins/shadowsocks-libev/info.py +73 -0
  68. inpanel/plugins/shadowsocks-libev/static/index.html +70 -0
  69. inpanel/plugins/shadowsocks-libev/static/index.js +18 -0
  70. inpanel/public/css/global.css +138 -0
  71. inpanel/public/favicon.ico +0 -0
  72. inpanel/public/images/alipay.jpg +0 -0
  73. inpanel/public/images/loading.gif +0 -0
  74. inpanel/public/images/weixin.jpg +0 -0
  75. inpanel/public/index.html +94 -0
  76. inpanel/public/js/controllers/controllers.js +566 -0
  77. inpanel/public/js/controllers/database.js +590 -0
  78. inpanel/public/js/controllers/ecs.js +624 -0
  79. inpanel/public/js/controllers/file.js +940 -0
  80. inpanel/public/js/controllers/plugins.js +105 -0
  81. inpanel/public/js/controllers/service.js +1460 -0
  82. inpanel/public/js/controllers/site.js +1241 -0
  83. inpanel/public/js/controllers/utils.js +2319 -0
  84. inpanel/public/js/core.js +221 -0
  85. inpanel/public/js/directives.js +784 -0
  86. inpanel/public/js/filters.js +395 -0
  87. inpanel/public/js/services.js +257 -0
  88. inpanel/public/lib/angular/1.0.2/angular-resource.min.js +10 -0
  89. inpanel/public/lib/angular/1.0.2/angular.min.js +158 -0
  90. inpanel/public/lib/bootstrap/css/bootstrap-theme.css +587 -0
  91. inpanel/public/lib/bootstrap/css/bootstrap-theme.css.map +1 -0
  92. inpanel/public/lib/bootstrap/css/bootstrap-theme.min.css +6 -0
  93. inpanel/public/lib/bootstrap/css/bootstrap-theme.min.css.map +1 -0
  94. inpanel/public/lib/bootstrap/css/bootstrap.css +6757 -0
  95. inpanel/public/lib/bootstrap/css/bootstrap.css.map +1 -0
  96. inpanel/public/lib/bootstrap/css/bootstrap.min.css +6 -0
  97. inpanel/public/lib/bootstrap/css/bootstrap.min.css.map +1 -0
  98. inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
  99. inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
  100. inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
  101. inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
  102. inpanel/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
  103. inpanel/public/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
  104. inpanel/public/lib/bootstrap/img/glyphicons-halflings.png +0 -0
  105. inpanel/public/lib/bootstrap/js/bootstrap.js +2377 -0
  106. inpanel/public/lib/bootstrap/js/bootstrap.min.js +7 -0
  107. inpanel/public/lib/bootstrap/js/npm.js +13 -0
  108. inpanel/public/lib/codemirror/codemirror-compressed.js +1 -0
  109. inpanel/public/lib/codemirror/codemirror.css +173 -0
  110. inpanel/public/lib/jquery/jquery-1.12.4.min.js +5 -0
  111. inpanel/public/lib/md5/md5.js +379 -0
  112. inpanel/public/lib/md5/md5.min.js +1 -0
  113. inpanel/public/partials/database/index.html +172 -0
  114. inpanel/public/partials/database/mysql/dbedit.html +462 -0
  115. inpanel/public/partials/database/mysql/dbnew.html +348 -0
  116. inpanel/public/partials/database/mysql/useredit.html +310 -0
  117. inpanel/public/partials/database/mysql/usernew.html +97 -0
  118. inpanel/public/partials/directives/message.html +20 -0
  119. inpanel/public/partials/directives/navbar.html +25 -0
  120. inpanel/public/partials/directives/selector.html +57 -0
  121. inpanel/public/partials/directives/srvbase.html +72 -0
  122. inpanel/public/partials/directives/srvext.html +34 -0
  123. inpanel/public/partials/directives/srvfile.html +23 -0
  124. inpanel/public/partials/directives/srvinstall.html +34 -0
  125. inpanel/public/partials/directives/srvlog.html +23 -0
  126. inpanel/public/partials/directives/srvminiop.html +28 -0
  127. inpanel/public/partials/directives/srvuninstall.html +38 -0
  128. inpanel/public/partials/directives/srvupdate.html +30 -0
  129. inpanel/public/partials/ecs/account.html +156 -0
  130. inpanel/public/partials/ecs/ecs.html +198 -0
  131. inpanel/public/partials/ecs/index.html +40 -0
  132. inpanel/public/partials/ecs/setings.html +459 -0
  133. inpanel/public/partials/file/file.html +501 -0
  134. inpanel/public/partials/file/trash.html +95 -0
  135. inpanel/public/partials/ftp.html +36 -0
  136. inpanel/public/partials/log.html +83 -0
  137. inpanel/public/partials/login.html +79 -0
  138. inpanel/public/partials/logout.html +22 -0
  139. inpanel/public/partials/main.html +534 -0
  140. inpanel/public/partials/plugins/index.html +55 -0
  141. inpanel/public/partials/plugins/plugins.html +13 -0
  142. inpanel/public/partials/secure.html +13 -0
  143. inpanel/public/partials/service/apache.html +147 -0
  144. inpanel/public/partials/service/cron.html +71 -0
  145. inpanel/public/partials/service/index.html +293 -0
  146. inpanel/public/partials/service/iptables.html +40 -0
  147. inpanel/public/partials/service/lighttpd.html +63 -0
  148. inpanel/public/partials/service/mariadb.html +113 -0
  149. inpanel/public/partials/service/memcache.html +36 -0
  150. inpanel/public/partials/service/minio.html +44 -0
  151. inpanel/public/partials/service/mongodb.html +44 -0
  152. inpanel/public/partials/service/mysql.html +113 -0
  153. inpanel/public/partials/service/named.html +61 -0
  154. inpanel/public/partials/service/nginx.html +296 -0
  155. inpanel/public/partials/service/ntp.html +40 -0
  156. inpanel/public/partials/service/php.html +250 -0
  157. inpanel/public/partials/service/proftpd.html +59 -0
  158. inpanel/public/partials/service/pureftpd.html +59 -0
  159. inpanel/public/partials/service/redis.html +40 -0
  160. inpanel/public/partials/service/samba.html +58 -0
  161. inpanel/public/partials/service/sendmail.html +40 -0
  162. inpanel/public/partials/service/ssh.html +186 -0
  163. inpanel/public/partials/service/tomcat.html +65 -0
  164. inpanel/public/partials/service/vsftpd.html +195 -0
  165. inpanel/public/partials/setting.html +299 -0
  166. inpanel/public/partials/site/apache/site.html +277 -0
  167. inpanel/public/partials/site/index.html +344 -0
  168. inpanel/public/partials/site/nginx/site.html +558 -0
  169. inpanel/public/partials/sorry.html +19 -0
  170. inpanel/public/partials/storage/autofm.html +103 -0
  171. inpanel/public/partials/storage/backup.html +42 -0
  172. inpanel/public/partials/storage/index.html +360 -0
  173. inpanel/public/partials/storage/migrate.html +93 -0
  174. inpanel/public/partials/storage/movedata.html +98 -0
  175. inpanel/public/partials/storage/remote.html +77 -0
  176. inpanel/public/partials/utils/cron.html +486 -0
  177. inpanel/public/partials/utils/firewall.html +266 -0
  178. inpanel/public/partials/utils/index.html +193 -0
  179. inpanel/public/partials/utils/network.html +118 -0
  180. inpanel/public/partials/utils/process.html +239 -0
  181. inpanel/public/partials/utils/repository.html +373 -0
  182. inpanel/public/partials/utils/shell.html +28 -0
  183. inpanel/public/partials/utils/ssl.html +319 -0
  184. inpanel/public/partials/utils/time.html +109 -0
  185. inpanel/public/partials/utils/user.html +359 -0
  186. inpanel/public/robots.txt +2 -0
  187. inpanel/remote.py +109 -0
  188. inpanel/templates/file/preview.html +34 -0
  189. inpanel/templates/index.html +93 -0
  190. inpanel/utils.py +282 -0
  191. inpanel/web.py +1811 -0
  192. inpanel/yum.py +756 -0
  193. inpanel-1.2.1.dist-info/METADATA +399 -0
  194. inpanel-1.2.1.dist-info/RECORD +198 -0
  195. inpanel-1.2.1.dist-info/WHEEL +5 -0
  196. inpanel-1.2.1.dist-info/entry_points.txt +2 -0
  197. inpanel-1.2.1.dist-info/licenses/LICENSE +30 -0
  198. inpanel-1.2.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,221 @@
1
+ // var releasetime = '2020-12-03 23:00:00 GMT+0800';
2
+ var _v = new Date(releasetime).getTime() / 1000;
3
+ //if (1) _v += Math.random(); // ie test mode
4
+ var inpanel = angular.module('inpanel', ['inpanel.services', 'inpanel.directives', 'inpanel.filters']);
5
+ inpanel.config(['$routeProvider', function ($routeProvider) {
6
+ var _r = function (t, c, a) {
7
+ var r = {
8
+ templateUrl: template_path + '/partials/' + t + '.html?_v=' + _v,
9
+ controller: c,
10
+ reloadOnSearch: false
11
+ };
12
+ if (!a) r.resolve = Auth;
13
+ return r;
14
+ };
15
+ $routeProvider.
16
+ when('/login', _r('login', LoginCtrl, true)).
17
+ when('/', _r('main', MainCtrl)).
18
+ when('/service/nginx', _r('service/nginx', ServiceNginxCtrl)).
19
+ when('/service/apache', _r('service/apache', ServiceApacheCtrl)).
20
+ when('/service/lighttpd', _r('service/lighttpd', ServiceLighttpdCtrl)).
21
+ when('/service/tomcat', _r('service/tomcat', ServiceTomcatCtrl)).
22
+ when('/service/vsftpd', _r('service/vsftpd', ServiceVsftpdCtrl)).
23
+ when('/service/proftpd', _r('service/proftpd', ServiceProFTPDCtrl)).
24
+ when('/service/pureftpd', _r('service/pureftpd', ServicePureFTPdCtrl)).
25
+ when('/service/mysql', _r('service/mysql', ServiceMySQLCtrl)).
26
+ when('/service/mariadb', _r('service/mariadb', ServiceMariaDBCtrl)).
27
+ when('/service/redis', _r('service/redis', ServiceRedisCtrl)).
28
+ when('/service/memcache', _r('service/memcache', ServiceMemcacheCtrl)).
29
+ when('/service/mongodb', _r('service/mongodb', ServiceMongoDBCtrl)).
30
+ when('/service/minio', _r('service/minio', ServiceMinIOCtrl)).
31
+ when('/service/php', _r('service/php', ServicePHPCtrl)).
32
+ when('/service/sendmail', _r('service/sendmail', ServiceSendmailCtrl)).
33
+ when('/service/ssh', _r('service/ssh', ServiceSSHCtrl)).
34
+ when('/service/iptables', _r('service/iptables', ServiceIPTablesCtrl)).
35
+ when('/service/cron', _r('service/cron', ServiceCronCtrl)).
36
+ when('/service/ntp', _r('service/ntp', ServiceNTPCtrl)).
37
+ when('/service/named', _r('service/named', ServiceNamedCtrl)).
38
+ when('/service/samba', _r('service/samba', ServiceSambaCtrl)).
39
+ when('/service', _r('service/index', ServiceCtrl)).
40
+ when('/file', _r('file/file', FileCtrl)).
41
+ when('/file/go#(:path)', _r('file/file', FileCtrl)).
42
+ when('/file/trash', _r('file/trash', FileTrashCtrl)).
43
+ when('/site', _r('site/index', SiteCtrl)).
44
+ when('/site/nginx/:section', _r('site/nginx/site', SiteNginxCtrl)).
45
+ when('/site/apache/:section', _r('site/apache/site', SiteApacheCtrl)).
46
+ when('/database', _r('database/index', DatabaseCtrl)).
47
+ when('/database/mysql/db/new', _r('database/mysql/dbnew', DatabaseMySQLNewDBCtrl)).
48
+ when('/database/mysql/db/edit/:section', _r('database/mysql/dbedit', DatabaseMySQLEditDBCtrl)).
49
+ when('/database/mysql/user/new', _r('database/mysql/usernew', DatabaseMySQLNewUserCtrl)).
50
+ when('/database/mysql/user/edit/:section', _r('database/mysql/useredit', DatabaseMySQLEditUserCtrl)).
51
+ when('/ftp', _r('ftp', FtpCtrl)).
52
+ when('/utils', _r('utils/index', UtilsCtrl)).
53
+ when('/utils/user', _r('utils/user', UtilsUserCtrl)).
54
+ when('/utils/process', _r('utils/process', UtilsProcessCtrl)).
55
+ when('/utils/network', _r('utils/network', UtilsNetworkCtrl)).
56
+ when('/utils/time', _r('utils/time', UtilsTimeCtrl)).
57
+ when('/utils/cron', _r('utils/cron', UtilsCronCtrl)).
58
+ when('/utils/ssl', _r('utils/ssl', UtilsSSLCtrl)).
59
+ when('/utils/repository', _r('utils/repository', UtilsRepositoryCtrl)).
60
+ when('/utils/shell', _r('utils/shell', UtilsShellCtrl)).
61
+ when('/utils/firewall', _r('utils/firewall', UtilsFirewallCtrl)).
62
+ when('/storage', _r('storage/index', StorageCtrl)).
63
+ when('/storage/remote/:section', _r('storage/remote', StorageRemoteCtrl)).
64
+ when('/storage/autofm', _r('storage/autofm', StorageAutoFMCtrl)).
65
+ when('/storage/movedata', _r('storage/movedata', StorageMoveDataCtrl)).
66
+ when('/storage/backup', _r('storage/backup', BackupCtrl)).
67
+ when('/storage/migrate', _r('storage/migrate', UtilsMigrateCtrl)).
68
+ when('/ecs', _r('ecs/ecs', ECSCtrl)).
69
+ when('/ecs/index', _r('ecs/index', ECSIndexCtrl)).
70
+ when('/ecs/account', _r('ecs/account', ECSAccountCtrl)).
71
+ when('/ecs/:section', _r('ecs/setting', ECSSettingCtrl)).
72
+ when('/setting', _r('setting', SettingCtrl)).
73
+ when('/secure', _r('secure', SecureCtrl)).
74
+ when('/plugins', _r('plugins/index', PluginsHome)).
75
+ when('/plugins/:section', _r('plugins/plugins', PluginsCtrl)).
76
+ when('/log', _r('log', LogCtrl)).
77
+ when('/logout', _r('logout', LogoutCtrl)).
78
+ when('/sorry', _r('sorry', SorryCtrl)).
79
+ otherwise({
80
+ redirectTo: '/sorry'
81
+ });
82
+ }]);
83
+ inpanel.run(['$rootScope', '$location', 'Request', function ($rootScope, $location, Request) {
84
+ $rootScope.sec = function (sec) {
85
+ $location.search('s', sec)
86
+ };
87
+
88
+ $rootScope.virt = '?';
89
+ $rootScope.checkVirt = function (callback) {
90
+ if ($rootScope.virt != '?') return;
91
+ Request.get('/api/query/server.virt', function (data) {
92
+ $rootScope.virt = data['server.virt'];
93
+ if (callback) callback.call();
94
+ });
95
+ };
96
+
97
+ // store some global data
98
+ $rootScope.$mysql = {
99
+ 'password': '',
100
+ 'password_validated': false
101
+ };
102
+
103
+ $rootScope.$ecs = {
104
+ 'access_key_id': '',
105
+ 'page_size': 10,
106
+ 'page_number': 1
107
+ };
108
+ $rootScope.$proxyroot = location_path;
109
+ }]);
110
+ // inpanel.value('version', {
111
+ // 'version': '1.1.27',
112
+ // 'releasetime': releasetime,
113
+ // 'changelog': 'http://inpanel.org/changelog.html'
114
+ // });
115
+
116
+ var Auth = {
117
+ // auth should be done before enter the module
118
+ auth: function ($q, $location, Auth, Message) {
119
+ var deferred = $q.defer();
120
+ Message.setInfo('正在加载,请稍候...', true);
121
+ Auth.required(function (authed) {
122
+ Message.setInfo(false);
123
+ if (authed) deferred.resolve();
124
+ }, function (status) {
125
+ if (status == 403) {
126
+ Message.setError('身份认证失败,请<a href="#/login">重新登录</a>!');
127
+ $location.path('/login');
128
+ } else {
129
+ Message.setError('对不起,加载失败!(网络异常或服务器故障)');
130
+ }
131
+ });
132
+ return deferred.promise;
133
+ },
134
+ // auth status would expired in 30 mins if no any client action
135
+ // we should active it every 5 mins if client is still active
136
+ auto_auth: function ($rootScope, $location, Auth, Timeout) {
137
+ if (!$rootScope._auth_check_inited) {
138
+ $rootScope._auth_check_inited = true;
139
+ // auto update auth if client active in the pass 5 mins
140
+ // and if no active in the pass 25 mins, a dialog will come out to confirm
141
+ var check_timeout = 300 * 1000;
142
+ var auth_timeout = 2500 * 1000;
143
+ var last_active = new Date().getTime();
144
+
145
+ $(document).mousemove(function () {
146
+ last_active = new Date().getTime();
147
+ });
148
+ $(document).keydown(function () {
149
+ last_active = new Date().getTime();
150
+ });
151
+
152
+ var active = (function () {
153
+ var stop_check = false;
154
+ var now = new Date().getTime();
155
+ if (now - last_active < check_timeout) {
156
+ Auth.required();
157
+ } else if (now - last_active > auth_timeout) {
158
+ // check if the cookie ready to expiring
159
+ stop_check = true;
160
+ Auth.getlastactive(function (lastactive) {
161
+ lastactive = parseInt(lastactive) * 1000;
162
+ if (now - lastactive > auth_timeout) {
163
+ // blink the title
164
+ var oldHtmlTitle = $rootScope.htmlTitle;
165
+ var blinks = ['登录超时', '!!!!!!!!'];
166
+ var blink_i = 0;
167
+ var stop_blink = false;
168
+ var toggletitle = function () {
169
+ if (!stop_blink) {
170
+ $rootScope.htmlTitle = blinks[(blink_i++) % 2];
171
+ Timeout(toggletitle, 1000, false, true, '_authtimeout_title');
172
+ } else {
173
+ $rootScope.htmlTitle = oldHtmlTitle;
174
+ }
175
+ };
176
+ toggletitle();
177
+ $rootScope._authrenew = function () {
178
+ last_active = new Date().getTime();
179
+ stop_blink = true;
180
+ Auth.required();
181
+ Timeout(active, check_timeout, false, true, '_authtimeout');
182
+ };
183
+ $('#_authconfirm').modal();
184
+ } else {
185
+ last_active = lastactive;
186
+ Timeout(active, check_timeout, false, true, '_authtimeout');
187
+ }
188
+ });
189
+ }
190
+ if (!stop_check && $location.path() != '/')
191
+ Timeout(active, check_timeout, false, true, '_authtimeout');
192
+ });
193
+ Timeout(active, check_timeout, false, true, '_authtimeout');
194
+ }
195
+ }
196
+ };
197
+ Auth.auth.$inject = ['$q', '$location', 'Auth', 'Message'];
198
+ Auth.auto_auth.$inject = ['$rootScope', '$location', 'Auth', 'Timeout'];
199
+
200
+ var getCookie = function (name) {
201
+ var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
202
+ return r ? r[1] : undefined;
203
+ };
204
+ var set_cookie = function (name, value) {
205
+ var Days = 30;
206
+ var exp = new Date();
207
+ exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
208
+ document.cookie = name + '=' + encodeURIComponent(value) + ';expires=' + exp.toGMTString();
209
+ }
210
+ var get_cookie = function(name) {
211
+ var arr, reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)');
212
+ return (arr = document.cookie.match(reg)) ? decodeURIComponent(arr[2]) : null;
213
+ }
214
+ var del_cookie = function (name) {
215
+ var exp = new Date();
216
+ exp.setTime(exp.getTime() - 1);
217
+ var cval = get_cookie(name);
218
+ if (cval != null) {
219
+ document.cookie= name + "="+cval+";expires="+exp.toGMTString();
220
+ }
221
+ }