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..."
@ 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..."
pctSet $ID "${OPTS_STAGE_2}" $REBOOT

View File

@ -65,12 +65,19 @@ echo "# Creating CT..."
pctCreateDebian $ID "${OPTS_STAGE_1}" "$PASS"
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..."
xread "user name for ssh: " SSH_USER
[ -z $SSH_USER ] \
|| @ lxc-attach $ID -- adduser $SSH_USER
echo "# Setup: users..."
while true ; do
xread "user name for ssh: " 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..."
pctSet $ID "${OPTS_STAGE_2}" $REBOOT

View File

@ -83,9 +83,7 @@ echo "# Copying assets..."
echo "# Setup: wireguard default profile..."
@ lxc-attach $ID -- bash -c "cd /root && \
ENDPOINT_PORT=51820 \
ENDPOINT=${ENDPOINT} \
CLIENT_IP=10.42.0.1/32 \
DNS=${NS_LAN_IP/\/*} \
ALLOWED_IPS=0.0.0.0/0 \
make default.client"
@ 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 > $@
# 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)
cat $< \
| sed \