Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions src/modules/admin-toolkit/config
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
###########################################################

# add user name, If left "default", no user will be added.
ADMIN_TOOLKIT_NAME=default
[ -n "$ADMIN_TOOLKIT_NAME" ] || ADMIN_TOOLKIT_NAME=default

# GECOS field of the new account. If Left "default" this is skipped.
# If you need to understand this visit https://en.wikipedia.org/wiki/Gecos_field
ADMIN_TOOLKIT_FULLNAME=default
[ -n "$ADMIN_TOOLKIT_FULLNAME" ] || ADMIN_TOOLKIT_FULLNAME=default

# override password, otherwise use image default raspberry.
ADMIN_TOOLKIT_PASSWORD=default
[ -n "$ADMIN_TOOLKIT_PASSWORD" ] || ADMIN_TOOLKIT_PASSWORD=default

# Want to remove pi from the sudoers file? "yes" to configure
ADMIN_TOOLKIT_PI_NO_SUDO=no
[ -n "$ADMIN_TOOLKIT_PI_NO_SUDO" ] || ADMIN_TOOLKIT_PI_NO_SUDO=no

# Hostname change script. Script will be added to the users home directory.
# Run this to change the hostname and it will auto-fix the FullPageOS chromium locked profile on reboot.
Expand All @@ -47,13 +47,13 @@ ADMIN_TOOLKIT_HOSTNAME_CHANGE_SCRIPT=no
# Add the public ssh key that you wish to use for connections to the pi
# this will add the authorized_keys file in the users .ssh folder.
# Format with quotations: "ssh-rsa SzYtCpyRUU1fvLXvWlezJw...=="
ADMIN_TOOLKIT_SSH=default
[ -n "$ADMIN_TOOLKIT_SSH" ] || ADMIN_TOOLKIT_SSH=default

# disable passwords for ssh logins(only if you set a key). "yes" to configure
ADMIN_TOOLKIT_SSH_NO_PASS=no
[ -n "$ADMIN_TOOLKIT_SSH_NO_PASS" ] || ADMIN_TOOLKIT_SSH_NO_PASS=no

# this will allow only the newly created user to ssh. "yes" to configure
ADMIN_TOOLKIT_SSH_ALLOW_ONLY_CREATED_USER=no
[ -n "$ADMIN_TOOLKIT_SSH_ALLOW_ONLY_CREATED_USER" ] || ADMIN_TOOLKIT_SSH_ALLOW_ONLY_CREATED_USER=no


###########################################################
Expand All @@ -67,41 +67,41 @@ ADMIN_TOOLKIT_SSH_NO_PASS=no
######### Raspbian Update #################################
# Updates all packages: apt-get update && apt-get upgrade
# this can take a while. "yes" to configure
ADMIN_TOOLKIT_UPDATE_PACKAGES=no
[ -n "$ADMIN_TOOLKIT_UPDATE_PACKAGES" ] || ADMIN_TOOLKIT_UPDATE_PACKAGES=no

######### Install Package(s) ##############################
# This might not work for you. Some packages cannot be installed in chroot.
# Keep in mind your image will be bigger and take longer to build.
# Use quotes if listing multiple packages (space Seperated list) ex. LIST="fortune cowsay..."
ADMIN_TOOLKIT_INSTALL_LIST=no
[ -n "$ADMIN_TOOLKIT_INSTALL_LIST" ] || ADMIN_TOOLKIT_INSTALL_LIST=no


######### UFW #############################################
# Set to yes if you want the ufw firewall installed. Unless you
# specify other ports below only ssh port 22 will be open, all
# other ports will be closed by default. "yes" to configure
ADMIN_TOOLKIT_UFW_INSTALL=no
[ -n "$ADMIN_TOOLKIT_UFW_INSTALL" ] || ADMIN_TOOLKIT_UFW_INSTALL=no

# To allow multiple open ports make a CSV(coma seperated list) to configure.
ADMIN_TOOLKIT_UFW_PORTS_TCP=no
ADMIN_TOOLKIT_UFW_PORTS_UDP=no
[ -n "$ADMIN_TOOLKIT_UFW_PORTS_TCP" ] || ADMIN_TOOLKIT_UFW_PORTS_TCP=no
[ -n "$ADMIN_TOOLKIT_UFW_PORTS_UDP" ] || ADMIN_TOOLKIT_UFW_PORTS_UDP=no

# Enable ufw logging. "yes" to configure
ADMIN_TOOLKIT_UFW_ENABLE_LOGGING=no
[ -n "$ADMIN_TOOLKIT_UFW_ENABLE_LOGGING" ] || ADMIN_TOOLKIT_UFW_ENABLE_LOGGING=no


######### Network Manager ##################
# On pi's connected over wifi Network Manager will
# cause you to have a different mac on every boot.
# You can remove it without any issues. "yes" to configure
ADMIN_TOOLKIT_REMOVE_NETWORK_MANAGER=no
[ -n "$ADMIN_TOOLKIT_REMOVE_NETWORK_MANAGER" ] || ADMIN_TOOLKIT_REMOVE_NETWORK_MANAGER=no

######### FullPageOS Hdmi Scripts ########################
# These can be used to turn TV's on and off. Use with cron jobs
# for automation. Works on most devices but not all.
# Installs in the /home/pi/scripts dir and makes use of
# pre written scripts in FullPageOS. "yes" to configure
ADMIN_TOOLKIT_HDMI_SCRIPTS=no
[ -n "$ADMIN_TOOLKIT_HDMI_SCRIPTS" ] || ADMIN_TOOLKIT_HDMI_SCRIPTS=no

######### Install Cron Job #############################
# With great power.... well you know...
Expand All @@ -110,13 +110,13 @@ ADMIN_TOOLKIT_REMOVE_NETWORK_MANAGER=no
# CRON_USER and file name must be the same. pi is the most common(default)
# Your cron file must have a new line at the bottom or import wont work.
# "yes" to configure
ADMIN_TOOLKIT_CRON_JOB=no
[ -n "$ADMIN_TOOLKIT_CRON_JOB" ] || ADMIN_TOOLKIT_CRON_JOB=no

# Cron jobs user name. If you're not adding a user leave this at pi
ADMIN_TOOLKIT_CRON_USER=pi
[ -n "$ADMIN_TOOLKIT_CRON_USER" ] || ADMIN_TOOLKIT_CRON_USER=pi

# if you want to install root user jobs... eg. auto reboot. "yes" to configure
ADMIN_TOOLKIT_SYSTEM_CRON=no
[ -n "$ADMIN_TOOLKIT_SYSTEM_CRON" ] || ADMIN_TOOLKIT_SYSTEM_CRON=no


######## User Defined Scripts ############################
Expand All @@ -125,10 +125,10 @@ ADMIN_TOOLKIT_REMOVE_NETWORK_MANAGER=no
# and they will be added to your created users home directory in
# a scripts folder or to /home/pi/scripts. Default is pi.
# "yes" to configure
ADMIN_TOOLKIT_USER_SCRIPTS=no
[ -n "$ADMIN_TOOLKIT_USER_SCRIPTS" ] || ADMIN_TOOLKIT_USER_SCRIPTS=no

# User Scripts User name. If you're not adding a user leave this at pi
ADMIN_TOOLKIT_USER_SCRIPTS_NAME=pi
[ -n "$ADMIN_TOOLKIT_USER_SCRIPTS_NAME" ] || ADMIN_TOOLKIT_USER_SCRIPTS_NAME=pi

######### Screen Rotation Script #######################
# **** REQUIRES THE GUI MODULE AND pi 4 ****
Expand All @@ -137,4 +137,4 @@ ADMIN_TOOLKIT_REMOVE_NETWORK_MANAGER=no
# add screen rotation after boot up.
# Examples: "normal","inverted","left","right"
# use a value other than normal to add rotation.
ADMIN_TOOLKIT_SCREEN_ROTATION=normal
[ -n "$ADMIN_TOOLKIT_SCREEN_ROTATION" ] || ADMIN_TOOLKIT_SCREEN_ROTATION=normal
6 changes: 4 additions & 2 deletions src/modules/admin-toolkit/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ source /common.sh
install_cleanup_trap

#####################################################################

### Add a user if in config
if [ "$ADMIN_TOOLKIT_NAME" != "default" ]
then
Expand All @@ -31,10 +32,13 @@ then
if [ "$ADMIN_TOOLKIT_PASSWORD" != "default" ]
then
echo "${ADMIN_TOOLKIT_NAME}:${ADMIN_TOOLKIT_PASSWORD}" | chpasswd
RANDOM_PW=$(date +%s | sha256sum | base64 | head -c 32)
echo "pi:${RANDOM_PW}" | chpasswd
else
echo "${ADMIN_TOOLKIT_NAME}:raspberry" | chpasswd
fi


# check for ssh key install and do other ssh things
if [ "$ADMIN_TOOLKIT_SSH" != "default" ]
then
Expand Down Expand Up @@ -150,8 +154,6 @@ then
chmod +x /home/pi/scripts/tv_off.sh
fi

fi

# User added scripts
if [ "$ADMIN_TOOLKIT_USER_SCRIPTS" == "yes" ]
then
Expand Down