diff --git a/Makefile b/Makefile index 472ffc2d..c51fc72b 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ setup: sudo pip3 install -r requirements.txt + -@cd onionr/static-data/ui/; ./compile.py install: sudo rm -rf /usr/share/onionr/ diff --git a/onionr/api.py b/onionr/api.py index 256f55f9..705a4781 100755 --- a/onionr/api.py +++ b/onionr/api.py @@ -129,7 +129,7 @@ class API: if not hmac.compare_digest(timingToken, self.timeBypassToken): if elapsed < self._privateDelayTime: time.sleep(self._privateDelayTime - elapsed) - return send_from_directory('static-data/ui/', path) + return send_from_directory('static-data/ui/dist/', path) @app.route('/client/') def private_handler(): diff --git a/onionr/static-data/ui/common/footer.html b/onionr/static-data/ui/common/footer.html new file mode 100644 index 00000000..6b5cfb06 --- /dev/null +++ b/onionr/static-data/ui/common/footer.html @@ -0,0 +1,4 @@ + + + + diff --git a/onionr/static-data/ui/common/header.html b/onionr/static-data/ui/common/header.html new file mode 100644 index 00000000..2a2b4f56 --- /dev/null +++ b/onionr/static-data/ui/common/header.html @@ -0,0 +1,30 @@ +<$= LANG.ONIONR_TITLE $> + + + + + + + + + + diff --git a/onionr/static-data/ui/common/onionr-timeline-post.html b/onionr/static-data/ui/common/onionr-timeline-post.html new file mode 100644 index 00000000..ceff5c65 --- /dev/null +++ b/onionr/static-data/ui/common/onionr-timeline-post.html @@ -0,0 +1,31 @@ + +
+
+
+
+ +
+
+
+ +
+ +
+
+ +
+ $content +
+ +
+ like + comment +
+
+
+
+
+ diff --git a/onionr/static-data/ui/compile.py b/onionr/static-data/ui/compile.py new file mode 100755 index 00000000..c93e4aa7 --- /dev/null +++ b/onionr/static-data/ui/compile.py @@ -0,0 +1,123 @@ +#!/usr/bin/python3 + +import shutil, os, re, json, traceback + +# get user's config +settings = {} +with open('config.json', 'r') as file: + settings = json.loads(file.read()) + +# "hardcoded" config, not for user to mess with +HEADER_FILE = 'common/header.html' +FOOTER_FILE = 'common/footer.html' +SRC_DIR = 'src/' +DST_DIR = 'dist/' +HEADER_STRING = '
' +FOOTER_STRING = '