ops: Remove unfurler daemon from install/build/start

This commit is contained in:
wiz 2025-12-23 22:37:20 +09:00
parent e7f0951069
commit 412c9c2f02
No known key found for this signature in database
GPG key ID: A394E332255A6173
13 changed files with 8 additions and 279 deletions

View file

@ -39,9 +39,6 @@ BITCOIN_INSTALL=ON
ELEMENTS_INSTALL=ON
CLN_INSTALL=ON
# install UNFURL
UNFURL_INSTALL=ON
# install CKPool
CKPOOL_INSTALL=ON
@ -365,13 +362,6 @@ CKPOOL_REPO_BRANCH=master
CKPOOL_LATEST_RELEASE=master
echo -n '.'
UNFURL_REPO_URL=https://github.com/mempool/mempool
UNFURL_REPO_NAME=unfurl
UNFURL_REPO_BRANCH=master
#UNFURL_LATEST_RELEASE=$(curl -s https://api.github.com/repos/mempool/mempool/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
UNFURL_LATEST_RELEASE=master
echo -n '.'
ELEMENTS_REPO_URL=https://github.com/ElementsProject/elements
ELEMENTS_REPO_NAME=elements
ELEMENTS_REPO_BRANCH=master
@ -408,23 +398,15 @@ DEBIAN_PKG+=(libboost-system-dev libboost-filesystem-dev libboost-chrono-dev lib
DEBIAN_PKG+=(nodejs npm mariadb-server nginx-core python3-certbot-nginx rsync ufw)
DEBIAN_PKG+=(geoipupdate)
DEBIAN_UNFURL_PKG=()
DEBIAN_UNFURL_PKG+=(cups chromium-bsu libatk1.0 libatk-bridge2.0 libxkbcommon-dev libxcomposite-dev)
DEBIAN_UNFURL_PKG+=(libxdamage-dev libxrandr-dev libgbm-dev libpango1.0-dev libasound-dev)
# packages needed for mempool ecosystem
FREEBSD_PKG=()
FREEBSD_PKG+=(zsh sudo git screen curl wget calc neovim)
FREEBSD_PKG+=(openssh-portable py311-pip rust llvm17 jq base64 libzmq4)
FREEBSD_PKG+=(boost-libs autoconf automake gmake gcc gcc13 libevent libtool pkgconf cmake)
FREEBSD_PKG+=(nginx rsync py311-certbot-nginx mariadb1011-server)
FREEBSD_PKG+=(redis sqlite3 libzmq4)
FREEBSD_PKG+=(redis sqlite3 libzmq4 pango cairo)
FREEBSD_PKG+=(libepoll-shim)
FREEBSD_UNFURL_PKG=()
FREEBSD_UNFURL_PKG+=(nvidia-driver-470 chromium xinit xterm twm ja-sourcehansans-otf)
FREEBSD_UNFURL_PKG+=(zh-sourcehansans-sc-otf ko-aleefonts-ttf lohit tlwg-ttf)
#############################
##### utility functions #####
#############################
@ -949,12 +931,6 @@ else
ELEMENTS_ELECTRS_INSTALL=OFF
fi
if grep Unfurl $tempfile >/dev/null 2>&1;then
UNFURL_INSTALL=ON
else
UNFURL_INSTALL=OFF
fi
##################
## dialog part 2 #
##################
@ -1451,6 +1427,8 @@ case $OS in
######## FIXME: this code doesn't work properly, needs fixing
#
# crontab -l|head -3|sed -e s/...................//|zsh
#
# echo "[*] Installing Core Lightning mainnet Cronjob"
# public_ipv4=$( ifconfig | grep 'inet ' | awk -F ' ' '{ print $2 }' | grep -v '^103\.165\.192\.' | grep -v '^127\.0\.0\.1' )
# public_ipv6=$( ifconfig | grep 'inet6' | awk -F ' ' '{ print $2 }' | grep -v '^2001:df6:7280::' | grep -v '^fe80::' | grep -v '^::1' )
@ -1468,75 +1446,6 @@ esac
fi
#######################
# Unfurl installation #
#######################
if [ "${UNFURL_INSTALL}" = ON ];then
echo "[*] Insalling Unfurl source"
case $OS in
FreeBSD)
if pciconf -lv|grep -i nvidia >/dev/null 2>&1;then
echo "[*] GPU detected: Installing packages for Unfurl"
osPackageInstall ${FREEBSD_UNFURL_PKG[@]}
echo 'allowed_users = anybody' >> /usr/local/etc/X11/Xwrapper.config
echo 'kld_list="nvidia"' >> /etc/rc.conf
echo 'nvidia_xorg_enable="YES"' >> /etc/rc.conf
echo "[*] Installing color emoji"
osSudo "${ROOT_USER}" curl -sSL "https://github.com/samuelngs/apple-emoji-linux/releases/download/ios-15.4/AppleColorEmoji.ttf" -o /usr/local/share/fonts/TTF/AppleColorEmoji.ttf
cat > /usr/local/etc/fonts/conf.d/01-emoji.conf <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Apple Color Emoji</string>
</edit>
</match>
<match>
<test name="family"><string>serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Apple Color Emoji</string>
</edit>
</match>
<match>
<test name="family"><string>Apple Color Emoji</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Apple Color Emoji</string>
</edit>
</match>
</fontconfig>
EOF
fi
;;
Debian)
echo "[*] Installing packages for Unfurl"
osPackageInstall ${DEBIAN_UNFURL_PKG[@]}
echo "[*] Cloning Mempool (Unfurl) repo from ${UNFURL_REPO_URL}"
osSudo "${UNFURL_USER}" git config --global pull.rebase true
osSudo "${UNFURL_USER}" git config --global advice.detachedHead false
osSudo "${UNFURL_USER}" git clone --branch "${UNFURL_REPO_BRANCH}" "${UNFURL_REPO_URL}" "${UNFURL_HOME}/${UNFURL_REPO_NAME}"
osSudo "${UNFURL_USER}" ln -s unfurl/production/unfurl-build upgrade
osSudo "${UNFURL_USER}" ln -s unfurl/production/unfurl-kill stop
osSudo "${UNFURL_USER}" ln -s unfurl/production/unfurl-start start
echo "[*] Installing nvm.sh from GitHub"
osSudo "${UNFURL_USER}" sh -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh'
echo "[*] Building NodeJS via nvm.sh"
osSudo "${UNFURL_USER}" zsh -c 'source ~/.zshrc ; nvm install v22.14.0 --shared-zlib'
;;
esac
fi
################################
# Bitcoin instance for Mainnet #
################################

View file

@ -66,19 +66,6 @@ build_frontend()
npm run build || exit 1
}
build_unfurler()
{
local site="$1"
echo "[*] Building unfurler for ${site}"
[ -z "${HASH}" ] && exit 1
cd "$HOME/${site}/unfurler" || exit 1
if [ ! -e "config.json" ];then
cp "${HOME}/mempool/production/unfurler-config.${site}.json" "config.json"
fi
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install || exit 1
npm run build || exit 1
}
build_backend()
{
local site="$1"
@ -165,11 +152,6 @@ for target in $frontend_repos;do
ship_frontend "${target}"
done
# build unfurlers
for repo in $frontend_repos;do
build_unfurler "${repo}"
done
# notify everyone
#echo "${HOSTNAME} updated to \`${REF}\` @ \`${HASH}\`" | /usr/local/bin/keybase chat send --nonblock --channel general mempool.dev
#echo "${HOSTNAME} updated to \`${REF}\` @ \`${HASH}\`" | /usr/local/bin/keybase chat send --nonblock --channel general "mempool.ops.${LOCATION}"

View file

@ -1,13 +0,0 @@
{
"SERVER": {
"HOST": "https://mempool.space",
"HTTP_PORT": 8001
},
"MEMPOOL": {
"HTTP_HOST": "https://mempool.space",
"HTTP_PORT": 443
},
"PUPPETEER": {
"CLUSTER_SIZE": 8
}
}

View file

@ -6,15 +6,6 @@ killall node 2>/dev/null
# kill "while true" loops
killall sh 2>/dev/null
# kill unfurler chrome instances
killall chrome 2>/dev/null
# kill xorg
killall xinit Xorg 2>/dev/null
# kill dbus
killall dbus-daemon 2>/dev/null
# kill nginx cache warmer scripts
for pid in `ps uaxww|grep warmer|grep zsh|awk '{print $2}'`;do
kill $pid

View file

@ -11,15 +11,11 @@ for site in mainnet mainnet-lightning testnet testnet-lightning testnet4 signet
screen -dmS "${site}" sh -c 'while true;do npm run start-production;sleep 1;done'
done
export DISPLAY=:0
screen -dmS x startx
sleep 3
# start unfurlers for each frontend
for site in mainnet liquid onbtc bitb meta river strategy xxi;do
cd "$HOME/${site}/unfurler" && \
echo "starting mempool unfurler: ${site}" && \
screen -dmS "unfurler-${site}" sh -c 'while true;do npm run unfurler;sleep 2;done'
# start SSR for each frontend
for site in services;do
cd "$HOME/${site}/ssr" && \
echo "starting ${site} SSR daemon: ${site}" && \
screen -dmS "${site}-ssr" sh -c 'while true;do npm run start;done'
done
# start nginx warm cacher

View file

@ -1,17 +0,0 @@
{
"SERVER": {
"HOST": "https://bitb.tk7.mempool.space",
"HTTP_PORT": 8006
},
"MEMPOOL": {
"HTTP_HOST": "http://127.0.0.1",
"HTTP_PORT": 86,
"NETWORK": "bitb"
},
"PUPPETEER": {
"CLUSTER_SIZE": 4,
"EXEC_PATH": "/usr/local/bin/chrome",
"MAX_PAGE_AGE": 86400,
"RENDER_TIMEOUT": 3000
}
}

View file

@ -1,17 +0,0 @@
{
"SERVER": {
"HOST": "https://liquid.fra.mempool.space",
"HTTP_PORT": 8003
},
"MEMPOOL": {
"HTTP_HOST": "http://127.0.0.1",
"HTTP_PORT": 83,
"NETWORK": "liquid"
},
"PUPPETEER": {
"CLUSTER_SIZE": 8,
"EXEC_PATH": "/usr/local/bin/chrome",
"MAX_PAGE_AGE": 86400,
"RENDER_TIMEOUT": 3000
}
}

View file

@ -1,17 +0,0 @@
{
"SERVER": {
"HOST": "https://mempool.tk7.mempool.space",
"HTTP_PORT": 8001
},
"MEMPOOL": {
"HTTP_HOST": "http://127.0.0.1",
"HTTP_PORT": 81,
"NETWORK": "bitcoin"
},
"PUPPETEER": {
"CLUSTER_SIZE": 8,
"EXEC_PATH": "/usr/local/bin/chrome",
"MAX_PAGE_AGE": 86400,
"RENDER_TIMEOUT": 3000
}
}

View file

@ -1,17 +0,0 @@
{
"SERVER": {
"HOST": "https://metaplanet.mempool.space",
"HTTP_PORT": 8005
},
"MEMPOOL": {
"HTTP_HOST": "http://127.0.0.1",
"HTTP_PORT": 85,
"NETWORK": "meta"
},
"PUPPETEER": {
"CLUSTER_SIZE": 2,
"EXEC_PATH": "/usr/local/bin/chrome",
"MAX_PAGE_AGE": 86400,
"RENDER_TIMEOUT": 3000
}
}

View file

@ -1,17 +0,0 @@
{
"SERVER": {
"HOST": "https://onbtc.tk7.mempool.space",
"HTTP_PORT": 8004
},
"MEMPOOL": {
"HTTP_HOST": "http://127.0.0.1",
"HTTP_PORT": 84,
"NETWORK": "onbtc"
},
"PUPPETEER": {
"CLUSTER_SIZE": 2,
"EXEC_PATH": "/usr/local/bin/chrome",
"MAX_PAGE_AGE": 86400,
"RENDER_TIMEOUT": 3000
}
}

View file

@ -1,17 +0,0 @@
{
"SERVER": {
"HOST": "https://river.tk7.mempool.space",
"HTTP_PORT": 8007
},
"MEMPOOL": {
"HTTP_HOST": "http://127.0.0.1",
"HTTP_PORT": 7,
"NETWORK": "river"
},
"PUPPETEER": {
"CLUSTER_SIZE": 2,
"EXEC_PATH": "/usr/local/bin/chrome",
"MAX_PAGE_AGE": 86400,
"RENDER_TIMEOUT": 3000
}
}

View file

@ -1,17 +0,0 @@
{
"SERVER": {
"HOST": "https://strategy.tk7.mempool.space",
"HTTP_PORT": 8008
},
"MEMPOOL": {
"HTTP_HOST": "http://127.0.0.1",
"HTTP_PORT": 88,
"NETWORK": "strategy"
},
"PUPPETEER": {
"CLUSTER_SIZE": 2,
"EXEC_PATH": "/usr/local/bin/chrome",
"MAX_PAGE_AGE": 86400,
"RENDER_TIMEOUT": 3000
}
}

View file

@ -1,17 +0,0 @@
{
"SERVER": {
"HOST": "https://xxi.tk7.mempool.space",
"HTTP_PORT": 8009
},
"MEMPOOL": {
"HTTP_HOST": "http://127.0.0.1",
"HTTP_PORT": 89,
"NETWORK": "xxi"
},
"PUPPETEER": {
"CLUSTER_SIZE": 2,
"EXEC_PATH": "/usr/local/bin/chrome",
"MAX_PAGE_AGE": 86400,
"RENDER_TIMEOUT": 3000
}
}