update to public gitea
This commit is contained in:
@ -13,6 +13,7 @@ then
|
||||
mkdir ${ZPC}
|
||||
fi
|
||||
|
||||
REPO=https://mint.nopenso.com/mirror
|
||||
for i in ${REPO}
|
||||
do
|
||||
echo $i
|
||||
@ -20,6 +21,6 @@ do
|
||||
then
|
||||
echo $i
|
||||
cd ${ZPC}
|
||||
git clone https://github.com/spongle70/${i}.git
|
||||
git clone ${REPO}/${i}.git
|
||||
fi
|
||||
done
|
||||
|
||||
@ -18,12 +18,14 @@ get_public_bastion () {
|
||||
chmod 644 ${AUTHFILE}
|
||||
|
||||
cd /tmp
|
||||
rm -rf /tmp/zKeys*
|
||||
rm -rf /tmp/z*
|
||||
|
||||
curl -LJO https://github.com/spongle70/zKeys/archive/refs/heads/main.zip
|
||||
REPO=https://mint.nopenso.com/mirror
|
||||
|
||||
curl -LJO ${REPO}/zKeys/archive/main.zip
|
||||
unzip zKeys*.zip
|
||||
|
||||
cd zKeys-main
|
||||
cd zkeys
|
||||
echo "Save keys from github"
|
||||
if [ "${SERVER_TYPE}" == "master" ]
|
||||
then
|
||||
@ -47,7 +49,7 @@ get_public_bastion () {
|
||||
|
||||
echo "The approved keys are:"
|
||||
cat ${AUTHFILE}
|
||||
rm -rf ./zKeys*
|
||||
rm -rf ./z*
|
||||
echo "${SERVER_TYPE}: finished $0"
|
||||
}
|
||||
|
||||
|
||||
60
shared/get_public_bastion.sh.O
Executable file
60
shared/get_public_bastion.sh.O
Executable file
@ -0,0 +1,60 @@
|
||||
#!/bin/sh
|
||||
set -u
|
||||
|
||||
########################################################
|
||||
get_public_bastion () {
|
||||
# AUTHDIR=/root/.ssh
|
||||
# AUTHFILE=${AUTHDIR}/authorized_keys
|
||||
|
||||
# mkdir -p ${AUTHDIR}
|
||||
|
||||
AUTHDIR=/var/lib/bastion/.ssh
|
||||
AUTHFILE=${AUTHDIR}/authorized_keys
|
||||
|
||||
mkdir -p ${AUTHDIR}
|
||||
|
||||
echo "Save keys from environment"
|
||||
echo "${PUBLIC_KEYS}" | base64 -d > ${AUTHFILE}
|
||||
chmod 644 ${AUTHFILE}
|
||||
|
||||
cd /tmp
|
||||
rm -rf /tmp/zKeys*
|
||||
|
||||
curl -LJO https://github.com/spongle70/zKeys/archive/refs/heads/main.zip
|
||||
unzip zKeys*.zip
|
||||
|
||||
cd zKeys-main
|
||||
echo "Save keys from github"
|
||||
if [ "${SERVER_TYPE}" == "master" ]
|
||||
then
|
||||
cat _b*.pub >> ${AUTHFILE}
|
||||
cat _d*.pub >> ${AUTHFILE}
|
||||
# remove above lines in near future
|
||||
cat _[1-9]ba*.pub >> ${AUTHFILE}
|
||||
else
|
||||
cat _v*.pub >> ${AUTHFILE}
|
||||
# remove above lines in near future
|
||||
cat _[1-9]vi*.pub >> ${AUTHFILE}
|
||||
fi
|
||||
|
||||
# testing
|
||||
# cat _d*.pub >> ${AUTHFILE}
|
||||
# cat _v*.pub >> ${AUTHFILE}
|
||||
# AUTHDIR=/root/.ssh
|
||||
# AUTHFILE=${AUTHDIR}/authorized_keys
|
||||
# cat _d*.pub >> ${AUTHFILE}
|
||||
# cat _v*.pub >> ${AUTHFILE}
|
||||
|
||||
echo "The approved keys are:"
|
||||
cat ${AUTHFILE}
|
||||
rm -rf ./zKeys*
|
||||
echo "${SERVER_TYPE}: finished $0"
|
||||
}
|
||||
|
||||
|
||||
main() {
|
||||
echo "--------------Starting $0 -------------------------"
|
||||
get_public_bastion
|
||||
}
|
||||
|
||||
main
|
||||
@ -18,12 +18,14 @@ get_public_rsync () {
|
||||
chmod 644 ${AUTHFILE}
|
||||
|
||||
cd /tmp
|
||||
rm -rf /tmp/zKeys*
|
||||
rm -rf /tmp/z*
|
||||
|
||||
curl -LJO https://github.com/spongle70/zKeys/archive/refs/heads/main.zip
|
||||
REPO=https://mint.nopenso.com/mirror
|
||||
|
||||
curl -LJO ${REPO}/zKeys/archive/main.zip
|
||||
unzip zKeys*.zip
|
||||
|
||||
cd zKeys-main
|
||||
cd zkeys
|
||||
echo "Save keys from github"
|
||||
cat _r*.pub >> ${AUTHFILE}
|
||||
# remove above lines in near future
|
||||
@ -31,7 +33,7 @@ get_public_rsync () {
|
||||
|
||||
echo "The approved keys are:"
|
||||
cat ${AUTHFILE}
|
||||
rm -rf ./zKeys*
|
||||
rm -rf ./z*
|
||||
echo "${SERVER_TYPE}: finished $0"
|
||||
}
|
||||
|
||||
|
||||
44
shared/get_public_rsync.sh.O
Executable file
44
shared/get_public_rsync.sh.O
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
set -u
|
||||
|
||||
########################################################
|
||||
get_public_rsync () {
|
||||
# AUTHDIR=/root/.ssh
|
||||
# AUTHFILE=${AUTHDIR}/authorized_keys
|
||||
|
||||
# mkdir -p ${AUTHDIR}
|
||||
|
||||
AUTHDIR=/root/.ssh
|
||||
AUTHFILE=${AUTHDIR}/authorized_keys
|
||||
|
||||
mkdir -p ${AUTHDIR}
|
||||
|
||||
echo "Save keys from environment"
|
||||
echo "${PUBLIC_KEYS}" | base64 -d > ${AUTHFILE}
|
||||
chmod 644 ${AUTHFILE}
|
||||
|
||||
cd /tmp
|
||||
rm -rf /tmp/zKeys*
|
||||
|
||||
curl -LJO https://github.com/spongle70/zKeys/archive/refs/heads/main.zip
|
||||
unzip zKeys*.zip
|
||||
|
||||
cd zKeys-main
|
||||
echo "Save keys from github"
|
||||
cat _r*.pub >> ${AUTHFILE}
|
||||
# remove above lines in near future
|
||||
cat _[1-9]rs*.pub >> ${AUTHFILE}
|
||||
|
||||
echo "The approved keys are:"
|
||||
cat ${AUTHFILE}
|
||||
rm -rf ./zKeys*
|
||||
echo "${SERVER_TYPE}: finished $0"
|
||||
}
|
||||
|
||||
|
||||
main() {
|
||||
echo "--------------Starting $0 -------------------------"
|
||||
get_public_rsync
|
||||
}
|
||||
|
||||
main
|
||||
Reference in New Issue
Block a user