@authrim/setup 0.1.24 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/init.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/ui.d.ts.map +1 -1
- package/dist/web/ui.js +215 -152
- package/dist/web/ui.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ function printBanner() {
|
|
|
24
24
|
console.log('');
|
|
25
25
|
console.log(chalk.blue('╔═══════════════════════════════════════════════════════════╗'));
|
|
26
26
|
console.log(chalk.blue('║') +
|
|
27
|
-
chalk.bold.white(' 🔐 Authrim Setup v0.1.
|
|
27
|
+
chalk.bold.white(' 🔐 Authrim Setup v0.1.27 ') +
|
|
28
28
|
chalk.blue('║'));
|
|
29
29
|
console.log(chalk.blue('║') +
|
|
30
30
|
chalk.gray(' OIDC Provider on Cloudflare Workers ') +
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const program = new Command();
|
|
|
17
17
|
program
|
|
18
18
|
.name('authrim-setup')
|
|
19
19
|
.description('CLI tool for setting up Authrim OIDC Provider on Cloudflare Workers')
|
|
20
|
-
.version('0.1.
|
|
20
|
+
.version('0.1.27');
|
|
21
21
|
program
|
|
22
22
|
.command('init', { isDefault: true })
|
|
23
23
|
.description('Initialize a new Authrim setup')
|
package/dist/web/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/web/ui.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/web/ui.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CA+9EnF"}
|
package/dist/web/ui.js
CHANGED
|
@@ -852,96 +852,114 @@ export function getHtmlTemplate(sessionToken, manageOnly) {
|
|
|
852
852
|
<div id="section-config" class="card hidden">
|
|
853
853
|
<h2 class="card-title">Configuration</h2>
|
|
854
854
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
<
|
|
858
|
-
<small style="color: var(--text-muted)">Lowercase letters, numbers, and hyphens only</small>
|
|
859
|
-
</div>
|
|
855
|
+
<!-- 1. Components (shown in custom mode) -->
|
|
856
|
+
<div id="advanced-options" class="hidden">
|
|
857
|
+
<h3 style="margin: 0 0 1rem; font-size: 1rem;">📦 Components</h3>
|
|
860
858
|
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
859
|
+
<!-- API Component (required) -->
|
|
860
|
+
<div class="component-card" style="background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 0.75rem;">
|
|
861
|
+
<label class="checkbox-item" style="font-weight: 600; margin-bottom: 0.25rem;">
|
|
862
|
+
<input type="checkbox" id="comp-api" checked disabled>
|
|
863
|
+
🔐 API (required)
|
|
864
|
+
</label>
|
|
865
|
+
<p style="margin: 0.25rem 0 0.5rem 1.5rem; font-size: 0.85rem; color: var(--text-muted);">
|
|
866
|
+
OIDC Provider endpoints: authorize, token, userinfo, discovery, management APIs.
|
|
867
|
+
</p>
|
|
868
|
+
<div style="margin-left: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem;">
|
|
869
|
+
<label class="checkbox-item" style="font-size: 0.9rem;">
|
|
870
|
+
<input type="checkbox" id="comp-saml">
|
|
871
|
+
SAML IdP
|
|
872
|
+
</label>
|
|
873
|
+
<label class="checkbox-item" style="font-size: 0.9rem;">
|
|
874
|
+
<input type="checkbox" id="comp-async">
|
|
875
|
+
Device Flow / CIBA
|
|
876
|
+
</label>
|
|
877
|
+
<label class="checkbox-item" style="font-size: 0.9rem;">
|
|
878
|
+
<input type="checkbox" id="comp-vc">
|
|
879
|
+
Verifiable Credentials
|
|
880
|
+
</label>
|
|
881
|
+
</div>
|
|
867
882
|
</div>
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
883
|
+
|
|
884
|
+
<!-- Login UI Component -->
|
|
885
|
+
<div class="component-card" style="background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 0.75rem;">
|
|
886
|
+
<label class="checkbox-item" style="font-weight: 600; margin-bottom: 0.25rem;">
|
|
887
|
+
<input type="checkbox" id="comp-login-ui" checked>
|
|
888
|
+
🖥️ Login UI
|
|
889
|
+
</label>
|
|
890
|
+
<p style="margin: 0.25rem 0 0 1.5rem; font-size: 0.85rem; color: var(--text-muted);">
|
|
891
|
+
User-facing login, registration, consent, and account management pages.
|
|
892
|
+
</p>
|
|
871
893
|
</div>
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
894
|
+
|
|
895
|
+
<!-- Admin UI Component -->
|
|
896
|
+
<div class="component-card" style="background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 0.75rem;">
|
|
897
|
+
<label class="checkbox-item" style="font-weight: 600; margin-bottom: 0.25rem;">
|
|
898
|
+
<input type="checkbox" id="comp-admin-ui" checked>
|
|
899
|
+
⚙️ Admin UI
|
|
900
|
+
</label>
|
|
901
|
+
<p style="margin: 0.25rem 0 0 1.5rem; font-size: 0.85rem; color: var(--text-muted);">
|
|
902
|
+
Admin dashboard for managing tenants, clients, users, and system settings.
|
|
903
|
+
</p>
|
|
875
904
|
</div>
|
|
905
|
+
|
|
906
|
+
<hr style="margin: 1.5rem 0; border: none; border-top: 1px solid var(--border);">
|
|
876
907
|
</div>
|
|
877
908
|
|
|
878
|
-
<!--
|
|
909
|
+
<!-- 2. Environment Name -->
|
|
879
910
|
<div class="form-group">
|
|
880
|
-
<label
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
</label>
|
|
884
|
-
<small style="color: var(--text-muted); margin-left: 1.5rem;">
|
|
885
|
-
Subdomain-based tenant isolation: https://{tenant}.{base-domain}
|
|
886
|
-
</small>
|
|
911
|
+
<label for="env">Environment Name <span style="color: var(--error);">*</span></label>
|
|
912
|
+
<input type="text" id="env" placeholder="e.g., prod, staging, dev" required>
|
|
913
|
+
<small style="color: var(--text-muted)">Lowercase letters, numbers, and hyphens only</small>
|
|
887
914
|
</div>
|
|
888
915
|
|
|
889
|
-
<!--
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
<
|
|
893
|
-
In single-tenant mode, Issuer URL = API domain. Leave empty to use workers.dev.
|
|
894
|
-
</div>
|
|
895
|
-
<div class="domain-row">
|
|
896
|
-
<span class="domain-label">Issuer/API</span>
|
|
897
|
-
<div class="domain-input-wrapper">
|
|
898
|
-
<input type="text" id="api-domain" placeholder="auth.example.com">
|
|
899
|
-
<span class="domain-default" id="api-default">{env}-ar-router.workers.dev</span>
|
|
900
|
-
</div>
|
|
901
|
-
</div>
|
|
902
|
-
<div class="issuer-preview" id="issuer-preview-single">
|
|
903
|
-
<span class="label">Issuer URL:</span>
|
|
904
|
-
<span class="value" id="issuer-url-single">https://{env}-ar-router.workers.dev</span>
|
|
905
|
-
</div>
|
|
906
|
-
</div>
|
|
916
|
+
<!-- 3. Domain Configuration -->
|
|
917
|
+
<!-- 3.1 API / Issuer Domain -->
|
|
918
|
+
<div class="domain-section">
|
|
919
|
+
<h4>🌐 API / Issuer Domain</h4>
|
|
907
920
|
|
|
908
|
-
<!-- Multi-tenant: Base Domain (issuer derived from subdomain) -->
|
|
909
|
-
<div id="multi-tenant-domain" class="domain-section" style="display: none;">
|
|
910
|
-
<h4>🌐 Multi-tenant Base Domain</h4>
|
|
911
|
-
<div class="section-hint">
|
|
912
|
-
Each tenant gets a subdomain. The base domain points to the router Worker.
|
|
913
|
-
</div>
|
|
914
921
|
<div class="form-group" style="margin-bottom: 0.75rem;">
|
|
915
922
|
<label for="base-domain">Base Domain <span style="color: var(--error);">*</span></label>
|
|
916
923
|
<input type="text" id="base-domain" placeholder="authrim.com">
|
|
924
|
+
<small style="color: var(--text-muted)">Your domain for Authrim (e.g., authrim.com)</small>
|
|
917
925
|
</div>
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
926
|
+
|
|
927
|
+
<!-- Naked Domain Option -->
|
|
928
|
+
<div class="form-group" style="margin-bottom: 0.75rem;">
|
|
929
|
+
<label class="checkbox-item" style="display: flex; align-items: center; gap: 0.5rem;">
|
|
930
|
+
<input type="checkbox" id="naked-domain">
|
|
931
|
+
<span>Start with naked domain</span>
|
|
932
|
+
</label>
|
|
933
|
+
<small style="color: var(--text-muted); margin-left: 1.5rem;">
|
|
934
|
+
Use https://example.com as initial Issuer. You can add subdomain tenants (tenant1.example.com) later.
|
|
935
|
+
</small>
|
|
921
936
|
</div>
|
|
922
|
-
</div>
|
|
923
937
|
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
938
|
+
<!-- Default Tenant (hidden when naked domain is checked) -->
|
|
939
|
+
<div id="tenant-fields">
|
|
940
|
+
<div class="form-group" style="margin-bottom: 0.5rem;">
|
|
941
|
+
<label for="tenant-name">Default Tenant Name</label>
|
|
942
|
+
<input type="text" id="tenant-name" placeholder="default" value="default">
|
|
943
|
+
<small style="color: var(--text-muted)">First tenant identifier (lowercase, no spaces)</small>
|
|
944
|
+
</div>
|
|
945
|
+
</div>
|
|
930
946
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
947
|
+
<div class="form-group" style="margin-bottom: 0;">
|
|
948
|
+
<label for="tenant-display">Organization Name</label>
|
|
949
|
+
<input type="text" id="tenant-display" placeholder="My Organization" value="Default Tenant">
|
|
950
|
+
<small style="color: var(--text-muted)">Display name shown to users</small>
|
|
951
|
+
</div>
|
|
935
952
|
</div>
|
|
936
953
|
|
|
937
|
-
<!-- UI
|
|
938
|
-
<div class="domain-section">
|
|
954
|
+
<!-- 3.2 UI Domains -->
|
|
955
|
+
<div class="domain-section" id="ui-domains-section">
|
|
939
956
|
<h4>🖥️ UI Domains (Optional)</h4>
|
|
940
957
|
<div class="section-hint">
|
|
941
|
-
Custom domains for Login
|
|
958
|
+
Custom domains for Login/Admin UIs. Each can be set independently.
|
|
959
|
+
Leave empty to use Cloudflare Pages default.
|
|
942
960
|
</div>
|
|
943
961
|
|
|
944
|
-
<div class="domain-row">
|
|
962
|
+
<div class="domain-row" id="login-domain-row">
|
|
945
963
|
<span class="domain-label">Login UI</span>
|
|
946
964
|
<div class="domain-input-wrapper">
|
|
947
965
|
<input type="text" id="login-domain" placeholder="login.example.com">
|
|
@@ -949,49 +967,37 @@ export function getHtmlTemplate(sessionToken, manageOnly) {
|
|
|
949
967
|
</div>
|
|
950
968
|
</div>
|
|
951
969
|
|
|
952
|
-
<div class="domain-row">
|
|
970
|
+
<div class="domain-row" id="admin-domain-row">
|
|
953
971
|
<span class="domain-label">Admin UI</span>
|
|
954
972
|
<div class="domain-input-wrapper">
|
|
955
973
|
<input type="text" id="admin-domain" placeholder="admin.example.com">
|
|
956
974
|
<span class="domain-default" id="admin-default">{env}-ar-ui.pages.dev/admin</span>
|
|
957
975
|
</div>
|
|
958
976
|
</div>
|
|
977
|
+
|
|
978
|
+
<div class="section-hint" style="margin-top: 0.75rem; background: #fef3c7;">
|
|
979
|
+
💡 CORS: Cross-origin requests from Login/Admin UI to API are automatically allowed.
|
|
980
|
+
</div>
|
|
959
981
|
</div>
|
|
960
982
|
|
|
961
|
-
<!--
|
|
962
|
-
<div
|
|
963
|
-
<
|
|
964
|
-
<div class="
|
|
965
|
-
<
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
<
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
<
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
<
|
|
978
|
-
|
|
979
|
-
SAML IdP
|
|
980
|
-
</label>
|
|
981
|
-
<label class="checkbox-item">
|
|
982
|
-
<input type="checkbox" id="comp-async">
|
|
983
|
-
Device Flow / CIBA
|
|
984
|
-
</label>
|
|
985
|
-
<label class="checkbox-item">
|
|
986
|
-
<input type="checkbox" id="comp-vc">
|
|
987
|
-
Verifiable Credentials
|
|
988
|
-
</label>
|
|
989
|
-
<div class="checkbox-item" style="color: var(--text-muted); font-style: italic;">
|
|
990
|
-
✓ External IdP (Social Login) - included
|
|
991
|
-
</div>
|
|
992
|
-
<div class="checkbox-item" style="color: var(--text-muted); font-style: italic;">
|
|
993
|
-
✓ ReBAC Policy Engine - included
|
|
994
|
-
</div>
|
|
983
|
+
<!-- 4. Preview Section (at the bottom) -->
|
|
984
|
+
<div class="infra-section" id="config-preview">
|
|
985
|
+
<h4>📋 Configuration Preview</h4>
|
|
986
|
+
<div class="infra-item">
|
|
987
|
+
<span class="infra-label">Workers:</span>
|
|
988
|
+
<span class="infra-value" id="preview-workers">{env}-ar-router, {env}-ar-auth, ...</span>
|
|
989
|
+
</div>
|
|
990
|
+
<div class="infra-item">
|
|
991
|
+
<span class="infra-label">Issuer URL:</span>
|
|
992
|
+
<span class="infra-value" id="preview-issuer">https://{tenant}.{base-domain}</span>
|
|
993
|
+
</div>
|
|
994
|
+
<div class="infra-item">
|
|
995
|
+
<span class="infra-label">Login UI:</span>
|
|
996
|
+
<span class="infra-value" id="preview-login">{env}-ar-ui.pages.dev</span>
|
|
997
|
+
</div>
|
|
998
|
+
<div class="infra-item">
|
|
999
|
+
<span class="infra-label">Admin UI:</span>
|
|
1000
|
+
<span class="infra-value" id="preview-admin">{env}-ar-ui.pages.dev/admin</span>
|
|
995
1001
|
</div>
|
|
996
1002
|
</div>
|
|
997
1003
|
|
|
@@ -1569,53 +1575,114 @@ export function getHtmlTemplate(sessionToken, manageOnly) {
|
|
|
1569
1575
|
});
|
|
1570
1576
|
|
|
1571
1577
|
// Configuration handlers
|
|
1572
|
-
// Update
|
|
1573
|
-
function
|
|
1574
|
-
env = env || '{env}';
|
|
1575
|
-
|
|
1576
|
-
document.getElementById('
|
|
1577
|
-
document.getElementById('
|
|
1578
|
-
document.getElementById('
|
|
1579
|
-
|
|
1580
|
-
|
|
1578
|
+
// Update preview section when any input changes
|
|
1579
|
+
function updatePreview() {
|
|
1580
|
+
const env = document.getElementById('env').value.trim().toLowerCase().replace(/[^a-z0-9-]/g, '') || '{env}';
|
|
1581
|
+
const baseDomain = document.getElementById('base-domain').value.trim();
|
|
1582
|
+
const nakedDomain = document.getElementById('naked-domain').checked;
|
|
1583
|
+
const tenantName = document.getElementById('tenant-name').value.trim() || 'default';
|
|
1584
|
+
const loginDomain = document.getElementById('login-domain').value.trim();
|
|
1585
|
+
const adminDomain = document.getElementById('admin-domain').value.trim();
|
|
1586
|
+
|
|
1587
|
+
// Workers
|
|
1588
|
+
document.getElementById('preview-workers').textContent = env + '-ar-router, ' + env + '-ar-auth, ...';
|
|
1589
|
+
|
|
1590
|
+
// Issuer URL
|
|
1591
|
+
if (baseDomain) {
|
|
1592
|
+
if (nakedDomain) {
|
|
1593
|
+
// Naked domain: https://example.com
|
|
1594
|
+
document.getElementById('preview-issuer').textContent = 'https://' + baseDomain;
|
|
1595
|
+
} else {
|
|
1596
|
+
// Subdomain: https://tenant.example.com
|
|
1597
|
+
document.getElementById('preview-issuer').textContent = 'https://' + tenantName + '.' + baseDomain;
|
|
1598
|
+
}
|
|
1599
|
+
} else {
|
|
1600
|
+
if (nakedDomain) {
|
|
1601
|
+
document.getElementById('preview-issuer').textContent = 'https://{base-domain}';
|
|
1602
|
+
} else {
|
|
1603
|
+
document.getElementById('preview-issuer').textContent = 'https://{tenant}.{base-domain}';
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
// Login UI - check if component is enabled (in custom mode)
|
|
1608
|
+
const loginUiEnabled = document.getElementById('comp-login-ui').checked;
|
|
1609
|
+
const previewLogin = document.getElementById('preview-login');
|
|
1610
|
+
if (!loginUiEnabled) {
|
|
1611
|
+
previewLogin.textContent = '(Not deployed)';
|
|
1612
|
+
previewLogin.style.color = 'var(--text-muted)';
|
|
1613
|
+
} else if (loginDomain) {
|
|
1614
|
+
previewLogin.textContent = 'https://' + loginDomain;
|
|
1615
|
+
previewLogin.style.color = '';
|
|
1616
|
+
} else {
|
|
1617
|
+
previewLogin.textContent = 'https://' + env + '-ar-ui.pages.dev';
|
|
1618
|
+
previewLogin.style.color = '';
|
|
1619
|
+
}
|
|
1581
1620
|
document.getElementById('login-default').textContent = env + '-ar-ui.pages.dev';
|
|
1621
|
+
|
|
1622
|
+
// Admin UI - check if component is enabled (in custom mode)
|
|
1623
|
+
const adminUiEnabled = document.getElementById('comp-admin-ui').checked;
|
|
1624
|
+
const previewAdmin = document.getElementById('preview-admin');
|
|
1625
|
+
if (!adminUiEnabled) {
|
|
1626
|
+
previewAdmin.textContent = '(Not deployed)';
|
|
1627
|
+
previewAdmin.style.color = 'var(--text-muted)';
|
|
1628
|
+
} else if (adminDomain) {
|
|
1629
|
+
previewAdmin.textContent = 'https://' + adminDomain;
|
|
1630
|
+
previewAdmin.style.color = '';
|
|
1631
|
+
} else {
|
|
1632
|
+
previewAdmin.textContent = 'https://' + env + '-ar-ui.pages.dev/admin';
|
|
1633
|
+
previewAdmin.style.color = '';
|
|
1634
|
+
}
|
|
1582
1635
|
document.getElementById('admin-default').textContent = env + '-ar-ui.pages.dev/admin';
|
|
1583
|
-
// Single-tenant issuer preview
|
|
1584
|
-
const apiDomain = document.getElementById('api-domain').value.trim();
|
|
1585
|
-
document.getElementById('issuer-url-single').textContent =
|
|
1586
|
-
apiDomain ? 'https://' + apiDomain : 'https://' + env + '-ar-router.workers.dev';
|
|
1587
1636
|
}
|
|
1588
1637
|
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1638
|
+
// Attach event listeners to all inputs
|
|
1639
|
+
['env', 'base-domain', 'naked-domain', 'tenant-name', 'login-domain', 'admin-domain', 'comp-login-ui', 'comp-admin-ui'].forEach(id => {
|
|
1640
|
+
const el = document.getElementById(id);
|
|
1641
|
+
if (el) {
|
|
1642
|
+
el.addEventListener('input', updatePreview);
|
|
1643
|
+
el.addEventListener('change', updatePreview);
|
|
1644
|
+
}
|
|
1592
1645
|
});
|
|
1593
1646
|
|
|
1594
|
-
//
|
|
1595
|
-
document.getElementById('
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1647
|
+
// Naked domain toggle - show/hide tenant name field
|
|
1648
|
+
document.getElementById('naked-domain').addEventListener('change', (e) => {
|
|
1649
|
+
const tenantFields = document.getElementById('tenant-fields');
|
|
1650
|
+
if (e.target.checked) {
|
|
1651
|
+
tenantFields.style.display = 'none';
|
|
1652
|
+
} else {
|
|
1653
|
+
tenantFields.style.display = 'block';
|
|
1654
|
+
}
|
|
1655
|
+
updatePreview();
|
|
1600
1656
|
});
|
|
1601
1657
|
|
|
1602
|
-
//
|
|
1603
|
-
document.getElementById('
|
|
1604
|
-
const
|
|
1605
|
-
document.getElementById('
|
|
1658
|
+
// Login UI component toggle - grey out domain settings when unchecked
|
|
1659
|
+
document.getElementById('comp-login-ui').addEventListener('change', (e) => {
|
|
1660
|
+
const loginDomainRow = document.getElementById('login-domain-row');
|
|
1661
|
+
const loginDomainInput = document.getElementById('login-domain');
|
|
1662
|
+
if (e.target.checked) {
|
|
1663
|
+
loginDomainRow.style.opacity = '1';
|
|
1664
|
+
loginDomainInput.disabled = false;
|
|
1665
|
+
} else {
|
|
1666
|
+
loginDomainRow.style.opacity = '0.4';
|
|
1667
|
+
loginDomainInput.disabled = true;
|
|
1668
|
+
loginDomainInput.value = '';
|
|
1669
|
+
}
|
|
1670
|
+
updatePreview();
|
|
1606
1671
|
});
|
|
1607
1672
|
|
|
1608
|
-
//
|
|
1609
|
-
document.getElementById('
|
|
1610
|
-
const
|
|
1611
|
-
const
|
|
1673
|
+
// Admin UI component toggle - grey out domain settings when unchecked
|
|
1674
|
+
document.getElementById('comp-admin-ui').addEventListener('change', (e) => {
|
|
1675
|
+
const adminDomainRow = document.getElementById('admin-domain-row');
|
|
1676
|
+
const adminDomainInput = document.getElementById('admin-domain');
|
|
1612
1677
|
if (e.target.checked) {
|
|
1613
|
-
|
|
1614
|
-
|
|
1678
|
+
adminDomainRow.style.opacity = '1';
|
|
1679
|
+
adminDomainInput.disabled = false;
|
|
1615
1680
|
} else {
|
|
1616
|
-
|
|
1617
|
-
|
|
1681
|
+
adminDomainRow.style.opacity = '0.4';
|
|
1682
|
+
adminDomainInput.disabled = true;
|
|
1683
|
+
adminDomainInput.value = '';
|
|
1618
1684
|
}
|
|
1685
|
+
updatePreview();
|
|
1619
1686
|
});
|
|
1620
1687
|
|
|
1621
1688
|
document.getElementById('btn-back-mode').addEventListener('click', () => {
|
|
@@ -1654,26 +1721,21 @@ export function getHtmlTemplate(sessionToken, manageOnly) {
|
|
|
1654
1721
|
configureBtn.disabled = false;
|
|
1655
1722
|
}
|
|
1656
1723
|
|
|
1657
|
-
const loginDomain = document.getElementById('login-domain').value.trim();
|
|
1658
|
-
const adminDomain = document.getElementById('admin-domain').value.trim();
|
|
1659
|
-
const multiTenant = document.getElementById('multi-tenant').checked;
|
|
1660
1724
|
const baseDomain = document.getElementById('base-domain').value.trim();
|
|
1725
|
+
const nakedDomain = document.getElementById('naked-domain').checked;
|
|
1661
1726
|
const tenantName = document.getElementById('tenant-name').value.trim() || 'default';
|
|
1662
1727
|
const tenantDisplayName = document.getElementById('tenant-display').value.trim() || 'Default Tenant';
|
|
1728
|
+
const loginDomain = document.getElementById('login-domain').value.trim();
|
|
1729
|
+
const adminDomain = document.getElementById('admin-domain').value.trim();
|
|
1663
1730
|
|
|
1664
|
-
// Validate base domain
|
|
1665
|
-
if (
|
|
1666
|
-
|
|
1667
|
-
result.textContent = '';
|
|
1668
|
-
result.appendChild(createAlert('error', 'Base domain is required for multi-tenant mode'));
|
|
1731
|
+
// Validate base domain is required
|
|
1732
|
+
if (!baseDomain) {
|
|
1733
|
+
alert('Base domain is required');
|
|
1669
1734
|
return;
|
|
1670
1735
|
}
|
|
1671
1736
|
|
|
1672
|
-
//
|
|
1673
|
-
|
|
1674
|
-
const apiDomain = multiTenant
|
|
1675
|
-
? baseDomain
|
|
1676
|
-
: (document.getElementById('api-domain').value.trim() || null);
|
|
1737
|
+
// API domain = base domain (wildcard subdomain routing)
|
|
1738
|
+
const apiDomain = baseDomain;
|
|
1677
1739
|
|
|
1678
1740
|
config = {
|
|
1679
1741
|
env,
|
|
@@ -1681,10 +1743,11 @@ export function getHtmlTemplate(sessionToken, manageOnly) {
|
|
|
1681
1743
|
loginUiDomain: loginDomain || null,
|
|
1682
1744
|
adminUiDomain: adminDomain || null,
|
|
1683
1745
|
tenant: {
|
|
1684
|
-
name: tenantName,
|
|
1746
|
+
name: nakedDomain ? null : tenantName, // null for naked domain
|
|
1685
1747
|
displayName: tenantDisplayName,
|
|
1686
|
-
multiTenant,
|
|
1687
|
-
baseDomain:
|
|
1748
|
+
multiTenant: true, // Always multi-tenant capable
|
|
1749
|
+
baseDomain: baseDomain,
|
|
1750
|
+
nakedDomain: nakedDomain,
|
|
1688
1751
|
},
|
|
1689
1752
|
components: {
|
|
1690
1753
|
api: true,
|
package/dist/web/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/web/ui.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,UAAU,eAAe,CAAC,YAAqB,EAAE,UAAoB;IACzE,gDAAgD;IAChD,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAErD,OAAO
|
|
1
|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