fortunaisk Plugin for Alliance Auth
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
FortunaISK (Beta)
A lottery module for Alliance Auth to organize, manage, and track community lotteries effortlessly. This module integrates seamlessly with Alliance Auth and its ecosystem, automating lottery creation, management, and winner selection.
Feedback Welcome
This module is currently in beta testing. Your feedback, ideas for improvements, and suggestions are highly valued. Feel free to reach out with any insights or recommendations!
Features
- Ticket Handling: Accepts and validates ticket purchases.
- Payment Processing: Automates payment verification and tracks anomalies.
- Winner Selection: Randomly selects winners using pre-defined criteria.
- Lottery History: Provides a detailed history of past lotteries and winners.
- Recurring Lotteries: Supports automated creation of recurring lotteries.
- Administrative Tools:
- Anomaly resolution for mismatched transactions.
- Prize distribution tracking.
- Comprehensive admin dashboard for statistics and management.
- Notifications:
- Discord notifications for major events like lottery completion or anomalies.
- Alliance Auth notifications for users about ticket status and winnings.
Prerequisites
- Alliance Auth
- Alliance Auth Corp Tools
- Django Celery and Django Celery Beat for task scheduling.
Installation
Step 1 - Install app
pip install fortunaisk
Step 2 - Configure Auth settings
Add 'fortunaisk' to your INSTALLED_APPS in local.py:
INSTALLED_APPS += ["fortunaisk"]
Step 3 - Maintain Alliance Auth
-
Run migrations:
python manage.py migrate
-
Gather static files:
python manage.py collectstatic
-
Restart Auth:
supervisorctl restart all
Step 4 - Configure tasks
Run the following management command to set up periodic tasks:
python manage.py setup_fortuna_tasks
Step 5 - Configure Webhooks
Visit the following URL to configure Discord webhooks:
AUTH_ADDRESS/admin/fortunaisk/webhookconfiguration/
Permissions
| Permission | Description |
|---|---|
fortunaisk.user |
Allows access to the user's personal dashboard and viewing their winnings. |
fortunaisk.admin |
Grants full administrative rights to manage lotteries, resolve anomalies, etc. |
Settings
| Name | Description | Default |
|---|---|---|
FORTUNAISK_PAYMENT_VALIDATION_TASK |
Priority level for payment validation tasks. | 1 |
FORTUNAISK_DISCORD_NOTIFICATION |
Priority level for Discord notifications. | 5 |
Architecture Overview
Models
- Lottery: Core model representing individual lotteries, including ticket price, duration, and winner details.
- AutoLottery: Handles recurring lotteries with customizable schedules and durations.
- TicketPurchase: Tracks individual ticket purchases and their status.
- Winner: Records winners and their prize amounts.
- TicketAnomaly: Logs discrepancies in ticket purchases or payments.
- ProcessedPayment: Maintains a record of processed payments to prevent duplicates.
- WebhookConfiguration: Stores Discord webhook URLs for notifications.
Tasks
check_purchased_tickets: Validates payments and generates corresponding tickets.check_lottery_status: Monitors lotteries and marks them as completed if their duration has expired.finalize_lottery: Selects winners and completes the lottery lifecycle.create_lottery_from_auto_lottery: Automatically generates a new lottery based on recurring settings.
Forms
- LotteryCreateForm: For creating standard one-time lotteries.
- AutoLotteryForm: For managing recurring lotteries with custom schedules and winner distributions.
Views and Templates
- Admin Dashboard: Central hub for managing lotteries, resolving anomalies, and distributing prizes.
- User Dashboard: Personalized view for users to track their tickets and winnings.
- Templates:
fortunaisk/base.html: Base template providing consistent layout and navigation.- Admin Views:
admin_dashboard.html: Summarizes financial statistics, ongoing lotteries, and unresolved anomalies.anomalies_list.html: Lists all anomalies for resolution.lottery_detail.html: Displays details of a specific lottery, including participants and winners.
- User Views:
my_dashboard.html: Displays a user's ticket purchases and winnings.lottery.html: Shows active lotteries with participation details.
- Lottery Management:
create_lottery.html: Form for creating one-time lotteries.create_auto_lottery.html: Form for setting up recurring lotteries.
- Historical Data:
lottery_history.html: Displays records of past lotteries.winner_list.html: Lists all winners with a podium for top earners.
Usage
User Features
- Active Lotteries: Users can view and participate in ongoing lotteries.
- Personal Dashboard: View purchased tickets and winnings.
- Lottery History: Access records of past lotteries and their outcomes.
Admin Features
- Create Lotteries: Set ticket prices, duration, winner count, and prize distribution.
- Manage Recurring Lotteries: Activate or deactivate automated lotteries.
- Monitor Participants: View ticket purchases and participant details.
- Resolve Anomalies: Identify and correct mismatches in ticket purchases or payments.
Contributing
Contributions are welcome! To report an issue or propose a feature:
-
Fork this repository.
-
Create a branch for your feature or fix:
git checkout -b feature/your-feature-name
-
Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for using FortunaISK! For questions or feedback, feel free to open an issue or contact the maintainer.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fortunaisk-0.2.3.tar.gz.
File metadata
- Download URL: fortunaisk-0.2.3.tar.gz
- Upload date:
- Size: 50.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5be6cb78f128aa035f99a6a02246ec53409061016f606d3e639d650c44d2e3c
|
|
| MD5 |
7f28f02be61dcaa5055770d22deda3c0
|
|
| BLAKE2b-256 |
32e870bf1415e6645df76d6da83a875044a3e58b3a879cb2e13a15d109f433ad
|
File details
Details for the file fortunaisk-0.2.3-py3-none-any.whl.
File metadata
- Download URL: fortunaisk-0.2.3-py3-none-any.whl
- Upload date:
- Size: 68.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19ee7be5bd49d2f4a508ac218e2a992cedb809c5a1646e268a36c6ed23ca6271
|
|
| MD5 |
36c3c9a080c590e174202c2137f1e31f
|
|
| BLAKE2b-256 |
431af5ea33583d791d2fbb47c26419b42348c6267e89e28d25470612cc82db4e
|