diff --git a/src/dashboard.py b/src/dashboard.py index e5d8e2b3..740594c5 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1663,5 +1663,4 @@ def startThreads(): if __name__ == "__main__": startThreads() DashboardPlugins.startThreads() - # app.logger.addHandler(logging.StreamHandler()) app.run(host=app_ip, debug=False, port=app_port) \ No newline at end of file diff --git a/src/gunicorn.conf.py b/src/gunicorn.conf.py index 8d226842..1385a2ee 100644 --- a/src/gunicorn.conf.py +++ b/src/gunicorn.conf.py @@ -10,7 +10,7 @@ def post_worker_init(worker): worker_class = 'gthread' workers = 1 -threads = 1 +threads = 2 bind = f"{app_host}:{app_port}" daemon = True pidfile = './gunicorn.pid' diff --git a/src/modules/WireguardConfiguration.py b/src/modules/WireguardConfiguration.py index 76da5f70..9106abbc 100644 --- a/src/modules/WireguardConfiguration.py +++ b/src/modules/WireguardConfiguration.py @@ -12,7 +12,6 @@ from flask import current_app from .ConnectionString import ConnectionString from .DashboardConfig import DashboardConfig -from .DashboardWebHooks import DashboardWebHooks from .Peer import Peer from .PeerJobs import PeerJobs from .PeerShareLinks import PeerShareLinks @@ -44,12 +43,10 @@ class WireguardConfiguration: self.__parser: configparser.ConfigParser = configparser.RawConfigParser(strict=False) self.__parser.optionxform = str self.__configFileModifiedTime = None - self.Status: bool = False self.Name: str = "" self.PrivateKey: str = "" self.PublicKey: str = "" - self.ListenPort: str = "" self.Address: str = "" self.DNS: str = "" @@ -67,7 +64,7 @@ class WireguardConfiguration: self.AllPeerShareLinks = AllPeerShareLinks self.DashboardWebHooks = DashboardWebHooks self.configPath = os.path.join(self.__getProtocolPath(), f'{self.Name}.conf') - self.engine: sqlalchemy.engine = sqlalchemy.create_engine(ConnectionString("wgdashboard")) + self.engine: sqlalchemy.Engine = sqlalchemy.create_engine(ConnectionString("wgdashboard")) self.metadata: sqlalchemy.MetaData = sqlalchemy.MetaData() self.dbType = self.DashboardConfig.GetConfig("Database", "type")[1] @@ -145,9 +142,10 @@ class WireguardConfiguration: self.addAutostart() - def __getProtocolPath(self): - return self.DashboardConfig.GetConfig("Server", "wg_conf_path")[1] if self.Protocol == "wg" \ - else self.DashboardConfig.GetConfig("Server", "awg_conf_path")[1] + def __getProtocolPath(self) -> str: + _, path = self.DashboardConfig.GetConfig("Server", "wg_conf_path") if self.Protocol == "wg" \ + else self.DashboardConfig.GetConfig("Server", "awg_conf_path") + return path def __initPeersList(self): self.Peers: list[Peer] = []