Skip to content

Commit

Permalink
Limit log size and add pre-logon message (#40)
Browse files Browse the repository at this point in the history
Fixes #35 and #12
  • Loading branch information
crschardt authored Dec 24, 2024
1 parent 9b2d529 commit 52ffb3d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ jobs:
commands: |
chmod +x ${{matrix.script}}
${{ matrix.script }}
chmod +x ./install_common.sh
./install_common.sh
echo "${{ github.ref_name }};${{ matrix.name }}" > /opt/photonvision/image-version
- name: Compress built image
Expand Down
19 changes: 19 additions & 0 deletions files/issue.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

####### PhotonVision is the free, fast, and
############# easy-to-use computer vision solution
################# for the FIRST Robotics Competition.
###### ###### :::
##### ##*:::::::::: To configure PhotonVision, open:
##### :::::::::::::::::::
#### ::::::::::: ### http://photonvision.local:5800
#### ####
#### #### using a computer on the same network
#### :: ### as this device.
#### ::::::: ####
#### :::::::: #### Documentation is available at:
##### :::::::: :
###### ####::::::::: https://docs.photonvision.org/
################## ::::::
##############
#########

19 changes: 19 additions & 0 deletions install_common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash -v

# 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

# 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

0 comments on commit 52ffb3d

Please sign in to comment.