ai/at
1
0

fix git checkout

This commit is contained in:
2025-12-10 17:41:42 +09:00
parent f14ce21ded
commit 14cc2e2dc8
2 changed files with 27 additions and 26 deletions

View File

@@ -86,7 +86,7 @@ services:
depends_on:
database:
condition: service_healthy
command: ["/bigsky", "--crawl-insecure-ws"]
#command: ["/bigsky", "--crawl-insecure-ws"]
social-app:
ports:

View File

@@ -52,6 +52,14 @@ function at-repos-env() {
name=${host%%.*}
domain=${host##*.}
dport=5000
# Pinned commits for stable versions (set to empty to use latest)
# indigo: 8be10287 was working, e1034c67 (latest) has issues
typeset -A PINNED_COMMITS
PINNED_COMMITS=(
[indigo]="8be10287"
[atproto]=""
)
}
# Arrays for patch management
@@ -120,31 +128,23 @@ function at-repos-pull() {
cd $d
}
function at-repos-social-app-ios-patch() {
$d/ios/setup.zsh
function at-repos-checkout-pinned() {
echo "🔒 Checking out pinned commits..."
cd $d/repos
for repo_name pinned_commit in ${(kv)PINNED_COMMITS}; do
if [ -n "$pinned_commit" ] && [ -d "$d/repos/$repo_name" ]; then
echo " 📌 $repo_name -> $pinned_commit"
cd $d/repos/$repo_name
git fetch origin
git checkout $pinned_commit
cd $d/repos
fi
done
cd $d
}
function at-repos-social-app-avatar-write() {
did_admin=did:plc:6qyecktefllvenje24fcxnie
dt=$d/repos/social-app/src
cd $dt
grep -R syu.is .|cut -d : -f 1|sort -u|xargs sediment "s/syu.is/${host}/g"
grep -R web.syu.is .|cut -d : -f 1|sort -u|xargs sediment "s/web.syu.is/web.${host}/g"
f=$dt/lib/constants.ts
sediment "s#export const BSKY_SERVICE = 'https://bsky.social'#export const BSKY_SERVICE = 'https://${host}'#g" $f
sediment "s#export const BSKY_SERVICE_DID = 'did:web:bsky.social'#export const BSKY_SERVICE_DID = 'did:web:${host}'#g" $f
sediment "s#export const PUBLIC_BSKY_SERVICE = 'https://public.api.bsky.app'#export const PUBLIC_BSKY_SERVICE = 'https://bsky.${host}'#g" $f
sediment "s#export const PUBLIC_APPVIEW = 'https://api.bsky.app'#export const PUBLIC_APPVIEW = 'https://bsky.${host}'#g" $f
sediment "s#export const PUBLIC_APPVIEW_DID = 'did:web:api.bsky.app'#export const PUBLIC_APPVIEW_DID = 'did:web:bsky.${host}'#g" $f
f=$dt/view/com/util/UserAvatar.tsx
curl -sL https://raw.githubusercontent.com/bluesky-social/social-app/refs/heads/main/src/view/com/util/UserAvatar.tsx -o $f
sediment "s#/img/avatar/plain/#https://cdn.web.syu.is/img/avatar/plain/#g" $f
sediment "s#/img/avatar_thumbnail/plain/#https://bsky.${host}/img/avatar/plain/#g" $f
sediment "s#source={{uri: avatar}}#source={{ uri: hackModifyThumbnailPath(avatar, 1 > 0), }}#g" $f
curl -sL https://raw.githubusercontent.com/bluesky-social/social-app/refs/heads/main/src/lib/strings/url-helpers.ts -o $dt/lib/strings/url-helpers.ts
sediment "s#https://go.web.syu.is/redirect?u=\${encodeURIComponent(url)}#\${url}#g" $dt/lib/strings/url-helpers.ts
grep -R $did_admin .|cut -d : -f 1|sort -u|xargs sediment "s/${did_admin}/${did}/g"
function at-repos-social-app-ios-patch() {
$d/ios/setup.zsh
}
# Common patch function with status detection
@@ -413,6 +413,7 @@ function at-repos-reset-bgs-db() {
echo "⚙️ Updating Slurp Config..."
docker exec -i $dp psql -U postgres -d bgs -c "UPDATE slurp_configs SET new_subs_disabled = false, new_pds_per_day_limit = 1000 WHERE id = 1;"
# host=pds:3000
echo "🔗 Registering Trusted Domain..."
# Retry loop for addTrustedDomain as BGS might still be warming up
for i in {1..5}; do
@@ -431,7 +432,7 @@ function at-repos-reset-bgs-db() {
result=$(curl -s -X POST "https://bgs.${host}/admin/pds/requestCrawl" \
-H "Authorization: Bearer ${BGS_ADMIN_KEY}" \
-H "Content-Type: application/json" \
-d "{\"hostname\":\"pds:3000\"}" \
-d "{\"hostname\":\"{$host}\"}" \
-w "%{http_code}" -o /dev/null)
if [ "$result" = "200" ]; then
echo "✅ PDS crawl requested successfully"
@@ -571,8 +572,8 @@ case "`cat /etc/hostname`" in
*)
at-repos-clone
at-repos-pull
at-repos-checkout-pinned
at-repos-social-app-ios-patch
#at-repos-social-app-avatar-write
at-repos-patch-apply-all
at-repos-ozone-patch
show-failed-patches