Skip to content

Commit dadd21b

Browse files
authored
Merge branch 'main' into sentry-ai/mcp
2 parents 500acd9 + ac83a17 commit dadd21b

File tree

99 files changed

+7537
-6449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+7537
-6449
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ GITHUB_CLIENT_ID=""
5050
GITHUB_CLIENT_SECRET=""
5151
BEEHIIVE_API_KEY=""
5252
BEEHIIVE_PUBLICATION_ID=""
53+
LISTMONK_DOMAIN=""
54+
LISTMONK_USER=""
55+
LISTMONK_API_KEY=""
56+
LISTMONK_LIST_ID=""
5357
THREADS_APP_ID=""
5458
THREADS_APP_SECRET=""
5559
FACEBOOK_APP_ID=""

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
2-
<a href="https://affiliate.postiz.com">
3-
<img src="https://github.com/user-attachments/assets/af9f47b3-e20c-402b-bd11-02f39248d738" />
2+
<a href="https://github.com/growchief/growchief">
3+
<img alt="automate" src="https://github.com/user-attachments/assets/d760188d-8d56-4b05-a6c1-c57e67ef25cd" />
44
</a>
55
</p>
66

apps/backend/src/api/routes/public.controller.ts

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
import { Body, Controller, Get, Param, Post, Req, Res } from '@nestjs/common';
1+
import {
2+
Body,
3+
Controller,
4+
Get,
5+
Param,
6+
Post,
7+
Query,
8+
Req,
9+
Res,
10+
StreamableFile,
11+
} from '@nestjs/common';
212
import { ApiTags } from '@nestjs/swagger';
313
import { AgenciesService } from '@gitroom/nestjs-libraries/database/prisma/agencies/agencies.service';
414
import { PostsService } from '@gitroom/nestjs-libraries/database/prisma/posts/posts.service';
@@ -11,6 +21,10 @@ import { makeId } from '@gitroom/nestjs-libraries/services/make.is';
1121
import { getCookieUrlFromDomain } from '@gitroom/helpers/subdomain/subdomain.management';
1222
import { AgentGraphInsertService } from '@gitroom/nestjs-libraries/agent/agent.graph.insert.service';
1323
import { Nowpayments } from '@gitroom/nestjs-libraries/crypto/nowpayments';
24+
import { Readable, pipeline } from 'stream';
25+
import { promisify } from 'util';
26+
27+
const pump = promisify(pipeline);
1428

1529
@ApiTags('Public')
1630
@Controller('/public')
@@ -136,4 +150,46 @@ export class PublicController {
136150
console.log('cryptoPost', body, path);
137151
return this._nowpayments.processPayment(path, body);
138152
}
153+
154+
@Get('/stream')
155+
async streamFile(
156+
@Query('url') url: string,
157+
@Res() res: Response,
158+
@Req() req: Request
159+
) {
160+
if (!url.endsWith('mp4')) {
161+
return res.status(400).send('Invalid video URL');
162+
}
163+
164+
const ac = new AbortController();
165+
const onClose = () => ac.abort();
166+
req.on('aborted', onClose);
167+
res.on('close', onClose);
168+
169+
const r = await fetch(url, { signal: ac.signal });
170+
171+
if (!r.ok && r.status !== 206) {
172+
res.status(r.status);
173+
throw new Error(`Upstream error: ${r.statusText}`);
174+
}
175+
176+
const type = r.headers.get('content-type') ?? 'application/octet-stream';
177+
res.setHeader('Content-Type', type);
178+
179+
const contentRange = r.headers.get('content-range');
180+
if (contentRange) res.setHeader('Content-Range', contentRange);
181+
182+
const len = r.headers.get('content-length');
183+
if (len) res.setHeader('Content-Length', len);
184+
185+
const acceptRanges = r.headers.get('accept-ranges') ?? 'bytes';
186+
res.setHeader('Accept-Ranges', acceptRanges);
187+
188+
if (r.status === 206) res.status(206); // Partial Content for range responses
189+
190+
try {
191+
await pump(Readable.fromWeb(r.body as any), res);
192+
} catch (err) {
193+
}
194+
}
139195
}

apps/backend/src/mcp/main.mcp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class MainMcp {
5050
@McpTool({
5151
toolName: 'POSTIZ_SCHEDULE_POST',
5252
zod: {
53-
type: eenum(['draft', 'scheduled']),
53+
type: eenum(['draft', 'schedule']),
5454
configId: string(),
5555
generatePictures: boolean(),
5656
date: string().describe('UTC TIME'),

apps/backend/src/public-api/public.api.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ export class PublicApiModule implements NestModule {
3434
consumer.apply(PublicAuthMiddleware).forRoutes(...authenticatedController);
3535
}
3636
}
37+

apps/backend/src/services/auth/auth.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { OrganizationService } from '@gitroom/nestjs-libraries/database/prisma/o
77
import { AuthService as AuthChecker } from '@gitroom/helpers/auth/auth.service';
88
import { ProvidersFactory } from '@gitroom/backend/services/auth/providers/providers.factory';
99
import dayjs from 'dayjs';
10-
import { NewsletterService } from '@gitroom/nestjs-libraries/services/newsletter.service';
1110
import { NotificationService } from '@gitroom/nestjs-libraries/database/prisma/notifications/notification.service';
1211
import { ForgotReturnPasswordDto } from '@gitroom/nestjs-libraries/dtos/auth/forgot-return.password.dto';
1312
import { EmailService } from '@gitroom/nestjs-libraries/services/email.service';
13+
import { NewsletterService } from '@gitroom/nestjs-libraries/newsletter/newsletter.service';
1414

1515
@Injectable()
1616
export class AuthService {

apps/cron/src/tasks/check.missing.queues.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class CheckMissingQueues {
2828
)
2929
).filter((p) => !p.isJob);
3030

31+
3132
for (const job of notExists) {
3233
this._workerServiceProducer.emit('post', {
3334
id: job.id,

apps/frontend/next.config.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ const nextConfig = {
66
experimental: {
77
proxyTimeout: 90_000,
88
},
9+
// Document-Policy header for browser profiling
10+
async headers() {
11+
return [{
12+
source: "/:path*",
13+
headers: [{
14+
key: "Document-Policy",
15+
value: "js-profiling",
16+
}, ],
17+
}, ];
18+
},
919
reactStrictMode: false,
1020
transpilePackages: ['crypto-hash'],
1121
// Enable production sourcemaps for Sentry
@@ -60,15 +70,15 @@ export default withSentryConfig(nextConfig, {
6070
org: process.env.SENTRY_ORG,
6171
project: process.env.SENTRY_PROJECT,
6272
authToken: process.env.SENTRY_AUTH_TOKEN,
63-
73+
6474
// Sourcemap configuration optimized for monorepo
6575
sourcemaps: {
6676
disable: false,
6777
// More comprehensive asset patterns for monorepo
6878
assets: [
6979
".next/static/**/*.js",
7080
".next/static/**/*.js.map",
71-
".next/server/**/*.js",
81+
".next/server/**/*.js",
7282
".next/server/**/*.js.map",
7383
],
7484
ignore: [
@@ -97,7 +107,7 @@ export default withSentryConfig(nextConfig, {
97107
telemetry: false,
98108
silent: process.env.NODE_ENV === 'production',
99109
debug: process.env.NODE_ENV === 'development',
100-
110+
101111
// Error handling for CI/CD
102112
errorHandler: (error) => {
103113
console.warn("Sentry build error occurred:", error.message);
2.52 KB
Loading

apps/frontend/src/app/(app)/(preview)/p/[id]/page.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ import utc from 'dayjs/plugin/utc';
1010
import { VideoOrImage } from '@gitroom/react/helpers/video.or.image';
1111
import { CopyClient } from '@gitroom/frontend/components/preview/copy.client';
1212
import { getT } from '@gitroom/react/translation/get.translation.service.backend';
13+
import dynamicLoad from 'next/dynamic';
14+
15+
const RenderPreviewDate = dynamicLoad(
16+
() =>
17+
import('@gitroom/frontend/components/preview/render.preview.date').then(
18+
(mod) => mod.RenderPreviewDate
19+
),
20+
{ ssr: false }
21+
);
22+
1323
dayjs.extend(utc);
1424
export const metadata: Metadata = {
1525
title: `${isGeneralServerSide() ? 'Postiz' : 'Gitroom'} Preview`,
@@ -91,11 +101,8 @@ export default async function Auth({
91101
</div>
92102
)}
93103
<div className="flex-1">
94-
{t('publication_date', 'Publication Date:')}
95-
{dayjs
96-
.utc(post[0].publishDate)
97-
.local()
98-
.format('MMMM D, YYYY h:mm A')}
104+
{t('publication_date', 'Publication Date:')}{' '}
105+
<RenderPreviewDate date={post[0].publishDate} />
99106
</div>
100107
</div>
101108
</div>

0 commit comments

Comments
 (0)