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 commie/__init__.py
Empty file.
Binary file added commie/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 commie/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 commie/backup.py
Original file line number Diff line number Diff line change
@@ -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
50 changes: 50 additions & 0 deletions commie/manifest.json
Original file line number Diff line number Diff line change
@@ -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
}
51 changes: 51 additions & 0 deletions commie/website.py
Original file line number Diff line number Diff line change
@@ -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