Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added privatebin/__init__.py
Empty file.
Binary file added privatebin/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added privatebin/assets/screen-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added privatebin/assets/screen-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions privatebin/backup.py
Original file line number Diff line number Diff line change
@@ -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
56 changes: 56 additions & 0 deletions privatebin/manifest.json
Original file line number Diff line number Diff line change
@@ -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
}
49 changes: 49 additions & 0 deletions privatebin/website.py
Original file line number Diff line number Diff line change
@@ -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.