| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9ad8605 commit 94eab76
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ jobs: | |||
| 25 | 25 | strategy: | |
| 26 | 26 | matrix: | |
| 27 | 27 | os: [ubuntu-latest] | |
| 28 | - node: [20] | ||
| 28 | + node: [24] | ||
| 29 | 29 | ||
| 30 | 30 | steps: | |
| 31 | 31 | - name: Checkout 🛎 | |
@@ -34,7 +34,7 @@ jobs: | |||
| 34 | 34 | - uses: pnpm/action-setup@v6 | |
| 35 | 35 | name: Install pnpm | |
| 36 | 36 | with: | |
| 37 | - version: 10 | ||
| 37 | + version: 11 | ||
| 38 | 38 | ||
| 39 | 39 | - name: Install dependencies 📦 | |
| 40 | 40 | run: pnpm install | |
@@ -46,7 +46,7 @@ jobs: | |||
| 46 | 46 | run: pnpm test | |
| 47 | 47 | ||
| 48 | 48 | - name: Build 🏗️ | |
| 49 | - run: pnpm run build | ||
| 49 | + run: mv .env.production .env && echo "GITHUB_SHA=${GITHUB_SHA}" >> .env && pnpm run generate | ||
| 50 | 50 | ||
| 51 | 51 | deploy: | |
| 52 | 52 | name: Deploy | |
@@ -61,13 +61,13 @@ jobs: | |||
| 61 | 61 | - uses: pnpm/action-setup@v6 | |
| 62 | 62 | name: Install pnpm | |
| 63 | 63 | with: | |
| 64 | - version: 10 | ||
| 64 | + version: 11 | ||
| 65 | 65 | ||
| 66 | 66 | - name: Install dependencies 📦 | |
| 67 | 67 | run: pnpm install | |
| 68 | 68 | ||
| 69 | 69 | - name: Build 🏗️ | |
| 70 | - run: pnpm run build | ||
| 70 | + run: mv .env.production .env && echo "GITHUB_SHA=${GITHUB_SHA}" >> .env && pnpm run generate | ||
| 71 | 71 | ||
| 72 | 72 | - name: Cloudflare Deploy 🚀 | |
| 73 | 73 | uses: cloudflare/pages-action@1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + API_BASE_URL=http://localhost:8000 | ||
| 2 | + | ||
| 3 | + APP_URL=http://localhost:3000 | ||
| 4 | + APP_NAME=httpSMS | ||
| 5 | + APP_GITHUB_URL=https://github.com/NdoleStudio/httpsms | ||
| 6 | + APP_DOCUMENTATION_URL=https://docs.httpsms.com | ||
| 7 | + APP_DOWNLOAD_URL=https://github.com/NdoleStudio/httpsms/releases/latest/download/HttpSms.apk | ||
| 8 | + APP_ENV=production | ||
| 9 | + | ||
| 10 | + # Firebase credentials | ||
| 11 | + FIREBASE_API_KEY=AIzaSyAKqPvj51igvvNNcRt_gL0A6cgx3ZB-kuQ | ||
| 12 | + FIREBASE_AUTH_DOMAIN=httpsms-docker.firebaseapp.com | ||
| 13 | + FIREBASE_PROJECT_ID=httpsms-docker | ||
| 14 | + FIREBASE_STORAGE_BUCKET=httpsms-docker.appspot.com | ||
| 15 | + FIREBASE_MESSAGING_SENDER_ID=668063041624 | ||
| 16 | + FIREBASE_APP_ID=668063041624:web:29b9e3b7027965ba08a22d | ||
| 17 | + FIREBASE_MEASUREMENT_ID=G-18VRYL22PZ | ||
| 18 | + | ||
| 19 | + # Cloudflare Turnstile site key for captcha on the search messages page | ||
| 20 | + # Get your site key at https://developers.cloudflare.com/turnstile/get-started/ | ||
| 21 | + CLOUDFLARE_TURNSTILE_SITE_KEY= | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,24 @@ | |||
| 1 | + API_BASE_URL=https://api.httpsms.com | ||
| 2 | + | ||
| 3 | + APP_URL=https://httpsms.com | ||
| 4 | + APP_NAME=httpSMS | ||
| 5 | + APP_GITHUB_URL=https://github.com/NdoleStudio/httpsms | ||
| 6 | + APP_DOCUMENTATION_URL=https://docs.httpsms.com | ||
| 7 | + APP_DOWNLOAD_URL=https://apk.httpsms.com/HttpSms.apk | ||
| 8 | + APP_ENV=production | ||
| 9 | + | ||
| 10 | + CHECKOUT_URL=https://httpsms.lemonsqueezy.com/checkout/buy/706c5638-4c8d-40db-a6f2-b6371b7e0af4 | ||
| 11 | + ENTERPRISE_CHECKOUT_URL=https://httpsms.lemonsqueezy.com/checkout/buy/d107cf05-4b13-4ebd-a770-c2cc75c69a14 | ||
| 12 | + | ||
| 13 | + FIREBASE_API_KEY=AIzaSyClL8AX2H_F77_n8yu5FgLzBmJTiSM0NsQ | ||
| 14 | + FIREBASE_AUTH_DOMAIN=httpsms-86c51.firebaseapp.com | ||
| 15 | + FIREBASE_PROJECT_ID=httpsms-86c51 | ||
| 16 | + FIREBASE_STORAGE_BUCKET=httpsms-86c51.appspot.com | ||
| 17 | + FIREBASE_MESSAGING_SENDER_ID=877524083399 | ||
| 18 | + FIREBASE_APP_ID=1:877524083399:web:430d6a29a0d808946514e2 | ||
| 19 | + FIREBASE_MEASUREMENT_ID=G-EZ5W9DVK8T | ||
| 20 | + | ||
| 21 | + CLOUDFLARE_TURNSTILE_SITE_KEY=0x4AAAAAAA6Hpp8SDyMMPhWg | ||
| 22 | + | ||
| 23 | + PUSHER_KEY=a4809008d8f03aaab022 | ||
| 24 | + PUSHER_CLUSTER=mt1 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,3 +22,5 @@ logs | |||
| 22 | 22 | .env | |
| 23 | 23 | .env.* | |
| 24 | 24 | !.env.example | |
| 25 | + !.env.docker | ||
| 26 | + !.env.production | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,7 @@ async function signInWithGoogle() { | |||
| 35 | 35 | const result = await signInWithPopup(auth, new GoogleAuthProvider()); | |
| 36 | 36 | onSuccess(result.user); | |
| 37 | 37 | } catch (error: unknown) { | |
| 38 | - handleError(error); | ||
| 38 | + handleError(error, true); | ||
| 39 | 39 | } finally { | |
| 40 | 40 | loading.value = false; | |
| 41 | 41 | } | |
@@ -48,7 +48,7 @@ async function signInWithGithub() { | |||
| 48 | 48 | const result = await signInWithPopup(auth, new GithubAuthProvider()); | |
| 49 | 49 | onSuccess(result.user); | |
| 50 | 50 | } catch (error: unknown) { | |
| 51 | - handleError(error); | ||
| 51 | + handleError(error, true); | ||
| 52 | 52 | } finally { | |
| 53 | 53 | loading.value = false; | |
| 54 | 54 | } | |
@@ -90,19 +90,30 @@ function onSuccess(user: unknown) { | |||
| 90 | 90 | router.push({ path: props.to }); | |
| 91 | 91 | } | |
| 92 | 92 | ||
| 93 | - function handleError(error: unknown) { | ||
| 93 | + function handleError(error: unknown, isSocial = false) { | ||
| 94 | 94 | const firebaseError = error as { code?: string; message?: string }; | |
| 95 | 95 | const code = firebaseError.code || ""; | |
| 96 | + let message = ""; | ||
| 96 | 97 | if (code === "auth/user-not-found" || code === "auth/invalid-credential") { | |
| 97 | - emailError.value = "Invalid email or password"; | ||
| 98 | + message = "Invalid email or password"; | ||
| 98 | 99 | } else if (code === "auth/email-already-in-use") { | |
| 99 | - emailError.value = "An account with this email already exists"; | ||
| 100 | + message = "An account with this email already exists"; | ||
| 100 | 101 | } else if (code === "auth/weak-password") { | |
| 101 | - emailError.value = "Password must be at least 6 characters"; | ||
| 102 | - } else if (code === "auth/popup-closed-by-user") { | ||
| 103 | - // User closed popup, no error to show | ||
| 102 | + message = "Password must be at least 6 characters"; | ||
| 103 | + } else if ( | ||
| 104 | + code === "auth/popup-closed-by-user" || | ||
| 105 | + code === "auth/cancelled-popup-request" | ||
| 106 | + ) { | ||
| 107 | + // User closed the popup, no error to show | ||
| 108 | + return; | ||
| 109 | + } else { | ||
| 110 | + message = firebaseError.message || "An error occurred"; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + if (isSocial) { | ||
| 114 | + notificationsStore.addNotification({ message, type: "error" }); | ||
| 104 | 115 | } else { | |
| 105 | - emailError.value = firebaseError.message || "An error occurred"; | ||
| 116 | + emailError.value = message; | ||
| 106 | 117 | } | |
| 107 | 118 | } | |
| 108 | 119 | </script> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,12 +13,13 @@ export function setApiKey(key: string | null) { | |||
| 13 | 13 | ||
| 14 | 14 | function createApiFetch(): $Fetch { | |
| 15 | 15 | const config = useRuntimeConfig(); | |
| 16 | - const baseURL = (config.public as Record<string, string>).apiBaseUrl; | ||
| 16 | + const publicConfig = config.public as Record<string, string>; | ||
| 17 | + const baseURL = publicConfig.apiBaseUrl; | ||
| 17 | 18 | ||
| 18 | 19 | return $fetch.create({ | |
| 19 | 20 | baseURL, | |
| 20 | 21 | headers: { | |
| 21 | - "X-Client-Version": "web", | ||
| 22 | + "X-Client-Version": publicConfig.clientVersion || "dev", | ||
| 22 | 23 | }, | |
| 23 | 24 | onRequest({ options }) { | |
| 24 | 25 | const headers = (options.headers ||= {}) as Record<string, string>; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,6 +53,7 @@ export default defineNuxtConfig({ | |||
| 53 | 53 | runtimeConfig: { | |
| 54 | 54 | public: { | |
| 55 | 55 | apiBaseUrl: process.env.API_BASE_URL || "http://localhost:8000", | |
| 56 | + clientVersion: process.env.GITHUB_SHA || "dev", | ||
| 56 | 57 | appUrl: process.env.APP_URL || "https://httpsms.com", | |
| 57 | 58 | appName: process.env.APP_NAME || "HTTP SMS", | |
| 58 | 59 | appGithubUrl: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments