mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-09-04 06:35:29 +00:00
feat(pricing): collapse to two tiers (#1309)
* feat(pricing): collapse to two tiers (Community + Admiral) Collapse Sencho's pricing from three tiers (Community / Skipper / Admiral) to two: a generous free Community tier and a single paid Admiral tier. The Skipper tier is removed. Now free in Community: auto-heal, auto-update, scheduled operations, webhooks, notification routing, Fleet Actions and bulk operations, SSO preset providers (Google / GitHub / Okta), unlimited users with admin and viewer roles, and deploy safety (atomic deploys, auto-rollback, and one-click rollback). Admiral (paid) is focused on running and governing a fleet: blueprints, Fleet Secrets, deploy enforcement, vulnerability report export, audit log, host console, private registries, mesh networking, node cordon, managed cloud backup, LDAP / Active Directory SSO, and the advanced RBAC roles (deployer, node-admin, auditor) with per-resource scoped assignments. Internally the license variant distinction is removed so tier is binary (community / paid). License validation still verifies the Lemon Squeezy store and product before granting paid status. Docs and the contributor guide are updated to the two-tier model. * docs(pricing): correct licensing page to two-tier pricing and tidy stale tier wording The licensing docs page kept the old Admiral pricing plus a Founder Lifetime column and an Enterprise paragraph after the two-tier collapse. Update it to $12/month or $99/year, drop the lifetime and Enterprise content, and link to the pricing page for current pricing. Also fix stale "Skipper" wording in CLA.md, SUPPORT.md, one test title, and three test comments. Historical CHANGELOG entries and the retired-Skipper license-guard test are intentionally left as-is. * docs: align licensing and SSO pages with the two-tier model Correct the SSO overview so the Google, GitHub, and Okta presets read as available on every tier, matching the provider table; only LDAP and Active Directory require Sencho Admiral. Remove the lifetime-plan references from the licensing, settings, and troubleshooting pages so they reflect subscription-only Admiral pricing. * fix(rbac): omit scoped permissions from /me on the Community tier Scoped role assignments only take effect on the paid tier, but GET /api/permissions/me returned them unconditionally, so a downgraded instance with leftover assignments rendered per-resource affordances the API then rejected with 403. The endpoint now mirrors the permission middleware and includes scoped permissions only on the paid tier. Adds a regression test covering the downgrade case. * docs: use custom-pricing wording on the contact page The two-tier model has no Enterprise tier; reword the contact page's enterprise pricing/deals to custom pricing/deals so it does not imply a tier that no longer exists.
This commit is contained in:
@@ -68,9 +68,8 @@ const PANEL_CLASS = 'rounded-lg border border-card-border border-t-card-border-t
|
||||
const PAGE_SIZE = 10;
|
||||
|
||||
export function CloudBackupSection() {
|
||||
const { license, isPaid } = useLicense();
|
||||
const isAdmiral = isPaid && license?.variant === 'admiral';
|
||||
const providerOptions = isAdmiral
|
||||
const { isPaid } = useLicense();
|
||||
const providerOptions = isPaid
|
||||
? [BASE_PROVIDER_OPTIONS[0], SENCHO_PROVIDER_OPTION, BASE_PROVIDER_OPTIONS[1]]
|
||||
: BASE_PROVIDER_OPTIONS;
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -312,7 +311,7 @@ export function CloudBackupSection() {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{isAdmiral && provider === 'sencho' && !senchoProvisioned && (
|
||||
{isPaid && provider === 'sencho' && !senchoProvisioned && (
|
||||
<div className={PANEL_CLASS}>
|
||||
<div className="flex items-center gap-2">
|
||||
<Cloud className="w-4 h-4 text-muted-foreground" strokeWidth={1.5} />
|
||||
@@ -328,7 +327,7 @@ export function CloudBackupSection() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isAdmiral && provider === 'sencho' && senchoProvisioned && (
|
||||
{isPaid && provider === 'sencho' && senchoProvisioned && (
|
||||
<div className={PANEL_CLASS}>
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<div className="flex items-center gap-2">
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Input } from '@/components/ui/input';
|
||||
import { TogglePill } from '@/components/ui/toggle-pill';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useLicense } from '@/context/LicenseContext';
|
||||
import { RefreshCw } from 'lucide-react';
|
||||
import { apiFetch } from '@/lib/api';
|
||||
import { toast } from '@/components/ui/toast-store';
|
||||
@@ -41,10 +42,10 @@ const DEFAULT_DEVELOPER: DeveloperFields = {
|
||||
};
|
||||
|
||||
export function DeveloperSection({ onDirtyChange }: DeveloperSectionProps) {
|
||||
const { isAdmin, permissions } = useAuth();
|
||||
const { isAdmin } = useAuth();
|
||||
const { isPaid } = useLicense();
|
||||
const { activeNode } = useNodes();
|
||||
const readOnly = !isAdmin;
|
||||
const isAdmiral = permissions?.isAdmiral ?? false;
|
||||
const [settings, setSettings] = useState<DeveloperFields>({ ...DEFAULT_DEVELOPER });
|
||||
const serverSettingsRef = useRef<DeveloperFields>({ ...DEFAULT_DEVELOPER });
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
@@ -202,7 +203,7 @@ export function DeveloperSection({ onDirtyChange }: DeveloperSectionProps) {
|
||||
</div>
|
||||
</SettingsField>
|
||||
|
||||
{isAdmiral && (
|
||||
{isPaid && (
|
||||
<SettingsField
|
||||
label="Audit log"
|
||||
helper="How long to keep audit trail entries."
|
||||
|
||||
@@ -16,17 +16,14 @@ import { useMastheadStats } from './MastheadStatsContext';
|
||||
|
||||
const PRICING_URL = 'https://sencho.io/pricing';
|
||||
|
||||
function getTierDisplayName(tier?: string, variant?: string | null, status?: string): string {
|
||||
if (tier === 'paid' && variant === 'admiral' && status === 'active') return 'Sencho Admiral';
|
||||
if (tier === 'paid' && variant === 'admiral' && status === 'trial') return 'Sencho Admiral (Trial)';
|
||||
if (tier === 'paid') return 'Sencho Skipper';
|
||||
function getTierDisplayName(tier?: string, status?: string): string {
|
||||
if (tier === 'paid' && status === 'trial') return 'Sencho Admiral (Trial)';
|
||||
if (tier === 'paid') return 'Sencho Admiral';
|
||||
return 'Sencho Community';
|
||||
}
|
||||
|
||||
function getTierMastheadValue(tier?: string, variant?: string | null): string {
|
||||
if (tier === 'paid' && variant === 'admiral') return 'admiral';
|
||||
if (tier === 'paid') return 'skipper';
|
||||
return 'community';
|
||||
function getTierMastheadValue(tier?: string): string {
|
||||
return tier === 'paid' ? 'admiral' : 'community';
|
||||
}
|
||||
|
||||
export function LicenseSection() {
|
||||
@@ -69,7 +66,7 @@ export function LicenseSection() {
|
||||
useMastheadStats([
|
||||
{
|
||||
label: 'PLAN',
|
||||
value: getTierMastheadValue(license?.tier, license?.variant),
|
||||
value: getTierMastheadValue(license?.tier),
|
||||
tone: isPaid ? 'value' : 'subtitle',
|
||||
},
|
||||
...(license?.status === 'trial' && license.trialDaysRemaining !== null
|
||||
@@ -93,7 +90,7 @@ export function LicenseSection() {
|
||||
<div className="flex flex-col gap-10">
|
||||
<SettingsSection title="Plan">
|
||||
<SettingsField
|
||||
label={getTierDisplayName(license?.tier, license?.variant, license?.status)}
|
||||
label={getTierDisplayName(license?.tier, license?.status)}
|
||||
helper={
|
||||
license?.status === 'expired'
|
||||
? 'Your license has expired. Renew to restore paid features.'
|
||||
|
||||
@@ -18,17 +18,15 @@ interface SectionGateProps {
|
||||
* guards remain the authoritative enforcement.
|
||||
*/
|
||||
export function SectionGate({ sectionId, children }: SectionGateProps) {
|
||||
const { isAdmin, permissions } = useAuth();
|
||||
const { isAdmin } = useAuth();
|
||||
const { isPaid } = useLicense();
|
||||
const { activeNode } = useNodes();
|
||||
|
||||
const isAdmiral = permissions?.isAdmiral ?? false;
|
||||
const isRemote = activeNode?.type === 'remote';
|
||||
|
||||
const visibility: VisibilityContext = {
|
||||
isAdmin,
|
||||
isPaid,
|
||||
isAdmiral,
|
||||
isRemote,
|
||||
};
|
||||
|
||||
|
||||
@@ -100,14 +100,13 @@ export function SettingsPage(props: SettingsPageProps) {
|
||||
}
|
||||
|
||||
function SettingsPageInner({ currentSection, onSectionChange }: SettingsPageProps) {
|
||||
const { isAdmin, permissions } = useAuth();
|
||||
const { isAdmin } = useAuth();
|
||||
const { isPaid } = useLicense();
|
||||
const { activeNode } = useNodes();
|
||||
const isRemote = activeNode?.type === 'remote';
|
||||
const isAdmiral = permissions?.isAdmiral ?? false;
|
||||
const visibility: VisibilityContext = useMemo(
|
||||
() => ({ isRemote, isAdmin, isPaid, isAdmiral }),
|
||||
[isRemote, isAdmin, isPaid, isAdmiral],
|
||||
() => ({ isRemote, isAdmin, isPaid }),
|
||||
[isRemote, isAdmin, isPaid],
|
||||
);
|
||||
|
||||
// Resolve the rendered section: must be a registry id and must be visible to the
|
||||
@@ -195,7 +194,7 @@ function SettingsPageInner({ currentSection, onSectionChange }: SettingsPageProp
|
||||
case 'system': return <SystemSection onDirtyChange={(d) => handleDirtyChange('system', d)} />;
|
||||
case 'notifications': return <NotificationsSection />;
|
||||
case 'notification-routing': return <NotificationRoutingSection />;
|
||||
case 'webhooks': return <WebhooksSection isPaid={isPaid} />;
|
||||
case 'webhooks': return <WebhooksSection />;
|
||||
case 'security': return <SecuritySection isPaid={isPaid} />;
|
||||
case 'cloud-backup': return <CloudBackupSection />;
|
||||
case 'developer': return <DeveloperSection onDirtyChange={(d) => handleDirtyChange('developer', d)} />;
|
||||
|
||||
@@ -16,17 +16,15 @@ interface SettingsSidebarProps {
|
||||
}
|
||||
|
||||
export function SettingsSidebar({ currentSection, onSectionChange, dirtyFlags, onOpenPalette }: SettingsSidebarProps) {
|
||||
const { isAdmin, permissions } = useAuth();
|
||||
const { isAdmin } = useAuth();
|
||||
const { isPaid } = useLicense();
|
||||
const { activeNode } = useNodes();
|
||||
|
||||
const isAdmiral = permissions?.isAdmiral ?? false;
|
||||
const isRemote = activeNode?.type === 'remote';
|
||||
|
||||
const visibility: VisibilityContext = {
|
||||
isAdmin,
|
||||
isPaid,
|
||||
isAdmiral,
|
||||
isRemote,
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ function ResourceLink({ icon, title, blurb, href, external = true }: ResourceLin
|
||||
}
|
||||
|
||||
export function SupportSection() {
|
||||
const { isPaid, license } = useLicense();
|
||||
const { isPaid } = useLicense();
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-10">
|
||||
@@ -63,13 +63,9 @@ export function SupportSection() {
|
||||
<div className="pt-3 grid gap-3">
|
||||
<ResourceLink
|
||||
icon={<Mail className="w-4 h-4" />}
|
||||
title={license?.variant === 'admiral' ? 'Priority email support' : 'Email support'}
|
||||
blurb={
|
||||
license?.variant === 'admiral'
|
||||
? 'Direct support with responses within 24 hours'
|
||||
: 'Reach our support team directly'
|
||||
}
|
||||
href={license?.variant === 'admiral' ? 'mailto:support@sencho.io' : 'mailto:licensing@sencho.io'}
|
||||
title="Priority email support"
|
||||
blurb="Direct support with responses within 24 hours"
|
||||
href="mailto:support@sencho.io"
|
||||
external={false}
|
||||
/>
|
||||
</div>
|
||||
@@ -80,7 +76,7 @@ export function SupportSection() {
|
||||
<SettingsCallout
|
||||
icon={<Crown className="h-4 w-4" />}
|
||||
title="Need faster support?"
|
||||
subtitle="Skipper and Admiral tiers include direct email support and priority issue handling."
|
||||
subtitle="Admiral includes direct email support and priority issue handling."
|
||||
action={
|
||||
<SettingsPrimaryButton
|
||||
size="sm"
|
||||
|
||||
@@ -10,7 +10,6 @@ import { toast } from '@/components/ui/toast-store';
|
||||
import { apiFetch } from '@/lib/api';
|
||||
import { useAuth, type UserRole } from '@/context/AuthContext';
|
||||
import { useLicense } from '@/context/LicenseContext';
|
||||
import { PaidGate } from '@/components/PaidGate';
|
||||
import { CapabilityGate } from '@/components/CapabilityGate';
|
||||
import { RefreshCw, Trash2, Plus, Pencil, ShieldOff } from 'lucide-react';
|
||||
import { SettingsCallout } from './SettingsCallout';
|
||||
@@ -37,7 +36,7 @@ interface RoleAssignmentItem {
|
||||
|
||||
export function UsersSection() {
|
||||
const { user: currentUser } = useAuth();
|
||||
const { isPaid, license } = useLicense();
|
||||
const { isPaid } = useLicense();
|
||||
const [users, setUsers] = useState<UserItem[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [showForm, setShowForm] = useState(false);
|
||||
@@ -260,8 +259,7 @@ export function UsersSection() {
|
||||
};
|
||||
|
||||
return (
|
||||
<PaidGate>
|
||||
<CapabilityGate capability="users" featureName="User Management">
|
||||
<CapabilityGate capability="users" featureName="User Management">
|
||||
<div className="space-y-6">
|
||||
{!showForm && (
|
||||
<div className="flex justify-end">
|
||||
@@ -290,7 +288,7 @@ export function UsersSection() {
|
||||
options={[
|
||||
{ value: 'admin', label: 'Admin' },
|
||||
{ value: 'viewer', label: 'Viewer' },
|
||||
...(isPaid && license?.variant === 'admiral' ? [
|
||||
...(isPaid ? [
|
||||
{ value: 'deployer', label: 'Deployer' },
|
||||
{ value: 'node-admin', label: 'Node Admin' },
|
||||
{ value: 'auditor', label: 'Auditor' },
|
||||
@@ -336,8 +334,8 @@ export function UsersSection() {
|
||||
</SettingsPrimaryButton>
|
||||
</div>
|
||||
|
||||
{/* Scoped Permissions (Admiral, editing only) */}
|
||||
{editingUser && isPaid && license?.variant === 'admiral' && (
|
||||
{/* Scoped Permissions (paid, editing only) */}
|
||||
{editingUser && isPaid && (
|
||||
<div className="border border-glass-border rounded-lg p-4 space-y-3 mt-4">
|
||||
<h4 className="text-sm font-medium">Scoped Permissions</h4>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
@@ -522,7 +520,6 @@ export function UsersSection() {
|
||||
</p>
|
||||
</ConfirmModal>
|
||||
</div>
|
||||
</CapabilityGate>
|
||||
</PaidGate>
|
||||
</CapabilityGate>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ interface WebhookExecution {
|
||||
executed_at: number;
|
||||
}
|
||||
|
||||
export function WebhooksSection({ isPaid }: { isPaid: boolean }) {
|
||||
export function WebhooksSection() {
|
||||
const { isAdmin } = useAuth();
|
||||
const { activeNode, nodes } = useNodes();
|
||||
const [webhooks, setWebhooks] = useState<WebhookItem[]>([]);
|
||||
@@ -158,8 +158,6 @@ export function WebhooksSection({ isPaid }: { isPaid: boolean }) {
|
||||
}
|
||||
};
|
||||
|
||||
if (!isPaid) return null;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-10">
|
||||
{isAdmin && (
|
||||
|
||||
@@ -16,7 +16,7 @@ export const SETTINGS_GROUPS: readonly SettingsGroupMeta[] = [
|
||||
{ id: 'advanced', label: 'Advanced', glyph: '\u25C7' },
|
||||
];
|
||||
|
||||
export type TierGate = 'skipper' | 'admiral' | null;
|
||||
export type TierGate = 'paid' | null;
|
||||
export type Scope = 'global' | 'node';
|
||||
|
||||
export interface SettingsItemMeta {
|
||||
@@ -67,7 +67,7 @@ export const SETTINGS_ITEMS: readonly SettingsItemMeta[] = [
|
||||
label: 'Users',
|
||||
description: 'Operators, role assignments, and access scopes.',
|
||||
keywords: ['operators', 'team', 'rbac', 'roles', 'permissions'],
|
||||
tier: 'skipper',
|
||||
tier: null,
|
||||
scope: 'global',
|
||||
adminOnly: true,
|
||||
hiddenOnRemote: true,
|
||||
@@ -109,7 +109,7 @@ export const SETTINGS_ITEMS: readonly SettingsItemMeta[] = [
|
||||
label: 'Registries',
|
||||
description: 'Private Docker registries and pull credentials.',
|
||||
keywords: ['docker', 'ghcr', 'ecr', 'private', 'pull', 'auth'],
|
||||
tier: 'admiral',
|
||||
tier: 'paid',
|
||||
scope: 'global',
|
||||
adminOnly: true,
|
||||
hiddenOnRemote: true,
|
||||
@@ -150,7 +150,7 @@ export const SETTINGS_ITEMS: readonly SettingsItemMeta[] = [
|
||||
label: 'Routing',
|
||||
description: 'Rules that steer alerts to the right channel based on severity or label.',
|
||||
keywords: ['rules', 'routing', 'channels', 'severity', 'labels'],
|
||||
tier: 'skipper',
|
||||
tier: null,
|
||||
scope: 'global',
|
||||
adminOnly: true,
|
||||
hiddenOnRemote: true,
|
||||
@@ -161,7 +161,7 @@ export const SETTINGS_ITEMS: readonly SettingsItemMeta[] = [
|
||||
label: 'Webhooks',
|
||||
description: 'Incoming HMAC-signed HTTP triggers that run stack actions from CI/CD pipelines.',
|
||||
keywords: ['webhook', 'incoming', 'trigger', 'ci', 'cd', 'pipeline', 'deploy', 'hmac', 'signature', 'action'],
|
||||
tier: 'skipper',
|
||||
tier: null,
|
||||
scope: 'global',
|
||||
hiddenOnRemote: true,
|
||||
},
|
||||
@@ -245,7 +245,6 @@ export interface VisibilityContext {
|
||||
isRemote: boolean;
|
||||
isAdmin: boolean;
|
||||
isPaid: boolean;
|
||||
isAdmiral: boolean;
|
||||
}
|
||||
|
||||
export function isItemVisible(item: SettingsItemMeta, ctx: VisibilityContext): boolean {
|
||||
@@ -255,7 +254,5 @@ export function isItemVisible(item: SettingsItemMeta, ctx: VisibilityContext): b
|
||||
}
|
||||
|
||||
export function isItemLocked(item: SettingsItemMeta, ctx: VisibilityContext): boolean {
|
||||
if (item.tier === 'skipper') return !ctx.isPaid;
|
||||
if (item.tier === 'admiral') return !ctx.isAdmiral;
|
||||
return false;
|
||||
return item.tier === 'paid' ? !ctx.isPaid : false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user