Starting server and forwarding it to onion works
This commit is contained in:
1
dragonion_server/utils/config/__init__.py
Normal file
1
dragonion_server/utils/config/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import db, models
|
||||
14
dragonion_server/utils/config/db.py
Normal file
14
dragonion_server/utils/config/db.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import sqlitedict
|
||||
|
||||
|
||||
class ConfigDatabase(sqlitedict.SqliteDict):
|
||||
def __init__(self, tablename):
|
||||
super().__init__(
|
||||
filename='data.storage',
|
||||
tablename=tablename,
|
||||
autocommit=True
|
||||
)
|
||||
|
||||
|
||||
config = ConfigDatabase('config')
|
||||
services = ConfigDatabase('services')
|
||||
17
dragonion_server/utils/config/models.py
Normal file
17
dragonion_server/utils/config/models.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class ConfigModel:
|
||||
...
|
||||
|
||||
|
||||
@dataclass
|
||||
class ServiceModel:
|
||||
port: int
|
||||
client_auth_priv_key: str
|
||||
client_auth_pub_key: str
|
||||
|
||||
service_id: str = None
|
||||
key_content: str = 'ED25519-V3'
|
||||
key_type: str = 'NEW'
|
||||
Reference in New Issue
Block a user