WebSub Part II: Aperture
Following on from yesterday’s Part I, today I’m talking about the process of installing Aaron Parecki’s Aperture Microsub Server. As before, this is the result of several different attempts at installation, and leaves out a lot of the handwringing. I recommended that before starting the process, the user should have created two (sub)domains and created standalone letsencrypt certificates for both. I refer to them here as watchtower.
and aperture.example.com
, I may end up writing up my thoughts on this process in another article.
Aperture 1
Aperture is a Microsub. The concept of Microsub is to decouple managing subscriptions and delivering content from the presentation of that content. The Microsub server handles the actual subscription to feeds, while providing a consistent API to clients for presentation in a reader interface.
System Requirements
- Web Server (I still recommend nginx
- PHP 7.2+ with Composer
- Redis
- Beanstalkd
- MariaDB10.2+ / Mysql 5.7+
Other Requirements
- SMTP account details
- Watchtower URL & Token
- Media Server URL (optional)
This last is a new feature since 12 March 2018. Aperture now optionally downloads and stores a copy of every photo/video/audio it encounters. If you choose to do this, then the system needs you to have prepared a (sub)domain for media-storage, the root of this (sub)domain is inside the Aperture folder, at $location/storage/app/media
.
Installation
Clone the repository to a serving-location on your server. Then prepare a mysql database with a suitable user.
$ mysql -u root -p
mariaDB> CREATE DATABASE aperture;
mariaDB> CREATE USER 'apertureuser'@'localhost' IDENTIFIED BY 'aperturepass';
mariaDB> GRANT ALL PRIVILEGES ON aperture.* to 'apertureuser'@'localhost';
mariaDB> FLUSH PRIVILEGES;
mariaDB> exit;
Preparation
First install all the dependencies with composer install
. Aperture is doing a lot of parsing, something I have a little recent experience of, so it isn’t surprising that the dependency list is fairly large.
Configuration
Copy the .env.example
file to .env
and then start filling in the blanks. All of these should be self explanatory; the Watchtower configurations are those which were set up when installing that service. The one change I made other than providing account details was to change the APP_ENV from local
to production
, this was per the laravel documentation. Ignore APP_KEY
for now.
Once that is done, there are two artisan commands required
$ php artisan migrate
$ php artisan key:generate
.env
and check that there is now a value given for APP_KEY
.
Create a user account
Finally, just as with Watchtower, it is necessary to create a user account in the sql database. Thankfully, development on this is still moving at a breakneck pace, so this is now accomplished by running the following command, passing your homepage/identity url as the argument:
$ php artisan create:user https://example.com/
<link rel="token_endpoint" href="https://tokens.indieauth.com/token" />
- Aperture relies on a WebSub-style API to watch the Subscriptions for changes. This is currently provided by Aaron’s Watchtower which I walked through yesterday. [return]