mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
148 lines
8.2 KiB
PHTML
148 lines
8.2 KiB
PHTML
<?php
|
|
$isUpgrade = $isUpgrade ?? false;
|
|
$lockedDatabase = $lockedDatabase ?? null;
|
|
$vars = $vars ?? [];
|
|
$defaultHttpPort = $defaultHttpPort ?? '80';
|
|
$defaultHttpsPort = $defaultHttpsPort ?? '443';
|
|
$defaultAppDomain = $vars['_APP_DOMAIN']['default'] ?? 'localhost';
|
|
$defaultAppDomain = ($defaultAppDomain === 'traefik') ? 'localhost' : $defaultAppDomain;
|
|
$defaultEmailCertificates = $defaultEmailCertificates ?? '';
|
|
$defaultDatabase = $vars['_APP_DB_ADAPTER']['default'] ?? 'mongodb';
|
|
$lockedDatabase = $isUpgrade && empty($lockedDatabase) ? $defaultDatabase : $lockedDatabase;
|
|
$enabledDatabases = $enabledDatabases ?? ['mongodb', 'mariadb', 'postgresql'];
|
|
$isLocalInstall = $isLocalInstall ?? false;
|
|
|
|
|
|
$cardStep = ($step === 5) ? 4 : $step;
|
|
$stepFile = __DIR__ . "/installer/templates/steps/step-{$cardStep}.phtml";
|
|
if (!is_file($stepFile)) {
|
|
$stepFile = __DIR__ . "/installer/templates/steps/step-1.phtml";
|
|
}
|
|
$cssVersion = @filemtime(__DIR__ . '/installer/css/styles.css') ?: time();
|
|
$tooltipsVersion = @filemtime(__DIR__ . '/installer/js/tooltips.js') ?: time();
|
|
$constantsVersion = @filemtime(__DIR__ . '/installer/js/constants.js') ?: time();
|
|
$stepsContextVersion = @filemtime(__DIR__ . '/installer/js/modules/context.js') ?: time();
|
|
$stepsStateVersion = @filemtime(__DIR__ . '/installer/js/modules/state.js') ?: time();
|
|
$stepsValidationVersion = @filemtime(__DIR__ . '/installer/js/modules/validation.js') ?: time();
|
|
$stepsUiVersion = @filemtime(__DIR__ . '/installer/js/modules/ui.js') ?: time();
|
|
$stepsToastVersion = @filemtime(__DIR__ . '/installer/js/modules/toast.js') ?: time();
|
|
$stepsProgressVersion = @filemtime(__DIR__ . '/installer/js/modules/progress.js') ?: time();
|
|
$stepsVersion = @filemtime(__DIR__ . '/installer/js/steps.js') ?: time();
|
|
$installerVersion = @filemtime(__DIR__ . '/installer/js/installer.js') ?: time();
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?php echo $isUpgrade ? 'Appwrite Update' : 'Appwrite Installation'; ?></title>
|
|
<meta name="appwrite-installer-csrf" content="<?php echo htmlspecialchars($csrfToken ?? '', ENT_QUOTES); ?>">
|
|
<link rel="icon" type="image/svg+xml" href="installer/icons/appwrite-mark.svg">
|
|
<link rel="stylesheet" href="installer/css/styles.css?v=<?php echo $cssVersion; ?>">
|
|
<script src="installer/js/tooltips.js?v=<?php echo $tooltipsVersion; ?>" defer></script>
|
|
<script src="installer/js/constants.js?v=<?php echo $constantsVersion; ?>" defer></script>
|
|
<!-- Load context first; other modules depend on InstallerStepsContext. -->
|
|
<script src="installer/js/modules/context.js?v=<?php echo $stepsContextVersion; ?>" defer></script>
|
|
<script src="installer/js/modules/state.js?v=<?php echo $stepsStateVersion; ?>" defer></script>
|
|
<script src="installer/js/modules/validation.js?v=<?php echo $stepsValidationVersion; ?>" defer></script>
|
|
<script src="installer/js/modules/ui.js?v=<?php echo $stepsUiVersion; ?>" defer></script>
|
|
<script src="installer/js/modules/toast.js?v=<?php echo $stepsToastVersion; ?>" defer></script>
|
|
<script src="installer/js/modules/progress.js?v=<?php echo $stepsProgressVersion; ?>" defer></script>
|
|
<script src="installer/js/steps.js?v=<?php echo $stepsVersion; ?>" defer></script>
|
|
<script src="installer/js/installer.js?v=<?php echo $installerVersion; ?>" defer></script>
|
|
</head>
|
|
<body
|
|
class="installer-page"
|
|
data-step="<?php echo $step; ?>"
|
|
data-upgrade="<?php echo $isUpgrade ? 'true' : 'false'; ?>"
|
|
<?php if (!empty($lockedDatabase)) { ?>
|
|
data-locked-database="<?php echo htmlspecialchars((string) $lockedDatabase, ENT_QUOTES, 'UTF-8'); ?>"
|
|
<?php } ?>
|
|
data-default-http-port="<?php echo htmlspecialchars((string) $defaultHttpPort, ENT_QUOTES, 'UTF-8'); ?>"
|
|
data-default-https-port="<?php echo htmlspecialchars((string) $defaultHttpsPort, ENT_QUOTES, 'UTF-8'); ?>"
|
|
data-default-app-domain="<?php echo htmlspecialchars((string) $defaultAppDomain, ENT_QUOTES, 'UTF-8'); ?>"
|
|
data-default-email-certificates="<?php echo htmlspecialchars((string) $defaultEmailCertificates, ENT_QUOTES, 'UTF-8'); ?>"
|
|
data-default-secret-key=""
|
|
data-default-assistant-openai-key=""
|
|
data-default-database="<?php echo htmlspecialchars((string) $defaultDatabase, ENT_QUOTES, 'UTF-8'); ?>"
|
|
data-enabled-databases="<?php echo htmlspecialchars(json_encode(array_values($enabledDatabases)), ENT_QUOTES, 'UTF-8'); ?>"
|
|
<?php if ($isLocalInstall) { ?>
|
|
data-dev-mode="true"
|
|
<?php } ?>
|
|
>
|
|
<div class="installer-backdrop" aria-hidden="true">
|
|
<span class="installer-gradients">
|
|
<span class="installer-blob blob-one">
|
|
<?php include __DIR__ . '/installer/icons/install-bg-1.svg'; ?>
|
|
</span>
|
|
<span class="installer-blob blob-two">
|
|
<?php include __DIR__ . '/installer/icons/install-bg-2.svg'; ?>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
|
|
<main class="installer-main">
|
|
<div class="installer-card" data-step="<?php echo $step; ?>">
|
|
<div class="installer-step">
|
|
<div class="step-panel is-active">
|
|
<?php include $stepFile; ?>
|
|
</div>
|
|
</div>
|
|
<div class="action-shell">
|
|
<div class="divider"></div>
|
|
<div class="action-bar">
|
|
<button class="button secondary" type="button" data-action="back">
|
|
<span class="button-text typography-text-m-500">Back</span>
|
|
</button>
|
|
|
|
<div class="step-indicators" aria-hidden="true">
|
|
<span class="step-indicator" data-step="1">
|
|
<span class="indicator-active"><?php include __DIR__ . '/installer/icons/indicator-active.svg'; ?></span>
|
|
<span class="indicator-inactive"><?php include __DIR__ . '/installer/icons/indicator-inactive.svg'; ?></span>
|
|
</span>
|
|
<span class="step-indicator" data-step="2">
|
|
<span class="indicator-active"><?php include __DIR__ . '/installer/icons/indicator-active.svg'; ?></span>
|
|
<span class="indicator-inactive"><?php include __DIR__ . '/installer/icons/indicator-inactive.svg'; ?></span>
|
|
</span>
|
|
<span class="step-indicator" data-step="3">
|
|
<span class="indicator-active"><?php include __DIR__ . '/installer/icons/indicator-active.svg'; ?></span>
|
|
<span class="indicator-inactive"><?php include __DIR__ . '/installer/icons/indicator-inactive.svg'; ?></span>
|
|
</span>
|
|
<span class="step-indicator" data-step="4">
|
|
<span class="indicator-active"><?php include __DIR__ . '/installer/icons/indicator-active.svg'; ?></span>
|
|
<span class="indicator-inactive"><?php include __DIR__ . '/installer/icons/indicator-inactive.svg'; ?></span>
|
|
</span>
|
|
</div>
|
|
|
|
<button class="button primary" type="button" data-action="next">
|
|
<span class="button-text typography-text-m-500">Next</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="install-screen" aria-live="polite">
|
|
<div class="install-screen-content">
|
|
<?php if ($step === 5) { include __DIR__ . '/installer/templates/steps/step-5.phtml'; } ?>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<footer class="installer-footer">
|
|
<div class="appwrite-logo">
|
|
<?php include __DIR__ . '/installer/icons/appwrite-logo.svg'; ?>
|
|
</div>
|
|
</footer>
|
|
|
|
<template id="field-error-template">
|
|
<div class="field-error typography-caption-400 text-error">
|
|
<span class="field-error-icon">
|
|
<?php include __DIR__ . '/installer/icons/exclamation-circle.svg'; ?>
|
|
</span>
|
|
<span class="field-error-text"></span>
|
|
</div>
|
|
</template>
|
|
|
|
<div id="installer-toast-stack" class="installer-toast-stack" aria-live="polite" aria-atomic="true"></div>
|
|
</body>
|
|
</html>
|