ai/at
1
0

add social-app-custom

This commit is contained in:
2025-12-03 12:38:37 +09:00
parent 647dd5978c
commit 437ff949c9
11 changed files with 649 additions and 13 deletions

View File

@@ -108,7 +108,8 @@ function at-repos-social-app-avatar-write() {
grep -R syu.is .|cut -d : -f 1|sort -u|xargs sed -i "s/syu.is/${host}/g"
grep -R web.syu.is .|cut -d : -f 1|sort -u|xargs sed -i "s/web.syu.is/web.${host}/g"
f=$dt/lib/constants.ts
sed -i "s/public.api.web/bsky/g" $f
sed -i "s/public.api.bsky.app/bsky.syu.is/g" $f
sed -i "s/bsky.social/syu.is/g" $f
f=$dt/view/icons/Logotype.tsx
o=$d/icons/Logotype.tsx
cp -rf $o $f
@@ -156,6 +157,16 @@ function at-repos-social-app-agent-patch() {
popd
}
function at-repos-social-app-disable-external-services-patch() {
f=$d/repos/social-app/src/state/geolocation/const.ts
p_=$d/patching/8980-social-app-disable-external-services.diff
d_=$d/repos/social-app
echo "applying patch: under ${f} for ${p_}"
pushd ${d_}
patch -p1 < ${p_}
popd
}
function at-repos-ozone-patch() {
#DOMAIN=syu.is
cd $d/repos
@@ -188,7 +199,7 @@ function at-repos-build-docker-social() {
docker compose build --no-cache social-app
}
function at-repos-build-docker-tag() {
function at-repos-push-docker() {
docker restart registry
docker stop registry
docker rm registry
@@ -230,9 +241,11 @@ function at-repos-pull-docker() {
docker compose up -d --pull always
}
function at-origin-social-app() {
cp -rf $d/social-app-custom $d/repos/social-app
}
at-repos-env
case "`cat /etc/hostname`" in
at)
at-repos-pull-docker
@@ -243,11 +256,101 @@ case "`cat /etc/hostname`" in
at-repos-social-app-icon
at-repos-social-app-icon-origin
at-repos-social-app-avatar-write
at-repos-social-app-agent-patch
at-repos-social-app-disable-external-services-patch
if [ -n "$1" ] && [ "$1" = "social-app-custom" ];then
at-social-app-custom-pages
at-social-app-custom-screens
at-social-app-aiat-config
at-social-app-aiat-logo
at-origin-social-app
exit
fi
at-repos-atproto-service-bsky-api-patch
at-repos-atproto-service-pds-index-patch
at-repos-social-app-agent-patch
at-repos-ozone-patch
at-repos-build-docker-atproto
at-repos-build-docker-social
if [ -n "$1" ] && [ "$1" = "s" ];then
at-repos-push-docker
exit
fi
at-repos-build-docker-atproto
at-repos-push-docker
;;
esac
function at-social-app-custom-pages() {
d_=$d/repos/social-app
custom=$d/social-app-custom
echo "copying custom components to social-app"
# Create components directory if not exists
mkdir -p ${d_}/src/components/custom
# Copy custom components
cp ${custom}/PrivacyContent.tsx ${d_}/src/components/custom/
cp ${custom}/AppInfo.tsx ${d_}/src/components/custom/
echo "custom components copied successfully"
}
function at-social-app-aiat-config() {
d_=$d/repos/social-app
custom=$d/social-app-custom
echo "applying Aiat configuration"
# Update app.config.js
cd ${d_}
# Backup original
cp app.config.js app.config.js.orig
# Apply changes using sed
sed -i "s/name: 'Bluesky'/name: 'Aiat'/g" app.config.js
sed -i "s/slug: 'bluesky'/slug: 'aiat'/g" app.config.js
sed -i "s/scheme: 'bluesky'/scheme: 'aiat'/g" app.config.js
sed -i "s/owner: 'blueskysocial'/owner: 'syui'/g" app.config.js
sed -i "s/bundleIdentifier: 'xyz.blueskyweb.app'/bundleIdentifier: 'ai.syui.at'/g" app.config.js
# Update package.json name
sed -i 's/"name": "bsky.app"/"name": "aiat"/g' package.json
echo "Aiat configuration applied"
}
function at-social-app-aiat-logo() {
d_=$d/repos/social-app
custom=$d/social-app-custom
echo "applying Aiat logo"
# Create logo directory if not exists
mkdir -p ${custom}/assets
# Copy logo if exists in custom folder
if [ -f ${custom}/assets/icon.png ]; then
cp ${custom}/assets/icon.png ${d_}/assets/app-icons/ios_icon_default_next.png
echo "Aiat logo applied"
else
echo "Warning: Logo file not found at ${custom}/assets/icon.png"
echo "Please add your logo file there"
fi
}
function at-social-app-custom-screens() {
d_=$d/repos/social-app
custom=$d/social-app-custom
echo "applying custom screens"
# Copy custom screen files
cp ${custom}/PrivacyPolicy.screen.tsx ${d_}/src/view/screens/PrivacyPolicy.tsx
cp ${custom}/Support.screen.tsx ${d_}/src/view/screens/Support.tsx
cp ${custom}/LicenseNotice.tsx ${d_}/src/components/custom/
echo "custom screens applied"
}