-
Notifications
You must be signed in to change notification settings - Fork 13
/
manifest.jps
112 lines (104 loc) · 3.77 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
type: install
id: plesk
version: '1.0'
name: Plesk Hosting Platform
homepage: https://www.plesk.com/
onBeforeInit: |
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
var client = new HttpClient(),
getMethod,
response,
status,
resp,
url;
var extip = false, resp;
resp = jelastic.billing.account.GetQuotas(appid, session, [
'environment.externalip.enabled',
'environment.externalip.maxcount',
'environment.externalip.maxcount.per.node'].join(";")
);
if (resp.result != 0) return resp;
if (resp.array[0].value && resp.array[1].value && resp.array[2].value) {
extip = true;
}
var url = "https://registry.hub.docker.com/v2/repositories/plesk/plesk/tags";
getMethod = new GetMethod(url);
status = client.executeMethod(getMethod);
resp = getMethod.getResponseBodyAsString();
resp = JSON.parse(resp);
tags = resp.results;
var ver = {},
def = "";
for (var i = 0; i < tags.length; i++) {
if (parseInt(tags[i].name) < 18) continue;
ver[tags[i].name] = tags[i].name;
if (!isNaN(tags[i].name) && tags[i].name > def) def = tags[i].name;
}
return {
result:0,
globals: {
extip: !!extip,
passwd: "!${fn.password}#"
},
settings: {
fields: [{
name: "version",
caption: "Plesk Version",
type: "list",
values: ver,
"default": def
}]
}
};
categories:
- apps/dev-and-admin-tools
description:
text: Plesk is a powerful commercial web hosting platform that provides a complete
set of technical, security and automation tools to simplify running and managing
web applications. Easily get started with this platform having it automatically
installed and pre-configured within Jelastic.
short: Web hosting platform with complete set of technical, security and automation
tools
logo: https://raw.githubusercontent.com/jelastic-jps/plesk/master/images/plesk.png
nodes:
- cloudlets: 16
nodeGroup: cp
extip: ${globals.extip}
image: plesk/plesk:${settings.version}
startServiceOnCreation: false
onInstall:
- if ('${globals.extip}' == 'true' ):
- setGlobals:
front-ip: ${nodes.cp[0].extIPs}
- else:
- setGlobals:
front-ip: ${nodes.cp[0].intIP}
- cmd[cp]: |-
chmod +x /usr/sbin/mysqld
find /var/lib/mysql -type f -exec touch {} \; && service mysql stop
sed -i -e 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${globals.front-ip}/g' /etc/nginx/plesk.conf.d/server.conf;
cert=$(ls /opt/psa/var/certificates)
sed -i 's|certificates\/.*\"|certificates\/'$cert'\"|g' /etc/nginx/plesk.conf.d/server.conf
service mysql start
- env.control.ExecDockerRunCmd [${nodes.cp.join(id,)}]
- cmd [cp]: |-
result=$(timeout 300 bash -c 'while [ $(plesk bin cloning --status) -ne 0 ]; do sleep 5; done; echo 0;')
[[ -z "$result" ]] && { plesk bin cloning -u -prepare-public-image false; }
while [[ $(ps uax | grep "plesk" | grep -v grep | wc -l) = 0 ]] ; do sleep 2; done
service mysql status || service mysql start
plesk bin admin --set-admin-password -passwd "${globals.passwd}"
iptables -t nat -I PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
iptables-save
[[ "${settings.version}" != "tests" ]] && {
plesk bin ipmanage -r ${nodes.cp[0].intIP}
plesk bin ipmanage --reread
} || {
echo "OK"
}
success: |
**Admin URL:** [https://${env.domain}](https://${env.domain})
**Login:** admin
**Password:** ${globals.passwd}
To add custom domain name for your Plesk installation follow the steps described in our [documentation](http://docs.jelastic.com/custom-domains)
startPage: https://${env.domain}