1
0
Fork
You've already forked missactive
0
A python script to list the active users on your Misskey (or forked) server.
  • Python 100%
2024年06月27日 11:06:39 +00:00
config.sample.ini Initial Upload 2024年03月17日 16:09:57 +00:00
drivestats.py Added DriveStats 2024年06月27日 11:49:29 +01:00
LICENSE Initial Upload 2024年03月17日 16:09:57 +00:00
missactive.py Initial Upload 2024年03月17日 16:09:57 +00:00
README.md Update README.md 2024年06月27日 11:06:39 +00:00
requirements.txt Initial Upload 2024年03月17日 16:09:57 +00:00

Python scripts for Misskey (or any of the *keys)

Below are details for two scripts:

  • Active users on the server
  • Drive stats

Misskey Active users

A simple python script to query the live database on your Misskey instance to report active users, based on the number of minutes since their latest activity.

It works with many of the forks of Misskey (The *keys!).

Example output

5 active Users in the last 20 minutes
------------------------------ + ------------
User | Last Active
------------------------------ + ------------
amuppet 15:19:06
gonzo 15:18:15
susieq 15:17:07
busyone 15:15:38
dolphin 15:05:52
------------------------------ + ------------

Prerequisites

  • Python3 & pip
  • the psycopg2 libraries to connect to a Postgresql database. Installed via pip below.
  • An open port from your computer to the DB server

Installation

Use git:

At the command line, move to a directory of your choice. The git command will create a sub-directory called missactive

git clone https://codeberg.org/daj/missactive.git
cd missactive

OR Download the ZIP or TAR. Unpack and change into the folder

Continue the installation:

 pip install -r requirements.txt
 cp config.sample.ini config.ini

Edit the config.ini and update all the settings. Example: nano config.ini

activeminutes is the number of minutes since the user was last active on the server. Suggested: 20

dbserver can be the IP address or the name of the server. If the name, do not use https:// Example: myserver.com

dbPort is the port on the server hosting the SQL database. You may need to open up this port on your server's firewall. Try to limit the firewall rule to only allow your own desktop's IP address for better security.

Warning: Be aware that the config file stores your database password, and it is not encrypted. Do not share this file with anyone!

Using

Change to the folder containing the script python3 missactive.py

Drive Stats

This script lists each local user and the total size of Drive space occupied on the server

Using

As above, with misaccitve.py but:

python3 drivestats.py