supernote 0.8.0__tar.gz → 0.9.2__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.
- {supernote-0.8.0 → supernote-0.9.2}/PKG-INFO +1 -1
- {supernote-0.8.0 → supernote-0.9.2}/pyproject.toml +1 -1
- {supernote-0.8.0 → supernote-0.9.2}/supernote/cli/client.py +1 -1
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/config.py +14 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote.egg-info/PKG-INFO +1 -1
- {supernote-0.8.0 → supernote-0.9.2}/LICENSE +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/README.md +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/setup.cfg +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/__init__.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/cli/__init__.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/cli/admin.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/cli/main.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/cli/notebook.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/cli/server.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/__init__.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/admin.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/api_model.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/auth.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/client.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/cloud_client.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/device.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/exceptions.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/hashing.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/login_client.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/schedule.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/client/web.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/__init__.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/auth.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/base.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/equipment.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/file_common.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/file_device.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/file_web.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/schedule.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/summary.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/system.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/models/user.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/notebook/__init__.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/notebook/color.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/notebook/converter.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/notebook/decoder.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/notebook/exceptions.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/notebook/fileformat.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/notebook/manipulator.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/notebook/parser.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/notebook/utils.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/py.typed +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/__init__.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/app.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/constants.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/__init__.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/base.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/models/__init__.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/models/device.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/models/file.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/models/kv.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/models/login_record.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/models/schedule.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/models/user.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/db/session.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/exceptions.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/routes/admin.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/routes/auth.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/routes/decorators.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/routes/file_device.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/routes/file_web.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/routes/oss.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/routes/schedule.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/routes/system.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/services/__init__.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/services/blob.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/services/coordination.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/services/file.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/services/integrity.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/services/schedule.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/services/user.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/services/vfs.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/utils/hashing.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/utils/rate_limit.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/utils/unique_id.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote/server/utils/url_signer.py +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote.egg-info/SOURCES.txt +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote.egg-info/dependency_links.txt +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote.egg-info/entry_points.txt +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote.egg-info/requires.txt +0 -0
- {supernote-0.8.0 → supernote-0.9.2}/supernote.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: supernote
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: All-in-one toolkit for Supernote devices: parse notebooks, self-host services, access services
|
|
5
5
|
Author-email: jya <jya@wizmy.net>, Allen Porter <allen.porter@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -4,7 +4,7 @@ requires = ["setuptools>=77.0"]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "supernote"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.9.2"
|
|
8
8
|
license = "Apache-2.0"
|
|
9
9
|
license-files = ["LICENSE"]
|
|
10
10
|
description = "All-in-one toolkit for Supernote devices: parse notebooks, self-host services, access services"
|
|
@@ -21,7 +21,7 @@ _LOGGER = logging.getLogger(__name__)
|
|
|
21
21
|
def load_cached_auth(url: str | None = None) -> tuple[FileCacheAuth, str]:
|
|
22
22
|
"""Load cached credentials."""
|
|
23
23
|
cache_path = os.path.expanduser("~/.cache/supernote.pkl")
|
|
24
|
-
if not os.path.exists(cache_path):
|
|
24
|
+
if not os.path.exists(cache_path) and not url:
|
|
25
25
|
print(f"Error: No cached credentials found at {cache_path}")
|
|
26
26
|
print("Please run 'supernote cloud-login --url <URL>' first.")
|
|
27
27
|
sys.exit(1)
|
|
@@ -3,6 +3,7 @@ import os
|
|
|
3
3
|
import secrets
|
|
4
4
|
from dataclasses import dataclass, field
|
|
5
5
|
from pathlib import Path
|
|
6
|
+
from typing import cast
|
|
6
7
|
|
|
7
8
|
from mashumaro.config import TO_DICT_ADD_OMIT_NONE_FLAG, BaseConfig
|
|
8
9
|
from mashumaro.mixins.yaml import DataClassYAMLMixin
|
|
@@ -66,8 +67,10 @@ class ServerConfig(DataClassYAMLMixin):
|
|
|
66
67
|
else:
|
|
67
68
|
if config_dir is None:
|
|
68
69
|
config_dir = os.getenv("SUPERNOTE_CONFIG_DIR", "config")
|
|
70
|
+
logger.info(f"Using SUPERNOTE_CONFIG_DIR: {config_dir}")
|
|
69
71
|
config_dir_path = Path(config_dir)
|
|
70
72
|
config_file = config_dir_path / "config.yaml"
|
|
73
|
+
logger.info(f"Using config file: {config_file}")
|
|
71
74
|
|
|
72
75
|
config = cls()
|
|
73
76
|
if config_file.exists():
|
|
@@ -117,6 +120,17 @@ class ServerConfig(DataClassYAMLMixin):
|
|
|
117
120
|
f"Remote Password Reset Enabled: {config.auth.enable_remote_password_reset}"
|
|
118
121
|
)
|
|
119
122
|
|
|
123
|
+
if not config_file.exists():
|
|
124
|
+
# Set default trace log file if not specified
|
|
125
|
+
if config.trace_log_file is None:
|
|
126
|
+
config.trace_log_file = str(
|
|
127
|
+
Path(config.storage_dir) / "system" / "trace.log"
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
logger.info(f"Saving config to {config_file}")
|
|
131
|
+
config_file.parent.mkdir(parents=True, exist_ok=True)
|
|
132
|
+
config_file.write_text(cast(str, config.to_yaml()))
|
|
133
|
+
|
|
120
134
|
return config
|
|
121
135
|
|
|
122
136
|
class Config(BaseConfig):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: supernote
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: All-in-one toolkit for Supernote devices: parse notebooks, self-host services, access services
|
|
5
5
|
Author-email: jya <jya@wizmy.net>, Allen Porter <allen.porter@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|