diff --git a/privatebin/__init__.py b/privatebin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/privatebin/assets/logo.png b/privatebin/assets/logo.png new file mode 100644 index 0000000..014bc46 Binary files /dev/null and b/privatebin/assets/logo.png differ diff --git a/privatebin/assets/screen-1.png b/privatebin/assets/screen-1.png new file mode 100644 index 0000000..75ac9e5 Binary files /dev/null and b/privatebin/assets/screen-1.png differ diff --git a/privatebin/assets/screen-2.png b/privatebin/assets/screen-2.png new file mode 100644 index 0000000..acd8109 Binary files /dev/null and b/privatebin/assets/screen-2.png differ diff --git a/privatebin/backup.py b/privatebin/backup.py new file mode 100644 index 0000000..745bcdf --- /dev/null +++ b/privatebin/backup.py @@ -0,0 +1,21 @@ +from arkos.backup import BackupController + + +class PrivateBinBackup(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/privatebin/manifest.json b/privatebin/manifest.json new file mode 100644 index 0000000..646c0bb --- /dev/null +++ b/privatebin/manifest.json @@ -0,0 +1,56 @@ +{ + "id": "privatebin", + "name": "PrivateBin", + "type": "website", + "icon": "file code outline", + "description": { + "short": "An advanced and beautiful ZeroBin fork - originally developed by Sebastien Sauvage.", + "long": "A minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bits AES." + }, + "categories": [ + { + "primary": "Websites", + "secondary": ["Collaboration", "Writing"] + } + ], + "version": "1.1-1", + "author": "matrob", + "homepage": "https://github.com/matrob/", + "app_author": "PrivateBin-Community", + "app_homepage": "https://privatebin.info/", + "logo": true, + "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" + }, + { + "type": "system", + "name": "PHP GD Image Processing", + "package": "php-gd", + "binary": null + } + ], + "generation": 1, + "website_updates": false, + "download_url": "https://github.com/PrivateBin/PrivateBin/archive/1.1.tar.gz", + "database_engines": [], + "uses_php": true +} diff --git a/privatebin/website.py b/privatebin/website.py new file mode 100644 index 0000000..7c749ef --- /dev/null +++ b/privatebin/website.py @@ -0,0 +1,49 @@ +import nginx +import os + +from arkos.system import users, groups +from arkos.websites import Site +from arkos.languages import php + + +class PrivateBin(Site): + addtoblock = [ + nginx.If('($http_user_agent ~* (bot|spider|crawl|https?://|WhatsApp|SkypeUriPreview))', + nginx.Key('return', '403')), + 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=""): + # Make sure that the correct PHP settings are enabled + php.enable_mod('gd') + + # 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: elaborate an update procedure when next PrivateBin version is out.