From 83dc20e502c5f23b5b1a77b9fcbce926084536be Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Tue, 4 Apr 2023 18:20:26 +0800 Subject: [PATCH] u --- debian-setup.Dockerfile | 2 +- debian-setup.sh | 8 ++++---- expect-ssh2server.sh | 4 ++-- git-clone-all.sh | 2 +- home-import.sh | 2 -- home-config.sh => nixhome-config.sh | 13 ++++++++----- nixhome-import.sh | 2 ++ nixhome/.bashrc | 12 ++++++------ seafile-install.sh | 2 +- uniapp-cli.Dockerfile | 4 ++-- 10 files changed, 27 insertions(+), 24 deletions(-) delete mode 100644 home-import.sh rename home-config.sh => nixhome-config.sh (89%) mode change 100755 => 100644 create mode 100644 nixhome-import.sh diff --git a/debian-setup.Dockerfile b/debian-setup.Dockerfile index fedbeff..66970e7 100644 --- a/debian-setup.Dockerfile +++ b/debian-setup.Dockerfile @@ -2,7 +2,7 @@ FROM debian:11.5 LABEL org.opencontainers.image.authors="luk" RUN apt update && apt install curl -y -RUN curl https://git.faronear.org/fon/sysconfig/raw/branch/main/debian-setup.sh > ~/debian-setup.sh && echo -e "l\n\n\n\n\n" | bash ~/debian-setup.sh +RUN curl https://git.faronear.org/npm/sysconfig/raw/branch/main/debian-setup.sh > ~/debian-setup.sh && echo -e "l\n\n\n\n\n" | bash ~/debian-setup.sh CMD bash diff --git a/debian-setup.sh b/debian-setup.sh index aaa0ff0..671b29c 100644 --- a/debian-setup.sh +++ b/debian-setup.sh @@ -2,7 +2,7 @@ echo "Usage: this.sh [NewUser]" echo "Example: this.sh alice" -echo "curl https://git.faronear.org/fon/sysconfig/raw/branch/main/debian-setup.sh > ~/debian-setup.sh && bash ~/debian-setup.sh" +echo "curl https://git.faronear.org/npm/sysconfig/raw/branch/main/debian-setup.sh > ~/debian-setup.sh && bash ~/debian-setup.sh" if [ "$1" ] then @@ -24,13 +24,13 @@ echo "=== Git cloning to /faronear/sysconfig" git config --global credential.helper cache if [ ! -d "/faronear/sysconfig" ] then - git clone https://git.faronear.org/fon/sysconfig /faronear/sysconfig + git clone https://git.faronear.org/npm/sysconfig /faronear/sysconfig chmod -R 755 /faronear # 确保其他用户能够读取 /faronear/sysconfig/nixhome/* fi echo echo "=== Configure root home" -source /faronear/sysconfig/home-config.sh /faronear/sysconfig/nixhome root +source /faronear/sysconfig/nixhome-config.sh /faronear/sysconfig/nixhome root echo echo "=== Change root password? for yes, for omit:" @@ -105,7 +105,7 @@ read -p ">>> " AddNewUser if [ "$AddNewUser" == 'y' ] then source /faronear/sysconfig/debian-add-user.sh $NewUser - source /faronear/sysconfig/home-config.sh /faronear/sysconfig/nixhome $NewUser + source /faronear/sysconfig/nixhome-config.sh /faronear/sysconfig/nixhome $NewUser echo echo "=== Enable xfce autologin [/etc/lightdm/lightdm.conf]: for autologin as [$NewUser] or for no change:" diff --git a/expect-ssh2server.sh b/expect-ssh2server.sh index 27a4dee..8c437ad 100755 --- a/expect-ssh2server.sh +++ b/expect-ssh2server.sh @@ -37,7 +37,7 @@ if [ $targetUrl ] then read -p "Enter adot password (ROAD) >>" PWD_ADOT read -p "Enter root password (YU) >>" PWD_ROOT - expect ~/faronear/fon/sysconfig/expect-ssh.sh $targetUrl adot $PWD_ADOT $PWD_ADOT + expect ~/faronear/npm/sysconfig/expect-ssh.sh $targetUrl adot $PWD_ADOT $PWD_ADOT else while [ ! "$HOST" ] do @@ -59,5 +59,5 @@ else read -p "root password = " ROOT_SU done - expect ~/faronear/fon/sysconfig/expect-ssh.sh $HOST $USER $PWD_USER $PWD_SU + expect ~/faronear/npm/sysconfig/expect-ssh.sh $HOST $USER $PWD_USER $PWD_SU fi diff --git a/git-clone-all.sh b/git-clone-all.sh index 0e23cfa..41163f0 100755 --- a/git-clone-all.sh +++ b/git-clone-all.sh @@ -8,7 +8,7 @@ popd mkdir fon.git pushd fon.git -git clone https://git.faronear.org/fon/sysconfig +git clone https://git.faronear.org/npm/sysconfig git clone https://git.faronear.org/fon/dot.vscode git clone https://git.faronear.org/fon/www.faronear.com git clone https://git.faronear.org/fon/yapi.faronear.org diff --git a/home-import.sh b/home-import.sh deleted file mode 100644 index a8358f4..0000000 --- a/home-import.sh +++ /dev/null @@ -1,2 +0,0 @@ -curl -sSL https://git.faronear.org/fon/sysconfig/raw/branch/main/nixhome/.bashrc > ~/.bashrc -curl -sSL https://git.faronear.org/fon/sysconfig/raw/branch/main/nixhome/.emacs > ~/.emacs \ No newline at end of file diff --git a/home-config.sh b/nixhome-config.sh old mode 100755 new mode 100644 similarity index 89% rename from home-config.sh rename to nixhome-config.sh index 1c44047..263cd54 --- a/home-config.sh +++ b/nixhome-config.sh @@ -1,10 +1,10 @@ #!/bin/bash NIXHOME0=/faronear/sysconfig/nixhome -NIXHOME1=/faronear/fon/sysconfig/nixhome -NIXHOME2=~/faronear/fon/sysconfig/nixhome -NIXHOME3=~/faronear/fon.git/sysconfig/nixhome -NIXHOME4=~/faronear.git/fon.git/sysconfig/nixhome +NIXHOME1=/faronear/npm/sysconfig/nixhome +NIXHOME2=~/faronear/npm/sysconfig/nixhome +NIXHOME3=~/faronear/npm.git/sysconfig/nixhome +NIXHOME4=~/faronear.git/npm.git/sysconfig/nixhome NIXHOME5=`pwd`/nixhome if [ "$1" ] @@ -92,7 +92,10 @@ then echo - if [ "$TheUser" != 'root' ] && [ "$(uname)" != "Darwin" ] # 仅允许 non-root 用户进行远程密钥登录 + if [ "$(uname)" == "Darwin" ] + then + echo '--- No need to run this script on Mac OS X. Exit now.' + elif [ "$TheUser" != 'root' ] # 仅允许 non-root 用户进行远程密钥登录 then mkdir -p $HomePath/.ssh diff --git a/nixhome-import.sh b/nixhome-import.sh new file mode 100644 index 0000000..a39f152 --- /dev/null +++ b/nixhome-import.sh @@ -0,0 +1,2 @@ +curl -sSL https://git.faronear.org/npm/sysconfig/raw/branch/main/nixhome/.bashrc > ~/.bashrc +curl -sSL https://git.faronear.org/npm/sysconfig/raw/branch/main/nixhome/.emacs > ~/.emacs \ No newline at end of file diff --git a/nixhome/.bashrc b/nixhome/.bashrc index e47b7bc..0cc5992 100644 --- a/nixhome/.bashrc +++ b/nixhome/.bashrc @@ -158,12 +158,12 @@ fi export USERPROFILE=$HOME # add sysconfig to path -tp1=/Users/luk.lu/faronear/fon/sysconfig -tp2=/Users/luk.lu/faronear/fon.git/sysconfig -tp3=/faronear/fon/sysconfig -tp4=/faronear/fon.git/sysconfig -tp5=/mnt/c/faronear/fon.git/sysconfig -tp6=/mnt/d/faronear/fon.git/sysconfig +tp1=/Users/luk.lu/faronear/npm/sysconfig +tp2=/Users/luk.lu/faronear/npm.git/sysconfig +tp3=/faronear/npm/sysconfig +tp4=/faronear/npm.git/sysconfig +tp5=/mnt/c/faronear/npm.git/sysconfig +tp6=/mnt/d/faronear/npm.git/sysconfig tp7=/faronear/sysconfig if [ -d $tp1 ] then diff --git a/seafile-install.sh b/seafile-install.sh index bfef502..c125928 100755 --- a/seafile-install.sh +++ b/seafile-install.sh @@ -38,6 +38,6 @@ popd # sudo apt install nginx -y # rm -fr /etc/nginx/sites-enabled/default -# cp /faronear/fon/sysconfig/seafile-nginx-http.conf /faronear/bin-seafile/ +# cp /faronear/npm/sysconfig/seafile-nginx-http.conf /faronear/bin-seafile/ # ln -s /faronear/bin-seafile/seafile-nginx-http.conf /etc/nginx/sites-enabled/ # service nginx restart diff --git a/uniapp-cli.Dockerfile b/uniapp-cli.Dockerfile index 7ca7603..c967ed6 100644 --- a/uniapp-cli.Dockerfile +++ b/uniapp-cli.Dockerfile @@ -1,9 +1,9 @@ -FROM node:16.18-bullseye +FROM arm64v8/node:16.18-bullseye LABEL org.opencontainers.image.authors="luk" RUN npm i -g --registry https://registry.npm.taobao.org @vue/cli@4 RUN cd / && echo -e "\n" | vue create --registry https://registry.npm.taobao.org -p dcloudio/uni-preset-vue uniapp-cli -# 上一行自动选择了第一个空模板,因此需要额外按照 sass +# 上一行自动选择了第一个空模板,因此需要额外安装 sass RUN cd /uniapp-cli && npm i -D --registry https://registry.npm.taobao.org sass@1.49.8 sass-loader@8.0.2 EXPOSE 8080