1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-21 12:42:40 +00:00
The clean & modern RSS server that doesn't give you any crap.
Find a file
J. King 2d7b2dde39 Fix-up laminas-xml and docopt
Now there's only Phony, which will be replaced with Phake.
2024-12-15 21:53:20 -05:00
dist Address case where user is already arsse 2024-01-10 11:00:08 -05:00
docs Merge branch 'arch2' 2024-01-09 18:42:55 -05:00
lib Address our own deprecations in PHP 8.4 2024-12-15 16:31:57 -05:00
locale Finish last Guzzle-related tests 2022-09-13 19:52:29 -04:00
sql Clean up obsolete FIXMEs 2022-04-25 18:30:13 -04:00
tests Address our own deprecations in PHP 8.4 2024-12-15 16:31:57 -05:00
vendor-bin Address our own deprecations in PHP 8.4 2024-12-15 16:31:57 -05:00
www/tt-rss/images Whitespace cleanup 2018-10-26 14:58:04 -04:00
.gitattributes Use Robo for programming task execution 2017-12-08 14:37:49 -05:00
.gitignore Use mdoc manual directly without any preprocessing 2023-10-29 22:20:14 -04:00
.php-cs-fixer.dist.php Update style rules 2023-06-17 11:09:03 -04:00
arsse.php Merge branch 'csfixer3' 2023-03-22 23:33:05 -04:00
AUTHORS Added per-file legal boilerplate 2017-11-16 20:23:18 -05:00
CHANGELOG Update changelog 2024-07-06 12:28:41 -04:00
composer.json Fix-up laminas-xml and docopt 2024-12-15 21:53:20 -05:00
composer.lock Fix-up laminas-xml and docopt 2024-12-15 21:53:20 -05:00
CONTRIBUTING.md Update test-running examples 2017-12-08 15:19:14 -05:00
LICENSE Add license file and skeleton of readme 2017-05-26 10:01:35 -04:00
package.json Appease GitHub once and for all 2021-05-24 19:22:37 -04:00
phpdoc.dist.xml Docblocks for Conf 2017-07-16 22:27:55 -04:00
postcss.config.js Reverting for now 2021-04-09 18:18:42 -05:00
README.md Remove references to Pandoc 2024-01-07 11:23:46 -05:00
robo Tweaks 2023-12-29 19:42:33 -05:00
robo.bat Housekeeping 2023-03-22 22:57:58 -04:00
RoboFile.php Address our own deprecations in PHP 8.4 2024-12-15 16:31:57 -05:00
UPGRADING Prepare release 2024-01-09 19:04:28 -05:00

The Advanced RSS Environment

The Arsse is a news aggregator server, written in PHP, which implements multiple synchronization protocols. Unlike most other aggregator servers, The Arsse does not include a Web front-end (though one is planned as a separate project), and it relies on existing protocols to maximize compatibility with existing clients.

Information on how to install and use the software can be found in the manual, which is available online as well as with every copy of the software. This readme file instead focuses on how to set up a programming environment to modify the source code.

Installing from source

The main repository for The Arsse can be found at code.mensbeam.com, with a mirror also available at GitHub. The GitHub mirror does not accept bug reports, but the two should otherwise be equivalent.

Composer is required to manage PHP dependencies. After cloning the repository or downloading a source code tarball, running composer install will download all the required dependencies, and will advise if any PHP extensions need to be installed. If not installing as a programming environment, running composer install -o --no-dev --no-scripts is recommended.

Repository structure

Library code

The code which runs The Arsse, contained in /arsse.php, is only a short stub: the application itself is composed of the classes found under /lib/, with the main ones being:

Path Description
CLI.php The command-line interface, including its documentation
Conf.php Configuration handling
Database.php High-level database interface
Db/ Low-level database abstraction layer
REST/ Protocol implementations
REST.php General protocol handler for CORS, HTTP auth, etc.
Arsse.php Singleton glueing the parts together

The /lib/Database.php file is the heart of the application, performing queries on behalf of protocol implementations or the command-line interface.

Also necessary to the functioning of the application is the /vendor/ directory, which contains PHP libraries which The Arsse depends upon. These are managed by Composer.

Supporting data files

The /locale/ and /sql/ directories contain human-language files and database schemata, both of which are occasionally used by the application in the course of execution. The /www/ directory serves as a document root for a few static files to be made available to users by a Web server.

The /dist/ directory, on the other hand, contains general and system-specific build files, manual pages, and samples of configuration for Web servers and other system integration. These are not used by The Arsse itself, but are used during the process of preparing new releases for supported operating systems.

Documentation

The source text for The Arsse's manual can be found in /docs/, with pages written in Markdown and converted to HTML with Daux. If a static manual is generated its files will appear under /manual/.

The Arsse also has a UNIX manual page written in mdoc format, which can be found under /dist/man/.

In addition to the manuals the files /README.md (this file), /CHANGELOG, /UPGRADING, /LICENSE, and /AUTHORS also document various things about the software, rather than the software itself.

Tests

The /tests/ directory contains everything related to automated testing. It is itself organized as follows:

Path Description
cases/ The test cases themselves, organized in roughly the same structure as the code
coverage/ (optional) Generated code coverage reports
docroot/ Sample documents used in some tests, to be returned by PHP's basic HTTP server
lib/ Supporting classes which do not contain test cases
bootstrap.php Bootstrap script, equivalent to /arsse.php, but for tests
phpunit.dist.xml PHPUnit configuration file
server.php Simple driver for the PHP HTTP server used during testing

PHPUnit's configuration can be customized by copying its configuration file to /tests/phpunit.xml and modifying the copy accordingly.

Tooling

The /vendor-bin/ directory houses the files needed for the tools used in The Arsse's programming environment. These are managed by the Composer "bin" plugin and are not used by The Arsse itself. The following files are also related to various programming tools:

Path Description
/.gitattributes Git settings for handling files
/.gitignore Git file exclusion patterns
/.php-cs-fixer.dist.php Configuration for php-cs-fixer
/.php-cs-fixer.cache Cache for php-cs-fixer
/composer.json Configuration for Composer
/composer.lock Version synchronization data for Composer
/RoboFile.php Task definitions for Robo
/robo Simple wrapper for executing Robo on POSIX systems
/robo.bat Simple wrapper for executing Robo on Windows

In addition the files /package.json and /postcss.config.js as well as the /node_modules/ directory are used by Yarn and PostCSS when modifying the stylesheet for The Arsse's manual.

Common tasks

We use a tool called Robo to simplify the execution of common tasks. It is installed with The Arsse's other dependencies, and its configured tasks can be listed by executing ./robo without arguments.

Running tests

The Arsse has an extensive PHPUnit test suite; tests can be run by executing ./robo test, which can be supplemented with any arguments understoof by PHPUnit. For example, to test only the Tiny Tiny RSS protocol, one could run ./robo test --testsuite TTRSS.

There is also a test:quick Robo task which excludes slower tests, and a test:full task which includes redundant tests in addition to the standard test suite

Test coverage

Computing the coverage of tests can be done by running ./robo coverage, after which an HTML-format coverage report will be written to /tests/coverage/. Either PCOV or Xdebug is required for this. PCOV is generally recommended as it is faster than Xdebug. Neither extension need be enabled globally; Robo will enable it when needed.

Enforcing coding style

The php-cs-fixer tool, executed via ./robo clean, can be used to rewrite code to adhere to The Arsse's coding style. The style largely follows PSR-12 with some exceptions:

  • Classes, methods, and functions should have their opening brace on the same line as the signature
  • Anonymous functions should have no space before the parameter list

Building the manual

The Arsse's user manual, made using Daux, can be compiled by running ./robo manual, which will output files to /manual/. It is also possible to serve the manual from a test HTTP server on port 8085 by running ./robo manual:live.

Rebuilding the manual theme

The manual employs a custom theme derived from the standard Daux theme. If the standard Daux theme receives improvements, the custom theme can be rebuilt by running ./robo manual:theme. This requires that NodeJS and Yarn be installed, but JavaScript tools are not required to modify The Arsse itself, nor the content of the manual.

Packaging a release

Producing release packages is done by running ./robo package. This performs the following operations:

  • Duplicates a Git working tree with the commit (usually a release tag) to package
  • Generates the HTML manual
  • Installs runtime Composer dependencies with an optimized autoloader
  • Deletes numerous unneeded files
  • Exports the default configuration of The Arsse to a file
  • Compresses the remaining files into a tarball