Installation

You should have already done these steps:

  1. Check Hardware provisioning
  2. Check pre-requisites

(Ever need help ? Go to Asqatasun Forum.)

Create user and directories

Asqatasun needs an actual system user to run. This is needed for Firefox (+ geckoDriver) to place its own directories for runtime (like ~/.cache, ~/.dconf or ~/.mozilla).

ASQA_SYSTEM_USER="asqatasun"
ASQA_HOME="/home/${ASQA_SYSTEM_USER}"

useradd -c "Asqatasun user" -d "${ASQA_HOME}" -l -s /bin/bash "${ASQA_SYSTEM_USER}"
mkdir -p \
  /var/log/asqatasun/ \
  /etc/asqatasun/ \
  "${ASQA_HOME}/.dconf"
chown -R asqatasun \
  /var/log/asqatasun/ \
  /etc/asqatasun/ \
  "${ASQA_HOME}"

Download Asqatasun binaries

Retrieve the lastest version of Asqatasun and extract it on your file system.

cd /home/asqatasun
wget https://download.asqatasun.org/asqatasun-latest.tar.bz2
tar xfj asqatasun-latest.tar.bz2

Create symbolic links to binaries:

ASQA_RELEASE="5.0.0-rc.1"
APP_FILE="asqatasun-web-app-${ASQA_RELEASE}.war"
API_FILE="asqatasun-server-${ASQA_RELEASE}.jar"

cd "/home/asqatasun/"
ln -s "${APP_FILE}" "asqatasun-webapp.war"
ln -s "${API_FILE}" "asqatasun-rest-server.jar"

Systemd unit: Asqatasun web application

Create configuration file. Please adjust credentials to your instance.

touch /etc/asqatasun/asqatasun-webapp.yml
chown asqatasun /etc/asqatasun/asqatasun-webapp.yml
chmod 600 /etc/asqatasun/asqatasun-webapp.yml

unset HISTFILE    # Do not keep the following commands in history (credentials in plain text)
DB_DRIVER='mysql'
DB_HOST='localhost'
DB_PORT='3306'
DB_DATABASE='asqatasun'
DB_USER='asqatasunDatabaseUserLogin'
DB_PASSWORD='asqatasunDatabaseUserP4ssword'
WEBAPPURL='https://asqatasun.example.org'       # without trailing slash
ASQATASUN_VERSION='5.0.0-rc.1'

cat >/etc/asqatasun/asqatasun-webapp.yml <<EOF
---
jdbc:
  url: "jdbc:${DB_DRIVER}://${DB_HOST}:${}DB_PORT/${DB_DATABASE}"
  user: "${DB_USER}"
  password: "${DB_PASSWORD}"
app:
  version: "${ASQATASUN_VERSION}"
  webapp:
    security:
      owasp:
        esapiPropertyValue: "/etc/asqatasun"
        tokenDurationValidity: 3600
    ui:
      config:
        authorizedPageSize: "10,25,50,100,250,1000,-1"
        authorizedRefForCriterionViewList: "Aw22,Rgaa30,Rgaa40"
        authorizedScopeForCriterionList: "DOMAIN,SCENARIO"
        authorizedScopeForPageList: "DOMAIN,SCENARIO"
        authorizedScopeForSynthesis: "DOMAIN,SCENARIO"
        authorizedScopeForTrend: "DOMAIN,SCENARIO"
        defaultReferential: "Rgaa40"
        forbiddenUserListForSettings: "guest"
        nbOfFailedPages: 10
        nbOfFailedTest: 5
        referentialWithModifiableTestWeight: "SEO,Aw22"
        userExclusionListForEmail: "guest"
        webAppUrl: "${WEBAPPURL}"
        contrastfinderServiceUrl: "https://app.contrast-finder.org"
        forgottenPassword:
          excludeUserList: "guest"
        orchestrator:
          ayncDelay: 30000
          emailSentToUserExclusionList: "guest"
          krashReportMailList: "support@asqatasun.org"
          enableKrashReport: true
EOF

Then create the systemd unit itself:

cat >/etc/systemd/system/asqatasun-webapp.service <<EOF
[Unit]
Description=asqatasun-webapp
After=syslog.target

[Service]
User=asqatasun
ExecStart=/usr/bin/java                                                     \
    -Dspring.config.location=file:///etc/asqatasun/asqatasun-webapp.yaml    \
    -Dwebdriver.firefox.bin=/opt/firefox/firefox                            \
    -Dwebdriver.gecko.driver=/opt/geckodriver                               \
    -Dapp.logging.path=/var/log/asqatasun/webapp/                           \
    -jar asqatasun-webapp.war
SuccessExitStatus=143
WorkingDirectory=/home/asqatasun

[Install]
WantedBy=multi-user.target
EOF

Finally enable it at boot time:

systemctl enable asqatasun-webapp.service

Systemd unit: Asqatasun API

This section (Systemd unit: Asqatasun API) should be adapted to be similar to the web-app installation.

API_PORT="8081"
API_LOG_DIR="/var/log/asqatasun/api"

cat >/etc/systemd/system/asqatasun-api.service <<EOF
[Unit]
Description=asqatasun-rest-server
After=syslog.target

[Service]
User=asqatasun
EnvironmentFile=/etc/systemd/system/asqatasun-db.service.env
ExecStart=/usr/bin/java -Dwebdriver.firefox.bin=/opt/firefox/firefox -Dwebdriver.gecko.driver=/opt/geckodriver -Dapp.logging.path=${API_LOG_DIR} -Dapp.engine.loader.selenium.headless=true -jar asqatasun-rest-server.jar --spring.profiles.active=webapp --server.port=${API_PORT} --management.server.port=8091
SuccessExitStatus=143
Restart=always
WorkingDirectory=/opt/asqatasun

[Install]
WantedBy=multi-user.target
EOF

Next step

You can go to Start Asqatasun