Table of Contents
These documents relate to an "application-server" called "Haiku Depot Server" which vends an internet application that stores and allows interaction with software packages for the Haiku Operating System
The application server is able to communicate with remote repositories to retrieve "Haiku Package Repository" (.hpkr) files. .hpkr files contain meta-data of the packages that are stored at that repository. The application server is able to consume the .hpkr data and populate its own internal database with some of the meta-data that it contains. The .hpkr format is a binary data structure described here.
The application-server then provides an HTTP-vended API as well as a web user-interface to the data. The application server is also intended to interact with a desktop client also called "Haiku Depot". The system augments the information acquired from the .hpkr data with additional detail such as;
The default database setup installs a user with the nickname of "root" with a known password of "p4mphl3t". This password must be changed before the system is made available over a network.
The API-related HTTP traffic into the application server uses basic or token bearer authentication. Either technique exposes authentication details in the request and response. For this reason it is advised that HTTP traffic to and from the application server be transported as secure HTTP (https) in order to prevent a third party from reading the HTTP headers and extracting this information.
The icon for this project has been copied from the HaikuDepot application in the Haiku source code repository and converted into SVG and PDF where appropriate. Details of this are in the "haikudepotserver-webapp" project as a "README.TXT" file.
The source code is hosted at GitHub.
On a debian host, some of these prerequisites can be installed with;
apt-get install openjdk-17-jdk apt-get install postgresql postgresql-client apt-get install python3
The setup discussed here is very simplistic as it is not possible to envisage all of the possible environmental factors involved in a production deployment. By this point, the Postgres database server is installed on a UNIX-like computer system and is running as the system user "postgres".
To get the Postgres database server to listen on an internet socket, uncomment the "postgresql.conf" file line;
listen_address = 'localhost'
In order to get connections to localhost to take authentication via username and password, edit the table at the end of the "pg_hba.conf" file by modifying the "METHOD" column for rows pertaining to the localhost; change "ident" to "md5".
The Postgres database server should then be restarted.
Create a new database user with the following command;
sudo -u postgres createuser -P -E haikudepotserver
Now create the new database;
sudo -u postgres createdb -O haikudepotserver haikudepotserver
You can check the login to the database works by opening a SQL terminal;
psql -h localhost -U haikudepotserver haikudepotserver
The database schema objects will be automatically populated into the fresh database by the application-server as it launches. This technique uses Flyway.