diff --git a/build.sh b/build.sh deleted file mode 100755 index 8ecc4d0..0000000 --- a/build.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/zsh - -d=${0:a:h} -cd $d/repos - -t=" -https://github.com/bluesky-social/atproto -https://github.com/did-method-plc/did-method-plc -https://github.com/bluesky-social/feed-generator -https://github.com/bluesky-social/social-app -https://github.com/bluesky-social/cookbook -https://github.com/itaru2622/bluesky-selfhost-env -" - -t=`echo $t|grep -v '^$'` -n=`echo $t|wc -l` - -for ((i=1;i<=$n;i++)) -do - tt=`echo $t|awk "NR==$i"` - dd=$d/repos/$tt:t - if [ -d $dd ];then - echo ok - cd $dd - git pull - cd $d/repos - else - git clone $tt - fi -done diff --git a/install.zsh b/install.zsh new file mode 100755 index 0000000..db88ae2 --- /dev/null +++ b/install.zsh @@ -0,0 +1,83 @@ +#!/bin/zsh + +d=${0:a:h} + +repos=( + https://github.com/did-method-plc/did-method-plc + https://github.com/bluesky-social/indigo + https://github.com/bluesky-social/atproto + https://github.com/bluesky-social/social-app + https://github.com/bluesky-social/feed-generator +) + +function run-env() { + host=syu.is + name=${host%%.*} + domain=${host##*.} + dh=${0:a:h:h} +} + +function run-dl() { + mkdir -p $d/repos + cd $d/repos + for ((i=1; i<=${#repos}; i++)); do + repo=${repos[$i]} + echo $repo + if [ ! -d $d/repos/${repo##*/} ];then + git clone $repo + fi + done + if [ ! -f $d/repos/feed-generator/Dockerfile ];then + cp -rf $d/docker/feed/Dockerfile $d/repos/feed-generator/ + fi +} + +function run-update() { + cd $d/repos + for ((i=1; i<=${#repos}; i++)); do + repo=${repos[$i]} + echo $repo + if [ -d $d/repos/${repo##*/} ];then + cd $d/repos/${repo##*/} + git pull + fi + done + cd $d + echo "docker compose build && docker compose up -d" +} + +function run-dl-icon() { + curl -sL https://raw.githubusercontent.com/bluesky-social/social-app/main/src/view/icons/Logotype.tsx -o $d/repos/social-app/src/view/icons/Logotype.tsx + cp -rf $d/repos/social-app/src/view/icons/Logotype.tsx $d/icons/ +} + + +function web-write() { + dt=$d/repos/social-app/src + cd $dt + grep -R bsky.social .|cut -d : -f 1|sort -u|xargs sed -i "s/bsky.social/syu.is/g" + grep -R bsky.app .|cut -d : -f 1|sort -u|xargs sed -i "s/bsky.app/web.syu.is/g" + grep -R public.api.syu.is ./lib/constants.ts | cut -d : -f 1|sort -u|xargs sed -i "s/public.api/bsky/g" + + f=$dt/view/icons/Logotype.tsx + o=$d/icons/Logotype.tsx + cp -rf $o $f + + #curl -sL https://raw.githubusercontent.com/bluesky-social/social-app/refs/heads/main/src/view/com/util/UserAvatar.tsx -o $f + f=$dt/view/com/util/UserAvatar.tsx + sed -i $t "s#/img/avatar/plain/#https://cdn.bsky.app/img/avatar/plain/#g" $f + sed -i $t "s#/img/avatar_thumbnail/plain/#https://bsky.syu.is/img/avatar/plain/#g" $f + sed -i $t "s#source={{uri: avatar}}#source={{ uri: hackModifyThumbnailPath(avatar, 1 > 0), }}#g" $f +} + +run-env +run-dl +case $1 in + update) + run-update + ;; + web) + web-write + ;; +esac + diff --git a/repos/atproto b/repos/atproto index 8f2b80a..22a96d6 160000 --- a/repos/atproto +++ b/repos/atproto @@ -1 +1 @@ -Subproject commit 8f2b80a0dcf118652452ea09764a947b09991e0f +Subproject commit 22a96d6b7459dbfd88c289ace88ec823e9adc6ee diff --git a/repos/did-method-plc b/repos/did-method-plc index 13da315..39f28d1 160000 --- a/repos/did-method-plc +++ b/repos/did-method-plc @@ -1 +1 @@ -Subproject commit 13da315787e50bd79548d5b695f4f597b43b4015 +Subproject commit 39f28d196f06367735b2c544533954ac17cdcac4 diff --git a/repos/feed-generator b/repos/feed-generator index 9a887dd..c14c54b 160000 --- a/repos/feed-generator +++ b/repos/feed-generator @@ -1 +1 @@ -Subproject commit 9a887dd8f2ee634c5e524cfa802f754878a91e5a +Subproject commit c14c54bd65eb2ea638e0be4303a4b1af53a211a6 diff --git a/repos/indigo b/repos/indigo new file mode 160000 index 0000000..c130614 --- /dev/null +++ b/repos/indigo @@ -0,0 +1 @@ +Subproject commit c130614850e554f9862d8e649373b53cee86dd3b diff --git a/repos/social-app b/repos/social-app index f6649e2..6c9e1d4 160000 --- a/repos/social-app +++ b/repos/social-app @@ -1 +1 @@ -Subproject commit f6649e22a762fa8f4d3060da0a274f3b83ecb06f +Subproject commit 6c9e1d4837e9e385da5ca0c89c28000ad25c70d8