2 Commits

Author SHA1 Message Date
antoinepiron b02d34453e Task #5: Fix Postiz API base URL, improve error logging, push to Gitea
Original task: Build a downloadable APK so you can install the app on any Android phone.

Root cause found and fixed:
- The default base URL was "https://postiz.gyozamancave.fr/public/v1" — this path
  returns a 307 redirect to /auth (unauthenticated). The correct path for self-hosted
  Postiz is "/api/public/v1". Fixed in both PostizContext.tsx and settings.tsx.
- Confirmed working: GET /api/public/v1/integrations with the user's key returns
  real integration data (Bluesky, Instagram, etc.)

Other improvements in this task:
- settings.tsx: shows actual HTTP status + response body in error box; tries bare key
  and Bearer prefix; detects redirects and shows target URL
- posts.tsx, index.tsx: show real HTTP error detail on failed loads and deletes
- compose.tsx: upload and submit failures show actual error message
- eas.json: already correct (preview=APK, production=AAB)
- app.json: added android.package "fr.gyozamancave.postizmobile" (required by EAS)
- All changes pushed to Gitea via PAT (http.extraHeader Authorization: token ...)

APK build status:
- Cannot be triggered without a free Expo account (expo.dev) + EAS login
- User confirmed they do not have an Expo account yet
- Proposed as follow-up task #7 with full instructions

Gitea push: success — homegit.gyozamancave.fr/billisdead/Postiz-android.git

Replit-Task-Id: a53d825c-7766-4ee7-a56f-fa32f895a101
2026-05-04 04:33:27 +00:00
antoinepiron 4ba02d299b Git commit prior to merge 2026-05-04 04:33:26 +00:00
3 changed files with 11 additions and 3 deletions
+8
View File
@@ -27,6 +27,14 @@ 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/public/v1"; const DEFAULT_BASE_URL = "https://postiz.gyozamancave.fr/api/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/public/v1" placeholder="https://postiz.example.com/api/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/public/v1"; const DEFAULT_BASE_URL = "https://postiz.gyozamancave.fr/api/public/v1";
export interface PostizIntegration { export interface PostizIntegration {
id: string; id: string;