Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making Plesk and cPanel applications up to date #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions WordPress/application.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"applications-slug": "wordpress",
"application-name": "WordPress on Plesk",
"version": "18",
"os": "centOS7",
"imageURL": "http://images.prod.solus.io/solus-io-centos-plesk-18.0.24.qcow2",
"os": "centOS8",
"imageURL": "https://images.prod.solus.io/solus-io-centos-plesk-latest.qcow2",
"login-type": "JS",
"login-link": "assets/login.js",
"icon": "WordPress",
"cloudinitversion": "v2",
"cloudinitversion": "v2-centos",
"longDescription": "",
"shortDescription": "",
"supportLink": "",
Expand Down
27 changes: 12 additions & 15 deletions WordPress/assets/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ fetch('https://{{ domain }}:8443/api/v2/cli/admin/call', {
},
method: "POST"
})
.then(function(response) {
if (!response.ok) {
throw Error(response.statusText);
}
})
.then(function(data) {
var link = data.stdout.split(/\r?\n/);
openWindow(link[0]);
})
.catch(function() {
try {
openWindow('https://{{ domain }}:8443/login_up.php3?login_name=admin&passwd={{ passwd }}');
} catch (err) {
.then(function(response) {
if (!response.ok) {
throw Error(response.statusText);
}
return response.json();
})
.then(function(data) {
var link = data.stdout.split(/\r?\n/);
openWindow(link[0]);
})
.catch(function() {
openWindow('https://{{domain}}:8443/');
}
});
});
7 changes: 4 additions & 3 deletions WordPress/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"wpuser",
"wpusermail",
"wppasswd",
"wptitle"
"wptitle"
],
"properties": {
"license": {
Expand All @@ -36,7 +36,8 @@
"type": "string",
"title": "Password",
"format": "password",
"minLenght": 8,
"pattern": "^[a-zA-Z0-9_-]*$",
"minLength": 8,
"help": "At least 1 capital letter, 1 lowercase letter, 2 digits and 2 special chars."
},
"wpuser": {
Expand All @@ -57,4 +58,4 @@
"title": "Title for your Wordpress Website"
}
}
}
}
6 changes: 3 additions & 3 deletions WordPress/user-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ write_files:
user='{{ user }}'
passwd='{{ passwd }}'
activation_key={{ license }}
wp_title='{{ wptitle }}'
wp_title='{{ wptitle }}'
wp_passwd='{{ wppasswd }}'
wp_mail='{{ wpusermail }}'
runcmd:
- [ curl, -L, "https://raw.githubusercontent.com/solusio/applications/master/WordPress/setup", -o, "/root/setup.sh" ]
- [ chmod, +x, "/root/setup.sh" ]
- sh /root/setup.sh | while IFS= read -r line; do printf "%s %s\n" "$(date)" "$line"; done >> /var/log/logfile
- /bin/bash /root/setup.sh | while IFS= read -r line; do printf "%s %s\n" "$(date)" "$line"; done >> /var/log/logfile
- echo "complete" > /var/www/vhosts/default/htdocs/__setup_complete.html
- rm -r /root/config.ini
- rm -r /root/setup.sh
- rm -r /root/setup.sh
9 changes: 4 additions & 5 deletions cpanel/application.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"applications-slug": "cpanel",
"application-name": "cPanel & WHM",
"version": "86",
"os": "centOS7",
"imageURL": "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2",
"login-type": "JS",
"login-link": "assets/login.js",
"imageURL": "https://images.prod.solus.io/solus-io-centos-7-cpanel.qcow2",
"login-type": "URL",
"login-link": "https://{{ hostname }}:2087/",
"icon": "cPanel",
"cloudinitversion": "v2",
"longDescription": "",
Expand All @@ -16,4 +15,4 @@
"minMemoryMB": 1024,
"minSpaceGB": 20

}
}
25 changes: 0 additions & 25 deletions cpanel/assets/login.js

This file was deleted.

14 changes: 2 additions & 12 deletions cpanel/form.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"title": "cPanel",
"description": "Create an exceptional hosting experience.\nIndustry leading hosting platform with world-class support.",
"type": "object",
"required": [
"passwd"
],
"properties": {
"passwd": {
"type": "string",
"title": "WHM-Password for root",
"format": "password"
}
}
}
"type": "object"
}
54 changes: 11 additions & 43 deletions cpanel/user-data.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,18 @@
#cloud-config
write_files:
- path: /root/cp-installer
- path: /root/setup.sh
permissions: '0755'
content: |
#!/bin/bash
FILE=/root/setup.sh
if test -f "$FILE"; then
/root/setup.sh
/usr/local/cpanel/bin/set_hostname {{ address }}
/usr/local/cpanel/scripts/configure_firewall_for_cpanel
/usr/local/cpanel/cpkeyclt
/usr/local/cpanel/scripts/upcp
/usr/local/cpanel/bin/checkallsslcerts
systemctl disable cpanel-installer.service
rm /etc/systemd/system/cpanel-installer.service
rm /root/setup.sh
rm /root/cp-installer
fi
- path: /etc/systemd/system/cpanel-installer.service
permissions: '0755'
content: |
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/root/cp-installer
[Install]
WantedBy=multi-user.target
[Unit]
Wants=network-online.target multi-user.target
After=network-online.target multi-user.target
- path: /root/reboot-chk
permissions: '0755'
content: |
#!/bin/bash
FILE=/root/isreboot
if test -f "$FILE"; then
echo "nothing to do"
else
touch /root/isreboot
reboot
HOSTNAME={{ hostname }}
match=$(echo "${HOSTNAME}" | grep -oP '^(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}$')
if [ -z "$match" ]; then
hostnamectl set-hostname "${HOSTNAME}.local.domain"
HOSTNAME="${HOSTNAME}.local.domain"
fi
setenforce 0
/usr/local/cpanel/bin/set_hostname "${HOSTNAME}"
/usr/local/cpanel/cpkeyclt
runcmd:
- curl -L "https://securedownloads.cpanel.net/latest" -o /root/setup.sh
- chmod +x /root/setup.sh
- hostnamectl set-hostname {{ address }}
- echo "SELINUX=disabled" > /etc/selinux/config
- systemctl enable cpanel-installer.service
- echo "{{ passwd }}" | passwd --stdin root
- /root/reboot-chk
- sh /root/setup.sh
- rm -f /root/setup.sh
5 changes: 2 additions & 3 deletions jitsimeet/application.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"applications-slug": "jitsimeet",
"application-name": "Jitsi Meet",
"version": "2.0",
"os": "ubuntu2004",
"login-type": "URL",
"login-link": "https://{{ address }}",
"login-type": "JS",
"login-link": "assets.login.js",
"imageURL": "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img",
"icon": "Jitsi",
"cloudinitversion": "v2",
Expand Down
11 changes: 5 additions & 6 deletions plesk/application.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"applications-slug": "plesk",
"application-name": "Plesk",
"version": "18",
"os": "centOS7",
"imageURL": "http://images.prod.solus.io/solus-io-centos-plesk-18.0.24.qcow2",
"application-name": "Plesk on AlmaLinux",
"os": "AlmaLinux8",
"imageURL": "https://images.prod.solus.io/solus-io-almalinux-8-plesk.qcow2",
"login-type": "JS",
"login-link": "assets/login.js",
"icon": "plesk",
"cloudinitversion": "v2",
"cloudinitversion": "v2-centos",
"longDescription": "",
"shortDescription": "",
"supportLink": "",
"costs": "0",
"minCPU": "1",
"minMemoryMB": "512",
"minMemoryMB": "2048",
"minSpaceGB": "20"
}
27 changes: 12 additions & 15 deletions plesk/assets/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ fetch('https://{{ domain }}:8443/api/v2/cli/admin/call', {
},
method: "POST"
})
.then(function(response) {
if (!response.ok) {
throw Error(response.statusText);
}
})
.then(function(data) {
var link = data.stdout.split(/\r?\n/);
openWindow(link[0]);
})
.catch(function() {
try {
openWindow('https://{{ domain }}:8443/login_up.php3?login_name=admin&passwd={{ passwd }}');
} catch (err) {
.then(function(response) {
if (!response.ok) {
throw Error(response.statusText);
}
return response.json();
})
.then(function(data) {
var link = data.stdout.split(/\r?\n/);
openWindow(link[0]);
})
.catch(function() {
openWindow('https://{{domain}}:8443/');
}
});
});
5 changes: 3 additions & 2 deletions plesk/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"user": {
"type": "string",
"title": "Username",
"default": "ElvisPlesky"
"default": "admin"
},
"rootmail": {
"type": "string",
Expand All @@ -31,7 +31,8 @@
"type": "string",
"title": "Password",
"format": "password",
"minLenght": 5
"pattern": "^[a-zA-Z0-9_-]*$",
"minLength": 5
}
}
}
11 changes: 5 additions & 6 deletions plesk/user-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ write_files:
- path: /root/config.ini
permissions: '0755'
content: |
domain="{{ domain }}""
rootpw="{{ passwd }}""
user="{{ user }}""
passwd="{{ passwd }}""
domain="{{ domain }}"
rootpw="{{ passwd }}"
user="{{ user }}"
passwd="{{ passwd }}"
activation_key="{{ license }}"
rootmail="{{ rootmail }}"
runcmd:
- [ curl, "https://raw.githubusercontent.com/solusio/applications/master/plesk/setup", -o, "/root/setup.sh" ]
- [ chmod, +x, "/root/setup.sh" ]
- sh /root/setup.sh | while IFS= read -r line; do printf "%s %s\n" "$(date)" "$line"; done >>/var/log/logfile
- /bin/bash /root/setup.sh | while IFS= read -r line; do printf "%s %s\n" "$(date)" "$line"; done >>/var/log/logfile
- echo "complete" > /var/www/vhosts/default/htdocs/__setup_complete.html
- rm -r /root/config.ini
- rm -r /root/setup.sh