Skip to content

Commit 659ffd8

Browse files
authored
Merge branch 'main' into @APiligrim/metatags
2 parents 599346a + 66526a8 commit 659ffd8

File tree

308 files changed

+4423
-6810
lines changed

Some content is hidden

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

308 files changed

+4423
-6810
lines changed

.github/workflows/build-and-push-link-aws.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build-and-push-link-aws
22
on:
33
workflow_dispatch:
4+
pull_request:
5+
paths:
6+
- 'bskylink/**'
7+
- 'Dockerfile.bskylink'
8+
- '.github/workflows/build-and-push-link-aws.yaml'
49

510
env:
611
REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }}
@@ -45,7 +50,7 @@ jobs:
4550
uses: docker/build-push-action@v4
4651
with:
4752
context: .
48-
push: ${{ github.event_name != 'pull_request' }}
53+
push: true
4954
file: ./Dockerfile.bskylink
5055
tags: ${{ steps.meta.outputs.tags }}
5156
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/build-and-push-ogcard-aws.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build-and-push-ogcard-aws
22
on:
33
workflow_dispatch:
4+
pull_request:
5+
paths:
6+
- 'bskyogcard/**'
7+
- 'Dockerfile.bskyogcard'
8+
- '.github/workflows/build-and-push-ogcard-aws.yaml'
49

510
env:
611
REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }}
@@ -45,7 +50,7 @@ jobs:
4550
uses: docker/build-push-action@v4
4651
with:
4752
context: .
48-
push: ${{ github.event_name != 'pull_request' }}
53+
push: true
4954
file: ./Dockerfile.bskyogcard
5055
tags: ${{ steps.meta.outputs.tags }}
5156
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/build-submit-ios.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ jobs:
5353

5454
- uses: maxim-lobanov/setup-xcode@v1
5555
with:
56-
xcode-version: '16.4'
56+
xcode-version: "16.4"
5757

5858
- name: ☕️ Setup Cocoapods
5959
uses: maxim-lobanov/setup-cocoapods@v1
6060
with:
61-
version: 1.14.3
61+
version: 1.16.2
6262

6363
- name: 💾 Cache Pods
6464
uses: actions/cache@v3

.github/workflows/bundle-deploy-eas-update.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ jobs:
192192

193193
- uses: maxim-lobanov/setup-xcode@v1
194194
with:
195-
xcode-version: '16.2'
195+
xcode-version: "16.2"
196196

197197
- name: ☕️ Setup Cocoapods
198198
uses: maxim-lobanov/setup-cocoapods@v1
199199
with:
200-
version: 1.14.3
200+
version: 1.16.2
201201

202202
- name: 💾 Cache Pods
203203
uses: actions/cache@v3
@@ -293,8 +293,8 @@ jobs:
293293

294294
- uses: actions/setup-java@v4
295295
with:
296-
distribution: 'temurin'
297-
java-version: '17'
296+
distribution: "temurin"
297+
java-version: "17"
298298

299299
- name: ⚙️ Install dependencies
300300
run: yarn install
@@ -332,7 +332,7 @@ jobs:
332332
id: timestamp
333333
uses: nanzm/get-time-action@master
334334
with:
335-
format: 'MM-DD-HH-mm-ss'
335+
format: "MM-DD-HH-mm-ss"
336336

337337
- name: 🚀 Upload Artifact
338338
id: upload-artifact

Dockerfile.bskyogcard

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ COPY --from=build /app /app
2626
RUN mkdir /app/data && chown node /app/data
2727

2828
VOLUME /app/data
29-
EXPOSE 3000
29+
EXPOSE 3000 3001
3030
ENV CARD_PORT=3000
31+
ENV CARD_METRICS_PORT=3001
3132
ENV NODE_ENV=production
3233
# potential perf issues w/ io_uring on this version of node
3334
ENV UV_USE_IO_URING=0

__tests__/lib/images.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {createDownloadResumable, deleteAsync} from 'expo-file-system'
1+
import {createDownloadResumable, deleteAsync} from 'expo-file-system/legacy'
22
import {manipulateAsync, SaveFormat} from 'expo-image-manipulator'
33

44
import {

app.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module.exports = function (_config) {
4343
icon: './assets/app-icons/ios_icon_default_light.png',
4444
userInterfaceStyle: 'automatic',
4545
primaryColor: '#1083fe',
46+
newArchEnabled: false,
4647
ios: {
4748
supportsTablet: false,
4849
bundleIdentifier: 'xyz.blueskyweb.app',
@@ -102,6 +103,7 @@ module.exports = function (_config) {
102103
'zh-Hans',
103104
'zh-Hant',
104105
],
106+
UIDesignRequiresCompatibility: true,
105107
},
106108
associatedDomains: ASSOCIATED_DOMAINS,
107109
entitlements: {
@@ -207,13 +209,12 @@ module.exports = function (_config) {
207209
{
208210
ios: {
209211
deploymentTarget: '15.1',
210-
newArchEnabled: false,
212+
buildReactNativeFromSource: true,
211213
},
212214
android: {
213215
compileSdkVersion: 35,
214216
targetSdkVersion: 35,
215217
buildToolsVersion: '35.0.0',
216-
newArchEnabled: false,
217218
},
218219
},
219220
],

bskylink/src/bin.ts

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,62 @@
11
import {Database, envToCfg, httpLogger, LinkService, readEnv} from './index.js'
2+
23
async function main() {
3-
const env = readEnv()
4-
const cfg = envToCfg(env)
5-
if (cfg.db.migrationUrl) {
6-
const migrateDb = Database.postgres({
7-
url: cfg.db.migrationUrl,
8-
schema: cfg.db.schema,
9-
})
10-
await migrateDb.migrateToLatestOrThrow()
11-
await migrateDb.close()
12-
}
4+
try {
5+
httpLogger.info('Starting blink service')
136

14-
const link = await LinkService.create(cfg)
7+
const env = readEnv()
8+
const cfg = envToCfg(env)
159

16-
if (link.ctx.cfg.service.safelinkEnabled) {
17-
link.ctx.safelinkClient.runFetchEvents()
18-
}
10+
httpLogger.info(
11+
{
12+
port: cfg.service.port,
13+
safelinkEnabled: cfg.service.safelinkEnabled,
14+
hasDbUrl: !!cfg.db.url,
15+
hasDbMigrationUrl: !!cfg.db.migrationUrl,
16+
},
17+
'Configuration loaded',
18+
)
19+
20+
if (cfg.db.migrationUrl) {
21+
httpLogger.info('Running database migrations')
22+
const migrateDb = Database.postgres({
23+
url: cfg.db.migrationUrl,
24+
schema: cfg.db.schema,
25+
})
26+
await migrateDb.migrateToLatestOrThrow()
27+
await migrateDb.close()
28+
httpLogger.info('Database migrations completed')
29+
}
1930

20-
await link.start()
21-
httpLogger.info('link service is running')
22-
process.on('SIGTERM', async () => {
23-
httpLogger.info('link service is stopping')
24-
await link.destroy()
25-
httpLogger.info('link service is stopped')
26-
})
31+
httpLogger.info('Creating LinkService')
32+
const link = await LinkService.create(cfg)
33+
34+
if (link.ctx.cfg.service.safelinkEnabled) {
35+
httpLogger.info('Starting Safelink client')
36+
link.ctx.safelinkClient.runFetchEvents()
37+
}
38+
39+
await link.start()
40+
httpLogger.info('Link service is running')
41+
42+
process.on('SIGTERM', async () => {
43+
httpLogger.info('Link service is stopping')
44+
await link.destroy()
45+
httpLogger.info('Link service is stopped')
46+
})
47+
} catch (error) {
48+
httpLogger.error(
49+
{
50+
error: String(error),
51+
stack: error instanceof Error ? error.stack : undefined,
52+
},
53+
'Failed to start blink service',
54+
)
55+
process.exit(1)
56+
}
2757
}
2858

29-
main()
59+
main().catch(error => {
60+
console.error('Unhandled startup error:', error)
61+
process.exit(1)
62+
})

bskylink/src/db/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ export class Database {
3434

3535
static postgres(opts: PgOptions): Database {
3636
const {schema, url, txLockNonce} = opts
37+
log.info(
38+
{
39+
schema,
40+
poolSize: opts.poolSize,
41+
poolMaxUses: opts.poolMaxUses,
42+
poolIdleTimeoutMs: opts.poolIdleTimeoutMs,
43+
},
44+
'Creating database connection',
45+
)
46+
3747
const pool =
3848
opts.pool ??
3949
new Pg.Pool({

bskyogcard/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414
"@atproto/common": "^0.4.0",
1515
"@resvg/resvg-js": "^2.6.2",
1616
"express": "^4.19.2",
17+
"express-prom-bundle": "^7.0.0",
1718
"http-terminator": "^3.2.0",
1819
"pino": "^9.2.0",
20+
"prom-client": "^15.1.3",
1921
"react": "^18.3.1",
2022
"satori": "^0.10.13",
2123
"twemoji": "^14.0.2"
2224
},
2325
"devDependencies": {
26+
"@types/express": "^4.17.21",
2427
"@types/node": "^20.14.3",
2528
"ts-node": "^10.9.2",
2629
"typescript": "^5.4.5"

0 commit comments

Comments
 (0)