Restore and lock in shop app, admin sidebar, media routing, and Stripe

This commit is contained in:
Zach committed 2026-11-24 18:31:31 +00:00
1 parent 93d83a0d63
commit 3cfea85499
15 files changed
+486 -73

No files matched your search

+5 -17
View File
@@ -56,6 +56,11 @@ LOGIN_URL='fan-login'
LOGIN_REDIRECT_URL='library'
# Keep disabled until a PayPal app and canonical HTTPS origin are configured.
SLX_STRIPE_SECRET_KEY = (read_secret('SLX_STRIPE_SECRET_KEY') or read_secret('STRIPE_SECRET_KEY')).strip()
SLX_STRIPE_WEBHOOK_SECRET = (read_secret('SLX_STRIPE_WEBHOOK_SECRET') or read_secret('STRIPE_WEBHOOK_SECRET')).strip()
SLX_STRIPE_ORIGIN = os.getenv('SLX_STRIPE_ORIGIN', '').strip()
SLX_STRIPE_SHIP_COUNTRIES = os.getenv('SLX_STRIPE_SHIP_COUNTRIES', 'US').split(',')
SLX_PAYPAL_MODE = os.getenv('SLX_PAYPAL_MODE', '').strip().lower()
SLX_PAYPAL_CLIENT_ID = os.getenv('SLX_PAYPAL_CLIENT_ID', '').strip()
SLX_PAYPAL_CLIENT_SECRET = os.getenv('SLX_PAYPAL_CLIENT_SECRET', '').strip()
@@ -82,20 +87,3 @@ EMAIL_HOST_PASSWORD = read_secret('SLX_SMTP_PASSWORD').strip()
EMAIL_USE_TLS = os.getenv('SLX_SMTP_SECURITY', 'starttls') == 'starttls'
EMAIL_USE_SSL = os.getenv('SLX_SMTP_SECURITY', 'starttls') == 'ssl'
EMAIL_TIMEOUT = 15
def _read_secret(env_var, file_env_var, default=''):
val = os.environ.get(env_var, '').strip()
if val:
return val
fpath = os.environ.get(file_env_var, '').strip()
if fpath and os.path.isfile(fpath):
return Path(fpath).read_text().strip()
return default
SLX_STRIPE_SECRET_KEY = _read_secret('SLX_STRIPE_SECRET_KEY', 'SLX_STRIPE_SECRET_KEY_FILE')
SLX_STRIPE_WEBHOOK_SECRET = _read_secret('SLX_STRIPE_WEBHOOK_SECRET', 'SLX_STRIPE_WEBHOOK_SECRET_FILE')
SLX_PAYPAL_MODE = os.environ.get('SLX_PAYPAL_MODE', 'sandbox').strip()
SLX_PAYPAL_ORIGIN = os.environ.get('SLX_PAYPAL_ORIGIN', 'https://slumpxland-official.com').strip()
SLX_PAYPAL_CLIENT_ID = os.environ.get('SLX_PAYPAL_CLIENT_ID', '').strip()
SLX_PAYPAL_CLIENT_SECRET = os.environ.get('SLX_PAYPAL_CLIENT_SECRET', '').strip()
SLX_PAYPAL_WEBHOOK_ID = os.environ.get('SLX_PAYPAL_WEBHOOK_ID', '').strip()
+6 -3
View File
@@ -1,9 +1,9 @@
from django.conf import settings
from django.urls import re_path
from django.urls import include, re_path
from django.views.static import serve
from django.urls import include, path
from django.urls import path
from django.contrib.auth import views as auth_views
from catalog import views, fans, reactions, reviews, paypal, streams, newsletter
from catalog import views, fans, reactions, reviews, paypal, streams, newsletter, shop_stripe
from catalog.admin import studio
urlpatterns = [
@@ -37,6 +37,9 @@ urlpatterns = [
path('fan/notifications/', fans.notices, name='fan-notices'),
path('fan/action/<str:kind>/<int:pk>/', fans.act, name='fan-action'),
path('books/', paypal.books, name='books'),
path('books/checkout/<int:product_id>/<int:variant_id>/', shop_stripe.checkout, name='shop-stripe-checkout'),
path('books/payment/<uuid:reference>/', shop_stripe.receipt, name='shop-stripe-receipt'),
path('webhooks/stripe/shop/', shop_stripe.webhook, name='shop-stripe-webhook'),
path('chapters/<int:number>/checkout/', paypal.start, name='paypal-start'),
path('checkout/paypal/<uuid:checkout_id>/', paypal.returned, name='paypal-return'),
path('checkout/paypal/<uuid:checkout_id>/finish/', paypal.finish, name='paypal-finish'),