Add keyboard config "daemon" and http service config

This commit is contained in:
Martin Raiber 2021-07-21 23:08:59 +02:00
parent 9d6880fbbb
commit 0c67d7d07f
6 changed files with 73 additions and 14 deletions

View File

@ -3,7 +3,7 @@ Description=UrBackup Restore Client
After=network.target
[Service]
ExecStart=/root/urbackuprestoreclient --restore-client --logfile /root/restore_mode.txt --loglevel debug -t
ExecStart=/root/urbackuprestoreclient --restore-client --logfile /root/restore_client.log --loglevel debug -t
WorkingDirectory=/root
User=root
TasksMax=infinity

View File

@ -0,0 +1,14 @@
[Unit]
Description=UrBackup Restore HTTP server
After=network.target
[Service]
ExecStart=/root/urbackuprestoreclient --restore-http --logfile /root/restore_http.log --loglevel debug -t
WorkingDirectory=/root
User=root
TasksMax=infinity
[Install]
WantedBy=multi-user.target

20
restore_cd/setxkbmap.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
FIFOFN=/home/urbackup/setxkbmap
if [ -e $FIFOFN ]
then
exit 1
fi
mkfifo $FIFOFN
chmod 777 $FIFOFN
while true
do
if read LAYOUT < $FIFOFN
then
echo "New keyboard layout: $LAYOUT"
setxkbmap "$LAYOUT"
fi
done

View File

@ -15,16 +15,14 @@ cd `dirname $0`
echo "Installing services..."
cp restore-client.service /lib/systemd/system/
cp restore-client-internet.service /lib/systemd/system/
cp restore-http.service /lib/systemd/system/
systemctl enable restore-client.service
systemctl enable restore-client-internet.service
systemctl enable restore-http
echo "Starting restore service..."
systemctl start restore-client
echo "Setting up keyboard layout..."
echo "#!/bin/true" > /usr/share/console-setup/keyboard-configuration.config
chmod +x /usr/share/console-setup/keyboard-configuration.config
dpkg-reconfigure keyboard-configuration
service keyboard-setup restart
setupcon
echo "Starting restore http service..."
systemctl start restore-http
while ! dialog --menu "Please select restore user interface" 15 50 10 "g" "Graphical/modern interface (recommended)" "t" "Text/console-based interface" 2> out
do
echo "Please select user interface"
@ -33,12 +31,26 @@ done
SELUI=$(cat out)
if [ "x$SELUI" = xt ]
then
echo "Setting up keyboard layout..."
echo "#!/bin/true" > /usr/share/console-setup/keyboard-configuration.config
chmod +x /usr/share/console-setup/keyboard-configuration.config
dpkg-reconfigure keyboard-configuration
service keyboard-setup restart
setupcon
echo "Starting restore wizard..."
./urbackuprestoreclient --restore-wizard --logfile restore_wizard.txt --loglevel debug
./urbackuprestoreclient --restore-wizard --logfile restore_console_wizard.log --loglevel debug
echo "Wizard stoped with error code: $?"
tail -n 100 restore_wizard.txt
read -p "Press any key to continue..."
else
systemctl start graphical.target
cp setxkbmap.sh /home/urbackup/
chmod +x /home/urbackup/setxkbmap.sh
chown urbackup /home/urbackup/setxkbmap.sh
if [ -e /etc/xdg/lxsession/LXDE/autostart ]
then
echo "@/home/urbackup/setxkbmap.sh" >> /etc/xdg/lxsession/LXDE/autostart
fi
sudo -u urbackup startx
fi

View File

@ -14,16 +14,29 @@ make -j4
LANG=en
cd urbackupclient/restorewww
npm install
npm run build
cd ..
cd ..
mkdir -p restore_cd/urbackup/restore
cp urbackupclient/backup_client.db restore_cd/urbackup/
touch restore_cd/urbackup/new.txt
mkdir -p restore_cd/restorewww/
cp -R urbackupclient/restorewww/build/* restore_cd/restorewww/
cp urbackupclientbackend restore_cd/urbackuprestoreclient
cp urbackupserver/restore/$LANG/* restore_cd/urbackup/restore/
cp urbackupserver/restore/* restore_cd/urbackup/restore/ || true
chmod +x restore_cd/urbackup/restore/*.sh
#strip restore_cd/urbackuprestoreclient
strip restore_cd/urbackuprestoreclient
cd restore_cd
tar -cJf ../restore_cd_2.tar.xz *
cp ../restore_cd_2.tar.xz /var/www/restore_cd_2.tar.xz
tar -cJf ../restore_cd_2_amd64.tar.xz *
if [ "x$SCP_RESTORE" = x1 ]
then
scp ../restore_cd_2_amd64.tar.xz 192.168.0.40:/var/www/ssl/
else
cp ../restore_cd_2_amd64.tar.xz /var/www/restore_cd_2_amd64.tar.xz
fi

View File

@ -1,11 +1,11 @@
{
"name": "antd-demo-ts",
"name": "urbackup-image-restore-ui",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "antd-demo-ts",
"name": "urbackup-image-restore-ui",
"version": "0.1.0",
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",