Skip to content

Commit 33904ed

Browse files
author
peakwinter
committed
last bugfixes for 0.5.1
1 parent 86c6716 commit 33904ed

File tree

15 files changed

+389
-185
lines changed

15 files changed

+389
-185
lines changed

genesis/plugins/plugins/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def get_ui(self):
4747

4848
if k.problem:
4949
row.find('status').set('iconfont', 'gen-close-2 text-error')
50-
row.find('status').set('text', 'Error')
50+
row.find('status').set('text', k.problem)
5151
row.find('icon').set('class', k.iconfont + ' text-error')
5252
row.find('name').set('class', 'text-error')
5353
row.find('desc').set('class', 'text-error')

genesis/plugins/security/firewall.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import iptc
2+
import re
23

34
from genesis.com import *
45
from genesis.api import *

genesis/plugmgr.py

+15-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from genesis.api import *
2525
from genesis.com import *
26-
from genesis.utils import BackgroundWorker, detect_platform, shell, shell_status, download
26+
from genesis.utils import BackgroundWorker, detect_platform, shell, shell_cs, shell_status, download
2727
import genesis
2828

2929
RETRY_LIMIT = 10
@@ -238,6 +238,7 @@ def load(plugin, cat=''):
238238

239239
info = PluginInfo()
240240
try:
241+
d = None
241242
# Save info
242243
info.id = plugin
243244
info.ptype = mod.TYPE
@@ -285,7 +286,7 @@ def load(plugin, cat=''):
285286
break
286287
info.deps = deps
287288
for req in deps:
288-
PluginLoader.verify_dep(req, cat)
289+
d = PluginLoader.verify_dep(req, cat)
289290

290291
PluginLoader.__classes[plugin] = []
291292
PluginLoader.__submods[plugin] = {}
@@ -312,6 +313,8 @@ def load(plugin, cat=''):
312313
# Store the whole plugin
313314
setattr(genesis.plugins, plugin, mod)
314315
PluginLoader.notify_plugins_changed()
316+
if d:
317+
return d
315318
except BaseRequirementError, e:
316319
info.problem = e
317320
raise e
@@ -390,7 +393,7 @@ def unload(plugin):
390393
@staticmethod
391394
def verify_dep(dep, cat=''):
392395
"""
393-
Verifies that given plugin dependency is satisfied. Returns bool
396+
Verifies that given plugin dependency is satisfied.
394397
"""
395398
platform = PluginLoader.platform
396399
log = PluginLoader.log
@@ -441,8 +444,12 @@ def verify_dep(dep, cat=''):
441444
exec('import %s'%dep['binary'])
442445
except:
443446
# Let's try to install it anyway
444-
shell('pip%s install %s' % ('2' if platform in ['arkos', 'arch'] else '', dep['package']))
445-
raise ModuleRequirementError(dep, True)
447+
s = shell_cs('pip%s install %s' % ('2' if platform in ['arkos', 'arch'] else '', dep['package']))
448+
if s[0] != 0:
449+
raise ModuleRequirementError(dep, False)
450+
else:
451+
return 'Restart Genesis for changes to take effect.'
452+
raise ModuleRequirementError(dep, False)
446453
else:
447454
p = False
448455
s = shell('pip%s freeze'%'2' if platform in ['arkos', 'arch'] else '')
@@ -729,8 +736,9 @@ def str_req(self):
729736

730737
class LiveInstall(BackgroundWorker):
731738
def run(self, rm, id, load, cat):
732-
rm.install(id, load=load, cat=cat)
733-
cat.put_message('info', 'Plugin installed. Refresh page for changes to take effect.')
739+
d = rm.install(id, load=load, cat=cat)
740+
if d:
741+
cat.put_message('info', 'Plugin installed. %s'%str(d))
734742
ComponentManager.get().rescan()
735743
ConfManager.get().rescan()
736744
cat._reloadfw = True

plugins/basicsite/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"secondary": ["Websites", "Static Sites"]
1111
}
1212
]
13-
VERSION = '1'
13+
VERSION = '2'
1414

1515
AUTHOR = 'arkOS'
1616
HOMEPAGE = 'https://arkos.io'

plugins/db-mariadb/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"secondary": []
1111
}
1212
]
13-
VERSION = '2.1'
13+
VERSION = '2.2'
1414

1515
AUTHOR = 'arkOS'
1616
HOMEPAGE = 'http://arkos.io'

plugins/ghost/main.py

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def post_install(self, name, path, vars):
3131
nodectl = apis.langassist(self.app).get_interface('NodeJS')
3232
users = UsersBackend(self.app)
3333

34+
if not os.path.exists('/usr/bin/python') and os.path.exists('/usr/bin/python'):
35+
os.symlink('/usr/bin/python2', '/usr/bin/python')
36+
3437
# A bug in 0.4.1 prevents [email protected] from installing properly.
3538
# Fallback to 2.1.15
3639
d = json.loads(open(os.path.join(path, 'package.json'), 'r').read())

plugins/jekyll/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"secondary": ["Blogs", "Websites", "Static Sites"]
1616
}
1717
]
18-
VERSION = '1'
18+
VERSION = '1.1'
1919

2020
AUTHOR = 'arkOS'
2121
HOMEPAGE = 'https://arkos.io'

plugins/nodejs/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
"name": "NodeJS",
2828
"package": "nodejs",
2929
"binary": "npm"
30+
},
31+
{
32+
"type": "plugin",
33+
"name": "Supervisor",
34+
"package": "supervisor"
3035
}
3136
]
3237
}

plugins/php/main.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
from genesis.ui import *
24
from genesis.api import *
35
from genesis import apis
@@ -10,13 +12,16 @@ class PHP(Plugin):
1012
name = 'PHP'
1113

1214
def install_composer(self):
15+
cwd = os.getcwd()
1316
self.enable_mod('phar')
14-
s = shell_cs('curl -sS https://getcomposer.org/installer | php')
17+
self.open_basedir('add', '/root')
18+
s = shell_cs('cd /root; curl -sS https://getcomposer.org/installer | php', stderr=True)
1519
if s[0] != 0:
1620
raise Exception('Composer download/config failed. Error: %s'%str(s[1]))
1721
os.rename('composer.phar', '/usr/local/bin/composer')
18-
os.chmod('/usr/bin/composer', 755)
22+
os.chmod('/usr/local/bin/composer', 755)
1923
self.open_basedir('add', '/usr/local/bin')
24+
shell('cd %s' % cwd)
2025

2126
def verify_composer(self):
2227
if not shell_status('which composer') == 0:
@@ -26,7 +31,9 @@ def verify_composer(self):
2631

2732
def composer_install(self, path):
2833
self.verify_composer()
29-
shell('cd %s; composer install'%path)
34+
s = shell_cs('cd %s; composer install'%path)
35+
if s[0] != 0:
36+
raise Exception('Composer failed to install this app\'s bundle. Error: %s'%str(s[1]))
3037

3138
def enable_mod(self, *mod):
3239
for x in mod:

plugins/radicale/__init__.py

+23-6
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,30 @@
3636
"package": "python2",
3737
"binary": "python2"
3838
},
39+
{
40+
"type": "app",
41+
"name": "uWSGI",
42+
"package": "uwsgi",
43+
"binary": "uwsgi"
44+
},
45+
{
46+
"type": "app",
47+
"name": "uWSGI Common Plugin",
48+
"package": "uwsgi-plugin-common",
49+
"binary": None
50+
},
51+
{
52+
"type": "app",
53+
"name": "uWSGI Python2 Plugin",
54+
"package": "uwsgi-plugin-python2",
55+
"binary": None
56+
},
3957
{
4058
"type": "module",
4159
"name": "Radicale",
4260
"package": "radicale",
4361
"binary": "radicale"
4462
},
45-
{
46-
"type": "module",
47-
"name": "uWSGI",
48-
"package": "uwsgi",
49-
"binary": None
50-
},
5163
{
5264
"type": "plugin",
5365
"name": "Python",
@@ -57,6 +69,11 @@
5769
"type": "plugin",
5870
"name": "Reverse Proxy",
5971
"package": "reverseproxy"
72+
},
73+
{
74+
"type": "plugin",
75+
"name": "Supervisor",
76+
"package": "supervisor"
6077
}
6178
]
6279
}

0 commit comments

Comments
 (0)