tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-01-10 02:14:36 +03:00
parent 8dc4d4a32d
commit 0c67c3c36d
4 changed files with 15 additions and 8 deletions

View File

@ -90,7 +90,7 @@ echo "# Setup: iptables..."
echo "# Setup: iptables update script..." echo "# Setup: iptables update script..."
@ lxc-attach $ID rc-update add local @ lxc-attach $ID rc-update add local
@ lxc-attach $ID ln -s /root/routing.sh /etc/local.d/iptables-update.start @ lxc-attach $ID -- ln -s /root/routing.sh /etc/local.d/iptables-update.start
echo "# Post config..." echo "# Post config..."
pctSet $ID "${OPTS_STAGE_2}" $REBOOT pctSet $ID "${OPTS_STAGE_2}" $REBOOT

View File

@ -65,12 +65,19 @@ echo "# Creating CT..."
pctCreateDebian $ID "${OPTS_STAGE_1}" "$PASS" pctCreateDebian $ID "${OPTS_STAGE_1}" "$PASS"
echo "# Installing dependencies..." echo "# Installing dependencies..."
@ lxc-attach $ID apt install vim htop iftop iotop tmux mc @ lxc-attach $ID apt install vim htop iftop iotop tmux mc sudo
echo "# Setup: user..." echo "# Setup: users..."
xread "user name for ssh: " SSH_USER while true ; do
[ -z $SSH_USER ] \ xread "user name for ssh: " SSH_USER
|| @ lxc-attach $ID -- adduser $SSH_USER [ -z $SSH_USER ] \
|| @ lxc-attach $ID -- adduser $SSH_USER
read -ep "Add another user? [y/N]: " MORE
if [[ $MORE == 'y' ]] ; then
continue
fi
break
done
echo "# Post config..." echo "# Post config..."
pctSet $ID "${OPTS_STAGE_2}" $REBOOT pctSet $ID "${OPTS_STAGE_2}" $REBOOT

View File

@ -83,9 +83,7 @@ echo "# Copying assets..."
echo "# Setup: wireguard default profile..." echo "# Setup: wireguard default profile..."
@ lxc-attach $ID -- bash -c "cd /root && \ @ lxc-attach $ID -- bash -c "cd /root && \
ENDPOINT_PORT=51820 \ ENDPOINT_PORT=51820 \
ENDPOINT=${ENDPOINT} \
CLIENT_IP=10.42.0.1/32 \ CLIENT_IP=10.42.0.1/32 \
DNS=${NS_LAN_IP/\/*} \
ALLOWED_IPS=0.0.0.0/0 \ ALLOWED_IPS=0.0.0.0/0 \
make default.client" make default.client"
@ lxc-attach $ID -- chmod 600 /etc/wireguard/wg0.conf @ lxc-attach $ID -- chmod 600 /etc/wireguard/wg0.conf

View File

@ -30,6 +30,8 @@ CLIENT_IP ?= 10.42.0.1/32
cat $< | wg pubkey > $@ cat $< | wg pubkey > $@
# NOTE: the first letter of each pattern is quoted to prevent it from
# being substituted when generating this Makefile from template.
$(SERVER_CONF): $(SERVER_TPL) $(SERVER_KEY) $(SERVER_CONF): $(SERVER_TPL) $(SERVER_KEY)
cat $< \ cat $< \
| sed \ | sed \