-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.php
More file actions
242 lines (224 loc) · 11.1 KB
/
Copy pathsetup.php
File metadata and controls
242 lines (224 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<?php
// OpenSim Webinterface Setup Assistant
// This file helps with the initial configuration
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenSim Webinterface Setup</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" rel="stylesheet">
<style>
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.setup-container {
max-width: 800px;
margin: 2rem auto;
padding: 0 1rem;
}
.setup-card {
background: rgba(255,255,255,0.95);
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
overflow: hidden;
}
.setup-header {
background: linear-gradient(135deg, #2c3e50, #34495e);
color: white;
padding: 2rem;
text-align: center;
}
.setup-content {
padding: 2rem;
}
.step {
background: #f8f9fa;
border-left: 4px solid #007bff;
padding: 1rem;
margin-bottom: 1rem;
border-radius: 0 8px 8px 0;
}
.code-block {
background: #1e1e1e;
color: #d4d4d4;
padding: 1rem;
border-radius: 8px;
font-family: 'Courier New', monospace;
margin: 1rem 0;
overflow-x: auto;
}
.success-icon {
color: #28a745;
font-size: 4rem;
}
.warning-icon {
color: #ffc107;
font-size: 4rem;
}
</style>
</head>
<body>
<div class="setup-container">
<div class="setup-card">
<div class="setup-header">
<i class="bi bi-gear-fill" style="font-size: 3rem; margin-bottom: 1rem;"></i>
<h1>OpenSim Webinterface Setup</h1>
<p class="mb-0">Welcome! Let's configure your OpenSimulator web interface.</p>
</div>
<div class="setup-content">
<?php
$setup_status = [
'env_exists' => file_exists('include/env.php'),
'config_exists' => file_exists('include/config.php'),
'images_dir' => is_dir('images'),
'cache_dir' => is_dir('cache'),
'writable' => is_writable('include/')
];
$all_good = array_reduce($setup_status, function($carry, $item) {
return $carry && $item;
}, true);
?>
<?php if ($all_good): ?>
<!-- Setup Complete -->
<div class="text-center mb-4">
<i class="bi bi-check-circle-fill success-icon"></i>
<h2 class="text-success mt-3">Setup Complete!</h2>
<p class="text-muted">Your OpenSim Webinterface is ready to use.</p>
</div>
<div class="d-grid gap-2">
<a href="welcome.php" class="btn btn-success btn-lg">
<i class="bi bi-house-fill"></i> Go to Homepage
</a>
<a href="welcomesplashpage_modern.php" class="btn btn-primary btn-lg">
<i class="bi bi-star-fill"></i> Try Modern Interface
</a>
</div>
<?php else: ?>
<!-- Setup Required -->
<div class="text-center mb-4">
<i class="bi bi-exclamation-triangle-fill warning-icon"></i>
<h2 class="text-warning mt-3">Configuration Needed</h2>
<p class="text-muted">Please complete the following steps to finish setup.</p>
</div>
<!-- Configuration Steps -->
<div class="step">
<h5>
<?php if ($setup_status['env_exists']): ?>
<i class="bi bi-check-circle-fill text-success"></i>
<?php else: ?>
<i class="bi bi-x-circle-fill text-danger"></i>
<?php endif; ?>
Step 1: Database Configuration
</h5>
<?php if (!$setup_status['env_exists']): ?>
<p>Create the database configuration file:</p>
<div class="code-block">
cp include/env.example.php include/env.php</div>
<p>Then edit <code>include/env.php</code> with your database credentials:</p>
<div class="code-block">
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'your_opensim_db_user');
define('DB_PASSWORD', 'your_opensim_db_password');
define('DB_NAME', 'your_opensim_database');</div>
<?php else: ?>
<p class="text-success mb-0">✓ Database configuration file exists</p>
<?php endif; ?>
</div>
<div class="step">
<h5>
<?php if ($setup_status['config_exists']): ?>
<i class="bi bi-check-circle-fill text-success"></i>
<?php else: ?>
<i class="bi bi-x-circle-fill text-danger"></i>
<?php endif; ?>
Step 2: Website Configuration
</h5>
<?php if (!$setup_status['config_exists']): ?>
<p>Create the main configuration file:</p>
<div class="code-block">
cp include/config.example.php include/config.php</div>
<p>Edit <code>include/config.php</code> and update:</p>
<ul>
<li><code>BASE_URL</code> - Your website URL</li>
<li><code>SITE_NAME</code> - Your grid name</li>
<li><code>HEADER_FILE</code> - Choose your template (use 'headerModern.php' for the new design)</li>
</ul>
<?php else: ?>
<p class="text-success mb-0">✓ Main configuration file exists</p>
<?php endif; ?>
</div>
<div class="step">
<h5>
<?php if ($setup_status['images_dir']): ?>
<i class="bi bi-check-circle-fill text-success"></i>
<?php else: ?>
<i class="bi bi-exclamation-triangle-fill text-warning"></i>
<?php endif; ?>
Step 3: Images Directory
</h5>
<?php if (!$setup_status['images_dir']): ?>
<p>Create the images directory for slideshow:</p>
<div class="code-block">mkdir images</div>
<p>Add your slideshow images to this directory (JPG, PNG, GIF formats supported).</p>
<?php else: ?>
<p class="text-success mb-0">✓ Images directory exists</p>
<?php endif; ?>
</div>
<div class="step">
<h5>
<?php if ($setup_status['cache_dir']): ?>
<i class="bi bi-check-circle-fill text-success"></i>
<?php else: ?>
<i class="bi bi-exclamation-triangle-fill text-warning"></i>
<?php endif; ?>
Step 4: Cache Directory
</h5>
<?php if (!$setup_status['cache_dir']): ?>
<p>Create the cache directory:</p>
<div class="code-block">mkdir cache
chmod 755 cache</div>
<?php else: ?>
<p class="text-success mb-0">✓ Cache directory exists</p>
<?php endif; ?>
</div>
<div class="alert alert-info">
<h6><i class="bi bi-info-circle"></i> Additional Notes:</h6>
<ul class="mb-0">
<li>Make sure your web server has read/write permissions to the cache directory</li>
<li>For security, ensure your database user has only necessary permissions</li>
<li>The new modern interface is available at <code>*_modern.php</code> files</li>
<li>Test database connectivity after configuration</li>
</ul>
</div>
<div class="text-center mt-4">
<button onclick="window.location.reload()" class="btn btn-primary">
<i class="bi bi-arrow-clockwise"></i> Check Setup Again
</button>
</div>
<?php endif; ?>
<!-- OpenSimulator Configuration -->
<div class="mt-4 p-3 bg-light rounded">
<h6><i class="bi bi-server"></i> OpenSimulator Configuration</h6>
<p class="mb-2">Add these lines to your <code>Robust.HG.ini</code> file:</p>
<div class="code-block" style="font-size: 0.85rem;">
Tip: Casperia Prime also includes compatibility shims for older filenames (searchservice.php, createavatar.php, etc.) if you still have old configs.
MapTileURL = "${Const|BaseURL}:${Const|PublicPort}/oswebinterface/maps/gridmap.php"
SearchURL = "${Const|BaseURL}:${Const|PublicPort}/oswebinterface/gridsearch.php"
DestinationGuide = "${Const|BaseURL}/oswebinterface/guide.php"
AvatarPicker = "${Const|BaseURL}/oswebinterface/avatarpicker.php"
welcome = ${Const|BaseURL}/oswebinterface/welcomesplashpage.php
about = ${Const|BaseURL}/oswebinterface/about.php
register = ${Const|BaseURL}/oswebinterface/register.php
help = ${Const|BaseURL}/oswebinterface/help.php</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>