Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions setup-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ sudosed() {

# if agama is already running -> stop it
$SUDO systemctl list-unit-files agama.service &>/dev/null && $SUDO systemctl stop agama.service
$SUDO systemctl list-unit-files agama-web-server.service &>/dev/null && $SUDO systemctl stop agama-web-server.service

# Ruby services

# Packages required for Ruby development (i.e., bundle install).
$SUDO zypper --non-interactive --gpg-auto-import-keys install \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --gpg-auto-import-keys option is only needed when installing packages from unknown 3rd party repositories. It is not needed when using the official openSUSE repositories. (It could actually accidentally accept some forged GPG key...)

$SUDO zypper --non-interactive install \
gcc \
gcc-c++ \
make \
Expand All @@ -46,7 +47,7 @@ $SUDO zypper --non-interactive --gpg-auto-import-keys install \

# Packages required by Agama Ruby services (see ./service/package/gem2rpm.yml).
# TODO extract list from gem2rpm.yml
$SUDO zypper --non-interactive --gpg-auto-import-keys install \
$SUDO zypper --non-interactive install \
dbus-1-common \
suseconnect-ruby-bindings \
autoyast2-installation \
Expand Down Expand Up @@ -88,13 +89,13 @@ $SUDO zypper --non-interactive --gpg-auto-import-keys install \

# Install x86_64 packages
if [ $(uname -m) == "x86_64" ]; then
$SUDO zypper --non-interactive --gpg-auto-import-keys install \
$SUDO zypper --non-interactive install \
fde-tools
fi

# Install s390 packages
if [ $(uname -m) == "s390x" ]; then
$SUDO zypper --non-interactive --gpg-auto-import-keys install \
$SUDO zypper --non-interactive install \
yast2-s390 \
yast2-reipl \
yast2-cio
Expand Down Expand Up @@ -168,15 +169,24 @@ $SUDO cp -v $MYDIR/service/share/dbus.conf /usr/share/dbus-1/agama.conf
# it is intention to use debug here to get more useful debugging output
sudosed "s@\(Exec\)=/usr/bin/@\1=$MYDIR/rust/target/debug/@" $SVC $DBUSDIR/$SVC
done

sudosed "s@\(ExecStart\)=/usr/bin/@\1=$MYDIR/rust/target/debug/@" \
agama-web-server.service /usr/lib/systemd/system/agama-web-server.service

cp -f agama.pam /usr/lib/pam.d/agama
)

# copy the product files
mkdir -p /usr/share/agama/products.d
cp -f $MYDIR/products.d/*.yaml /usr/share/agama/products.d

# systemd reload and start of service
(
$SUDO systemctl daemon-reload
# Start the separate dbus-daemon for Agama
# (in CI we run a custom cockpit-ws which replaces the cockpit.socket
# dependency, continue in that case)
$SUDO systemctl start agama.service || pgrep cockpit-ws
$SUDO systemctl start agama.service
# Start the web server
$SUDO systemctl start agama-web-server.service
)

# - Make sure NetworkManager is running
Expand Down
20 changes: 13 additions & 7 deletions setup-web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ else
SUDO=""
fi

$SUDO zypper --non-interactive --gpg-auto-import-keys install \
make \
'npm>=18' \
cockpit || exit 1
$SUDO zypper --non-interactive install \
'npm>=18'

$SUDO systemctl start cockpit
cd web

cd web; make devel-install; cd -
$SUDO ln -snf `pwd`/web/dist /usr/share/cockpit/agama
if [ ! -e node_modules ]; then
npm install
fi

npm run build

cd -

$SUDO mkdir -p /usr/share/agama
$SUDO ln -snf `pwd`/web/dist /usr/share/agama/web_ui
16 changes: 11 additions & 5 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# This script sets up the development environment without installing Agama packages. This script is
# supposed to run within a repository clone.
# This script sets up the development environment without installing Agama
# packages. This script is supposed to run within a git repository clone.

# Exit on error; unset variables are an error.
set -eu
Expand Down Expand Up @@ -39,8 +39,14 @@ fi;

# Start the installer.
echo
echo "D-Bus will start the services, see journalctl for their logs."
echo "To start the services manually, logging to the terminal:"
echo "The configured Agama services can be manually started with these commands:"
echo
echo " $SUDO systemctl start agama.service"
echo " $SUDO systemctl start agama-web-server.service"
echo
echo "Visit http://localhost"
echo
echo "Note: If the firewall is running and you want to access the Agama installer"
echo "remotely then you need to open the firewall port with:"
echo
echo "Visit http://localhost:9090/cockpit/@localhost/agama/index.html"
echo " $SUDO firewall-cmd --zone=public --add-service=https"
11 changes: 9 additions & 2 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use this command:
```

The extra `--open` option automatically opens the server page in your default
web browser. In this case the server will use the `https://localhost:8080` URL
and expects a running `agama-web-server` at `https://localhost`.
web browser. In this case the server will use the `http://localhost:8080` URL
and expects a running `agama-web-server` at `http://localhost`.

This can work also remotely, with a Agama instance running in a different
machine (a virtual machine as well). In that case run
Expand All @@ -48,6 +48,13 @@ Example of running from different machine:
ESLINT=0 AGAMA_SERVER=https://10.100.1.1 npm run server
```

If you are using the Live ISO then you can use the predefined `agama` host name
configured via mDNS:

```
AGAMA_SERVER=https://agama.local npm run server
```

### Debugging Hints

There are several places to look when something does not work and requires debugging.
Expand Down