A single-file, well-apportioned, embedded comment toolkit written in PHP for use with static sites using SQLite.
Find a file
2025-11-29 16:03:37 -08:00
.gitignore Basic of an admin user; comment posts; comment moderation; and comment display now working. 2025-11-23 11:14:41 -08:00
index.php Forgot to include the CSRF token for login auth so it made login impossible. Didn't catch this on testing because I was already logged in >.< 2025-11-29 16:03:37 -08:00
LICENSE AGPL 3 2025-11-28 16:02:11 -08:00
README.md Updating docs and another pass on security soft points. 2025-11-28 15:59:05 -08:00
test.html Updating test. 2025-11-27 13:20:58 -08:00

RPM Comments

A single-file, well-apportioned, embedded comment toolkit written in PHP for use with static sites using SQLite.

Installation

  1. Download the latest version of the index.php file, or the latest release ZIP.
  2. Upload the file to your server; ideally host the file on it's own subdomain or in a subdirectory. (eg, https://comments.example.com/index.php or https://example.com/comments/index.php)
  3. Access RPM Comments at the URL you specified in step 2. A config.php will be automatically generated, and, if you're using Apache, an .htaccess fill will also be created.
  4. Edit the config.php file to your liking. Make sure trusted_ip_header and allowed_domains have been set for embedding to work. The DB file path must be outside of the web root for security reasons.
  5. Access RPM Comments at the URL you specified in step 2 again and create your first admin user.
  6. You're expected to have a reverse proxy in front of RPM Comments to manage bot-blocking as there is no built-in spam prevention.

Usage

RPM Comments is a single-file PHP component that can be embedded in any static site. No dependencies are required.

Embedding

To embed RPM Comments, add the following code to your HTML in the <head> section. If you're using Apache with mod_rewrite, you can use the .htaccess file to auto-generate the URL. If you're using another server, you'll need to manually specify the rewrite rules.

<script src="https://comments.example.com/comment.js"></script>

You can also not use clean URLs and specify the full URL to the script.

<script src="https://comments.example.com/index.php?q=comment.js"></script>

Then place the following code where you want the comments to appear.

<rpm-comments
  server="https://comments.example.com"
  id="example-page"
  style="list-style:none;padding-left:0;">
</rpm-comments>

The following attributes are supported:

Attribute Description
server The URL to the RPM Comments server.
id The page ID to load comments for. This is used to filter comments by page.
style The style attribute for the <rpm-comments> element.

Moderation

You can visit the admin page at /admin or /index.php?q=admin to manage comments.