various improvements

This commit is contained in:
julien
2025-10-05 13:32:39 +02:00
parent a46a6c65f1
commit db11f4bbc0
5 changed files with 13 additions and 100 deletions

View File

@@ -2,6 +2,18 @@
Debian 13 NETig configuration for `server` or `desktop` profiles.
What it does :
* Update the system
* Install a firewall
* Install a set of package accordingly to the selected profile
* Install Docker
* Add a ZRAM
* Apply any needed system configuration for your profile
What it doesn't :
* Add `contrib` nor `non-free` repositories
* Configure the desktop for you
## Prerequisites
A fresh Debian 13 install without `Debian desktop environment` nor any desktop installed.
@@ -17,22 +29,3 @@ Downlad and extract the archive :
```
And then run the `./run.sh` script and choose your profile.
## Manual tasks
### Server
Edit crontab with :
```
# crontab -e
```
And add the following content :
```
# Run the NETig backup script at 4h every monday
0 4 * * mon /usr/local/sbin/netig-srv-backup
```
### Desktop
There is nothing to do, your system is ready to enjoy !

View File

@@ -4,11 +4,6 @@ echo
echo " => Configuration"
echo
if [ $profile = server ]; then
# Copy scripts
cp scripts/* /usr/local/sbin
fi
if [ $profile = desktop ]; then
# Disable all managed interfaces excerpt loopback from /etc/network/interfaces file to allow NetworkManager to manage them
sed -i '/# The primary network interface/Q' /etc/network/interfaces

View File

@@ -1,13 +0,0 @@
#!/bin/bash
echo
echo " => Repositories"
echo
grep -E "(contrib|non-free)" /etc/apt/sources.list > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Adding contrib and non-free repositories to /etc/apt/sources.list"
sed -i "s/http:\/\/deb.debian.org\/debian\/ trixie main non-free-firmware/& contrib non-free/" /etc/apt/sources.list
sed -i "s/http:\/\/security.debian.org\/debian-security trixie-security main non-free-firmware/& contrib non-free/" /etc/apt/sources.list
sed -i "s/http:\/\/deb.debian.org\/debian\/ trixie-updates main non-free-firmware/& contrib non-free/" /etc/apt/sources.list
fi

3
run.sh
View File

@@ -29,8 +29,7 @@ do
esac
done
modules="repos.sh
updates.sh
modules="updates.sh
firewall.sh
pkgs.sh
docker.sh

View File

@@ -1,61 +0,0 @@
#!/bin/bash
################################################################################
### Variables
# Source directory
source="/var/netig/srv"
# Destination directory
destination="/var/netig/bak"
# Backup file name
backup="bak_$(hostname -f)_$(date +"%Y%m%d").tar.zst"
################################################################################
### Down services
( cd /var/netig/srv/status.netig.net && docker compose down )
for f in /var/netig/srv/*
do
if [ -d "$f" ]; then
cd $f
docker compose down
fi
done
################################################################################
### Making the backup archive
echo
echo " Making the backup archive."
echo
tar --zstd -cf $destination/$backup -C $source .
################################################################################
### Up services
for f in /var/netig/srv/*
do
if [ -d "$f" ]; then
cd $f
if [ -d "django" ]
then
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
else
docker compose up -d
fi
fi
done
################################################################################
### Remove destination archives older than n days
find $destination -name "bak_*" -type f -mtime +20 -delete
################################################################################
### End message
echo
echo " Backup done."
echo