Skip to content

Commit 62976bb

Browse files
committed
fix: various tweaks -d
1 parent 87763ae commit 62976bb

File tree

7 files changed

+63
-51
lines changed

7 files changed

+63
-51
lines changed

@fiction/admin/dashboard/OnboardSurvey.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const { card } = defineProps<{ card: Card }>()
1616
1717
const { fictionUser } = useService<{ fictionUser: FictionUser }>()
1818
19-
const TRIAL_PRODUCT = 'pro_month'
20-
const TRIAL_PRICE = 79
19+
const TRIAL_PRODUCT = 'standard_month'
20+
const TRIAL_PRICE = 9
2121
2222
const form = vue.ref<{
2323
fullName?: string

@fiction/plugins/plugin-monitor/index.ts

+12-9
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,18 @@ export class FictionMonitor extends FictionPlugin<FictionMonitorSettings> {
4242
const { user, params } = event.detail
4343
if (!this.settings.fictionEnv?.isApp.value) {
4444
const { cityName, regionName, countryCode } = user.geo || {}
45-
await this.slackNotify({
46-
message: `user created: ${user.email}`,
47-
data: {
48-
name: user.fullName || 'No Name',
49-
emailVerified: user.emailVerified ? 'Yes' : 'No',
50-
location: `${cityName}, ${regionName}, ${countryCode}` || 'No Location',
51-
...params,
52-
},
53-
})
45+
46+
if (user.email?.includes('test') || user.email?.includes('fiction.com')) {
47+
await this.slackNotify({
48+
message: `user created: ${user.email}`,
49+
data: {
50+
name: user.fullName || 'No Name',
51+
emailVerified: user.emailVerified ? 'Yes' : 'No',
52+
location: `${cityName}, ${regionName}, ${countryCode}` || 'No Location',
53+
...params,
54+
},
55+
})
56+
}
5457
}
5558
})
5659

@fiction/plugins/plugin-stripe/test/utils.unit.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('processCustomerData', () => {
2626
})
2727

2828
const mockProducts = [
29-
{ key: 'basic', tier: 1 },
29+
{ key: 'standard', tier: 1 },
3030
{ key: 'pro', tier: 2 },
3131
]
3232

@fiction/themes/fiction/pages/pricing/index.ts

+21-14
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,20 @@ import type { CardFactory } from '@fiction/site/cardFactory'
88

99
import { getCheckoutUrl } from '@fiction/plugin-stripe/utils.js'
1010

11-
async function purchaseUrl(args: { priceLookupKey: string, fictionStripe?: FictionStripe }) {
12-
const { fictionStripe } = args
11+
async function purchaseUrl(args: { priceLookupKey: string, site: Site }) {
12+
const { site } = args
1313

14-
const loginPath = '/auth'
14+
const { fictionStripe, fictionUser } = site.fictionSites.fictionEnv.getService<{ fictionStripe: FictionStripe }>()
1515

16-
if (!fictionStripe) {
16+
const loginPath = '/app/auth?_reload=1'
17+
18+
if (typeof window === 'undefined') {
19+
return loginPath
20+
}
21+
22+
const user = await fictionUser.userInitialized()
23+
24+
if (!fictionStripe || !user) {
1725
return loginPath
1826
}
1927

@@ -25,8 +33,6 @@ export async function getPricingPage(args: { factory: CardFactory, site: Site })
2533

2634
const annualDiscountPercent = 30
2735

28-
const { fictionStripe } = site.fictionSites.fictionEnv.getService<{ fictionStripe: FictionStripe }>()
29-
3036
const pricingCard = await factory.fromTemplate<typeof pricingTemplate>({
3137
templateId: 'cardPricingV1',
3238
userConfig: {
@@ -35,8 +41,8 @@ export async function getPricingPage(args: { factory: CardFactory, site: Site })
3541
layout: 'standard',
3642
prices: [
3743
{
38-
title: 'Free',
39-
price: 0,
44+
title: 'Standard',
45+
price: 9,
4046
description: `Start building your audience`,
4147
variant: 'muted',
4248
icon: { class: 'i-tabler-rocket' },
@@ -48,9 +54,10 @@ export async function getPricingPage(args: { factory: CardFactory, site: Site })
4854
{ label: 'Email Support' },
4955
],
5056
button: {
51-
label: 'Start Free',
57+
label: 'Start Standard',
5258
icon: { class: 'i-tabler-rocket' },
53-
href: '#free-tier',
59+
href: await purchaseUrl({ site, priceLookupKey: 'standard_month' }),
60+
hrefAnnual: await purchaseUrl({ site, priceLookupKey: 'standard_year' }),
5461
},
5562
},
5663
{
@@ -73,8 +80,8 @@ export async function getPricingPage(args: { factory: CardFactory, site: Site })
7380
button: {
7481
label: 'Start Pro Trial',
7582
icon: { class: 'i-tabler-stars' },
76-
href: await purchaseUrl({ fictionStripe, priceLookupKey: 'pro_month' }),
77-
hrefAnnual: await purchaseUrl({ fictionStripe, priceLookupKey: 'pro_year' }),
83+
href: await purchaseUrl({ site, priceLookupKey: 'pro_month' }),
84+
hrefAnnual: await purchaseUrl({ site, priceLookupKey: 'pro_year' }),
7885
},
7986
},
8087
{
@@ -98,8 +105,8 @@ export async function getPricingPage(args: { factory: CardFactory, site: Site })
98105
button: {
99106
label: 'Start Workshop Trial',
100107
icon: { class: 'i-tabler-crown' },
101-
href: await purchaseUrl({ fictionStripe, priceLookupKey: 'elite_month' }),
102-
hrefAnnual: await purchaseUrl({ fictionStripe, priceLookupKey: 'elite_year' }),
108+
href: await purchaseUrl({ site, priceLookupKey: 'elite_month' }),
109+
hrefAnnual: await purchaseUrl({ site, priceLookupKey: 'elite_year' }),
103110
},
104111
},
105112
],

fly/fiction.gateway.toml

+25-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# fly.toml app configuration file generated for fiction-gateway
1+
# fly.toml for fiction-gateway
22
app = 'fiction-gateway'
33
primary_region = 'lax'
4+
kill_timeout = "5s"
5+
kill_signal = "SIGINT"
46

57
[build]
68
dockerfile = './Dockerfile'
@@ -9,32 +11,36 @@ build-target = 'fiction-gateway'
911
[deploy]
1012
strategy = 'bluegreen'
1113

12-
# Using services instead of http_service for TCP passthrough
14+
# HTTP Service (Port 80)
1315
[[services]]
14-
internal_port = 6565
1516
protocol = "tcp"
16-
auto_stop_machines = true
17-
auto_start_machines = true
18-
min_machines_running = 1
19-
processes = [ "app" ]
17+
internal_port = 6565
18+
auto_stop_machines = false # Changed to match example
19+
auto_start_machines = false # Changed to match example
20+
21+
[services.concurrency]
22+
hard_limit = 170 # Adjusted to match example
23+
soft_limit = 150 # Adjusted to match example
2024

21-
# TCP passthrough port
2225
[[services.ports]]
23-
port = 443
24-
handlers = [] # Empty handlers for TCP passthrough
26+
port = 80
27+
handlers = [ "http" ]
28+
29+
# HTTPS Service (Port 443)
30+
[[services]]
31+
protocol = "tcp"
32+
internal_port = 6565
33+
auto_stop_machines = false
34+
auto_start_machines = false
2535

2636
[services.concurrency]
27-
type = 'requests'
28-
hard_limit = 1000
29-
soft_limit = 500
37+
hard_limit = 170
38+
soft_limit = 150
3039

31-
# Health check
32-
[[services.tcp_checks]]
33-
interval = "60s"
34-
timeout = "5s"
35-
grace_period = "10s"
40+
[[services.ports]]
41+
port = 443
42+
# No handlers for raw TCP mode
3643

37-
# VM configuration remains the same
3844
[[vm]]
3945
size = 'performance-1x'
4046
memory = '8gb'

fly/proxy/Caddyfile

+2-6
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@
99
level INFO
1010
}
1111

12+
# DNS challenge config - no resolvers needed
1213
acme_dns cloudflare {env.CLOUDFLARE_API_TOKEN}
13-
resolvers 1.1.1.1
1414
}
1515

1616
:443 {
17-
# Add health check endpoint
18-
handle /healthz {
19-
respond "OK" 200
20-
}
21-
17+
# Main proxy config
2218
reverse_proxy fiction-gateway.internal:6565 {
2319
header_up Host {http.request.host}
2420
header_up X-Real-IP {remote_ip}

icon-red.png

39 KB
Loading

0 commit comments

Comments
 (0)