board/common: allow default auth:none restconf via nginx to clixon

- Only disable default services we don't need, prevents touching
   services mid-air in runlevel S.  Allow nginx now as well
 - Enable fcgi based RESTCONF interface via nginx by default
 - Enable auth:none for customer demo

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-03-16 15:55:13 +01:00
parent 3c6c2ec66d
commit 24d2f28fb6
2 changed files with 27 additions and 8 deletions
+12 -3
View File
@@ -5,10 +5,19 @@
# This is a managed node, ignore all default configuration...
rm -f /etc/rc.local
rm -rf /etc/finit.d/enabled/*.conf
rm -rf /etc/network/interfaces*
#...except for some core services
for svc in clixon getty sysklogd; do
ln -s ../available/$svc.conf /etc/finit.d/enabled/$svc.conf
reserved()
{
for svc in clixon getty nginx sysklogd; do
[ "$1" = "${svc}.conf" ] && return 0
done
return 1
}
for file in /etc/finit.d/enabled/*.conf; do
reserved "$(basename "$file")" && continue
rm "$file"
done
+15 -5
View File
@@ -1,9 +1,19 @@
#!/bin/sh
set -e
# TODO: Copy in a proper factory config from
# /usr/share/vendor/<hardware-id>_db or similar.
touch /mnt/tmp/infix/db/factory_db
FACTORY=/mnt/tmp/infix/db/factory_db
[ -f /cfg/startup_db ] || cp /mnt/tmp/infix/db/factory_db /cfg/startup_db
# TODO: Maybe copy in a proper factory config from
# /usr/share/vendor/<hardware-id>_db or similar.
# Right now we generate one from probed data.
cat <<EOF >$FACTORY
<config>
<restconf xmlns="http://clicon.org/restconf">
<enable>true</enable>
<auth-type>none</auth-type>
<fcgi-socket>/run/clixon/restconf.sock</fcgi-socket>
</restconf>
</config>
EOF
[ -f /cfg/startup_db ] || cp "$FACTORY" /cfg/startup_db