Skip to content

Commit

Permalink
AryaOS 1.0.0 is ALIVE.
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Apr 3, 2024
1 parent 467c957 commit 6a9ac2b
Show file tree
Hide file tree
Showing 35 changed files with 4,868 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pi-gen:

copy:
rsync -va ../aryaos kelp.local:~/src/SNS/
rsync -va ../aryaos titan2.local:~/src/SNS/
# rsync -va ../aryaos titan2.local:~/src/SNS/

sync: copy

Expand Down
2 changes: 1 addition & 1 deletion config
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

AOS_FLAVOR="AryaOS"

IMG_NAME="aryaos-1.0.0-beta10"
IMG_NAME="aryaos-1.0.0"

PI_GEN_RELEASE="AryaOS: An Operating System for Modern Situational Awareness."
TARGET_HOSTNAME="aryaos"
Expand Down
14 changes: 11 additions & 3 deletions stage3-base/00-install/files/99-AryaOS-Dispatcher
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/bash
# AryaOS 99-AryaOS-Dispatcher
#
# Script to dispatch NetworkManager events for AryaOS.
Expand Down Expand Up @@ -50,20 +50,25 @@ if [ -f $AOS_CONFIG ]; then
. $AOS_CONFIG
fi

function restart_aos_services() {
restart_aos_services() {
for srv in $AOS_SERVICES; do
if [ systemctl is-enabled $srv ]; then
logger "99-AryaOS-Dispatcher restarting $srv"
echo "99-AryaOS-Dispatcher restarting $srv" | systemd-cat -p info -t 99-AryaOS-Dispatcher
systemctl restart $srv || exit 0
fi
done
}

function set_pytak_mc_addr() {
set_pytak_mc_addr() {
MC_ADDR="${1:-0.0.0.0}"
sed --follow-symlinks -i -E -e "s/PYTAK_MULTICAST_LOCAL_ADDR.*/PYTAK_MULTICAST_LOCAL_ADDR=$MC_ADDR/" $AOS_CONFIG
}

set_index_addr() {
ADDR="${1:-10.41.0.1}"
sed --follow-symlinks -E -e "s/aryaos.local/$ADDR/" < /var/www/html/index2.html > /var/www/html/index.html
}

for i in $ADDRESS_FAMILIES; do
export ADDRFAM="$i"
Expand All @@ -72,8 +77,10 @@ for i in $ADDRESS_FAMILIES; do
connectivity-change)
if [ "$CONNECTIVITY_STATE" = "LIMITED" ]; then
set_pytak_mc_addr $WIFI_AP_IP
set_index_addr $WIFI_AP_IP
elif [ "$CONNECTIVITY_STATE" = "FULL" ]; then
set_pytak_mc_addr

fi
restart_aos_services

Expand All @@ -84,6 +91,7 @@ for i in $ADDRESS_FAMILIES; do
export PHASE="post-up"
if [ -n "$DHCP4_IP_ADDRESS" && "$PYTAK_MULTICAST_LOCAL_ADDR" != "0.0.0.0" ]; then
set_pytak_mc_addr $DHCP4_IP_ADDRESS
set_index_addr $DHCP4_IP_ADDRESS
fi
restart_aos_services

Expand Down
2 changes: 1 addition & 1 deletion stage3-base/00-install/files/README-AryaOS.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

June 26, 2023
April 2, 2024
-------------

Thank you for purchasing or downloading AryaOS. Our hope is that this project serves
Expand Down
4 changes: 2 additions & 2 deletions stage3-wifi/00-install/03-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

# The main branch of comitup uses a different syntax.
# sed --follow-symlinks -i -E -e "s/SERVER_PORT = 80/SERVER_PORT = ${COMITUP_WEB_PORT}/" /usr/share/comitup/web/comitupweb.py
sed --follow-symlinks -i -E -e "s/port=80/port=${COMITUP_WEB_PORT}/" "${ROOTFS_DIR}/usr/share/comitup/web/comitupweb.py"
sed --follow-symlinks -i -E -e "s/port=80/port=9080/" "${ROOTFS_DIR}/usr/share/comitup/web/comitupweb.py"

install -v -m 644 files/comitup.conf "${ROOTFS_DIR}/boot/"
install -v -m 644 files/comitup.conf "${ROOTFS_DIR}/etc/"
install -v -m 755 files/run_comitup.sh "${ROOTFS_DIR}/usr/local/sbin/"
install -v -m 755 files/comitup-callback.sh "${ROOTFS_DIR}/usr/local/sbin/"
install -v -m 644 files/comitup.service "${ROOTFS_DIR}/lib/systemd/system/"
2 changes: 1 addition & 1 deletion stage3-wifi/00-install/files/comitup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# connections on the second. IP forwarding and NAT are enabled, so that
# hosts on the comitup hotspot will be able to access external networks.
#
# enable_appliance_mode: true
enable_appliance_mode: false

# external_callback
#
Expand Down
2 changes: 1 addition & 1 deletion stage3-wifi/00-install/files/run_comitup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


AOS_CONFIG="/boot/${AOS_FLAVOR:-AryaOS}-config.txt"
COMITUP_CONF="/boot/comitup.conf"
COMITUP_CONF="/etc/comitup.conf"

if [ -f $AOS_CONFIG ]; then
. $AOS_CONFIG
Expand Down
12 changes: 5 additions & 7 deletions stage5-common/00-install/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ function gen_aos_service_sudoers() {

# Captive portal / main page
mkdir -p "${ROOTFS_DIR}/var/www/"
rsync -va files/html/ "${ROOTFS_DIR}/var/www/"
rsync -va files/calfire_airbases/ "${ROOTFS_DIR}/var/www/html/"
rsync -va files/html/ "${ROOTFS_DIR}/var/www/html/"
rsync -va files/calfire_airbases/ "${ROOTFS_DIR}/var/www/html/calfire_airbases/"
chmod +x "${ROOTFS_DIR}/var/www/html"

install -v -m 755 files/wifi-nuke.py "${ROOTFS_DIR}/usr/local/sbin/wifi-nuke.py"

# Node-RED
install -v -m 644 files/aryaos-flows.json "${ROOTFS_DIR}/home/node-red/.node-red/"
cat "${ROOTFS_DIR}/home/node-red/.node-red/aryaos-flows.json" > "${ROOTFS_DIR}/home/node-red/.node-red/flows.json"
install -v -m 644 files/AryaOS_flows.json "${ROOTFS_DIR}/home/node-red/.node-red/"
cat "${ROOTFS_DIR}/home/node-red/.node-red/AryaOS_flows.json" > "${ROOTFS_DIR}/home/node-red/.node-red/flows.json"

install -v -m 640 files/node-red.sudoers "${ROOTFS_DIR}/etc/sudoers.d/node-red"
SUDO_SERVICES="dump1090-fa dump978-fa gpsd comitup ${AOS_SERVICES}"
SUDO_SERVICES="dump1090-fa dump978-fa gpsd comitup aiscatcher AISCOT LINCOT ADSBCOT DroneCOT ${AOS_SERVICES} AryaSea AryaAir AryaUAS"
gen_aos_service_sudoers "${SUDO_SERVICES}" >> "${ROOTFS_DIR}/etc/sudoers.d/node-red"

# FIXME: Disabled to work-around https://github.com/snstac/aryaos/issues/56
Expand All @@ -47,8 +47,6 @@ gen_aos_service_sudoers "${SUDO_SERVICES}" >> "${ROOTFS_DIR}/etc/sudoers.d/node-
# LINCOT tracker
install -v -m 755 files/get_position.sh "${ROOTFS_DIR}/usr/local/bin/"

id lincot || useradd --system lincot

APP_NAME="LINCOT"
install -v -m 644 "files/${APP_NAME}-config.txt" "${ROOTFS_DIR}/boot/"
install -v -m 755 "files/run_${APP_NAME}.sh" "${ROOTFS_DIR}/usr/local/sbin/"
Expand Down
10 changes: 8 additions & 2 deletions stage5-common/00-install/01-run-chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,11 @@ python3 -m pip install lincot --break-system-packages

systemctl enable NetworkManager-dispatcher

sed --follow-symlinks -i -E -e "s/blank.org/${AT_FLAVOR}.local/" /usr/share/comitup/web/templates/connect.html
sed --follow-symlinks -i -E -e "s/aryaos.local/${AT_FLAVOR}.local/" /var/www/html/index.html
id lincot || useradd --system lincot

sed --follow-symlinks -i -E -e "s/blank.org/aryaos.local/" /usr/share/comitup/web/templates/connect.html
# sed --follow-symlinks -i -E -e "s/aryaos.local/${AT_FLAVOR}.local/" /var/www/html/index.html

# sed --follow-symlinks -i -E -e "s/flows.json/AryaOS_flows.json/" /home/node-red/.node-red/settings.js

#sed --follow-symlinks -i -E -e "s/flowFile:.*,/flowFile: 'AryaOS_flows.json',/" /home/node-red/.node-red/settings.js
2 changes: 2 additions & 0 deletions stage5-common/00-install/files/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- THIS FILE IS AUTO GENERATED -->
<!DOCTYPE html>

<html lang="en">
Expand Down
70 changes: 70 additions & 0 deletions stage5-common/00-install/files/html/index2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!--
AryaOS index.html
Copyright Sensors & Signals LLC https://www.snstac.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>

<html lang="en">

<head>
<title>Welcome to AryaOS</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/uikit.min.css"/>
<link href="css/styles.css" rel="stylesheet">
</head>

<body>
<div>
<h1 class="uk-heading-medium uk-heading-line"><span>AryaOS</span></h1>
<p uk-margin>An Operating System for Modern Situational Awareness.</p>
</div>

<div uk-grid class=".uk-child-width-expand">
<div class="uk-button-group">
<a href="http://aryaos.local:1880/ui/"><button class="uk-button uk-button-primary">AryaOS Dashboards</button></a>
<a href="http://aryaos.local:8080"><button class="uk-button uk-button-primary">Skyaware Map</button></a>
<a href="http://aryaos.local:9080"><button class="uk-button uk-button-secondary">WiFi Configuration</button></a>
<a href="http://aryaos.local:1880/"><button class="uk-button uk-button-danger">Node-RED</button></a>
</div>
</div>

<div>
<h3 class="uk-heading-small uk-heading-line">Support</h3>
<p class="uk-margin-auto-top">Support is available by emailing: <a href="mailto:info@snstac.com">info@snstac.com</a> or via Signal: +1-310-621-9598</p>
</div>

<div>
<h3 class="uk-heading-small">License</h3>
<pre>
Copyright Sensors & Signals LLC <a href="https://www.snstac.com">www.snstac.com</a>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</pre>
</div>

<script src="js/uikit.min.js"></script>
<script src="js/uikit-icons.min.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion stage5-common/00-install/files/run_LINCOT.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
set -a
AOS_CONFIG="/boot/${AOS_FLAVOR:-AryaOS}-config.txt"

if [-f $AOS_CONFIG ]; then
if [ -f $AOS_CONFIG ]; then
. $AOS_CONFIG
else
echo "$AOS_CONFIG doesn't exist, exiting."
Expand Down
2 changes: 1 addition & 1 deletion stage5-common/00-install/files/run_lincot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
set -a
AOS_CONFIG="/boot/${AOS_FLAVOR:-AryaOS}-config.txt"

if [-f $AOS_CONFIG ]; then
if [ -f $AOS_CONFIG ]; then
. $AOS_CONFIG
else
echo "$AOS_CONFIG doesn't exist, exiting."
Expand Down
1 change: 1 addition & 0 deletions stage6-air/04-aryaosair/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#

install -v -m 644 files/AryaAir.service "${ROOTFS_DIR}/lib/systemd/system/"
install -v -m 755 files/enable_AryaAir.sh "${ROOTFS_DIR}/usr/local/sbin/"
install -v -m 644 files/dump1090-fa.service "${ROOTFS_DIR}/lib/systemd/system/"
install -v -m 644 files/dump978-fa.service "${ROOTFS_DIR}/lib/systemd/system/"

Expand Down
2 changes: 1 addition & 1 deletion stage6-air/04-aryaosair/files/ADSBCOT.service
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RuntimeDirectoryMode=0755
ExecStart=/usr/local/sbin/run_ADSBCOT.sh
SyslogIdentifier=ADSBCOT
Type=simple
Restart=on-failure
Restart=always
RestartSec=20
RestartPreventExitStatus=64
Nice=-5
Expand Down
2 changes: 1 addition & 1 deletion stage6-air/04-aryaosair/files/AryaAir.service
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AryaOS AryaSea.service
# AryaOS AryaAir.service
#
# Meta-app for AryaOS air SA services.
#
Expand Down
28 changes: 28 additions & 0 deletions stage6-air/04-aryaosair/files/enable_AryaAir.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# AryaOS enable_AryaAir.sh
#
# Enables AryaAir services.
#
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

set -a
AOS_CONFIG="/boot/${AOS_FLAVOR:-AryaOS}-config.txt"

set +a
logger "Enabling AryaAir services."
systemctl enable AryaAir --now
systemctl enable dump1090-fa --now
systemctl enable dump978-fa --now
systemctl enable ADSBCOT --now
systemctl enable LINCOT --now
2 changes: 2 additions & 0 deletions stage7-sea/00-install/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#

install -v -m 644 files/AryaSea.service "${ROOTFS_DIR}/lib/systemd/system/"
install -v -m 755 files/enable_AryaSea.sh "${ROOTFS_DIR}/usr/local/sbin"
install -v -m 644 "files/AryaSea_flows.json" "${ROOTFS_DIR}/home/node-red/.node-red"

install -v -m 755 files/uart_control "${ROOTFS_DIR}/home/pi"

Expand Down
9 changes: 5 additions & 4 deletions stage7-sea/00-install/01-run-chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ cd /usr/share/aiscatcher
mkdir -p my-plugins
cp AIS-catcher/plugins/* my-plugins/

id aiscat || useradd --system aiscat
usermod -a -G plugdev aiscat
id aiscatcher || useradd --system aiscatcher
usermod -a -G plugdev aiscatcher
usermod -a -G dialout aiscatcher

chown aiscat:aiscat -R /usr/share/aiscatcher
chown aiscatcher:aiscatcher -R /usr/share/aiscatcher

systemctl disable hciuart

Expand All @@ -50,4 +51,4 @@ python3 -m pip install aiscot --break-system-packages
systemctl daemon-reload
systemctl disable aiscatcher
systemctl disable AISCOT
systemctl disable AryaAir
systemctl disable AryaSea
2 changes: 1 addition & 1 deletion stage7-sea/00-install/files/AISCOT.service
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RuntimeDirectoryMode=0755
ExecStart=/usr/local/sbin/run_AISCOT.sh
SyslogIdentifier=AISCOT
Type=simple
Restart=on-failure
Restart=always
RestartSec=20
RestartPreventExitStatus=64
Nice=-5
Expand Down
Loading

0 comments on commit 6a9ac2b

Please sign in to comment.