This package provides the marketplace/payment integration for the Kiwi TCMS multi-tenant SaaS. Everyting that we do is open and that's why this piece of code is open source as well. You don't need this add-on in order to run Kiwi TCMS!
pip install kiwitcms-github-marketplace
Required settings:
KIWI_GITHUB_PAT_FOR_CHECKING_ORGS_AND_USERNAMES
- stringKIWI_GITHUB_MARKETPLACE_SECRET
- binary stringKIWI_FASTSPRING_SECRET
- binary stringQUAY_IO_TOKEN
- stringMAILCHIMP_USERNAME
- stringMAILCHIMP_SECRET
- string
- Subscriptions on FastSpring use the SKU field to define access to private
docker repositories. The format is
repo_name1+repo_name2
, wherehttps://quay.io/kiwitcms/<repo_name>
exists - FastSpring SKUs starting with "x-" are considered special and we don't treat them as docker repository names
- Plans on GitHub Marketplace use one of their bullet items to define access
to private docker repositories. Format is
Docker repositories: quay.io/kiwitcms/<repo1>, quay.io/kiwitcms/<repo2>
- Check for recurring billing events for GitHub Marketplace b/c GitHub will not send a webhook for them
- Return billing email for GitHub payloads when sender is null. Fixes a bug in processing webhooks from GitHub
- Fix a bug in the Subscriptions page when subscription ID is None
- Bug-fix: solve a crash when applying migrations/0011
- Bug-fix: remove Quay.io account based on Purchase.subscription when handling cancelled subscriptions instead of using sender's email address
- Automatically create a user account when someone purchases a paid subscription. Senders can reset their passwords and still be able to login if they wish to or use OAuth login!
- Use
Purchase.subscription
instead ofPurchase.sender
when creating Quay.io accounts, including a database migration for historical records. This means that Quay.io accounts are now numerical, instead of based on email addresses - Record subscription_id for GitHub events in the format
gh-<user-id>-<user|organization ID>
- Prefix manual purchases subscription_id with
man-
- Prefix FastSpring subscription_id with
fs-
, including a database migration for historical records - Consider a GitHub purchase as activated only when price > 0 which fixes a side effect bug which was creating a Quay.io account for users who "purchased" the FREE plan on GitHub Marketplace
- Refactor
GitHub.action_is_recurring_billing()
- Relicense this package under GNU Affero General Public License v3 or later
- Prior versions are still licensed under GNU General Public License v3
- Require a new setting
KIWI_GITHUB_PAT_FOR_CHECKING_ORGS_AND_USERNAMES
- Add
Purchase.gitops_prefix
field with a new DB migration - Record
Purchase.gitops_prefix
upon receiving incoming billing events from GitHub - Allow the Subscription page to edit the new
gitops_prefix
field - Add the
GitOps.allow()
API method for usage inkiwitcms/gitops
- Replace inline style attributes with CSS classes
- Adjust name of settings for
revoke_oauth_token()
to match production environment - Adjust arguments for newer versions of PyGithub
- Allow edits to
Tenant.extra_emails
field by overriding the HTML templates so we can expose this inside the UI. This new field is shown when creating a new tenant or editing an existing one - FastSpring webhooks handler will also try matching the
Tenant.extra_emails
field before updating the expiration period. This will handle the situation whereTenant.owner
is no longer the one who pays for the subscription - Pin transitive dependencies to reduce the possibility of installing vulnerable packages
- Fix potentially uninitilized local variable
- Start using psycopg 3 for testing
- Build and test with Python 3.11 & fix an import error
- Update key name for error responses from Quay.io
- Start testing with upstream Postgres container image, v16 currently.
Note that installing
btree_gin
extension is commented out insidetcms_github_marketplace/migrations/0001_initial.py
- Fix a potential crash inside the Subscriptions page
- Update mailchimp3 from 3.0.18 to 3.0.21
- Try harder not to crash when handling non-recurring events from FastSpring
- Force
None
value for SKU to be evaluated as empty string
- Handle expiration of unpaid requests for add-on services
- Unpin version for requests library to avoid potential conflicts with other add-ons
- Update requests from 2.28.2 to 2.29.0
- Don't fail when trying to delete user after subscription has been cancelled
- Discover billing cycle info from FastSpring subscription data
- Update mailchimp3 from 3.0.17 to 3.0.18
- Add Admin interface so we can 'Approve' manual purchases
- Display both monthly & yearly price columns in admin panel
- Refactor by using a generic purchase notification handling workflow class
- Add preliminary support for yearly subscriptions on FastSpring by removing hard-coded values
- Add more tests
- Fix fallback typo for FastSpring SKUs
- Adjust the fallback match string for Kiwi TCMS Enterprise on FastSpring
- Update requests from 2.28.1 to 2.28.2
- Adjust callbacks for newer PyGithub
- Reformat files with Black
- Don't raise general exceptions
- Send an exit poll after a subscription has been cancelled
- Add filters to Purchase admin page
- Match username with email address for GitHub hooks too
- Add Purchase.subscription field
- Record subscription ID and search FastSpring tenants across all possible billing emails
- Fix a 500 error because of missing prism.js
- Update requests from 2.27.1 to 2.28.1
- Bump versions for the rest of eslint plugins
- Adjust pylint options b/c of newer version
- Report test results to Kiwi TCMS
- Add more tests related to tenant groups
- Require kiwitcms-tenants>=2.0
- Update GitHub actions & pre-commit hook versions
- Fallback to searching by name instead of SKU for FastSpring because the SKU field isn't reliably sent for existing subscribers.
- Add help block pointing to instructions for private containers at the bottom of the Docker credentials card
- Add 2 new fields to
Purchase
model in database to hold information about enabled product features - Automatically configure product access via FastSpring SKUs or GitHub Marketplace bullet items
- Properly handle cancelled and deactivated subscriptions, removing user accounts when needed
- Automatically handle docker accounts on Quay.io when a subscriotion is made and display them on the subscription page
- Display the 2 new fields in Purchase admin
- Ask subscribers to opt-in for newsletter
- Add more automated tests & CI tools
- Search tenants either by owner email or username. Fixes an issue where some tenant owners use the billing email as their username, while changing the contact email in the Kiwi TCMS database
- Adjust for backwards incompatible changes in PyGithub 1.55
- Use f-strings
- Fix a bug which allowed users to create multiple tenants
- Fix Sentry #KIWI-TCMS-H2
- Fix issues discovered by newest pylint
- Don't allow user to create multiple tenants if they refresh the page, e.g. after a 504 response. Instead redirect them to previously existing tenant
- Migrate from Travis CI to GitHub Actions
- Improvements of tests & CI
- Test with Kiwi TCMS v10.1 or later
- Require kiwitcms-tenants>=1.5 in order to support public read-only tenants
- Migrate to Python 3.8
- Internal refactoring
- Don't delete users upon cancellation via GitHub
- Show new column in purchase admin
- Stop advertising GitHub Marketplace subscriptions
- Allow POST request (web hooks) without CSRF token
- Don't fail when cancelling GitHub FREE subscriptions for senders which don't exist
- Fix traceback when trying to create tenant and user is not logged in
- Tested with Kiwi TCMS > 8.6
- Refactor deprecation warnings with Django 3.1
- Start using the new standard models.JSONField()
- Remove
tcms_settings_dir/marketplace.py
b/csettings.PUBLIC_VIEWS
has been removed
- Require kiwitcms-tenants>=1.1
- Subscribe button is now a drop-down listing all platforms oferring a Private Tenant subscription
- Bug fix: display form errors when creating new tenant
- Update template strings
- Turn into proper Kiwi TCMS plugin and install settings overrides under
tcms_settings_dir/
(compatible with Kiwi TCMS v8.2 or later):- does not need
MENU_ITEMS
andPUBLIC_VIEWS
override anymore - does not need to load
tcms_github_marketplace
inINSTALLED_APPS
manually
- does not need
- Jump over
tcms_tenants.views.NewTenantView
b/c it requirestcms_tenants.add_tenant
permission and here we don't need that - Exclude public tenant from recurring purchase hooks
- Do not attempt delete for superuser cancelling their tenant purchases
- Replace
ugettext_lazy
withgettext_lazy
for Django 3.0
- Compatible with PyGithub v1.45+ which will be used in the upcoming Kiwi TCMS v7.3
utils.verify_signature()
moved totcms.utils.github
as of Kiwi TCMS v7.2- flake8 & pylint fixes
- Fix a bug in reading pricing info when renewing subscriptions via FastSpring
- Show vendor specific cancel URL
- Don't crash when revoking GitHub tokens
- Update subscription link via FastSpring
- Handle purchases from FastSpring
Purchase.sender
is now anEmailField
- Handle purchases for organizations
- Do no use
next_billing_date
and useeffective_date
when calculatingpaid_until
- Use the new
delete_user()
function when cancelling subscriptions - Extend UI card in subscription page to 6 columns b/c long URL
- Handle recurring purchases
- Don't crash if visiting Create Tenant without a purchase
- Show tenants which user can access and which they own
- Show purchase history with Buy/Cancel buttons
- Use
prism.js
for syntax highlighting - Add translation files
- Don't crash if install URL is visited without purchase
- Add Purchase admin, accessible only to superuser
- [db] Rename
marketplace_purchase
field topayload
and addvendor
field toPurchase
model - Add a view which overrides tenant creation with information from the latest purchase. This is what users will see when creating their private tenants
- When creating Private Tenant try to correctly set
paid_until
date based onnext_billing_date
orbilling_cycle
fields in the payload sent to us by GitHub
- Fix index name in models to be the same as in migrations
- Handle Marketplace plan cancellations
- Refactor how hooks and installation is handled. Now purchase info is stored in database and we search for it during installation
- Introduces database migrations
- Free plan purchases from Marketplace still redirect to Public Tenant
- Handle GitHub hook pings
- Free plan purchases from Marketplace redirect to Public Tenant