Skip to content

Commit

Permalink
clean up some ssh stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Dec 29, 2023
1 parent 1898551 commit d5e5ab2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
10 changes: 9 additions & 1 deletion workspace/scripts/01-make-pioreactor-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ install_cleanup_trap

USERNAME=pioreactor
PASS=raspberry
SSH_DIR=/home/$USERNAME/.ssh

adduser --gecos "" --disabled-password $USERNAME
chpasswd <<<"$USERNAME:$PASS"
Expand Down Expand Up @@ -41,4 +42,11 @@ chmod 755 /home/$USERNAME

# change default password for the pi user, as per RPi Foundations recommendation. Not sure if this works...
chpasswd <<<"pi:notaraspberry"
rm /etc/ssh/sshd_config.d/rename_user.conf
rm /etc/ssh/sshd_config.d/rename_user.conf

##### set some SSH stuff, populated on firstboot.
sudo -u $USERNAME rm -rf $SSH_DIR # remove if already exists.

sudo -u $USERNAME mkdir -p $SSH_DIR
sudo cp /files/ssh_config $SSH_DIR/config
sudo chown pioreactor:pioreactor $SSH_DIR/config
7 changes: 3 additions & 4 deletions workspace/scripts/02-install-python-and-pip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ install_cleanup_trap


USERNAME=pioreactor
SSH_DIR=/home/$USERNAME/.ssh


apt-get install -y python3-pip
apt-get install -y python3-dev # needed to build CLoader in pyyaml
sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED || true # see jeff gerlings blog post
sudo pip3 install pip -U # update to latest

# these live in /root/.config/pip/pip.conf
sudo pip3 config set global.disable-pip-version-check true # don't check for latest pip
sudo pip3 config set global.root-user-action "ignore"
sudo pip3 config set global.extra-index-url 'https://www.piwheels.org/simple'


sudo -u $USERNAME rm -rf $SSH_DIR # remove if already exists.

sudo -u $USERNAME mkdir -p $SSH_DIR
sudo cp /files/ssh_config $SSH_DIR/config

7 changes: 7 additions & 0 deletions workspace/scripts/files/bash/update_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ rm -rf $UI_FOLDER
mkdir $UI_FOLDER
cp -rp $WORK_DIR/. $UI_FOLDER
chgrp -R www-data $UI_FOLDER

ENV=$UI_FOLDER/.env
if [ -f "$ENV" ]; then
echo "$FILE exists."
else
mv $UI_FOLDER/.env.example ENV
fi
2 changes: 1 addition & 1 deletion workspace/scripts/files/config.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ pause_between_subdoses_seconds=5
waste_removal_multiplier=2
max_volume_to_warn=17.0
max_volume_to_stop=18.0
max_subdose=0.75


[dosing_automation.pid_morbidostat]
Expand Down Expand Up @@ -155,7 +156,6 @@ rate_std=0.20
ekf_variance_shift_post_dosing_minutes=0.40
ekf_variance_shift_post_dosing_factor=2500


[data_sharing_with_pioreactor]
# This enables sending error logs back to us developers at Pioreactor.
# (switch to 1 to enable sending, 0 to disable any sending)
Expand Down

0 comments on commit d5e5ab2

Please sign in to comment.