Skip to content
Snippets Groups Projects
Commit dee18111 authored by Timothee Besset's avatar Timothee Besset
Browse files

redo the hackendeck service setup

parent 3b924e16
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# Streamlining hackendeck setups
import sys
import os
import subprocess
import logging
KSSHASKPASS = '/usr/bin/ksshaskpass'
SSHD_CONFIG = '/etc/ssh/sshd_config'
if __name__ == '__main__':
logging.basicConfig(format='%(message)s', level=logging.DEBUG)
logger = logging.getLogger(__name__)
hackendeck = ( subprocess.run('grep -e "^ID=manjaro$" /etc/os-release', shell=True).returncode == 0 )
if not hackendeck:
# plz send patches
logger.info('Only supported on Manjaro - please check documentation')
sys.exit(1)
logger.info('======== Running hackendeck configuration checks ==========')
assert os.path.exists(KSSHASKPASS)
os.environ['SUDO_ASKPASS'] = KSSHASKPASS
# this goes pear shaped because of LD_* scout runtime
#need_tk = ( subprocess.run('pacman -Q tk', shell=True).returncode != 0 )
need_tk = not os.path.exists('/usr/lib/libtk.so')
if need_tk:
logger.info('Installing Tk library')
subprocess.check_call('sudo -A pacman --noconfirm -S tk', shell=True)
logger.info('Tk library is installed')
need_patch_sshd = ( subprocess.run(f'grep -e "^PubkeyAcceptedAlgorithms" {SSHD_CONFIG}', shell=True).returncode != 0 )
if need_patch_sshd:
logger.info('Patch sshd for old ssh-rsa hash')
subprocess.check_call('sudo -A bash -c \'echo -e "HostkeyAlgorithms +ssh-rsa\nPubkeyAcceptedAlgorithms +ssh-rsa\n" >> /etc/ssh/sshd_config\'', shell=True)
logger.info('sshd has been patched for old ssh-rsa hash')
enable_sshd = ( subprocess.run('systemctl status sshd 2>&1 >/dev/null', shell=True).returncode != 0 )
if enable_sshd:
logger.info('sshd needs to be enabled')
subprocess.check_call('sudo -A systemctl enable --now sshd', shell=True)
logger.info('sshd is enabled')
logger.info('======== hackendeck configuration complete ==========')
#!/bin/bash
set -o pipefail
shopt -s failglob
set -u
# https://archived.forum.manjaro.org/t/tk-error-application-specific-initialization-failed-unknown-color-name-background/155675/2
xrdb -load /dev/null
GUI_FOLDER="$(cd $(dirname $0) && echo $PWD)"
BIN_FOLDER=$(realpath ${GUI_FOLDER}/../bin)
export PATH="${BIN_FOLDER}:$PATH"
${BIN_FOLDER}/configure-hackendeck.py || exit 1
exec ${GUI_FOLDER}/steam-devkit-gui.pyz
File mode changed from 100644 to 100755
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment