-
Notifications
You must be signed in to change notification settings - Fork 5
/
manifest.jps
94 lines (79 loc) · 3.98 KB
/
manifest.jps
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
version: 0.3
type: install
id: webmail
name: WebMail Lite
categories:
- apps/project-management
baseUrl: https://raw.githubusercontent.com/jelastic-jps/webmail-lite/master/
logo: images/webmail.png
homepage: https://afterlogic.org/download/webmail-lite-php
description: |
WebMail Lite is Fast and easy-to-use webmail front-end for your existing POP3/IMAP mail server.
WebMail Lite can be used to access mail on virtually any POP3 or IMAP enabled mail server.
The integrated web administration panel allows you to manage the system settings without manual editing config files.
globals:
DB_PASS: "${fn.password(10)}"
ADMIN_PASS: ${fn.password(10)}
ROOT: /var/www/webroot/ROOT/
CONFIG_PATH: /var/www/webroot/ROOT/data/settings/config.json
mixins:
- configs/vers.yaml
nodes:
- cloudlets: 16
nodeType: nginxphp
engine: php8.2
- nodeType: mysql8
cloudlets: 8
onInstall:
- deploy:
archive: https://github.com/afterlogic/webmail-lite-8/archive/latest.zip
name: webmail_php.zip
context: ROOT
- cmd[sqldb]: |-
MYSQL_PWD=${nodes.mysql8.password} mysql -uroot -e "CREATE DATABASE webmail_lite;"
MYSQL_PWD=${nodes.mysql8.password} mysql -uroot -e "CREATE USER 'webmail_lite'@'%' IDENTIFIED BY '${globals.DB_PASS}';"
MYSQL_PWD=${nodes.mysql8.password} mysql -uroot -e "GRANT ALL PRIVILEGES ON webmail_lite.* TO 'webmail_lite'@'%' WITH GRANT OPTION;"
- cmd [cp]: |-
cd ${globals.ROOT}
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sed -i "s|0\.9\.[^\"\s]*|dev-master|g" composer.json
sed -i "s|^1.0|^2.0|g" composer.json
curl -fsSL "https://raw.githubusercontent.com/afterlogic/webmail-lite-8/master/package.json" -o package.json
php composer.phar update
- cmd [cp]: |-
cd ${globals.ROOT}
yum install -y npm
npm install -g npm@9.7.1
cd modules/AdminPanelWebclient/vue
npm install -g @quasar/cli
npm install underscore
user: root
- cmd [cp]: |-
cd ${globals.ROOT}
npm run styles:build --themes=Default,DefaultDark,DeepForest,Funny,Sand
npm run js:build
npm run js:min
password=$(php -r "echo password_hash('${globals.ADMIN_PASS}', PASSWORD_DEFAULT) . PHP_EOL;")
out=$(sed -z 's|dminPassword"\: \[\n \"\"|dminPassword"\: \[\n \"'$password'\"|' ${globals.CONFIG_PATH})
echo $out > ${globals.CONFIG_PATH}
cd modules/AdminPanelWebclient/vue
npm run build-production
- cmd [cp]: |-
sed -ri "s|ContentSecurityPolicy[^],]*|ContentSecurityPolicy\": [ \"default-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; img-src * data: blob:; frame-src *; font-src 'self' data:\"|g" ${globals.CONFIG_PATH}
sed -ri "s|add_header Content-Security-Policy(.*)|#add_header Content-Security-Policy\1|g" /etc/nginx/conf.d/headers/10-shared_headers.conf
sed -ri "s|add_header Cross-Origin-Opener-Policy(.*)|#add_header Cross-Origin-Opener-Policy\1|g" /etc/nginx/conf.d/headers/10-shared_headers.conf
sed -ri "s|\"DBHost\"\: \[.\"[^\"]*\", \"string\"|\"DBHost\"\: \[ \"${nodes.sqldb.address}\", \"string\"|" ${globals.CONFIG_PATH}
sed -ri "s|\"DBName\"\: \[.\"[^\"]*\"|\"DBName\": [ \"webmail_lite\"|g" ${globals.CONFIG_PATH}
sed -ri "s|\"DBLogin\"\: \[.\"[^\"]*\"|\"DBLogin\": [ \"webmail_lite\"|g" ${globals.CONFIG_PATH}
sed -ri "s|\"DBPassword\": \[.\"[^\"]*\"|\"DBPassword\": [ \"${globals.DB_PASS}\"|g" ${globals.CONFIG_PATH}
- cmd[cp]: sed -ri "s|location \/ \{|location ^~ /data { deny all; }\n location \/ \{|g" /etc/nginx/conf.d/sites-enabled/default.conf
user: root
- restartNodes[cp]
success: |
Below you will find your admin panel link, username and password.
Admin panel URL: [${env.protocol}://${env.domain}/adminpanel/](${env.protocol}://${env.domain}/adminpanel/)
Admin name: superadmin
Password: ${globals.ADMIN_PASS}
To add custom domain name for your Webmail Lite installation follow the steps described in our [documentation](http://docs.jelastic.com/custom-domains)