plugin-jm-server 0.1.12__tar.gz → 0.1.13__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugin_jm_server
3
- Version: 0.1.12
3
+ Version: 0.1.13
4
4
  Summary: plugin_jm_server, a plugin for jmcomic that can be used to view comics in a web browser.
5
5
  Home-page: https://github.com/hect0x7/plugin-jm-server
6
6
  Author: hect0x7
@@ -0,0 +1,3 @@
1
+ __version__ = '0.1.13'
2
+
3
+ from .app import *
@@ -20,6 +20,7 @@ class JmServer:
20
20
  def __init__(self,
21
21
  default_path,
22
22
  password,
23
+ ip_whitelist=None,
23
24
  current_path=None,
24
25
  img_overwrite: Optional[dict] = None,
25
26
  **extra,
@@ -49,8 +50,13 @@ class JmServer:
49
50
  self.password = password
50
51
  self.file_manager = FileManager(default_path, current_path)
51
52
  self.extra = extra
53
+ self.ip_whitelist = ip_whitelist
52
54
 
53
55
  def verify(self):
56
+ ip_whitelist = self.ip_whitelist
57
+ if ip_whitelist is not None and request.remote_addr not in ip_whitelist:
58
+ abort(404)
59
+
54
60
  """
55
61
  验证登录状态
56
62
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugin_jm_server
3
- Version: 0.1.12
3
+ Version: 0.1.13
4
4
  Summary: plugin_jm_server, a plugin for jmcomic that can be used to view comics in a web browser.
5
5
  Home-page: https://github.com/hect0x7/plugin-jm-server
6
6
  Author: hect0x7
@@ -1,3 +0,0 @@
1
- __version__ = '0.1.12'
2
-
3
- from .app import *