Skip to content

Commit cc2b4c2

Browse files
committed
fix: updating self-host branch with bugfixes from development branch
2 parents 685c38d + 1330c23 commit cc2b4c2

13 files changed

Lines changed: 380 additions & 419 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Backend to Development
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
paths:
8+
- "src/server/**"
9+
- ".github/workflows/deploy-dev-backend.yaml"
10+
11+
jobs:
12+
deploy:
13+
name: Deploy Backend to Dev VM
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Deploy over SSH
17+
uses: appleboy/ssh-action@v1.0.3
18+
with:
19+
host: ${{ secrets.DEV_SERVER_VM_HOST }}
20+
username: ${{ secrets.DEV_SERVER_VM_USER }}
21+
key: ${{ secrets.DEV_SERVER_VM_SSH_PRIVATE_KEY }}
22+
script: |
23+
set -e
24+
cd ~/sentient
25+
git pull origin development
26+
cd src/server
27+
echo "Building and deploying the backend..."
28+
docker compose down
29+
docker compose up --build -d
30+
echo "Cleaning up old Docker images..."
31+
docker image prune -f
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Frontend to Development
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
paths:
8+
- "src/client/**"
9+
- ".github/workflows/deploy-dev-frontend.yaml"
10+
11+
jobs:
12+
deploy:
13+
name: Deploy Frontend to Dev VM
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Deploy over SSH
17+
uses: appleboy/ssh-action@v1.0.3
18+
with:
19+
host: ${{ secrets.DEV_CLIENT_VM_HOST }}
20+
username: ${{ secrets.DEV_CLIENT_VM_USER }}
21+
key: ${{ secrets.DEV_CLIENT_VM_SSH_PRIVATE_KEY }}
22+
script: |
23+
set -e
24+
cd ~/sentient
25+
git pull origin development
26+
cd src/client
27+
echo "Building and deploying the frontend..."
28+
docker compose down
29+
docker compose up --build -d
30+
echo "Cleaning up old Docker images..."
31+
docker image prune -f

.github/workflows/deploy-dev.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Backend to Staging
2+
3+
on:
4+
push:
5+
branches:
6+
- staging
7+
paths:
8+
- "src/server/**"
9+
- ".github/workflows/deploy-stag-backend.yaml"
10+
11+
jobs:
12+
deploy:
13+
name: Deploy Backend to Staging VM
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Deploy over SSH
17+
uses: appleboy/ssh-action@v1.0.3
18+
with:
19+
host: ${{ secrets.STAG_SERVER_VM_HOST }}
20+
username: ${{ secrets.STAG_SERVER_VM_USER }}
21+
key: ${{ secrets.STAG_SERVER_VM_SSH_PRIVATE_KEY }}
22+
script: |
23+
set -e
24+
cd ~/sentient
25+
git pull origin staging
26+
cd src/server
27+
echo "Building and deploying the backend..."
28+
docker compose down
29+
docker compose up --build -d
30+
echo "Cleaning up old Docker images..."
31+
docker image prune -f
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Frontend to Staging
2+
3+
on:
4+
push:
5+
branches:
6+
- staging
7+
paths:
8+
- "src/client/**"
9+
- ".github/workflows/deploy-stag-frontend.yaml"
10+
11+
jobs:
12+
deploy:
13+
name: Deploy Frontend to Staging VM
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Deploy over SSH
17+
uses: appleboy/ssh-action@v1.0.3
18+
with:
19+
host: ${{ secrets.STAG_CLIENT_VM_HOST }}
20+
username: ${{ secrets.STAG_CLIENT_VM_USER }}
21+
key: ${{ secrets.STAG_CLIENT_VM_SSH_PRIVATE_KEY }}
22+
script: |
23+
set -e
24+
cd ~/sentient
25+
git pull origin staging
26+
cd src/client
27+
echo "Building and deploying the frontend..."
28+
docker compose down
29+
docker compose up --build -d
30+
echo "Cleaning up old Docker images..."
31+
docker image prune -f

.github/workflows/deploy-stag.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/sync.yaml

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/client/app/api/settings/integrations/connect/oauth/callback/route.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function GET(request) {
3333
// The browser session (cookie) is automatically forwarded by Next.js server-side fetch,
3434
// which authenticates the user to our own API proxy.
3535
const apiResponse = await fetch(
36-
`${request.nextUrl.origin}/api/settings/integrations/connect/oauth`,
36+
`${process.env.APP_BASE_URL}/api/settings/integrations/connect/oauth`,
3737
{
3838
method: "POST",
3939
headers: {
@@ -43,7 +43,7 @@ export async function GET(request) {
4343
body: JSON.stringify({
4444
service_name: state,
4545
code: code,
46-
redirect_uri: `${request.nextUrl.origin}/api/settings/integrations/connect/oauth/callback`
46+
redirect_uri: `${process.env.APP_BASE_URL}/api/settings/integrations/connect/oauth/callback`
4747
})
4848
}
4949
)

src/client/app/home/page.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,16 @@ const HomePage = () => {
291291

292292
const fetchUserDetails = useCallback(async () => {
293293
try {
294-
const response = await fetch("/api/user/profile")
294+
const response = await fetch("/api/user/data")
295295
if (!response.ok) throw new Error("Failed to fetch user details")
296-
setUserDetails(await response.json())
296+
const result = await response.json()
297+
const userName =
298+
result?.data?.personalInfo?.name ||
299+
result?.data?.onboardingAnswers?.["user-name"]
300+
setUserDetails({ given_name: userName || "User" })
297301
} catch (error) {
298302
toast.error(`Error fetching user details: ${error.message}`)
303+
setUserDetails({ given_name: "User" })
299304
}
300305
}, [])
301306

src/client/app/settings/page.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import {
3030
} from "@tabler/icons-react"
3131
import { useState, useEffect, useCallback, useRef } from "react"
3232
import { Tooltip } from "react-tooltip"
33-
import React from "react"
34-
import { useSmoothScroll } from "@hooks/useSmoothScroll"
3533

3634
const integrationIcons = {
3735
gmail: IconMail,
@@ -445,9 +443,6 @@ const Settings = () => {
445443
const [loadingIntegrations, setLoadingIntegrations] = useState(true)
446444
const [activeManualIntegration, setActiveManualIntegration] = useState(null)
447445
const [processingIntegration, setProcessingIntegration] = useState(null)
448-
const scrollRef = useRef(null)
449-
450-
useSmoothScroll(scrollRef)
451446

452447
// --- CORRECTED: Specific list of Google services ---
453448
const googleServices = [
@@ -639,10 +634,7 @@ const Settings = () => {
639634
Settings
640635
</h1>
641636
</header>
642-
<main
643-
ref={scrollRef}
644-
className="flex-1 overflow-y-auto p-4 sm:p-6 md:p-10 custom-scrollbar"
645-
>
637+
<main className="flex-1 overflow-y-auto p-4 sm:p-6 md:p-10 custom-scrollbar">
646638
<div className="w-full max-w-5xl mx-auto space-y-10">
647639
<WhatsAppSettings />
648640
<PrivacySettings />

0 commit comments

Comments
 (0)