diff --git a/app/src/main/java/com/foxx/androidcast/network/BackendEndpoints.java b/app/src/main/java/com/foxx/androidcast/network/BackendEndpoints.java index a273f05..6b517e6 100644 --- a/app/src/main/java/com/foxx/androidcast/network/BackendEndpoints.java +++ b/app/src/main/java/com/foxx/androidcast/network/BackendEndpoints.java @@ -3,8 +3,10 @@ package com.foxx.androidcast.network; /** Canonical production BE URLs on {@code apps.f0xx.org} (network self-test + defaults). */ public final class BackendEndpoints { public static final String APPS_HOST = "apps.f0xx.org"; - public static final String CRASHES_BASE = - "https://" + APPS_HOST + "/app/androidcast_project/crashes"; + public static final String ISSUES_BASE = + "https://" + APPS_HOST + "/app/androidcast_project/issues"; + /** @deprecated use {@link #ISSUES_BASE}; nginx 301 redirects legacy path. */ + public static final String CRASHES_BASE = ISSUES_BASE; public static final String GRAPHS_BASE = "https://" + APPS_HOST + "/app/androidcast_project/graphs"; public static final String HEARTBEAT_URL = CRASHES_BASE + "/api/heartbeat.php"; @@ -27,9 +29,15 @@ public final class BackendEndpoints { return trimmed; } if (trimmed.contains("://f0xx.org/app/androidcast_project/crashes") - || trimmed.contains("://foxx.org/app/androidcast_project/crashes")) { + || trimmed.contains("://foxx.org/app/androidcast_project/crashes") + || trimmed.contains("://f0xx.org/app/androidcast_project/issues") + || trimmed.contains("://foxx.org/app/androidcast_project/issues")) { return trimmed.replace("://f0xx.org/", "://" + APPS_HOST + "/") - .replace("://foxx.org/", "://" + APPS_HOST + "/"); + .replace("://foxx.org/", "://" + APPS_HOST + "/") + .replace("/crashes/", "/issues/"); + } + if (trimmed.contains("/crashes/")) { + return trimmed.replace("/crashes/", "/issues/"); } return trimmed; } @@ -40,8 +48,9 @@ public final class BackendEndpoints { return GRAPH_UPLOAD_URL; } String trimmed = normalizeCrashesUrl(crashesUrl.trim()); - if (trimmed.contains("/crashes/")) { - return trimmed.replace("/crashes/", "/graphs/").replace("/api/upload.php", "/api/graph_upload.php"); + if (trimmed.contains("/issues/")) { + return trimmed.replace("/issues/", "/graphs/") + .replace("/api/upload.php", "/api/graph_upload.php"); } return GRAPH_UPLOAD_URL; } diff --git a/app/src/test/java/com/foxx/androidcast/network/BackendEndpointsTest.java b/app/src/test/java/com/foxx/androidcast/network/BackendEndpointsTest.java index d2678fd..fbd26bb 100644 --- a/app/src/test/java/com/foxx/androidcast/network/BackendEndpointsTest.java +++ b/app/src/test/java/com/foxx/androidcast/network/BackendEndpointsTest.java @@ -9,7 +9,7 @@ public class BackendEndpointsTest { @Test public void canonicalUrlsUseAppsHost() { assertTrue(BackendEndpoints.HEARTBEAT_URL.startsWith("https://apps.f0xx.org/")); - assertTrue(BackendEndpoints.UPLOAD_URL.contains("/api/upload.php")); + assertTrue(BackendEndpoints.UPLOAD_URL.contains("/issues/api/upload.php")); assertTrue(BackendEndpoints.ENTITLEMENTS_FETCH_URL.contains("/entitlements/api/fetch.php")); } diff --git a/examples/app_hub/index.php b/examples/app_hub/index.php index 4f4a84c..e3a6531 100644 --- a/examples/app_hub/index.php +++ b/examples/app_hub/index.php @@ -5,7 +5,8 @@ if (!is_file($__platformDir . '/footer.php')) { } require_once $__platformDir . '/footer.php'; $__sessionFile = $__platformDir . '/shared_session.php'; -$hubCrashesBase = '/app/androidcast_project/crashes'; +$hubProjectBase = '/app/androidcast_project'; +$hubIssuesBase = '/app/androidcast_project/issues'; $hubUsername = ''; if (is_file($__sessionFile) && function_exists('session_start')) { require_once $__sessionFile; @@ -35,7 +36,7 @@ function hub_h(string $s): string { if (l === 'en' || l === 'ru') document.documentElement.setAttribute('lang', l); })(); - + @@ -46,12 +47,12 @@ function hub_h(string $s): string { } } - + - + - + @@ -139,15 +140,15 @@ function hub_h(string $s): string { -
+

Sign in to view anonymous issue reports

@@ -50,7 +51,7 @@ $bp = Auth::basePath();

Default: admin / admin

-

Register

+

Register

diff --git a/examples/crash_reporter/backend/views/register.php b/examples/crash_reporter/backend/views/register.php index 88dbc10..100252b 100644 --- a/examples/crash_reporter/backend/views/register.php +++ b/examples/crash_reporter/backend/views/register.php @@ -1,5 +1,6 @@ @@ -29,7 +30,7 @@ $bp = Auth::basePath(); -
+

Create account

We will email a verification link before you can sign in.

@@ -45,7 +46,7 @@ $bp = Auth::basePath(); -

Back to sign in

+

Back to sign in

diff --git a/examples/crash_reporter/backend/views/two_factor_challenge.php b/examples/crash_reporter/backend/views/two_factor_challenge.php index 24183d8..e3a96ea 100644 --- a/examples/crash_reporter/backend/views/two_factor_challenge.php +++ b/examples/crash_reporter/backend/views/two_factor_challenge.php @@ -1,5 +1,7 @@ @@ -17,6 +19,7 @@ $bp = Auth::basePath(); +
@@ -28,16 +31,22 @@ $bp = Auth::basePath();
-
+

Two-factor authentication

Enter the 6-digit code from your authenticator app.

+ +
+ QR code for mobile sign-in link +
Scan to open the hub on your phone ·
+
+ + -

Cancel

+

Cancel

diff --git a/examples/crash_reporter/backend/views/verify_email.php b/examples/crash_reporter/backend/views/verify_email.php index 4b5b179..d6f0871 100644 --- a/examples/crash_reporter/backend/views/verify_email.php +++ b/examples/crash_reporter/backend/views/verify_email.php @@ -1,5 +1,6 @@ @@ -21,10 +22,10 @@ $bp = Auth::basePath();

Email verification

Your email is verified. You can sign in and enroll two-factor authentication.

-

Sign in

+

Sign in

-

Register again

+

Register again