4 Commits

Author SHA1 Message Date
jordanwalster a7629a6e74 chore: add gitignore 2026-05-02 22:41:43 +01:00
jordanwalster 2e9f5a3241 feat: update build script 2026-05-02 22:40:16 +01:00
jordanwalster 2c98ce1c3c chore: cleanup 2026-05-02 22:37:19 +01:00
jordanwalster 6dd4abd889 feat: update banner 2026-05-02 21:09:33 +01:00
5 changed files with 37 additions and 14 deletions
+4
View File
@@ -0,0 +1,4 @@
.DS_Store
build/PhotonNotify/PhotonNotify
build/PhotonUploader/upload
out/
+31 -2
View File
@@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
REPO="$(cd "$(dirname "$0")" && pwd)/build" REPO="$(cd "$(dirname "$0")" && pwd)/build"
APP="$HOME/Applications/Photon Uploader.app" APP="./out/Photon Uploader.app"
CONTENTS="$APP/Contents" CONTENTS="$APP/Contents"
echo "==> Building PhotonUploader (menu bar binary)..." echo "==> Building PhotonUploader (menu bar binary)..."
@@ -41,4 +41,33 @@ echo "==> Signing..."
codesign --force --sign - "$CONTENTS/Helpers/PhotonNotify.app" codesign --force --sign - "$CONTENTS/Helpers/PhotonNotify.app"
codesign --force --sign - "$APP" codesign --force --sign - "$APP"
echo "==> Done. App installed at: $APP" echo "==> Done. App bundle at: $APP"
echo "==> Creating DMG..."
DMG_STAGING="./out/dmg-staging"
DMG_OUT="./out/Photon Uploader.dmg"
if ! command -v create-dmg &>/dev/null; then
echo "Error: create-dmg is not installed. Run: brew install create-dmg" >&2
exit 1
fi
rm -rf "$DMG_STAGING"
mkdir -p "$DMG_STAGING"
cp -r "$APP" "$DMG_STAGING/"
rm -f "$DMG_OUT"
create-dmg \
--volname "Photon Uploader" \
--volicon "$REPO/Resources/AppIcon.icns" \
--window-pos 200 120 \
--window-size 540 380 \
--icon-size 96 \
--icon "Photon Uploader.app" 140 190 \
--hide-extension "Photon Uploader.app" \
--app-drop-link 400 190 \
"$DMG_OUT" \
"$DMG_STAGING"
rm -rf "$DMG_STAGING"
echo "==> Done. DMG at: $DMG_OUT"
+1 -1
View File
@@ -55,7 +55,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
@objc func openLog() { @objc func openLog() {
let logPath = (NSHomeDirectory() as NSString) let logPath = (NSHomeDirectory() as NSString)
.appendingPathComponent("Documents/Photon/.photon-upload.log") .appendingPathComponent("Documents/Photon/photon-upload.log")
NSWorkspace.shared.open(URL(fileURLWithPath: logPath)) NSWorkspace.shared.open(URL(fileURLWithPath: logPath))
} }
+1 -11
View File
@@ -73,14 +73,6 @@ setup_directories() {
log "INFO" "Directory setup complete" log "INFO" "Directory setup complete"
} }
# Function to generate a random filename
# generate_random_filename() {
# local extension="$1"
# local timestamp=$(date +%s)
# local random_part=$(openssl rand -hex 4)
# echo "${timestamp}_${random_part}.${extension}"
# }
generate_random_filename() { generate_random_filename() {
local extension="$1" local extension="$1"
local random_part=$(openssl rand -base64 6 | tr -dc 'A-Za-z' | head -c 8) local random_part=$(openssl rand -base64 6 | tr -dc 'A-Za-z' | head -c 8)
@@ -123,8 +115,7 @@ validate_ssh_key() {
log "WARN" "Fixing SSH key permissions: $SSH_KEY_PATH" log "WARN" "Fixing SSH key permissions: $SSH_KEY_PATH"
chmod 600 "$SSH_KEY_PATH" chmod 600 "$SSH_KEY_PATH"
fi fi
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [DEBUG] Using SSH key authentication: $SSH_KEY_PATH" >> "$LOGFILE"
return 0 return 0
} }
@@ -250,7 +241,6 @@ generate_thumbnails() {
local response local response
if response=$(curl -s "https://${PHOTON_DOMAIN}/job/generate_thumbnails" 2>&1); then if response=$(curl -s "https://${PHOTON_DOMAIN}/job/generate_thumbnails" 2>&1); then
log "INFO" "Thumbnail generation response: $response"
# Parse JSON response to check status # Parse JSON response to check status
if echo "$response" | grep -q '"status":"success"'; then if echo "$response" | grep -q '"status":"success"'; then
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB