Differences between revisions 24 and 25
Revision 24 as of 2021-10-14 22:30:45
Size: 2939
Editor: Praveen A
Comment: vapid keys are now generated during installation (not hard coded)
Revision 25 as of 2021-10-14 22:35:30
Size: 3374
Editor: Praveen A
Comment: add instructions to test the package using containers or vms
Deletions are marked like this. Additions are marked like this.
Line 54: Line 54:

== Testing the package ==

You can setup [[Packaging/Pre-Requisites/LXC|lxc]], [[Packaging/Pre-Requisites/nspawn|system nspawn]] or a [[Packaging/Pre-Requisites/Virtual-Machine|virtual machine]] to install the package. Use `/etc/hosts` file of the host machine to map the container or virtual machine ip to a hostname and use this hostname for the pupilfirst service. You can visit the service using a brower on the host machine.

Pupilfirst (https://www.pupilfirst.com/) is a Free Software Learning Management system written in Ruby on Rails. Currently they only support deploying to heroku. This page will be used to keep track of packaging pupilfirst for Debian.

Experimental

Add personal repo of pupilfirst maintainer following https://people.debian.org/~praveen/pupilfirst/README

$ sudo apt install ruby-rails/experimental ruby-actioncable/experimental \
ruby-actionmailbox/experimental ruby-actionmailer/experimental \
ruby-actionpack/experimental ruby-actiontext/experimental \
ruby-actionview/experimental ruby-activejob/experimental ruby-activemodel/experimental \
ruby-activerecord/experimental ruby-activestorage/experimental \
ruby-activesupport/experimental ruby-railties/experimental \
ruby-tzinfo/experimental pupilfirst

Visit http://<your fqdn> on your browser to see the default page.

Start rails console,

$ set -a && . /etc/pupilfirst/pupilfirst.env && set +a
$ cd /usr/share/pupilfirst/
$ sudo -u pupilfirst -EH bundle exec rails console

If you don'tuse sudo, use su pupilfirst -s /bin/sh -c 'bundle exec rails console'

and follow upstream documentation to configure your instance https://github.com/pupilfirst/pupilfirst/blob/master/docs/developers/docs/heroku.md#set-up-a-user-to-sign-in-with

Current status

Upstream meta issue for tracking issues that need help from upstream - https://github.com/pupilfirst/pupilfirst/issues/797

  1. Basic package template - done
  2. Install rubygems dependencies (pull unpackaged gems from rubygems.org) - done
  3. Configure database - done (need to provide a working config/database.yml)
  4. Run database migrations - done
  5. Install node dependencies - done
  6. Precompile assets (includes webpacker) - done (needed to copy source tree to /var as symlinking some directories don't work)
  7. Start rails app - done (use local storage over amazon s3, create tmpfiles.d config for pids and sockets, need to disable https)
  8. Configure puma - done
  9. Configure systemd units - done
  10. Configure nginx - done (todo: switch to unix socket)
  11. Set admin password and add school - in progress (done manually, need upstream help to enable login via username/disable recaptcha)
  12. Properly generate keys and remove hard coding - in progress (vapid keys are now generated during installation, todo remove hardcoding of secret_key_base)
  13. Setup debconf for choosing hostname and https - in progress (hostname is handled via debconf now)
  14. Use runuser instead of su in scripts - not started

Testing the package

You can setup lxc, system nspawn or a virtual machine to install the package. Use /etc/hosts file of the host machine to map the container or virtual machine ip to a hostname and use this hostname for the pupilfirst service. You can visit the service using a brower on the host machine.