sup rev 7

Add SCN base plugins to start playing a bit more :-)
author Christophe Lincoln <pankso@slitaz.org>
date Fri Feb 24 09:09:43 2017 +0100 (2017-02-24)
parents 655dd6422146
children 01b65f9074e0
files server/sup/sup.cgi server/sup/sup.conf
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/server/sup/sup.cgi	Fri Feb 24 09:09:43 2017 +0100
     1.3 @@ -0,0 +1,94 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# TinyCM/TazBug Plugin - SliTaz User Packages
     1.7 +#
     1.8 +# This plugin is part of the SPI tools and services. More information
     1.9 +# at http://hg.slitaz.org/sup/file/ && http://scn.slitaz.org/?d=en/sup
    1.10 +#
    1.11 +# Copyright (C) 2017 SliTaz GNU/Linux - BSD License
    1.12 +# Author: Christophe Lincoln <pankso@slitaz.org>
    1.13 +#
    1.14 +
    1.15 +case " $(GET sup) " in
    1.16 +	
    1.17 +	*\ pkg\ *)
    1.18 +		pkg="$(GET name)"
    1.19 +		supdb="$content/sup"
    1.20 +		wok="$supdb/wok"
    1.21 +		d="Sup package: $pkg"
    1.22 +		header
    1.23 +		html_header
    1.24 +		user_box
    1.25 +		
    1.26 +		cat << EOT
    1.27 +<h2>${d}</h2>
    1.28 +<div id="tools">
    1.29 +	<a href='?sup'>Sup hub</a>
    1.30 +EOT
    1.31 +		if check_auth; then
    1.32 +			cat << EOT
    1.33 +	<a href='?sup=debug'>Sup debug</a>
    1.34 +EOT
    1.35 +		fi
    1.36 +		#. ${wok}/${pkg}/receip
    1.37 +		cat << EOT
    1.38 +</div>
    1.39 +
    1.40 +<pre>
    1.41 +$(cat ${wok}/${pkg}/receip )
    1.42 +</pre>
    1.43 +EOT
    1.44 +		
    1.45 +		html_footer && exit 0 ;;
    1.46 +
    1.47 +	*\ debug\ *)
    1.48 +		d="Sup server debug"
    1.49 +		header
    1.50 +		html_header
    1.51 +		user_box
    1.52 +		cat << EOT
    1.53 +<h2>${d}</h2>
    1.54 +<div id="tools">
    1.55 +	<a href='?sup'>Sup hub</a>
    1.56 +</div>
    1.57 +EOT
    1.58 +		if ! check_auth; then
    1.59 +			echo "Only for logged users" && html_footer && exit 0
    1.60 +		fi
    1.61 +		echo "<pre>"
    1.62 +		echo "Checking: $content/sup/wok"
    1.63 +		for pkg in $(ls $content/sup/wok); do
    1.64 +			echo "$pkg"
    1.65 +		done
    1.66 +		echo "</pre>"
    1.67 +		html_footer && exit 0 ;;
    1.68 +	
    1.69 +	*\ sup\ *)
    1.70 +		d="SliTaz User Packages"
    1.71 +		supdb="$content/sup"
    1.72 +		wok="$supdb/wok"
    1.73 +		header
    1.74 +		html_header
    1.75 +		user_box
    1.76 +		cat << EOT
    1.77 +<h2>${d}</h2>
    1.78 +<p>
    1.79 +	SliTaz User Packages server services. In developement :-)
    1.80 +</p>
    1.81 +
    1.82 +<pre>
    1.83 +Packages : $(ls $wok | wc -l)
    1.84 +Mirror   : <a href="$content/sup/packages/">Browse packages</a>
    1.85 +Tools    : <a href="?sup=debug">Debug page</a>
    1.86 +</pre>
    1.87 +EOT
    1.88 +		# Packages list
    1.89 +		echo "<h3>Sup packages</h3>"
    1.90 +		echo "<pre>"
    1.91 +		for pkg in $(ls $content/sup/wok); do
    1.92 +			echo "<a href='?sup=pkg&amp;name=$pkg'>$pkg</a>"
    1.93 +		done
    1.94 +		echo "</pre>"
    1.95 +		html_footer && exit 0 ;;
    1.96 +		
    1.97 +esac
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/server/sup/sup.conf	Fri Feb 24 09:09:43 2017 +0100
     2.3 @@ -0,0 +1,13 @@
     2.4 +# TinyCM Plugin configuration
     2.5 +
     2.6 +PLUGIN="SliTaz User Packages"
     2.7 +SHORT_DESC="SUP online hug and services"
     2.8 +MAINTAINER="devel@slitaz.org"
     2.9 +
    2.10 +# Authenticated users
    2.11 +PLUGINS_TOOLS="${PLUGINS_TOOLS} <a href="?sup">Sup hub</a>"
    2.12 +DASHBOARD_TOOLS="${DASHBOARD_TOOLS} <a href="?sup">Sup hub</a>"
    2.13 +PROFILE_TOOLS="${PROFILE_TOOLS}"
    2.14 +
    2.15 +# Admin only in Dashboard
    2.16 +ADMIN_TOOLS="${ADMIN_TOOLS}"