Skip to content
/ PKAwake Public

A simple web client for the PluralKit API, displaying whether your system has at least one current fronter.

License

Notifications You must be signed in to change notification settings

u1f408/PKAwake

Repository files navigation

PluralKit "Are we awake?" frontend

A simple web client for the PluralKit API, displaying whether your system has at least one current fronter.

Optionally, displays:

  • Member cards for the current fronter(s)
  • The length of time since the switch occurred
    • Optionally, only if that time exceeds a configured threshold

You can specify a PluralKit system ID in the URL to display that system instead of the one configured in the environment. For example, navigating to awake.iris.ac.nz/exmpl will show the PluralKit Example System.


Screenshots

Awake: (system has current fronters)

Screenshot - awake (system has current fronters)

Asleep: (system is switched out)

Screenshot - asleep (system is switched out)

Installation

The simple version:

  1. Clone this repository somewhere your web server can access
  2. Run composer install
  3. Copy .env.dist to .env
  4. Edit .env to configure the site
  5. Point your web server to the public/ directory of this repository

API response caching

If you're running this on a public server, please configure the built-in caching - it reduces the load on the PluralKit servers, as well as improves page load times:

% tail -n4 .env
## Should we cache the PluralKit API responses in Redis?
## If `1`, we need a REDIS_URL
SITE_CACHE_ENABLED="1"
REDIS_URL="redis://localhost/0"

Web server setup: apache2

  1. Enable mod_rewrite and mod_php
  2. Point the DocumentRoot of a virtual host to the public/ directory of this repository

And that's it! .htaccess files are magic.

Web server setup: nginx

server {
    listen 443 ssl;
    server_name awake.example.com;
    root /path/to/pkawake/public;

    # Replace this line with however your configuration enables
    # passing `.php` files through to php-fpm
    include fastcgi_php.conf;

    location / {
        try_files $uri /index.php;
    }
}

License

This project is licensed under the terms of the MIT License, the text of which can be found in the LICENSE file.

About

A simple web client for the PluralKit API, displaying whether your system has at least one current fronter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published