-
Notifications
You must be signed in to change notification settings - Fork 24
/
install-1x.html
438 lines (403 loc) · 22.6 KB
/
install-1x.html
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Install</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="icon.ico">
<link rel="stylesheet" href="site.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="index.html">
<img src="img/logo.svg" width="120" height="60" alt="">
</a>
<button class="navbar-toggler toggler-home" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarSupportedContent">
<ul class="navbar-nav ml-lg-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="features.html">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="security.html">Security</a>
</li>
<li class="nav-item">
<a class="nav-link" href="modules.html">Mods</a>
</li>
<li class="nav-item">
<a class="nav-link" href="license.html">License</a>
</li>
<li class="nav-item">
<!--<a class="nav-link" href="tests.html">Test</a>-->
</li>
<li class="nav-item">
<a class="nav-link" href="documentation.html">Documentation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="developers-documentation.html">DEVS-DOC </a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://unencumberedbyfacts.com" target="_blank">Blog</a>
</li>
<li class="nav-item">
<a onclick="document.getElementsByClassName('navbar-collapse')[0].style.display='none';"
class="nav-link" href="contribute.html">Contribute</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/cypht-org/cypht-website/blob/master/install-1x.html">
<img src="img/edit_icon.png" alt="Edit Icon" width="23" height="23" style="vertical-align:middle;" title="Edit this page">
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<section class="content-section container">
<h2>Install Cypht v1.4.x</h2>
<p>You can install specific versions of Cypht:</p>
<p>
<a href="install.html">
<button type="button" class="btn btn-success">Cypht master</button>
</a>
<a href="install-1x.html">
<button type="button" class="btn btn-success">Cypht v1.4.x</button>
</a>
<a href="install-2x.html">
<Cypht type="button" class="btn btn-success">Cypht v2.x</button>
</a>
</p>
<p>Cypht has four differents installation ways:</p>
<ul>
<li>Manual installation</li>
<li>Installation within Tiki</li>
<li>install using Docker (use cypht docker image)</li>
<li>Install cypht on a YunoHost server</li>
</ul>
<p>Please read the bellow explanations about each way and pick one of your choice.</p>
<hr>
<h2>1. Manual installation</h2>
<h2>Requirements</h2>
<p>Cypht 1.4.x requires PHP 5.6 or 7.0 or 7.1 or 7.2 or 7.3 or 7.4 (for PHP 8.1+, please use Cypht 2.1+), <a href="https://getcomposer.org/">Composer 2</a>, and at minimum the
<a href="http://php.net/manual/en/book.openssl.php">OpenSSL</a>, <a
href="http://php.net/manual/en/book.mbstring.php">mbstring</a> and <a
href="http://php.net/manual/en/book.curl.php">cURL</a> extensions. Cypht can also leverage several other
extensions as defined in <a
href="https://github.com/cypht-org/cypht/blob/1.4.x/composer.json#L37-L44">composer.json</a>.
Testing is done on <a href="https://www.debian.org/">Debian</a> and <a
href="http://www.ubuntu.com/">Ubuntu</a>
platforms with <a href="http://nginx.com/">Nginx</a> and <a href="http://httpd.apache.org/">Apache</a>.
</p>
<p>Before proceeding please make sure your system meets minimal requirements</p>
<h2>Steps</h2>
<h4>1. Check minimum requirements</h4>
<p>
<pre>
#!/bin/bash
# You need to check php version which should be >=5.6 for version 1.4.x and 7.4 for upcoming Cypht version 2.0
php --version
# Next you need to check composer version which should be >=2.0.0
composer --version
# List installed PHP extensions. at least OpenSSL, mbstring and cURL should be in the list
php -m</pre>
</p>
<h4>2. Download and prepare the code</h4>
<p>It's important to consider where you put the Cypht source. The web-server will need read-only access to it,
and
moving it from one place to another requires re-running the configuration script. Do NOT put the source in
the
document root as this could create a security risk. On Debian, it's common to use the /usr/local/share/
sub-directory for a situation like this. Here is short bash script that will download the latest code, setup
the
correct permissions and ownership, put the source in /usr/local/share/cypht, and create a default hm3.ini
file.
It requires sudo access:
</p>
<pre>
#!/bin/bash
# this is where Cypht will be installed
DESTINATION="/usr/local/share/cypht"
# validate the destination directory
sudo test -r $DESTINATION -a -x $DESTINATION
if [ $? -ne 0 ]; then
sudo mkdir $DESTINATION
fi
# create working directory
mkdir cypht-temp
cd cypht-temp
# grab latest code
wget https://github.com/cypht-org/cypht/archive/1.4.x.zip
# unpack the archive
unzip 1.4.x.zip
# run composer
cd cypht-1.4.x && composer install && cd ..
# create a vanilla ini file
cp cypht-1.4.x/hm3.sample.ini cypht-1.4.x/hm3.ini
# fix permissions and ownership
find cypht-1.4.x -type d -print | xargs chmod 755
find cypht-1.4.x -type f -print | xargs chmod 644
sudo chown -R root:root cypht-1.4.x
# copy to destination folder
sudo mv cypht-1.4.x/* $DESTINATION
# remove working directory
cd ..
sudo rm -rf cypht-temp</pre>
<h4>3. Configure the program</h4>
<p>To configure Cypht for your environment, you must first edit the <a
href="https://github.com/cypht-org/cypht/blob/1.4.x/hm3.sample.ini">hm3.ini</a> file to your liking,
then
run the config_gen.php script to generate the optimized configuration file and assets used at run-time.</p>
<p>First edit the hm3.ini file to configure Cypht for your environment. If you choose to use a database for any
of
the 3 available purposes (authentication, sessions, or user settings), you will need to complete the "DB
support" section and create the required tables. SQL to do so can be found in the hm3.sample.ini file. The
ini
file has lots of comments explaining what each option does.</p>
<p>Cypht needs read, and read-write access to a few directories on the server. For security reasons these should
NOT
be inside the web-server document root. A good place for these is under the /var/lib/ sub-directory. Here
are
the commands To create the required directories per the default values in the ini file (assuming your
web-server
software runs as the "www-data" user).</p>
<pre>sudo mkdir /var/lib/hm3
sudo mkdir /var/lib/hm3/attachments
sudo mkdir /var/lib/hm3/users
sudo mkdir /var/lib/hm3/app_data
sudo chown -R www-data /var/lib/hm3/</pre>
<p>The "/var/lib/hm3/users" directory is only required if you are using the file-system and not a database to
store
user settings (user_config_type = file in the hm3.ini). You can put these directories anywhere, just make
sure
the values in the ini file point to the right place.
</p>
<h4>4. Generate the run-time configuration</h4>
<p>Cypht uses a build process to create an optimized configuration, and to combine and minimize page assets.
Once
you have edited your hm3.ini file, generate the configuration with:</p>
<pre>cd /usr/local/share/cypht (or wherever you put the code in section 1)
sudo php ./scripts/config_gen.php</pre>
<p>This will create a sub-directory called site that contains the code and page assets that need to be inside
the
document root, and it creates an optimized configuration file called hm3.rc in the current directory.
Anytime
you change the ini file settings, or move the source location, you will need to re-run the config_gen script
to
update the program.</p>
<h4>5. Enable the program in your web-server</h4>
<p>The easiest way to serve Cypht is to symlink it to the web-server document root. You can also copy the
generated
files to your web-server location, but then you will need to re-copy them anytime the config_gen script is
run.
If the source is located at /usr/local/share/cypht, and the web-server document root is at /var/www/html,
the
following command will make Cypht available under the "mail" path of the
web-server:</p>
<pre>sudo ln -s /usr/local/share/cypht/site /var/www/html/mail</pre>
<p>Now going to https://your-server/mail/ should load the Cypht login page. Note that If you use a symlink, your
web-server must be configured to follow symlinks.</p>
<h4>6. Users</h4>
<p>Setting up users depends on what type of authentication you configure in the hm3.ini file. If you are using
the
local database configuration for users, there are scripts in the scripts/ directory to help manage them:
<pre>
# create an account
php ./scripts/create_account.php username password
# delete an account
php ./scripts/delete_account.php username
# change an account password
php ./scripts/update_password.php username password
</pre>
</p>
<h4>7. Debug mode</h4>
<p>Cypht has a debug or developer mode that can be used to troubleshoot problems or enable faster development of
modules. To enable the debug version of Cypht, just sym-link the entire source directory instead of the site
sub-directory:</p>
<pre>sudo ln -s /usr/local/share/cypht /var/www/html/mail-debug</pre>
<p>Debug mode is not as efficient as the normal version, and it is NOT designed to be secure. DO NOT RUN DEBUG
MODE
IN PRODUCTION. You have been warned! Debug mode outputs lots of information to the PHP error log that can be
useful for trouble-shooting problems. The location of the error log varies based on your php.ini settings
and
web-server software.</p>
<h4>8. Other INI files</h4>
<p>Some Cypht modules require additional ini files to be configured. These should NOT be inside the web-server
document root. Cypht will look for them in the location defined by "app_data_dir" in the hm3.ini file. A
sample
ini file for each module set that requires one is included in the source for that module. To configure them
you
must copy the sample ini file to the "app_data_dir" and edit it for your setup. Some of these require
configuring your service with a provider, specifically ones related to Oauth2 client setup (Github,
WordPress,
Oauth2 over IMAP for Gmail and Outlook). Re-run the config_gen script after configuring an ini file and it
will
be merged into the main configuration settings.
<ul>
<li><b>Github</b>
<p>Cypht can connect to github and aggregate notification data about repository activity.<br />
Example github.ini file:<br />
<a
href="https://github.com/cypht-org/cypht/blob/1.4.x/modules/github/github.ini">https://github.com/cypht-org/cypht/blob/1.4.x/modules/github/github.ini</a><br /><br />
Authorize an application for github:<br />
<a href="https://github.com/settings/developers">https://github.com/settings/developers</a>
</p>
</li>
<li><b>OAUTH2 over IMAP</b>
<p>Gmail and Outlook.com support OAUTH2 authentication over IMAP. This is preferable to normal IMAP
authentication because Cypht never has access to your account password.<br /><br />
Example oauth2 ini file:<br />
<a
href="https://github.com/cypht-org/cypht/blob/1.4.x/modules/imap/oauth2.ini">https://github.com/cypht-org/cypht/blob/1.4.x/modules/imap/oauth2.ini</a><br /><br />
Authorize an application for gmail<br />
<a
href="https://console.developers.google.com/project">https://console.developers.google.com/project</a><br /><br />
Authorize an application for outlook.com<br />
<a
href="https://account.live.com/developers/applications/">https://account.live.com/developers/applications/</a><br /><br />
</p>
</li>
<li><b>LDAP contacts</b>
<p>Cypht can use an LDAP server for contacts.<br /><br />
Example ldap.ini file:<br />
<a
href="https://github.com/cypht-org/cypht/blob/1.4.x/modules/ldap_contacts/ldap.ini">https://github.com/cypht-org/cypht/blob/1.4.x/modules/ldap_contacts/ldap.ini</a><br /><br />
</p>
</li>
<li><b>WordPress</b>
<p>Cypht can aggregate WordPress.com notifications.<br /><br />
Example wordpress.ini file:<br />
<a
href="https://github.com/cypht-org/cypht/blob/1.4.x/modules/wordpress/wordpress.ini">https://github.com/cypht-org/cypht/blob/1.4.x/modules/wordpress/wordpress.ini</a><br /><br />
Authorize an application for WordPress.com:<br />
<a href="https://developer.wordpress.com/apps/">https://developer.wordpress.com/apps/</a>
</p>
</li>
<li><b>Custom themes</b>
<p>You can create your own themes for Cypht. Edit the themes.ini file to include your theme, and put the
css
file in modules/themes/assets.</p><br />
<p>
<a
href="https://github.com/cypht-org/cypht/blob/1.4.x/modules/themes/themes.ini">https://github.com/cypht-org/cypht/blob/1.4.x/modules/themes/themes.ini</a>
</p>
</li>
</ul>
<h2>2. Install cypht using Docker</h2>
<p>
Using Docker is one of the easiest way to install cypht as the cypht docker image comes with all the steps
required in the manual instalation done for you. But the bad news is that this installation way requires
docker knowledge.<br />
Here is the cypht docker repository: <a
href="https://hub.docker.com/r/sailfrog/cypht-docker">https://hub.docker.com/r/sailfrog/cypht-docker</a><br />
To run containers required by cypht, please, first make sure you have docker and docker-compose installed on
your system, then take a look on the section "example docker-compose" of repository overview, then do the
following:
</p>
<ul>
<li>Create a new directory on your system named as you want.</li>
<li>In the directory created previously, create a file named "docker-compose.yaml" then copy and paste the content of <a href="https://hub.docker.com/r/sailfrog/cypht-docker">the example docker-compose section</a> in the created file .</li>
<li>Open your CLI/terminal and move to the directory containing the docker-compose file and run the command
to run containers
<pre>docker-compose up -d</pre>
</li>
<li>After containers started, you can access cypht on port 80 of your host if you didn't change the port
value in the docker-compose file.</li>
</ul>
<p>
NOTE: Please change usernames and passwords before using the given docker-compose code in your production
environment.
</p>
<h2>3. Install Cypht on a YunoHost server</h2>
<p>This is an other easy way of installing and use Cypht.<br>
YunoHost is an operating system that aims to simplify server administration as much as possible to
democratize self-hosting while remaining reliable,
secure, ethical and lightweight. It is a free software project owned exclusively by volunteers. Technically,
it can be seen as a distribution based on
Debian GNU/Linux and can be installed on many types of hardware.<br />
To learn more about YunoHost, visit <a
href="https://yunohost.org/en/whatsyunohost">https://yunohost.org/en/whatsyunohost</a>
</p>
<p>To install Cypht on YunoHost, please follow these steps:</p>
<ul>
<li>If you don't have an installed YunoHost server, please consult <a
href="https://yunohost.org/#/install">the guide</a> to learn how to install it. If you have it,
please go directly to the next step.</li>
<li>If you just installed YunoHost or had it installed before, access your server and go to the admin
dashboard, then click on "Applications"</li>
<li>In the next page, click on the "install" button</li>
<li>In the search area, enter "cypht"</li>
<li>In the search result, click on cypht app</li>
<li>Scroll down, then fill in the form according to your need or keep the default values, then clik on the
"install" button. Note: Make sure the url value is not
used by another app on the server or in case you have another cypht instance previously installed you
have to modify it instead of using the default valuue.
</li>
<li>Once clicked on the "install" button, wait for the installation to complete, it may take while.</li>
<li>Once the installation completed, you will be taking back to the dashboard.</li>
<li>To open the app, click on the app recently installed and then on the "open the app" button, then the
application opens in a new tab.</li>
<li>Enter the username and admin password you've provided previously in the installation form and then click
on the login button to enter cypht and start configuring your email accounts.</li>
</ul>
<h2>4. Install Cypht within Tiki</h2>
<p>If you have tiki installed, you can use Cypht within tiki. This is an easy way of installing Cypht.<br />
Please follow the following link for a complete guide of how to install and use cypht within Tiki.</br>
<a href="https://doc.tiki.org/Webmail">https://doc.tiki.org/Webmail</a>
</p></br>
<h4>Having problems?</h4>
We are happy to help trouble-shoot any installation issues you run into. Chat with us at Gitter <a href="https://gitter.im/cypht-org/community">Cypht at Gitter</a> and We'll get back to you as soon as we can.
</section>
<!--Footer section-->
<section class="footer-section" id="contact">
<div class="container text-center">
<h2>Have a suggestion or a question?</h2>
<h3>Or maybe you want to throw huge wads of cash at us? </h3>
<p>We love feedback so let us know what you think!</p>
</div>
</section>
<section class=" social-section text-center">
<div class="container">
<div class="row">
<div class="col-3 col-md-3 col-sm-12">
<p>
<span>Page on Github</span><br>
<a href="https://github.com/cypht-org/cypht-website/blob/master/install-1x.html">Edit here</a>
</p>
</div>
<div class="col-3 col-md-3 col-sm-12">
<p>
<span>Fill out an issue at Github</span><br>
<a href="https://github.com/cypht-org/cypht/issues">Submit an issue</a>
</p>
</div>
<div class="col-3 col-md-3 col-sm-12">
<p>
<span>Chat with us at Gitter</span><br>
<a href="https://gitter.im/cypht-org/community">Cypht at Gitter</a>
</p>
</div>
<div class="col-3 col-md-3 col-sm-12">
<p>
<span>Want to contribute?</span><br>
<a href="contribute.html">Cypht website contribution</a>
</p>
</div>
</div>
</div>
</section>
<script src="jquery.slim.min.js"></script>
<script src="bootstrap.bundle.min.js"></script>
</body>
</html>