Skip to content

Commit bec45b4

Browse files
gcampclaude
andcommitted
Switch to GCS public URL and pin 1Password account
Use storage.googleapis.com URL directly instead of img.transitapp.com since there is no custom domain. Pin OP_ACCOUNT to transit.1password.com so users with multiple 1Password accounts don't need to set it manually. Bump version to 1.4.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9b2567b commit bec45b4

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

docs/PRODUCTION-SETUP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ rm /tmp/prod-key.json
4949

5050
```bash
5151
image-upload-transit ~/Desktop/test.png
52-
# Should return: https://img.transitapp.com/<id>.png
52+
# Should return: https://storage.googleapis.com/image-upload-cli-tool/<id>.png
5353
```

image_upload_transit.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
"""CLI tool for uploading images/videos to GCS with short transitapp.com URLs."""
2+
"""CLI tool for uploading images/videos to GCS."""
33

44
import argparse
55
import base64
@@ -17,7 +17,7 @@
1717
import uuid
1818
from pathlib import Path
1919

20-
VERSION = "1.3.0"
20+
VERSION = "1.4.0"
2121
CONFIG_DIR = Path.home() / ".config" / "image-upload-transit"
2222

2323
IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".gif", ".webp", ".avif", ".heic", ".bmp", ".tiff", ".tif", ".svg"}
@@ -28,8 +28,9 @@
2828
MAX_VIDEO_SIZE = 100 * 1024 * 1024 # 100 MB
2929

3030
BUCKET = "image-upload-cli-tool"
31-
BASE_URL = "https://img.transitapp.com"
31+
BASE_URL = f"https://storage.googleapis.com/{BUCKET}"
3232

33+
OP_ACCOUNT = "transit.1password.com"
3334
OP_VAULT = "Shared"
3435
OP_ITEM = "image-upload-transit Service Account (Production)"
3536

@@ -57,7 +58,7 @@ def check_op_cli() -> None:
5758
except subprocess.CalledProcessError:
5859
raise CredentialsError("1Password CLI check failed")
5960

60-
result = subprocess.run(["op", "account", "list"], capture_output=True)
61+
result = subprocess.run(["op", "account", "list", "--account", OP_ACCOUNT], capture_output=True)
6162
if result.returncode != 0 or not result.stdout.strip():
6263
raise CredentialsError("Not signed in to 1Password. Run: op signin")
6364

@@ -73,7 +74,7 @@ def get_credentials(force_refresh: bool = False) -> dict:
7374
check_op_cli()
7475

7576
result = subprocess.run(
76-
["op", "item", "get", OP_ITEM, "--vault", OP_VAULT, "--format", "json"],
77+
["op", "item", "get", OP_ITEM, "--vault", OP_VAULT, "--account", OP_ACCOUNT, "--format", "json"],
7778
capture_output=True,
7879
text=True,
7980
)
@@ -227,7 +228,7 @@ def upload_file(filepath: str, credentials: dict) -> str:
227228
def main() -> int:
228229
"""Main entry point."""
229230
parser = argparse.ArgumentParser(
230-
description="Upload images/videos to GCS with short transitapp.com URLs",
231+
description="Upload images/videos to GCS",
231232
prog="image-upload-transit",
232233
epilog="""
233234
Examples:
@@ -236,7 +237,7 @@ def main() -> int:
236237
%(prog)s --json photo.jpg Output result as JSON (for scripting/agents)
237238
238239
JSON Output Format (--json):
239-
Success: {"file": "image.png", "url": "https://img.transitapp.com/abc123.png", "success": true}
240+
Success: {"file": "image.png", "url": "https://storage.googleapis.com/image-upload-cli-tool/abc123.png", "success": true}
240241
Error: {"file": "bad.txt", "error": "Unsupported file type", "success": false}
241242
Multiple files produce one JSON object per line (JSONL format).
242243

0 commit comments

Comments
 (0)