forked from PhotonVision/photon-image-modifier
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_common.sh
More file actions
executable file
·35 lines (29 loc) · 1.17 KB
/
Copy pathinstall_common.sh
File metadata and controls
executable file
·35 lines (29 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Verbose and exit on errors
# set -ex
# Do additional tasks that are common across all images,
# but not suitable for inclusion in install.sh
echo "Running install_common.sh"
# Limit the maximum length of systemd-journald logs
mkdir -p /etc/systemd/journald.conf.d
cat > /etc/systemd/journald.conf.d/60-limit-log-size.conf <<EOF
# Added by Photonvision to keep the logs to a reasonable size
[Journal]
SystemMaxUse=100M
EOF
# Create user photon:vision login
echo "creating photon user"
useradd photon -m -b /home -s /bin/bash
usermod -a -G sudo photon
echo 'photon ALL=(ALL) NOPASSWD: ALL' | tee -a /etc/sudoers.d/010_photon-nopasswd >/dev/null
chmod 0440 /etc/sudoers.d/010_photon-nopasswd
echo "photon:vision" | chpasswd
# Add a helpful message to the logon screen
# ASCII Art generated by: https://www.asciiart.eu/image-to-ascii
cp -f ./files/issue.txt /etc/issue
cp -f /etc/issue /etc/issue.net
sed -i 's/#Banner none/Banner \/etc\/issue.net/g' /etc/ssh/sshd_config
echo "Banner \/etc\/issue.net" > /etc/ssh/sshd_config.d/10_PhotonVisionBanner.conf
# Add photon version file
mkdir -p /opt/photonvision/
echo "${GITHUB_REF_NAME};${image_name}" > /opt/photonvision/image-version