diff --git a/commie/__init__.py b/commie/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/commie/assets/screen-1.png b/commie/assets/screen-1.png new file mode 100644 index 0000000..7e3ab64 Binary files /dev/null and b/commie/assets/screen-1.png differ diff --git a/commie/assets/screen-2.png b/commie/assets/screen-2.png new file mode 100644 index 0000000..d9e01ef Binary files /dev/null and b/commie/assets/screen-2.png differ diff --git a/commie/backup.py b/commie/backup.py new file mode 100644 index 0000000..a56530c --- /dev/null +++ b/commie/backup.py @@ -0,0 +1,21 @@ +from arkos.backup import BackupController + + +class commieBackup(BackupController): + def get_config(self, site): + return [] + + def get_data(self, site): + return [] + + def pre_backup(self, site): + pass + + def post_backup(self, site): + pass + + def pre_restore(self): + pass + + def post_restore(self, site, dbpasswd): + pass diff --git a/commie/manifest.json b/commie/manifest.json new file mode 100644 index 0000000..95836c6 --- /dev/null +++ b/commie/manifest.json @@ -0,0 +1,50 @@ +{ + "id": "commie", + "name": "commie", + "type": "website", + "icon": "file code outline", + "description": { + "short": "Open source pastebin", + "long": "commie is a pastebin script with line commenting support." + }, + "categories": [ + { + "primary": "Websites", + "secondary": ["Collaboration", "Writing"] + } + ], + "version": "1.0-1", + "author": "matrob", + "homepage": "https://github.com/matrob/", + "app_author": "Andreas Gohr", + "app_homepage": "http://commie.io/", + "logo": false, + "screenshots": ["screen-1.png", "screen-2.png"], + "services": [ + { + "name": "PHP FastCGI", + "binary": "php-fpm", + "ports": [] + } + ], + "modules": ["website", "backup"], + "dependencies": [ + { + "type": "system", + "name": "php", + "package": "php", + "binary": null + }, + { + "type": "system", + "name": "PHP FastCGI", + "package": "php-fpm", + "binary": "php-fpm" + } + ], + "generation": 1, + "website_updates": false, + "download_url": "https://github.com/splitbrain/commie.git", + "database_engines": [], + "uses_php": true +} diff --git a/commie/website.py b/commie/website.py new file mode 100644 index 0000000..fe13850 --- /dev/null +++ b/commie/website.py @@ -0,0 +1,51 @@ +import nginx +import os + +from arkos.system import users, groups +from arkos.websites import Site + + +class commie(Site): + addtoblock = [ + nginx.Location( + '~ /(data)', + nginx.Key('deny', 'all'), + nginx.Key('return', '404') + ), + nginx.Location( + '~ \.php$', + nginx.Key('fastcgi_pass', 'unix:/run/php-fpm/php-fpm.sock'), + nginx.Key('fastcgi_index', 'index.php'), + nginx.Key('include', 'fastcgi.conf') + )] + + def pre_install(self, extra_vars): + pass + + def post_install(self, extra_vars, dbpasswd=""): + # Rename commie index.html to index.php to make it work with our default nginx config + os.rename(os.path.join(self.path, "index.html"), os.path.join(self.path, "index.php")) + + # Give access to httpd + uid, gid = users.get_system("http").uid, groups.get_system("http").gid + for r, d, f in os.walk(self.path): + for x in d: + os.chown(os.path.join(r, x), uid, gid) + for x in f: + os.chown(os.path.join(r, x), uid, gid) + + def pre_remove(self): + pass + + def post_remove(self): + pass + + def enable_ssl(self, cfile, kfile): + pass + + def disable_ssl(self): + pass + + def update(self, pkg, ver): + pass + # TODO: pull from Git at appropriate intervals