Merge pull request #47 from WordOps/updating-configuration

fix 22222
This commit is contained in:
VirtuBox
2019-03-29 17:32:06 +01:00
committed by GitHub
2 changed files with 9 additions and 24 deletions

View File

@@ -20,7 +20,7 @@ script:
- unset LANG
- sudo bash -c 'echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > /home/travis/.gitconfig'
- sudo echo "Travis Banch = $TRAVIS_BRANCH"
- sudo apt-get install -y --force-yes git python3-setuptools python3-dev python3-apt ccze
- sudo apt-get install -y --force-yes git python3-setuptools python3-dev python3-apt ccze tree
- sudo bash install $TRAVIS_BRANCH
- sudo wo --help
@@ -63,3 +63,4 @@ script:
- sudo bash -c 'nginx -T 2>&1 > /var/log/wo/nginx.log 2>&1' || sudo tail -n50 /var/log/wo/wordops.log
- sudo bash -c 'tar -I pigz -cf wordops.tar.gz /var/log/wo'
- sudo curl --progress-bar --upload-file "wordops.tar.gz" https://transfer.vtbox.net/$(basename wordops.tar.gz) && echo "" || sudo echo "transfer.sh is down"
- sudo tree -L 2 /etc/nginx

View File

@@ -373,21 +373,18 @@ class WOStackController(CementBaseController):
# Nginx-Plus does not have nginx
# package structure like this
# So creating directories
if (set(["nginx"]).issubset(set(apt_packages))):
Log.info(self,
"Installing WordOpsConfigurations for" "NGINX")
if not os.path.exists('/etc/nginx/sites-available'):
Log.debug(self, 'Creating directory'
if not os.path.exists('/etc/nginx/sites-available'):
Log.debug(self, 'Creating directory'
'/etc/nginx/sites-available')
os.makedirs('/etc/nginx/sites-available')
os.makedirs('/etc/nginx/sites-available')
if not os.path.exists('/etc/nginx/sites-enabled'):
Log.debug(self, 'Creating directory'
if not os.path.exists('/etc/nginx/sites-enabled'):
Log.debug(self, 'Creating directory'
'/etc/nginx/sites-available')
os.makedirs('/etc/nginx/sites-enabled')
os.makedirs('/etc/nginx/sites-enabled')
# 22222 port settings
data = dict(webroot=WOVariables.wo_webroot)
if not os.path.isfile("/etc/nginx/sites-available/22222"):
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/sites-available/'
'22222')
@@ -487,19 +484,6 @@ class WOStackController(CementBaseController):
["/etc/nginx"], msg="Adding Nginx into Git")
WOService.reload_service(self, 'nginx')
if set(["nginx"]).issubset(set(apt_packages)):
WOShellExec.cmd_exec(self, "sed -i -e 's/^user/#user/'"
" -e '/^#user/a user"
"\ www-data\;'"
" /etc/nginx/nginx.conf")
if not WOShellExec.cmd_exec(self, "cat /etc/nginx/"
"nginx.conf | grep -q "
"'/etc/nginx/sites-enabled'"):
WOShellExec.cmd_exec(self, "sed -i '/\/etc\/"
"nginx\/conf\.d\/\*"
"\.conf/a \ include"
"\ \/etc\/nginx\/sites-enabled"
"\/*;' /etc/nginx/nginx.conf")
print("HTTP Auth User Name: WordOps" +
"\nHTTP Auth Password : {0}".format(passwd))
WOService.reload_service(self, 'nginx')