Skip to content

Commit

Permalink
perf: 使用fork仓库
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Feb 2, 2024
1 parent f533391 commit efbd531
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 676 deletions.
20 changes: 7 additions & 13 deletions initfs/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,26 @@ cp -av /tmp/nginx.conf /etc/nginx/http.d/default.conf
cd /var/www

if [ ! -d /var/www/api ]; then
wget https://github.com/imsyy/DailyHotApi/archive/refs/heads/master.tar.gz
wget https://github.com/rehiy/dailyhot-api/archive/refs/heads/master.tar.gz
tar xvf master.tar.gz && mv DailyHotApi-master api
rm -f master.tar.gz
fi

cd /var/www/api

sed -i "s|parent:|title:|" routes/ngabbs.js
sed -i 's|\$(this)|\$(e)|g' routes/ithome.js
sed -i 's|each(()|each((i,e)|g' routes/ithome.js

[ -d node_modules ] || npm i

######

cd /var/www

if [ ! -d /var/www/web ]; then
wget https://github.com/imsyy/DailyHot/archive/refs/heads/master.tar.gz
tar xvf master.tar.gz && mv DailyHot-master web
if [ ! -d /var/www/front-build ]; then
wget https://github.com/rehiy/dailyhot-front/archive/refs/heads/master.tar.gz
tar xvf master.tar.gz && mv DailyHot-master front-build
rm -f master.tar.gz
fi

cp -av /tmp/web/* web/

cd /var/www/web
cd /var/www/front-build

sed -i "s|Copyright By|$(date +'%Y')|" src/components/Footer.vue
sed -i 's|"author": "imsyy"|"author": "APP_COPYRIGHT"|' package.json
Expand All @@ -51,8 +45,8 @@ echo "VITE_DIR=/" >>.env
[ -d node_modules ] || npm i
[ -d dist ] || npm run build

mv dist /var/www/webui
rm -rf /var/www/web
mv dist /var/www/front
rm -rf /var/www/front-build

######

Expand Down
2 changes: 1 addition & 1 deletion initfs/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV_REPLACER="s|APP_ICP|$APP_ICP|g"
ENV_REPLACER="$ENV_REPLACER; s|APP_COPYRIGHT_URL|$APP_COPYRIGHT_URL|g"
ENV_REPLACER="$ENV_REPLACER; s|APP_COPYRIGHT|$APP_COPYRIGHT|g"

sed -i "$ENV_REPLACER" /var/www/webui/assets/*.js
sed -i "$ENV_REPLACER" /var/www/front/assets/*.js

node /var/www/api/index.js &
nginx -g "daemon off;"
2 changes: 1 addition & 1 deletion initfs/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ server {
listen [::]:80;

location / {
root /var/www/webui;
root /var/www/front;
index index.html index.htm;
}

Expand Down
Binary file removed initfs/web/public/logo/douban_group.png
Binary file not shown.
Binary file removed initfs/web/public/logo/github.png
Binary file not shown.
Binary file removed initfs/web/public/logo/netease_music_toplist.png
Binary file not shown.
Binary file removed initfs/web/public/logo/ngabbs.png
Binary file not shown.
Binary file removed initfs/web/public/logo/qq_music_toplist.png
Binary file not shown.
Binary file removed initfs/web/public/logo/v2ex.png
Binary file not shown.
16 changes: 0 additions & 16 deletions initfs/web/src/api/index.js

This file was deleted.

Loading

0 comments on commit efbd531

Please sign in to comment.