This commit is contained in:
陆柯 2023-04-04 18:20:26 +08:00
parent ca0c7fcffc
commit 83dc20e502
10 changed files with 27 additions and 24 deletions

View File

@ -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

View File

@ -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? <y> for yes, <anything else> 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]: <y> for autologin as [$NewUser] or <anything else> for no change:"

View File

@ -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

View File

@ -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

View File

@ -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

13
home-config.sh → nixhome-config.sh Executable file → Normal file
View File

@ -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

2
nixhome-import.sh Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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