heartranked

git clone https://git.tarina.org/heartranked
Log | Files | Refs

commit f8aa9008e50cb8339307baca162b773fb045bfc6
parent f8e09e2d06c2b9b04e1f1af199e418564f1adbd0
Author: rbckman <rob@tarina.org>
Date:   Mon,  3 Aug 2026 19:56:22 +0300

soon...

Diffstat:
Mhtml/heartranked.html | 32++++++++++++++++----------------
Ainstall.sh | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 102 insertions(+), 16 deletions(-)

diff --git a/html/heartranked.html b/html/heartranked.html @@ -23,7 +23,7 @@ $unique UNICORNS 🦄 PEACE! ☮️ <div id="mod"> $if rights=='mod' or rights=='admin': $ #displayname = db.query("SELECT displayname FROM rymdadmin WHERE name='"+namn+"';")[0] - $ displayname=loadjson('users/'+session.user) + $ displayname=loadjson('r/users/'+session.user) hey <b><a href="/tuning">$displayname.displayname</a></b>, <a href="/invites">invite</a> or <a href="/editor?new=yes">write</a> <br> $else: @@ -43,21 +43,21 @@ $if search != '': <br> <br> <div class="heartpost"> - $:markdown.markdown(loadtext('posts/'+g.postid+'/intro')) + $:markdown.markdown(loadtext('p/posts/'+g.postid+'/intro')) </div> <div class="postmenu"> <small>by $g.creator $formattime(g.timeadded)</small><br> $getcombines(g.postid) $if g.combine: $ #combined = db.select('published', where="postid='"+g.combine+"'")[0] - $ combined=loadjson('posts/'+g.combine+/meta') + $ combined=loadjson('p/posts/'+g.combine+/meta') <small>combo with <a href="/?show=$combined.postid">$combined.soundname</a></small><br> $if g.remix: $ #remixed = db.select('published', where="postid='"+g.remix+"'")[0] - $ combined=loadjson('posts/'+g.remix+/meta') + $ combined=loadjson('p/posts/'+g.remix+/meta') <small>remixed <a href="/?show=$remixed.postid">$remixed.soundname</a></small><br> - $if loadtext('posts/'+g.postid+'/post') != '': - $if len(loadtext('posts/'+g.postid+'/post')) > 255: + $if loadtext('p/posts/'+g.postid+'/post') != '': + $if len(loadtext('p/posts/'+g.postid+'/post')) > 255: <a href="/?show=$g.postid">read plenty more</a> $else: <a href="/?show=$g.postid">read more</a> @@ -79,7 +79,7 @@ $else: <br> <br> <div class="heartpost"> - $:markdown.markdown(loadtext('posts/'+g.postid+'/intro')) + $:markdown.markdown(loadtext('p/posts/'+g.postid+'/intro')) </div> <div class="postmenu"> <small><small>$formattime(g.timeadded)</small></small> @@ -90,15 +90,15 @@ $else: $if g.combine: $if postexist(g.combine): $ combined = db.select('published', where="postid='"+g.combine+"'")[0] - $ combined=loadjson('posts/'+g.combine+/meta') + $ combined=loadjson('p/posts/'+g.combine+/meta') <small>combo with <a href="/?show=$combined.postid">$combined.soundname</a></small><br> $if g.remix: $if postexist(g.remix): $ #remixed = db.select('published', where="postid='"+g.remix+"'") - $ remixed=loadjson('posts/'+g.remix+/meta') + $ remixed=loadjson('p/posts/'+g.remix+/meta') <small>remixed <a href="/?show=$remixed.postid">$remixed[0].soundname</a></small><br> - $if (loadtext('posts/'+g.postid+'/post') != '': - $if len(loadtext('posts/'+g.postid+'/post')) > 255: + $if (loadtext('p/posts/'+g.postid+'/post') != '': + $if len(loadtext('p/posts/'+g.postid+'/post')) > 255: <a href="/?show=$g.postid">read plenty more</a> $else: <a href="/?show=$g.postid">read more</a> @@ -114,7 +114,7 @@ $else: </div> $else: $ #goodies = db.select('published', where="postid='"+show+"'") - $ goodies=loadjson('posts/'+show+'/meta') + $ goodies=loadjson('p/posts/'+show+'/meta') $for g in goodies: <a href="/#$g.soundname">back</a> $if namn == g.creator: @@ -127,19 +127,19 @@ $else: <div class="post" id="$g.soundname"> <br> <div class="heartpost"> - $:markdown.markdown(loadtext('posts/'+g.postid+'/intro')) - $:markdown.markdown(loadtext('posts/'+g.postid+'/post')) + $:markdown.markdown(loadtext('p/posts/'+g.postid+'/intro')) + $:markdown.markdown(loadtext('p/posts/'+g.postid+'/post')) </div> <div class="postmenu"> <small>by $g.creator $formattime(g.timeadded)</small><br> $getcombines(g.postid) $if g.combine: $ #combined = db.select('published', where="postid='"+g.combine+"'")[0] - $ combined=loadjson('posts/'+g.combine+/meta') + $ combined=loadjson('p/posts/'+g.combine+/meta') <small>combo with <a href="/?show=$combined.postid">$combined.soundname</a></small><br> $if g.remix: $ #remixed = db.select('published', where="postid='"+g.remix+"'")[0] - $ remixed=loadjson('posts/'+g.remix+/meta') + $ remixed=loadjson('p/posts/'+g.remix+/meta') <small>remixed <a href="/?show=$remixed.postid">$remixed.soundname</a></small><br> and <a href="/#$g.soundname">back</a> $if namn == g.creator: diff --git a/install.sh b/install.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +ROOT_UID=0 # Root has $UID 0. + +if [ "$UID" -eq "$ROOT_UID" ] +then + echo "OK" +else + echo "Run with sudo!" + echo "sudo ./install.sh" + exit 0 +fi + +echo "Hurray! du e sudo user!" +cat <<'EOF' + + .__---~~~(~~-_. + _-' ) -~~- ) _-" )_ + ( ( `-,_..`.,_--_ '_,)_ + ( -_) ( -_-~ -_ `, ) + (_ -_ _-~-__-~`, ,' )__-'))--___--~~~--__--~~--___--__.. + _ ~`_-'( (____;--==,,_))))--___--~~~--__--~~--__----~~~'`=__-~+_-_. +(@) (@) ````` `-_(())_-~ mn +EOF + +echo "Installing all dependencies..." +apt-get update +sudo apt install apache2 libapache2-mod-wsgi-py3 python3-pip python3-pil python3-bcrypt python3-webpy +#python3 -m pip install web.py==0.61 + +echo "skapa www-data åtkomst" +mkdir u r p +sudo chown -R www-data u +sudo chown -R www-data r +sudo chown -R www-data p + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +ACONF="/etc/apache2/sites-available/heartranked.conf" + +echo "Adding local site to /etc/apache2/sites-available/heartranked.conf" +cat <<'EOF' > $ACONF +<VirtualHost *:80> + ServerName localhost +EOF +echo " DocumentRoot $DIR" >> $ACONF +echo " WSGIScriptAlias / $DIR/server.py" >> $ACONF +echo " WSGIPassAuthorization On" >> $ACONF +echo " AddType text/html .py" >> $ACONF +echo " Alias /static $DIR/public_html/" >> $ACONF +echo " <Directory $DIR/public_html>" >> $ACONF +cat <<'EOF' >> $ACONF + Options FollowSymlinks + AllowOverride None + Require all granted + </Directory> + ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ + <Directory "/usr/lib/cgi-bin"> + AllowOverride None + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + Require all granted + </Directory> +EOF +echo " ErrorLog $DIR/error.log" >> $ACONF +echo "</VirtualHost>" >> $ACONF + +echo "<Directory $DIR>" >> /etc/apache2/apache2.conf +cat <<'EOF' >> /etc/apache2/apache2.conf + Options Indexes FollowSymLinks + AllowOverride None + Require all granted +</Directory> +EOF + +sudo a2ensite heartranked.conf +sudo systemctl restart apache2 + +cat <<'EOF' + .-. + .-""`""-. |(@ @) + _/`oOoOoOoOo`\_ \ \-/ + '.-=-=-=-=-=-=-.' \/ \ + `-=.=-.-=.=-' \ /\ + ^ ^ ^ _H_ \ + +EOF +