Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development (v1.9) #20

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
12 changes: 8 additions & 4 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
https://github.com/smartboyathome/Cheshire-Engine/blob/master/ScoringServer/utils.py
https://www.w3schools.com/
https://nitratine.net/blog/post/encryption-and-decryption-in-python
https://stackoverflow.com/a/55137835
https://github.com/smartboyathome/Cheshire-Engine/blob/master/ScoringServer/utils.py (Blueprint Loading)
https://www.w3schools.com/ (Design help)
https://nitratine.net/blog/post/encryption-and-decryption-in-python (Encryption in Python)
https://stackoverflow.com/a/55137835 (Git Repo name function)
https://gist.github.com/barzamin/590660de3ed13eaab9267f29d2a4c43f (Discord Login help)
https://github.com/jdiez17/flask-paypal (Flask PayPal Example)
https://designmodo.com/shopping-cart-ui/ (Shopping Cart UI)
https://stackoverflow.com/questions/988228/convert-a-string-representation-of-a-dictionary-to-a-dictionary (Convert a String representation of a Dictionary to a dictionary)
31 changes: 24 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,50 @@ A WIP Open-source WHMCS alternative.
- [x] Built with Flask
- [x] Lightweight
- [x] [Stripe](https://stripe.com) Support
- [x] One-Time Payments
- [x] Recurring Payments
- [ ] Webhook
- [x] [PayPal](https://paypal.com) Support (WIP)
- [x] One-Time Payments
- [ ] Recurring Payments
- [ ] Webhook
- [x] [hCaptcha](https://www.hcaptcha.com/)
- [x] Fully Modular Design
- [x] Custom Module Support
- [x] Admin Panel
- [x] Product Management
- [x] Stripe Products Integration
- [ ] Stripe Products Integration
- [x] Storefront
- [ ] Email Sending (W.I.P)
- [x] Shopping Cart (WIP)
- [x] Email Sending (WIP)
- [ ] Purchase Messages
- [ ] Contact Messages
- [ ] Account Registration Messages
- [x] Website Search (W.I.P)
- [x] User Management (W.I.P)
- [x] Website Search
- [x] User Management
- [x] Two Factor Authentication
- [x] Google Authenticator
- [ ] SMS Authentication (Soon)
- [ ] [TextMagic](https://textmagic.com)
- [x] Basic Accounts
- [ ] Affiliate Accounts
- [ ] Reseller Accounts
- [x] Multiple Login Methods
- [x] Email Login
- [x] Google Login
- [ ] Discord Login
- [x] Discord Login
- [x] Github Login

# Contribution
All contributions are welcome! Just create a fork and open up a Pull Request :)

# TODO
- [ ] Shopping Cart
- [ ] Domain Management/Reselling
- [ ] DNS Management
- [ ] ID Management
- [ ] Domain Redirection
- [ ] Management API
- [ ] Account Management
- [ ] Product Management
- [ ] [PayPal](https://paypal.com) Support (?)

- [ ] Documented Code & Comments
117 changes: 62 additions & 55 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,76 @@

<img src="https://img.shields.io/discord/887501133902385202?logo=discord&style=social"> <img src="https://img.shields.io/github/last-commit/Loona-cc/LoonaBilling?logo=github&style=social"> <img src="https://img.shields.io/github/workflow/status/Loona-cc/LoonaBilling/CodeQL?logo=github-sponsors&style=social">

# Development Changelog
Sorry for the late update, I tried to make this update a little bigger.
# Development Changelog (v1.9)
Sorry for the long wait for another update, had some problems with Stripe and the API.
Alot of the updates aren't documented

## Development TODO
+ Main
+ [ ] Backup System
+ [ ] Move Servers Easily
+ [ ] Online/Remote Backups
+ Payments
+ [x] Create Shopping Cart / Checkout (WIP)
+ [x] Create Customer Transaction Numbers (WIP) (Cart IDs)
+ [ ] Rework Payment Provider System
+ [x] Stripe (WIP)
+ [ ] PayPal (TODO)
+ Store
+ [ ] Make default be the default page (/store)
+ Products
+ [ ] Import Products from Payment Providers

## LoonaBilling
+ Renamed links in `templates/core/index.html`
+ Failed module loading is deleted from `app.mods` list
+ Changed encryption salt to ... instead of Mac Address (TODO)
+ Reason: Mac Address changes on different networks and will be a pain if servers change
+ Fixed Branding Issue
+ Added Error Handling for Admin Dashboard stats
+ Added Error Handling for Git Library

## Admin Dashboard
+ Added Admin Modules Tab
+ Enable/Disable Modules
+ Install Modules
## Stripe
+ Rewrote Stripe Module
+ Added Automation
+ [x] Payments
+ [ ] Subscriptions (TODO)

+ Added Update Tab
+ Check for updates
+ Pull new updates (WIP)

+ Added File Manager Tab
+ Edit template files from the web browser

+ New Admin Sidebar
+ Branding Tab
+ Modules Tab
+ Update Tab
+ File manager tab
+ Theme Manager

## Customer Dashboard
+ Added new links
+ Help / Support
+ Support Page
+ Tickets
+ Services
+ Payments

## Config
+ Removed Branding Settings -> Moved to Branding Tab
## PayPal
+ Added PayPal (Needs to be reworked)

## Accounts
+ Fixed dashboard being Accounts.wrapper
+ Added Manage Accounts Tab
+ Suspended accounts now redirect to `error.html` with message

# Auth Util
+ Updated login_is_required wrapper
+ Fixed routes becoming module.wrapper
+ Added Settings Tab
+ 2FA
+ [ ] Added 2FA Module System
+ Added Authenticator 2FA
+ Works with Google Authenticator
+ Asks for verification when logging in
+ Added SMS 2FA (Todo)
+ [ ] Implemented SMS 2FA
+ ...
+ Added Discord Login / Register
+ Added Enable / Disable for Google, Discord and Email
+ Added hCaptcha Tab
+ Added Github Login
+ Add Enable / Disable
+ Changed Discord Login/Register Enc PW to ID (instead of email)
+ Added Facebook Login
+ Added Enable / Disable (TODO)
+ Added Setup Guide (TODO)

## Products
+ Added Product importing from Payment Providers
+ Show Products
+ Import Products (Todo)

## Mail
+ Added SMTP Settings
+ Added Mail Sending

## Stripe
+ Stripe adds Customer ID to user config

# Files Util
+ Added `readJSON(file)` function
+ Added `readJSONVar(file, var)` function
+ Added `delVarJSON(file, var)` function
+ Added `getBranding()` function
+ Added `Filesize(file)` function
+ Added `endisModule(module)` function
+ Added `moduleEnabled(module)` function

# Mail Util
+ Added Threaded Mail Sending

# Network Util
+ Added Network Util to cut down on repeated code

## Divs
+ Added adminSide div
+ Added `updateJSONargs(file, arg, content)` function

# Other
+ Join our [Discord](https://loona.cc)!
1 change: 1 addition & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
port = 80
ssl = None # Replace with ssl = ('cert.pem', 'key.pem') for SSL
filemanagerEnabled = True
mailEnabled = True
25 changes: 20 additions & 5 deletions core/modules/automation/httprequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,31 @@
module = Blueprint('httprequests', __name__)
module.hasAdminPage = False
module.moduleDescription = 'Automate simple http requests'
module.version = '1.0'
module.version = '1.1'
module.methods = dir()

module.automation = [('sendRequest', {'url': 'str', 'data': 'str'})]

def sendRequest(url, data):
def test(xee, eee):
pass

def sendRequest(dta):
print('**********', dta)
url = dta[0]
data = dta[1]
try:
timeout = dta[2]
except:
timeout = 4
print(f'Sending data [{url}] ({data})')
try:
x = requests.post(url, data=data, timeout=4)
x = requests.post(url, data=data, timeout=timeout)
print(x.text)
return x.text
except Exception as e:
print(e)
return 0
exc_type, exc_obj, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
print(e, exc_type, fname, exc_tb.tb_lineno)
return {'success': False, 'error': e}

# Soon
Loading