8 Commits

Author SHA1 Message Date
Михаил Капелько
b34b5da8e9 ip 2026-01-28 21:57:32 +03:00
Михаил Капелько
1d39702bf3 symlink cv 2026-01-24 07:05:07 +03:00
Михаил Капелько
4088e3cecb пусто 2026-01-24 07:03:24 +03:00
3025f3c2d8 25K4 (#7) 2026-01-24 05:01:42 +01:00
Михаил Капелько
5258bb012e Revert "highlight client scripgts"
This reverts commit 8a64ccaa3f.
2025-12-06 06:55:24 +03:00
Михаил Капелько
ec554a2aa9 Revert "rename better"
This reverts commit e2a09dcaaf.
2025-12-06 06:55:02 +03:00
Михаил Капелько
e86a5b0989 Revert "add some steps"
This reverts commit d9d691db1d.
2025-12-06 06:54:40 +03:00
Михаил Капелько
3b173d32fb Revert "rename cfg"
This reverts commit bc380a60a4.
2025-12-06 06:54:17 +03:00
11 changed files with 51 additions and 6 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
@@ -47,4 +49,5 @@ function replace {
# Rename references
replace $DST_DIR/bank.html "$kmpWas" "$kmpNow"
replace $DST_DIR/budget.html "$kmpWas" "$kmpNow"
replace $DST_DIR/quiz.html "$kmpWas" "$kmpNow"

View File

@@ -12,4 +12,6 @@ rsync -aivc --delete $DBG_DIR/ $DST_DIR
# Symlink
cd $DST_DIR
ln -s ../cbr
ln -s ../cv
ln -s ../dbg
ln -s ../vid

View File

@@ -1,4 +1,4 @@
#!/bin/bash
CMD="0 20 * * * kornerr /home/kornerr/vps/publish.dbg"
CMD="0 20 * * * root /home/kornerr/vps/publish.dbg"
CRON_FILE=/etc/cron.d/dbg
echo "$CMD" > $CRON_FILE

View File

@@ -1,4 +1,5 @@
acl tul src 83.221.16.86
acl tul src 37.113.215.50
acl tul src 83.221.24.250
http_access allow tul
http_access deny all
http_port 3128

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..."