Skip to content

Commit

Permalink
feat: 支持ICP备案号
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Feb 1, 2024
1 parent 4427061 commit 59993dc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM node:alpine

LABEL version="1.0.2" \
LABEL version="1.0.3" \
maintainer="[email protected]"

ENV APP_ICP=
ENV APP_COPYRIGHT=Example
ENV APP_COPYRIGHT_RUL=http://www.example.org

Expand Down
8 changes: 4 additions & 4 deletions initfs/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ fi

cd /var/www/web

sed -i 's#"author": "imsyy"#"author": "APP_COPYRIGHT"#' package.json
sed -i 's#"github": "https://github.com/imsyy"#"github": "APP_COPYRIGHT_RUL"#' package.json
sed -i "s#Copyright By#$(date +'%Y')#" src/components/Footer.vue
sed -i "s|Copyright By|$(date +'%Y')|" src/components/Footer.vue
sed -i 's|"author": "imsyy"|"author": "APP_COPYRIGHT"|' package.json
sed -i 's|"github": "https://github.com/imsyy"|"github": "APP_COPYRIGHT_RUL"|' package.json

echo "VITE_GLOBAL_API=/api" >.env
echo "VITE_ICP=" >>.env
echo "VITE_ICP=APP_ICP" >>.env
echo "VITE_DIR=" >>.env

[ -d node_modules ] || npm i
Expand Down
7 changes: 5 additions & 2 deletions initfs/entrypoint
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/sh
#

sed -i "s|APP_COPYRIGHT|$APP_COPYRIGHT|g; s|APP_COPYRIGHT_URL|$APP_COPYRIGHT_URL|g" /var/www/webui/assets/*.js
ENV_REPLACER="s|APP_ICP|$APP_ICP|g"
ENV_REPLACER="$ENV_REPLACER; s|APP_COPYRIGHT|$APP_COPYRIGHT|g"
ENV_REPLACER="$ENV_REPLACER; s|APP_COPYRIGHT_URL|$APP_COPYRIGHT_URL|g"

node /var/www/api/index.js &
sed -i "$ENV_REPLACER" /var/www/webui/assets/*.js

node /var/www/api/index.js &
nginx -g "daemon off;"

0 comments on commit 59993dc

Please sign in to comment.