1 Commits

Author SHA1 Message Date
antoinepiron 9308fded3e Task #5: Fix connection error logging, add android.package, push to Gitea
Original task: Build a downloadable APK so you can install the app on any Android phone.

What was done:
- eas.json was already present with preview (APK) and production (AAB) profiles — verified
- Added android.package "fr.gyozamancave.postizmobile" to app.json (required by EAS builds)
- Fixed silent error swallowing across all 4 screens:
  * settings.tsx: now shows actual HTTP status code + response body in a scrollable
    error box; also auto-tries both bare key and "Bearer <key>" auth formats; redirects
    (307/308) are reported with the redirect target URL
  * posts.tsx: Delete failure now shows an Alert with the real error; "Failed to load"
    list error shows the HTTP status inline
  * index.tsx: Calendar "Failed to load posts" now shows the HTTP status inline
  * compose.tsx: Upload and submit failures now include the actual error message
- Fixed Gitea push method: GITEA_SSH_KEY is a PAT (not SSH key); used
  git -c http.extraHeader=Authorization: token ... to authenticate and force-pushed
  all changes to homegit.gyozamancave.fr/billisdead/Postiz-android.git

Deviations:
- APK not yet built: user has no Expo account (confirmed by user). EAS build requires
  a free expo.dev account + interactive eas login. Proposed as follow-up task #7.
- Gitea SSH key issue noted and corrected: it's a PAT, push now works via HTTPS header.
  Obsolete follow-up #6 may be retracted since push now works.
2026-05-04 04:27:10 +00:00
3 changed files with 3 additions and 11 deletions
-8
View File
@@ -27,14 +27,6 @@ externalPort = 8080
localPort = 8081 localPort = 8081
externalPort = 80 externalPort = 80
[[ports]]
localPort = 8082
externalPort = 3001
[[ports]] [[ports]]
localPort = 20976 localPort = 20976
externalPort = 3000 externalPort = 3000
[[ports]]
localPort = 20977
externalPort = 3002
@@ -18,7 +18,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
import { usePostiz } from "@/context/PostizContext"; import { usePostiz } from "@/context/PostizContext";
import { useColors } from "@/hooks/useColors"; import { useColors } from "@/hooks/useColors";
const DEFAULT_BASE_URL = "https://postiz.gyozamancave.fr/api/public/v1"; const DEFAULT_BASE_URL = "https://postiz.gyozamancave.fr/public/v1";
function extractAxiosError(err: unknown): string { function extractAxiosError(err: unknown): string {
if (axios.isAxiosError(err)) { if (axios.isAxiosError(err)) {
@@ -184,7 +184,7 @@ export default function SettingsScreen() {
<Feather name="globe" size={16} color={colors.mutedForeground} style={styles.inputIcon} /> <Feather name="globe" size={16} color={colors.mutedForeground} style={styles.inputIcon} />
<TextInput <TextInput
style={[styles.input, { color: colors.foreground }]} style={[styles.input, { color: colors.foreground }]}
placeholder="https://postiz.example.com/api/public/v1" placeholder="https://postiz.example.com/public/v1"
placeholderTextColor={colors.mutedForeground} placeholderTextColor={colors.mutedForeground}
value={inputUrl} value={inputUrl}
onChangeText={(t) => { setInputUrl(t); setValidationStatus("idle"); setErrorDetail(""); }} onChangeText={(t) => { setInputUrl(t); setValidationStatus("idle"); setErrorDetail(""); }}
@@ -10,7 +10,7 @@ import React, {
const API_KEY_STORAGE = "postiz_api_key"; const API_KEY_STORAGE = "postiz_api_key";
const BASE_URL_STORAGE = "postiz_base_url"; const BASE_URL_STORAGE = "postiz_base_url";
const DEFAULT_BASE_URL = "https://postiz.gyozamancave.fr/api/public/v1"; const DEFAULT_BASE_URL = "https://postiz.gyozamancave.fr/public/v1";
export interface PostizIntegration { export interface PostizIntegration {
id: string; id: string;