Skip to main content

Leverage the corptools data to notify via discord certain events at a corp/alliance level

Project description

High Performance Pings

Leverage the corptools data to notify via discord certain events at a corp/alliance level

filter on/off regions/const/system/corps/alliances/types/strucutre type/notification type via admin. end specific notifications to different places via webhooks

configurable @ settings

What Pings are Available

Structures

  • Attack/Reinforce
    • StructureLostShields
    • StructureLostArmor
    • StructureUnderAttack
  • low fuel ()
  • abandoned ()
  • destroyed (StructureDestroyed)
  • low power (StructureWentLowPower)
  • anchoring (StructureAnchoring)
  • unanchoring (StructureUnanchoring)
  • high power (StructureWentHighPower)
  • transfer (OwnershipTransferred)

POS

  • Attack/Reinforce
    • TowerAlertMsg

Sov

  • Attacks
    • SovStructureReinforced
    • EntosisCaptureStarted
  • POS Anchoring (AllAnchoringMsg) - Currently disabled by CCP

Moons

  • Extraction Started (MoonminingExtractionStarted)
  • Extraction Complete (MoonminingExtractionFinished)
  • Laser Fired (MoonminingLaserFired)
  • Auto Fracture (MoonminingAutomaticFracture)

HR

  • New Application (CorpAppNewMsg)

Corporation Projects

  • Started (CorporationGoalCreated)
  • Closed (CorporationGoalClosed)
  • Completed (CorporationGoalCompleted)
  • Expired (CorporationGoalExpired)
  • Limit Reached (CorporationGoalLimitReached)

Installation

  1. This app requires Corp-Tools to leverage Notification Data, install this first.
  • Assumptions made:
    • All characters that can provide notifications for the pings are loaded into the Character Audit module with at least notifications and roles modules enabled
    • All corporations that need to be monitored for fuel have a structures token loaded in the Corporation Audit Module.
    • All corporations that need to get fuel/lo/gas notifications have an assets token loaded in the Corporation Audit Module.
  1. pip install allianceauth-corptools-pinger
  2. Add 'pinger', to your INSTALLED_APPS in your projects local.py
  3. Migrate, Collectstatic, Restart Auth.
  4. Configure Pinger at /admin/pinger/pingerconfig/1/change/
  5. Verify pinger is setup with python manage.py pinger_stats

Setup

add periodic task, default timing below.

pinger.tasks.bootstrap_notification_tasks

make a new cron */10 * * * * *

Optional Optimization

This is only required if you have issues with backlog on your main workers. Generally not an issue for smaller installations.

Separate Worker Queue

Edit myauth/myauth/celery.py

app.conf.task_routes = {.....
                        'pinger.tasks.corporation_notification_update': {'queue':'pingbot'},
                        .....
                        }

Bare Metal

Add program block to supervisor.conf

[program:pingbot]
command=/path/to/venv/venv/bin/celery -A myauth worker --pool=threads --concurrency=5 -Q pingbot
directory=/home/allianceserver/myauth
user=allianceserver
numprocs=1
stdout_logfile=/home/allianceserver/myauth/log/pingbot.log
stderr_logfile=/home/allianceserver/myauth/log/pingbot.log
autostart=true
autorestart=true
startsecs=10
stopwaitsecs=60
killasgroup=true
priority=998

Docker

add a new worker container

  allianceauth_worker_pingbot:
    container_name: allianceauth_worker_pingbot
    <<: [*allianceauth-base, *allianceauth-health-checks]
    entrypoint: ["celery","-A","myauth","worker","--pool=threads","--concurrency=10","-Q","pingbot","-n","P_%n"]

Settings

Name Description Default
CT_PINGER_VALID_STATES A List of Valid States to be queries for Pinger notifications ["Member"]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

allianceauth_corptools_pinger-1.0.0b4.tar.gz (47.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

allianceauth_corptools_pinger-1.0.0b4-py3-none-any.whl (65.1 kB view details)

Uploaded Python 3

File details

Details for the file allianceauth_corptools_pinger-1.0.0b4.tar.gz.

File metadata

File hashes

Hashes for allianceauth_corptools_pinger-1.0.0b4.tar.gz
Algorithm Hash digest
SHA256 104414293a1ad8b466780ed6f2c4583dc42921f7003577b16b9fbc40edcd0891
MD5 dbdafe2e14ea5934df4bc87eab812fbf
BLAKE2b-256 dd60257032ad50b942306981eab0261ca8d43ebbfc291dc23fdc26f82b3e2efe

See more details on using hashes here.

File details

Details for the file allianceauth_corptools_pinger-1.0.0b4-py3-none-any.whl.

File metadata

File hashes

Hashes for allianceauth_corptools_pinger-1.0.0b4-py3-none-any.whl
Algorithm Hash digest
SHA256 a17bfbd288efa6f3c074374cc2e50bbfe927d5a32545e84a4f82e83906527aca
MD5 95f69986d91080a941777a6eb5ebeda8
BLAKE2b-256 786dda45a12214337879cde73ebbea4ffcfbf0821272a2cc8eb6b961f5ef21b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page