From 6f6e75f12b9b903dbc6f92c3dc77a3e6801936f3 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sat, 9 Sep 2023 14:50:46 +0800 Subject: [PATCH] u --- ssl-acme-install.sh => acme-install.sh | 0 ssl-acme-setup-all.sh => acme-setup-all.sh | 0 debian-setup.sh | 5 ++- docker-allow-user.sh | 4 +- docker-install.sh | 45 ++++++++-------------- ipfs-install.sh | 2 +- nixhome/.ssh/authorized_keys | 2 - rclone-install.sh | 3 ++ rclone-web.sh | 3 ++ 9 files changed, 28 insertions(+), 36 deletions(-) rename ssl-acme-install.sh => acme-install.sh (100%) mode change 100755 => 100644 rename ssl-acme-setup-all.sh => acme-setup-all.sh (100%) mode change 100755 => 100644 create mode 100644 rclone-install.sh create mode 100644 rclone-web.sh diff --git a/ssl-acme-install.sh b/acme-install.sh old mode 100755 new mode 100644 similarity index 100% rename from ssl-acme-install.sh rename to acme-install.sh diff --git a/ssl-acme-setup-all.sh b/acme-setup-all.sh old mode 100755 new mode 100644 similarity index 100% rename from ssl-acme-setup-all.sh rename to acme-setup-all.sh diff --git a/debian-setup.sh b/debian-setup.sh index 3db075b..bee7ec0 100755 --- 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/npm/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 -o ~/debian-setup.sh && bash ~/debian-setup.sh" if [ "$1" ] then @@ -13,7 +13,8 @@ fi echo "=== Installing basic tools" apt update -apt install -y emacs git wget curl screen sudo automake rsync net-tools dnsutils gcc g++ make python jq +apt install -y emacs git wget curl screen sudo automake rsync net-tools dnsutils gcc g++ make python3 jq +# Debian 12.0 has no python package, However the following packages replace it: python-is-python3 2to3 echo echo "=== Making dir /faronear/" diff --git a/docker-allow-user.sh b/docker-allow-user.sh index 9e76e93..8f0f7f0 100755 --- a/docker-allow-user.sh +++ b/docker-allow-user.sh @@ -3,11 +3,11 @@ if [ "$1" ] then DOCKERUSER=$1 else - echo "Enter the or for default 'adot'" + echo "Enter the or for default to '`whoami`'" read -p ">>> " DOCKERUSER if [ ! "$DOCKERUSER" ] then - DOCKERUSER=adot + DOCKERUSER=`whoami` fi fi diff --git a/docker-install.sh b/docker-install.sh index 9594838..2879ab9 100755 --- a/docker-install.sh +++ b/docker-install.sh @@ -6,22 +6,22 @@ # 安装自带版本 apt install docker.io && apt install docker-compose # sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -echo "=== Choose docker source (a: 阿里云, z: 中科大, leave blank for default):" +echo "=== Choose docker source: 阿里云, 中科大, for default" read -p ">>> " DOCKER_SOURCE if [ "$DOCKER_SOURCE" = 'a' ] then GPG_URL=http://mirrors.aliyun.com/docker-ce/linux/debian/gpg DOCKER_URL=http://mirrors.aliyun.com/docker-ce/linux/debian - COMPOSE_URL=https://get.daocloud.io/docker/compose/releases/download/2.12.2/ +# COMPOSE_URL=https://get.daocloud.io/docker/compose/releases/download/2.20.3/ elif [ "$DOCKER_SOURCE" = 'z' ] then GPG_URL=https://mirrors.ustc.edu.cn/docker-ce/linux/debian/gpg DOCKER_URL=https://mirrors.ustc.edu.cn/docker-ce/linux/debian - COMPOSE_URL=https://get.daocloud.io/docker/compose/releases/download/2.12.2/ +# COMPOSE_URL=https://get.daocloud.io/docker/compose/releases/download/2.20.3/ else GPG_URL=https://download.docker.com/linux/debian/gpg DOCKER_URL=https://download.docker.com/linux/debian - COMPOSE_URL=https://github.com/docker/compose/releases/download/2.12.2/ +# COMPOSE_URL=https://github.com/docker/compose/releases/download/2.20.3/ fi echo Prepare environment ... @@ -48,37 +48,24 @@ docker compose version # sudo curl -L $COMPOSE_URL/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose # sudo chmod +x /usr/local/bin/docker-compose -echo "=== 配置中国加速镜像源 /etc/docker/daemon.json (d: Docker中国, t: 腾讯云, z: 中科大, leave blank for no mirror):" +echo "=== Enter to 配置中国加速镜像源 /etc/docker/daemon.json, for no mirror:" read -p ">>> " DOCKER_MIRROR -if [ ! "$DOCKER_MIRROR" ] +if [ "$DOCKER_MIRROR" = 'y' ] then - echo "--- Docker mirror is not specified." -elif [ "$DOCKER_MIRROR" = 'd' ] -then - DOCKER_MIRROR=https://registry.docker-cn.com -elif [ "$DOCKER_MIRROR" = 't' ] -then - DOCKER_MIRROR=https://mirror.ccs.tencentyun.com -elif [ "$DOCKER_MIRROR" = 'z' ] -then - DOCKER_MIRROR=https://docker.mirrors.ustc.edu.cn -fi - -if [ "$DOCKER_MIRROR" ] -then - echo "{" | sudo tee /etc/docker/daemon.json > /dev/null - echo " \"registry-mirrors\": [" | sudo tee -a /etc/docker/daemon.json > /dev/null - echo " \"$DOCKER_MIRROR\"" | sudo tee -a /etc/docker/daemon.json > /dev/null - echo " ]" | sudo tee -a /etc/docker/daemon.json > /dev/null - echo "}" | sudo tee -a /etc/docker/daemon.json > /dev/null + echo '{ "registry-mirrors": [' > /etc/docker/daemon.json + echo ' "https://registry.docker-cn.com",' >> /etc/docker/daemon.json + echo ' "http://hub-mirror.c.163.com",' >> /etc/docker/daemon.json + echo ' "https://docker.mirrors.ustc.edu.cn",' >> /etc/docker/daemon.json + echo ' "https://mirror.ccs.tencentyun.com",' >> /etc/docker/daemon.json + echo ' "https://ung2thfc.mirror.aliyuncs.com"' >> /etc/docker/daemon.json + echo '] }' >> /etc/docker/daemon.json fi echo "=== 启动docker服务? for yes, for no" read -p ">>> " StartDockerDaemon if [ "$StartDockerDaemon" = 'y' ] then - # 开机启动 - sudo systemctl enable docker - # 当前启动 - sudo systemctl start docker + sudo systemctl enable docker # 开机启动 + sudo systemctl start docker # 当前启动 + sudo docker info # 查看状态,例如 'Registry Mirros:' fi diff --git a/ipfs-install.sh b/ipfs-install.sh index 425f707..dc508e5 100755 --- a/ipfs-install.sh +++ b/ipfs-install.sh @@ -1,6 +1,6 @@ ## https://dist.ipfs.tech/ -defaultVERSION=0.18.1 +defaultVERSION=0.22.0 if [ $1 ] then diff --git a/nixhome/.ssh/authorized_keys b/nixhome/.ssh/authorized_keys index 436e289..86d039c 100644 --- a/nixhome/.ssh/authorized_keys +++ b/nixhome/.ssh/authorized_keys @@ -1,3 +1 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC20z+Vye8tcTjSrG8eLw54eEyabSc7/MGPzGa7/SKRPG6KP00hV38bZTg86mB4MGpY8MjJbK6GiEpCVGZAjm0bnDleqnkuGa9CpcNay0bAL+8g0Vvi3Vc9vJ9crmR735N4mjAQdgeGG1VCYXx3LAUsJavqVuOkRhAEQItpAb73oi4Ms7Oos9vdWLPDLjn7rZKM+iyi1n8zGwYXBlNzijzVZd/XXnb95mo36MBM+tySm5/aOIE6a11kX+74jKijh+1Ekz6Y1LMUm0j0mU0aJ0FCDVipIMZ0FI+W7l0RKNrIywIhI6d7CWAaJoDnaUKE+UMyJ7FRWeUrgyWxXWPJ7Kror5Won1HXlLhgb/IbITEM2mnCfJXd0JO9BurMDID3fYfANwsfFS7Av9/5RRbYv7Z/emJlkWfQhnzNzdo9rsU2p+7G+TTbmK6v7rlogUGtT55PGyOVBQNTjiPkijH2ulP/z8i/fqJwMINguysVztSR3Ouk7vxiZY+B4kZ6sh9Vvds= luk.lu@DoomBase -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCyeH+sTHhoy6yknCU7A/38wjpEK7pYkpC5Kjqh035JciZzeae9Y9p2U71Ky2SLbIGHIG7+K/C2CzHL03fNnoEI/aNA44GSKP0hPGhGSiqeWYNvzkeqN1lJqSxZTRi0yiwDxdxPz1Jw+myZuBRdDSdg+/w41kLZQsNNQkERx73huo/HRJk/yL9QxbA8grwQmuB5xavwpOiCIxxV9b/9z7heYFhq0X4TVjr1Ewd12MpSJ7XKAEpURhKMActULclH5kbm/QlW2cRDd6w212h/H7ArEqNyOyCWHfD2Nb9JD+GazfwC0IIKTanaXa8WkVjCBOh2pa9+qwK66podi58Dqz3yrrI62f8SiVwjyeJHlOsySzPYXUXa+EHPrDVUTrxQTeElUgy4YuCBz8tes9ZIp2eaq9jlm7vNzRhXUNRKS85/9Vw0pmwOy0BWO4s/4WQxoYtQ8Iz2a8mckUPLB4KIGg8OG9xJWZUltyMDf9BKCQ/nBVU7Dkcpjq8LR9NYvz2U7PE= luk@venus -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC54Ter4uwpDPhUKFswjwa4au7tor75Q5NJkFAjngvkwCjfftoc6guqRQn3dw3G5yJfrTawb09m6m+hVcf9ZwOGmc0VGG5I3P0WZH/PvJZZlc1ZN9/V+QRAanUE6rnzelsoVphm5Z1aCbpcyJdFxy8wKbst9HTdupJ5pCigHx9mg9J60TjIBP1UDgWuqvjhh0249ztTR9nNAJaLfAG2iNKK+SdgwpZ8Gv8gyu8TKx5KnBncdJbWw75iBFw7C1b8KbiZKIkBID8akwt4Mq0o8f85gHInZxzKp22KWYWUb8OtCTqpqWwxa+ljrxutKxujfFWxo0F4locQIFDL59NOLUzcXRsKvJUqTx1djXN2Dx3Pvyy77GU1CQR7KeC/ZM7PR4RokBlWkqL0SSREeN8ssrht+bquYw7qdYZulvQwmzWiiHxXKtJ49G+G+G5wz9CXshqXGCrCU2Fw79tMnsmSsSjM+lmP9EJ+8Suq6xQEQ62aDlItxXW3Byvgfo9OWn/9cHM= home@earth diff --git a/rclone-install.sh b/rclone-install.sh new file mode 100644 index 0000000..0de5e93 --- /dev/null +++ b/rclone-install.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sudo -v ; curl https://rclone.org/install.sh | sudo bash diff --git a/rclone-web.sh b/rclone-web.sh new file mode 100644 index 0000000..0c63993 --- /dev/null +++ b/rclone-web.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +rclone rcd --rc-web-gui