Fix: disable SSL verification for edited media server upload

Root cause identified from logs:
  [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate

The server uses a self-signed certificate (like production), but the edited media
upload endpoint was not disabling SSL verification while other API calls do.

Solution:
- Add verify=False to requests.post() call in _upload_to_server()
- Matches the SSL verification handling in get_playlists_v2.py
- Add warning about SSL verification being disabled
- Now edited images can upload successfully to server

This fixes the upload failures that were preventing edited images from being
synced to the server.
This commit is contained in:
Kiwy Player
2026-01-17 21:53:07 +02:00
parent eeb2a61ef7
commit 9b58f6b63d
4 changed files with 7 additions and 3 deletions

View File

@@ -1 +1 @@
1768679079.4526675
1768679578.0929108

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -1,5 +1,5 @@
{
"time_of_modification": "2026-01-17T21:40:13.194566",
"time_of_modification": "2026-01-17T21:51:37.035997",
"original_name": "2026efvev-1428673176.jpg",
"new_name": "2026efvev-1428673176_e_v1.jpg",
"original_path": "/home/pi/Desktop/Kiwy-Signage/media/2026efvev-1428673176.jpg",

View File

@@ -456,6 +456,10 @@ class EditPopup(Popup):
# Add the original filename to metadata so server knows which file was edited
metadata['original_filename'] = os.path.basename(metadata['original_path'])
# Disable SSL verification for self-signed certificates (like main code does)
# Note: This is NOT recommended for production with untrusted servers
Logger.warning("⚠️ SSL verification disabled for edited media upload - only use with trusted servers")
# Prepare file and data for upload
with open(image_path, 'rb') as img_file:
files = {
@@ -474,7 +478,7 @@ class EditPopup(Popup):
Logger.info(f"EditPopup: - Metadata: {metadata_path}")
try:
response = requests.post(upload_url, headers=headers, files=files, data=data, timeout=30)
response = requests.post(upload_url, headers=headers, files=files, data=data, timeout=30, verify=False)
if response.status_code == 200:
response_data = response.json()