diff --git a/CONFIG_README.md b/CONFIG_README.md index 261e7db..2dd9896 100644 --- a/CONFIG_README.md +++ b/CONFIG_README.md @@ -18,10 +18,10 @@ Create a `config.json` file with the following structure: ```json { "app_name": "WebDrop Bridge", - "webapp_url": "https://wps.agravity.io/", + "webapp_url": "https://dev.agravity.io/", "url_mappings": [ { - "url_prefix": "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/", + "url_prefix": "https://devagravitystg.file.core.windows.net/devagravitysync/", "local_path": "Z:" } ], @@ -45,7 +45,7 @@ Create a `config.json` file with the following structure: ### Core Settings - **`webapp_url`** (string): URL of the web application to load - - Example: `"https://wps.agravity.io/"` + - Example: `"https://dev.agravity.io/"` - Supports `http://`, `https://`, or `file:///` URLs - **`url_mappings`** (array): Azure Blob Storage URL to local path mappings @@ -55,7 +55,7 @@ Create a `config.json` file with the following structure: - Example: ```json { - "url_prefix": "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/", + "url_prefix": "https://dev.file.core.windows.net/devagravitysync/", "local_path": "Z:" } ``` @@ -68,7 +68,7 @@ Create a `config.json` file with the following structure: When the web application provides a drag URL like: ``` -https://wpsagravitystg.file.core.windows.net/wpsagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/Hintergrund_Agravity.png +https://devagravitystg.file.core.windows.net/devagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/Hintergrund_Agravity.png ``` It will be converted to: @@ -84,7 +84,7 @@ Z:\aN5PysnXIuRECzcRbvHkjL7g0\Hintergrund_Agravity.png - **`allowed_urls`** (array): Allowed URL patterns for web content - Empty array = no restriction - - Example: `["wps.agravity.io", "*.example.com"]` + - Example: `["dev.agravity.io", "*.example.com"]` ### Update Settings @@ -148,7 +148,7 @@ If no JSON config exists, WebDrop Bridge will load from `.env`: ```env APP_NAME=WebDrop Bridge -WEBAPP_URL=https://wps.agravity.io/ +WEBAPP_URL=https://dev.agravity.io/ ALLOWED_ROOTS=Z:/ LOG_LEVEL=INFO WINDOW_WIDTH=1024 @@ -175,14 +175,14 @@ WINDOW_HEIGHT=768 ## Example Configurations -### Production (Agravity WPS) +### Production (Agravity DEV) ```json { - "webapp_url": "https://wps.agravity.io/", + "webapp_url": "https://dev.agravity.io/", "url_mappings": [ { - "url_prefix": "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/", + "url_prefix": "https://devagravitystg.file.core.windows.net/devagravitysync/", "local_path": "Z:" } ], diff --git a/config.example.json b/config.example.json index 8da1b1b..c58a29c 100644 --- a/config.example.json +++ b/config.example.json @@ -1,9 +1,9 @@ { "app_name": "WebDrop Bridge", - "webapp_url": "https://wps.agravity.io/", + "webapp_url": "https://dev.agravity.io/", "url_mappings": [ { - "url_prefix": "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/", + "url_prefix": "https://devagravitystg.file.core.windows.net/devagravitysync/", "local_path": "Z:" } ], diff --git a/src/webdrop_bridge/config.py b/src/webdrop_bridge/config.py index 667bd04..c246417 100644 --- a/src/webdrop_bridge/config.py +++ b/src/webdrop_bridge/config.py @@ -49,7 +49,7 @@ class Config: log_file: Optional log file path allowed_roots: List of whitelisted root directories for file access allowed_urls: List of whitelisted URL domains/patterns (empty = no restriction) - webapp_url: URL to load in embedded web application (default: https://wps.agravity.io/) + webapp_url: URL to load in embedded web application (default: https://dev.agravity.io/) url_mappings: List of Azure URL to local path mappings check_file_exists: Whether to validate that files exist before drag auto_check_updates: Whether to automatically check for updates @@ -139,7 +139,7 @@ class Config: log_file=log_file, allowed_roots=allowed_roots, allowed_urls=data.get("allowed_urls", []), - webapp_url=data.get("webapp_url", "https://wps.agravity.io/"), + webapp_url=data.get("webapp_url", "https://dev.agravity.io/"), url_mappings=mappings, check_file_exists=data.get("check_file_exists", True), auto_check_updates=data.get("auto_check_updates", True), @@ -181,7 +181,7 @@ class Config: log_file_str = os.getenv("LOG_FILE", "logs/webdrop_bridge.log") allowed_roots_str = os.getenv("ALLOWED_ROOTS", "Z:/,C:/Users/Public") allowed_urls_str = os.getenv("ALLOWED_URLS", "") - webapp_url = os.getenv("WEBAPP_URL", "https://wps.agravity.io/") + webapp_url = os.getenv("WEBAPP_URL", "https://dev.agravity.io/") window_width = int(os.getenv("WINDOW_WIDTH", "1024")) window_height = int(os.getenv("WINDOW_HEIGHT", "768")) # Window title defaults to app_name + version if not specified diff --git a/src/webdrop_bridge/core/url_converter.py b/src/webdrop_bridge/core/url_converter.py index 4841dfe..05b127f 100644 --- a/src/webdrop_bridge/core/url_converter.py +++ b/src/webdrop_bridge/core/url_converter.py @@ -32,7 +32,7 @@ class URLConverter: Example: >>> converter.convert_url_to_path( - ... "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/file.png" + ... "https://devagravitystg.file.core.windows.net/devagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/file.png" ... ) Path("Z:/aN5PysnXIuRECzcRbvHkjL7g0/file.png") """ diff --git a/tests/unit/test_drag_interceptor.py b/tests/unit/test_drag_interceptor.py index eaa5ce4..74b262e 100644 --- a/tests/unit/test_drag_interceptor.py +++ b/tests/unit/test_drag_interceptor.py @@ -19,7 +19,7 @@ def test_config(tmp_path): log_file=None, allowed_roots=[tmp_path], allowed_urls=[], - webapp_url="https://wps.agravity.io/", + webapp_url="https://dev.agravity.io/", url_mappings=[], check_file_exists=True, ) @@ -135,7 +135,7 @@ class TestDragInterceptorAzureURL: webapp_url="https://test.com/", url_mappings=[ URLMapping( - url_prefix="https://wpsagravitystg.file.core.windows.net/wpsagravitysync/", + url_prefix="https://devagravitystg.file.core.windows.net/devagravitysync/", local_path=str(tmp_path) ) ], @@ -144,7 +144,7 @@ class TestDragInterceptorAzureURL: interceptor = DragInterceptor(config) # Azure URL - azure_url = "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/test.png" + azure_url = "https://devagravitystg.file.core.windows.net/devagravitysync/test.png" # Mock the drag operation with patch("webdrop_bridge.core.drag_interceptor.QDrag") as mock_drag: diff --git a/tests/unit/test_url_converter.py b/tests/unit/test_url_converter.py index 60ab58f..1f2a7a3 100644 --- a/tests/unit/test_url_converter.py +++ b/tests/unit/test_url_converter.py @@ -18,10 +18,10 @@ def test_config(): log_file=None, allowed_roots=[], allowed_urls=[], - webapp_url="https://wps.agravity.io/", + webapp_url="https://dev.agravity.io/", url_mappings=[ URLMapping( - url_prefix="https://wpsagravitystg.file.core.windows.net/wpsagravitysync/", + url_prefix="https://devagravitystg.file.core.windows.net/devagravitysync/", local_path="Z:" ), URLMapping( @@ -40,7 +40,7 @@ def converter(test_config): def test_convert_simple_url(converter): """Test converting a simple Azure URL to local path.""" - url = "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/test/file.png" + url = "https://devagravitystg.file.core.windows.net/devagravitysync/test/file.png" result = converter.convert_url_to_path(url) assert result is not None @@ -49,7 +49,7 @@ def test_convert_simple_url(converter): def test_convert_url_with_special_characters(converter): """Test URL with special characters (URL encoded).""" - url = "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/folder/file%20with%20spaces.png" + url = "https://devagravitystg.file.core.windows.net/devagravitysync/folder/file%20with%20spaces.png" result = converter.convert_url_to_path(url) assert result is not None @@ -58,7 +58,7 @@ def test_convert_url_with_special_characters(converter): def test_convert_url_with_subdirectories(converter): """Test URL with deep directory structure.""" - url = "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/subfolder/file.png" + url = "https://devagravitystg.file.core.windows.net/devagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/subfolder/file.png" result = converter.convert_url_to_path(url) assert result is not None @@ -88,7 +88,7 @@ def test_convert_none_url(converter): def test_is_azure_url_positive(converter): """Test recognizing valid Azure URLs.""" - url = "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/file.png" + url = "https://devagravitystg.file.core.windows.net/devagravitysync/file.png" assert converter.is_azure_url(url) is True @@ -101,7 +101,7 @@ def test_is_azure_url_negative(converter): def test_multiple_mappings(converter): """Test that correct mapping is used for URL.""" - url1 = "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/file.png" + url1 = "https://devagravitystg.file.core.windows.net/devagravitysync/file.png" url2 = "https://other.blob.core.windows.net/container/file.png" result1 = converter.convert_url_to_path(url1) @@ -133,7 +133,7 @@ def test_url_mapping_adds_trailing_slash(): def test_convert_url_example_from_docs(converter): """Test the exact example from documentation.""" - url = "https://wpsagravitystg.file.core.windows.net/wpsagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/Hintergrund_Agravity.png" + url = "https://devagravitystg.file.core.windows.net/devagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/Hintergrund_Agravity.png" result = converter.convert_url_to_path(url) assert result is not None diff --git a/webapp/index.html b/webapp/index.html index b675dc3..15bbd3a 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -175,13 +175,13 @@
☁️

Azure Blob Storage Image

-

https://wpsagravitystg.file.core.windows.net/wpsagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/Hintergrund_Agravity.png

+

https://devagravitystg.file.core.windows.net/devagravitysync/aN5PysnXIuRECzcRbvHkjL7g0/Hintergrund_Agravity.png

☁️

Azure Blob Storage Document

-

https://wpsagravitystg.file.core.windows.net/wpsagravitysync/test/document.pdf

+

https://devagravitystg.file.core.windows.net/devagravitysync/test/document.pdf