diff --git a/setup-services.sh b/setup-services.sh index ee647418d1..cdee8dfb2d 100755 --- a/setup-services.sh +++ b/setup-services.sh @@ -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 \ +$SUDO zypper --non-interactive install \ gcc \ gcc-c++ \ make \ @@ -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 \ @@ -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 @@ -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 diff --git a/setup-web.sh b/setup-web.sh index 7e07af57a5..5eea2ca5f0 100755 --- a/setup-web.sh +++ b/setup-web.sh @@ -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 diff --git a/setup.sh b/setup.sh index 16d446444b..687f012120 100755 --- a/setup.sh +++ b/setup.sh @@ -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 @@ -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" diff --git a/web/README.md b/web/README.md index b08b951d3e..79ee998455 100644 --- a/web/README.md +++ b/web/README.md @@ -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 @@ -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.