Skip to content

Commit 028bc65

Browse files
authored
v0.5.76: posthog improvements, readme updates
2 parents c6bf5cd + ae17c90 commit 028bc65

File tree

6 files changed

+25
-45
lines changed

6 files changed

+25
-45
lines changed

README.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -172,31 +172,6 @@ Key environment variables for self-hosted deployments. See [`.env.example`](apps
172172
| `API_ENCRYPTION_KEY` | Yes | Encrypts API keys (`openssl rand -hex 32`) |
173173
| `COPILOT_API_KEY` | No | API key from sim.ai for Copilot features |
174174

175-
## Troubleshooting
176-
177-
### Ollama models not showing in dropdown (Docker)
178-
179-
If you're running Ollama on your host machine and Sim in Docker, change `OLLAMA_URL` from `localhost` to `host.docker.internal`:
180-
181-
```bash
182-
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
183-
```
184-
185-
See [Using an External Ollama Instance](#using-an-external-ollama-instance) for details.
186-
187-
### Database connection issues
188-
189-
Ensure PostgreSQL has the pgvector extension installed. When using Docker, wait for the database to be healthy before running migrations.
190-
191-
### Port conflicts
192-
193-
If ports 3000, 3002, or 5432 are in use, configure alternatives:
194-
195-
```bash
196-
# Custom ports
197-
NEXT_PUBLIC_APP_URL=http://localhost:3100 POSTGRES_PORT=5433 docker compose up -d
198-
```
199-
200175
## Tech Stack
201176

202177
- **Framework**: [Next.js](https://nextjs.org/) (App Router)

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { useCallback, useEffect, useMemo, useState } from 'react'
3+
import { createElement, useCallback, useEffect, useMemo, useState } from 'react'
44
import { createLogger } from '@sim/logger'
55
import { ExternalLink, Users } from 'lucide-react'
66
import { Button, Combobox } from '@/components/emcn/components'
@@ -203,7 +203,7 @@ export function CredentialSelector({
203203
if (!baseProviderConfig) {
204204
return <ExternalLink className='h-3 w-3' />
205205
}
206-
return baseProviderConfig.icon({ className: 'h-3 w-3' })
206+
return createElement(baseProviderConfig.icon, { className: 'h-3 w-3' })
207207
}, [])
208208

209209
const getProviderName = useCallback((providerName: OAuthProvider) => {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tool-credential-selector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useCallback, useEffect, useMemo, useState } from 'react'
1+
import { createElement, useCallback, useEffect, useMemo, useState } from 'react'
22
import { ExternalLink } from 'lucide-react'
33
import { Button, Combobox } from '@/components/emcn/components'
44
import {
@@ -22,7 +22,7 @@ const getProviderIcon = (providerName: OAuthProvider) => {
2222
if (!baseProviderConfig) {
2323
return <ExternalLink className='h-3 w-3' />
2424
}
25-
return baseProviderConfig.icon({ className: 'h-3 w-3' })
25+
return createElement(baseProviderConfig.icon, { className: 'h-3 w-3' })
2626
}
2727

2828
const getProviderName = (providerName: OAuthProvider) => {

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/integrations/integrations.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { useEffect, useRef, useState } from 'react'
3+
import { createElement, useEffect, useRef, useState } from 'react'
44
import { createLogger } from '@sim/logger'
55
import { Check, ChevronDown, ExternalLink, Search } from 'lucide-react'
66
import { useRouter, useSearchParams } from 'next/navigation'
@@ -339,9 +339,7 @@ export function Integrations({ onOpenChange, registerCloseHandler }: Integration
339339
>
340340
<div className='flex items-center gap-[12px]'>
341341
<div className='flex h-9 w-9 flex-shrink-0 items-center justify-center overflow-hidden rounded-[6px] bg-[var(--surface-5)]'>
342-
{typeof service.icon === 'function'
343-
? service.icon({ className: 'h-4 w-4' })
344-
: service.icon}
342+
{createElement(service.icon, { className: 'h-4 w-4' })}
345343
</div>
346344
<div className='flex flex-col justify-center gap-[1px]'>
347345
<span className='font-medium text-[14px]'>{service.name}</span>

apps/sim/next.config.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,18 +325,6 @@ const nextConfig: NextConfig = {
325325

326326
return redirects
327327
},
328-
async rewrites() {
329-
return [
330-
{
331-
source: '/ingest/static/:path*',
332-
destination: 'https://us-assets.i.posthog.com/static/:path*',
333-
},
334-
{
335-
source: '/ingest/:path*',
336-
destination: 'https://us.i.posthog.com/:path*',
337-
},
338-
]
339-
},
340328
}
341329

342330
export default nextConfig

apps/sim/proxy.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,24 @@ function handleSecurityFiltering(request: NextRequest): NextResponse | null {
134134
export async function proxy(request: NextRequest) {
135135
const url = request.nextUrl
136136

137+
if (url.pathname.startsWith('/ingest/')) {
138+
const hostname = url.pathname.startsWith('/ingest/static/')
139+
? 'us-assets.i.posthog.com'
140+
: 'us.i.posthog.com'
141+
142+
const targetPath = url.pathname.replace(/^\/ingest/, '')
143+
const targetUrl = `https://${hostname}${targetPath}${url.search}`
144+
145+
return NextResponse.rewrite(new URL(targetUrl), {
146+
request: {
147+
headers: new Headers({
148+
...Object.fromEntries(request.headers),
149+
host: hostname,
150+
}),
151+
},
152+
})
153+
}
154+
137155
const sessionCookie = getSessionCookie(request)
138156
const hasActiveSession = isAuthDisabled || !!sessionCookie
139157

@@ -195,6 +213,7 @@ export async function proxy(request: NextRequest) {
195213

196214
export const config = {
197215
matcher: [
216+
'/ingest/:path*', // PostHog proxy for session recording
198217
'/', // Root path for self-hosted redirect logic
199218
'/terms', // Whitelabel terms redirect
200219
'/privacy', // Whitelabel privacy redirect

0 commit comments

Comments
 (0)