Compare commits

16 Commits

Author SHA1 Message Date
Михаил Капелько
8b29410e02 rm obs 2025-12-06 07:56:52 +03:00
Михаил Капелько
5e8ef4749b do not copyo 2025-12-06 07:48:43 +03:00
Михаил Капелько
932cf86be9 done 2025-12-06 07:47:28 +03:00
Михаил Капелько
89abf6db4a once more 2025-12-06 07:28:01 +03:00
Михаил Капелько
c233149571 fix args 2025-12-06 07:27:28 +03:00
Михаил Капелько
1a4d1bc7a3 more quotes 2025-12-06 07:25:05 +03:00
Михаил Капелько
5962d51caf clientRenew stepped 2025-12-06 07:20:50 +03:00
Михаил Капелько
32101302c3 wait for key 2025-12-06 07:17:20 +03:00
Михаил Капелько
ea1c20b80d require args 2025-12-06 07:07:57 +03:00
Михаил Капелько
12eee71ff5 rename 2025-12-06 07:03:42 +03:00
Михаил Капелько
97e2c4c32e move cert 2025-12-06 07:02:45 +03:00
Михаил Капелько
335811b267 introduce steps 2025-12-06 07:00:38 +03:00
Михаил Капелько
e66f3b779c readme 2025-12-05 07:02:39 +03:00
Михаил Капелько
ab66358bb0 cleanfd 2025-11-13 22:17:16 +03:00
Михаил Капелько
fe206531f6 add pu ll 2025-11-13 22:16:17 +03:00
Михаил Капелько
4f06b7fa70 пусто 2025-11-13 22:14:21 +03:00
9 changed files with 46 additions and 4 deletions

View File

@@ -1 +1 @@
Some scripts to automate VPS setup
Scripts to automate VPS setup and maintenance

View File

@@ -1,3 +1,7 @@
#!/bin/bash -e
# https://habr.com/ru/articles/735712/
certbot certonly --manual --preferred-challenges http -d "kornerr.ru"
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
T=$SDIR/../step
STEP=0
source $T/ensureRootUser
source $T/renewCertbot

View File

@@ -2,10 +2,22 @@
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
T=$SDIR/../step
ACME_FILE=$1
ACME_VALUE=$2
if [ -z "$ACME_FILE" ] || [ -z "$ACME_VALUE" ]; then
echo "Usage: $0 ACME_FILE ACME_VALUE"
exit 1
fi
ACME_DIR="/var/www/html/.well-known/acme-challenge"
STEP=0
source $T/ensureRootUser
source $T/copyNginxACMEConfig
source $T/restartNginx
source $T/createACMEChallenge
source $T/waitForReturnKey
source $T/deleteACMEChallenge
source $T/copyNginxProdConfig
source $T/restartNginx

View File

@@ -15,7 +15,9 @@ fi
# Get the latest changes
cd $REPO_DIR
git checkout -f $MAIN_BRANCH
git clean -fd
git fetch --all
git pull
# Find out the latest commit in the whole repo
#git branch -av --sort=-committerdate

View File

@@ -13,3 +13,4 @@ rsync -aivc --delete $DBG_DIR/ $DST_DIR
cd $DST_DIR
ln -s ../cbr
ln -s ../dbg
ln -s ../vid

6
step/createACMEChallenge Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
STEP=$((STEP+1))
echo -e "\n> > > > Шаг №$STEP. Создаём файл проверки для ACME"
mkdir -p $ACME_DIR
echo "$ACME_VALUE" > "$ACME_DIR/$ACME_FILE"

6
step/deleteACMEChallenge Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
STEP=$((STEP+1))
echo -e "\n> > > > Шаг №$STEP. Удаляем файл проверки для ACME"
rm $ACME_DIR/$ACME_FILE
rmdir $ACME_DIR

6
step/renewCertbot Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/bash -e
# https://habr.com/ru/articles/735712/
STEP=$((STEP+1))
echo -e "\n> > > > Шаг №$STEP. Просим certbot обновить"
certbot certonly --manual --preferred-challenges http -d "kornerr.ru"

5
step/waitForReturnKey Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
STEP=$((STEP+1))
echo -e "\n> > > > Шаг №$STEP. Ожидаем нажатия клавиши Return"
read -p "Нажмите Return..."