Skip to content

Commit

Permalink
correct cronjob; add sudoers file
Browse files Browse the repository at this point in the history
  • Loading branch information
rtertiaer committed Jun 5, 2024
1 parent 37d6801 commit 8a2e73b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions config/support_group_sudoers
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
%support ALL=(ALL) NOPASSWD: ALL
5 changes: 2 additions & 3 deletions config/support_tunnel_crontab
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Recurring support_tunnel tasks handled by cron
# Installed by AmpliPi
# We add short jitter to avoid overloading our API all at once, but ensure all requests happen within a relatively short window so our app can scale to 0 during the off-periods.
0 * * * * root sleep $(expr $RANDOM \% 20) && /opt/support_tunnel/venv/bin/python3 -m invoke -r /opt/support_tunnel gc
*/5 * * * * root sleep $(expr $RANDOM \% 20) && /opt/support_tunnel/venv/bin/python3 -m invoke -r /opt/support_tunnel connect-approved-tunnels
0 * * * * root /opt/support_tunnel/venv/bin/python3 -m invoke -r /opt/support_tunnel gc
*/5 * * * * root /opt/support_tunnel/venv/bin/python3 -m invoke -r /opt/support_tunnel connect-approved-tunnels
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "amplipi"
version = "0.3.5"
version = "0.3.5+7d6801f-support_tunnel-dirty"
description = "A Pi-based whole house audio controller"
authors = [
"Lincoln Lorenz <lincoln@micro-nova.com>",
Expand Down Expand Up @@ -35,6 +35,7 @@ include = [
"config/*.rules",
"config/boot_config.txt",
"config/support_tunnel_crontab",
"config/support_group_sudoers",
"debs/**/*",
"fw/*.sh", # no need to add full source tree
"fw/bin/*",
Expand Down
18 changes: 13 additions & 5 deletions scripts/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,20 @@
'libsystemd-dev', # permits logging directly to journald
'wireguard', 'wireguard-tools' # -tools for wg-quick usage
],
'copy' : [{
'from': 'config/support_tunnel_crontab',
'to': '/etc/cron.d/support_tunnel',
'sudo': 'true'
}],
'copy' : [
{
'from': 'config/support_tunnel_crontab',
'to': '/etc/cron.d/support_tunnel',
'sudo': 'true'
},
{
'from': 'config/support_group_sudoers',
'to': '/etc/sudoers.d/099_support-nopasswd',
'sudo': 'true'
}
],
'script': [
'sudo addgroup support',
'sudo mkdir -p /var/lib/support_tunnel',
'sudo chmod 0777 /var/lib/support_tunnel', # TODO: lock this down
'if [ ! -e /opt/support_tunnel ] ; then'
Expand Down

0 comments on commit 8a2e73b

Please sign in to comment.