reformat code
* add security stack for futur usage * fix pep8 formatting issues
This commit is contained in:
@@ -35,6 +35,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
- MySQL monitoring with Netdata
|
- MySQL monitoring with Netdata
|
||||||
- WordOps-dashboard on 22222
|
- WordOps-dashboard on 22222
|
||||||
- Extplorer filemanager
|
- Extplorer filemanager
|
||||||
|
- Enable OSCP Stapling with Let's Encrypt
|
||||||
|
- Compress database backup with pigz before updating sites
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
<a href="https://travis-ci.org/WordOps/WordOps"><img src="https://travis-ci.org/WordOps/WordOps.svg?branch=master" alt="build"></a>
|
<a href="https://travis-ci.org/WordOps/WordOps"><img src="https://travis-ci.org/WordOps/WordOps.svg?branch=master" alt="build"></a>
|
||||||
<img src="https://img.shields.io/github/license/wordops/wordops.svg" alt="MIT">
|
<img src="https://img.shields.io/github/license/wordops/wordops.svg" alt="MIT">
|
||||||
<img src="https://img.shields.io/github/last-commit/wordops/wordops.svg" alt="Commits">
|
<img src="https://img.shields.io/github/last-commit/wordops/wordops.svg" alt="Commits">
|
||||||
<img alt="GitHub release" src="https://img.shields.io/github/release-pre/wordops/wordops.svg">
|
<img alt="GitHub release" src="https://img.shields.io/github/release/WordOps/WordOps.svg">
|
||||||
|
<a href="https://www.codacy.com/app/VirtuBox/WordOps?utm_source=github.com&utm_medium=referral&utm_content=WordOps/WordOps&utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/fe9100fd2c634de7882ecec17f00a11a"/></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
|||||||
2
install
2
install
@@ -178,7 +178,7 @@ wo_install_dep() {
|
|||||||
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install build-essential curl gzip python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 cron ccze rsync tree haveged ufw > /dev/null 2>&1
|
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install build-essential curl gzip python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 cron ccze rsync tree haveged ufw > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
wget -qO /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
[ -d /etc/apt/trusted.gpg.d ] && { wget -qO /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; }
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install build-essential curl gzip dirmngr sudo python3 python3-apt python3-setuptools python3-dev ca-certificates sqlite3 git tar software-properties-common pigz apt-transport-https gnupg2 cron ccze rsync tree haveged ufw > /dev/null 2>&1
|
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install build-essential curl gzip dirmngr sudo python3 python3-apt python3-setuptools python3-dev ca-certificates sqlite3 git tar software-properties-common pigz apt-transport-https gnupg2 cron ccze rsync tree haveged ufw > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -38,7 +38,7 @@ except Exception as e:
|
|||||||
print("Your informations will ONLY be stored locally")
|
print("Your informations will ONLY be stored locally")
|
||||||
|
|
||||||
wo_user = input("Enter your name: ")
|
wo_user = input("Enter your name: ")
|
||||||
while wo_user is "":
|
while wo_user == "":
|
||||||
print("Unfortunately, this can't be left blank")
|
print("Unfortunately, this can't be left blank")
|
||||||
wo_user = input("Enter your name: ")
|
wo_user = input("Enter your name: ")
|
||||||
|
|
||||||
|
|||||||
@@ -697,7 +697,9 @@ def sitebackup(self, data):
|
|||||||
if data['wo_db_name']:
|
if data['wo_db_name']:
|
||||||
Log.info(self, 'Backing up database \t\t', end='')
|
Log.info(self, 'Backing up database \t\t', end='')
|
||||||
try:
|
try:
|
||||||
if not WOShellExec.cmd_exec(self, "mysqldump --single-transaction {0} | pigz -9 -p\"$(nproc)\" > {1}/{0}.gz"
|
if not WOShellExec.cmd_exec(self, "mysqldump --single-transaction "
|
||||||
|
"{0} | pigz -9 -p\"$(nproc)\" "
|
||||||
|
"> {1}/{0}.gz"
|
||||||
.format(data['wo_db_name'],
|
.format(data['wo_db_name'],
|
||||||
backup_path)):
|
backup_path)):
|
||||||
Log.info(self,
|
Log.info(self,
|
||||||
|
|||||||
@@ -1159,7 +1159,7 @@ class WOStackController(CementBaseController):
|
|||||||
WOFileUtils.searchreplace(self, "{0}22222/htdocs/index.php"
|
WOFileUtils.searchreplace(self, "{0}22222/htdocs/index.php"
|
||||||
.format(WOVariables.wo_webroot),
|
.format(WOVariables.wo_webroot),
|
||||||
"eth0",
|
"eth0",
|
||||||
"{0}".format(WOVariables.wo_wan_interface))
|
"{0}".format(WOVariables.wo_wan))
|
||||||
|
|
||||||
Log.debug(self, "Setting Privileges to "
|
Log.debug(self, "Setting Privileges to "
|
||||||
"{0}22222/htdocs"
|
"{0}22222/htdocs"
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ class WOVariables():
|
|||||||
wo_wpcli_path = '/usr/local/bin/wp '
|
wo_wpcli_path = '/usr/local/bin/wp '
|
||||||
|
|
||||||
# get wan network interface name
|
# get wan network interface name
|
||||||
wo_wan_interface = os.popen("ip -4 route get 8.8.8.8 | "
|
wo_wan = os.popen("/sbin/ip -4 route get 8.8.8.8 | "
|
||||||
"grep -oP \"dev [^[:space:]]+ \" "
|
"grep -oP \"dev [^[:space:]]+ \" "
|
||||||
"| cut -d ' ' -f 2").read()
|
"| cut -d ' ' -f 2").read()
|
||||||
if wo_wan_interface == '':
|
if wo_wan == '':
|
||||||
wo_wan_interface = 'eth0'
|
wo_wan = 'eth0'
|
||||||
|
|
||||||
# Current date and time of System
|
# Current date and time of System
|
||||||
wo_date = datetime.datetime.now().strftime('%d%b%Y%H%M%S')
|
wo_date = datetime.datetime.now().strftime('%d%b%Y%H%M%S')
|
||||||
|
|||||||
Reference in New Issue
Block a user