diff --git a/apache/010-soundboard.conf b/apache/010-soundboard.conf
new file mode 100644
index 0000000..84372a9
--- /dev/null
+++ b/apache/010-soundboard.conf
@@ -0,0 +1,15 @@
+Listen 5000
+
+ #ServerName example.com
+
+ WSGIDaemonProcess soundboard user=www-data group=www-data threads=5
+ WSGIScriptAlias / /var/www/soundboard/soundboard.wsgi
+
+
+ WSGIProcessGroup soundboard
+ WSGIApplicationGroup %{GLOBAL}
+ WSGIScriptReloading On
+ Order deny,allow
+ Allow from all
+
+
diff --git a/soundboard.py b/soundboard.py
index 76e5956..4531992 100644
--- a/soundboard.py
+++ b/soundboard.py
@@ -18,7 +18,8 @@ processlist = []
@app.route("/say/", methods=["POST"])
@app.route("/say/")
def index(sound=None, text=None, video=None):
- sounds = sorted(os.listdir(config.path))
+ sounds = [os.fsencode(file).decode() for file in os.listdir(config.path)]
+ sounds = sorted(sounds)
if sound is not None and sound in sounds:
subprocess.Popen(["omxplayer", os.path.join(config.path, sound)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
diff --git a/soundboard.wsgi b/soundboard.wsgi
new file mode 100644
index 0000000..dffa811
--- /dev/null
+++ b/soundboard.wsgi
@@ -0,0 +1,10 @@
+import sys
+
+sys.path.insert(0, '/var/www/soundboard')
+
+activate_this = '/var/www/soundboard/py/bin/activate_this.py'
+
+with open(activate_this) as file_:
+ exec(file_.read(), dict(__file__=activate_this))
+
+from soundboard import app as application