wok-undigest rev 711
move zerobin to wok
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue May 29 17:27:17 2012 +0200 (2012-05-29) |
parents | 5685f79c8547 |
children | ff5e2909ebcc |
files | zerobin/receipt zerobin/stuff/zerobin.u |
line diff
1.1 --- a/zerobin/receipt Tue May 29 17:24:19 2012 +0200 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,67 +0,0 @@ 1.4 -# SliTaz package receipt. 1.5 - 1.6 -PACKAGE="zerobin" 1.7 -VERSION="0.15_alpha" 1.8 -CATEGORY="network" 1.9 -SHORT_DESC="Online pastebin where the server has zero knowledge of pasted data." 1.10 -MAINTAINER="pascal.bellard@slitaz.org" 1.11 -TARBALL="${PACKAGE}_$VERSION.zip" 1.12 -WEB_SITE="http://sebsauvage.net/wiki/doku.php?id=php:zerobin" 1.13 -WGET_URL="http://sebsauvage.net/files/$TARBALL" 1.14 - 1.15 -DEPENDS="php" 1.16 -SUGGESTED="php-gd" 1.17 - 1.18 -# Rules to configure and make the package. 1.19 -compile_rules() 1.20 -{ 1.21 - cd $src 1.22 - patch -p0 < $stuff/zerobin.u 1.23 - dos2unix *.txt *.php tpl/*.html lib/*.js lib/*.php lib/*.css 1.24 -} 1.25 - 1.26 -# Rules to gen a SliTaz package suitable for Tazpkg. 1.27 -genpkg_rules() 1.28 -{ 1.29 - mkdir -p $fs/usr/share/zerobin 1.30 - cp -a $src/* $fs/usr/share/zerobin 1.31 - chown -R www.www $fs/usr/share/zerobin 1.32 -} 1.33 - 1.34 -# Post and pre install commands 1.35 -post_install() 1.36 -{ 1.37 - # Configure lighttpd server 1.38 - if [ -f $1/etc/lighttpd/lighttpd.conf ]; then 1.39 - if ! grep -q /usr/share/zerobin/ $1/etc/lighttpd/lighttpd.conf; then 1.40 - sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/paste/" => "/usr/share/zerobin/",|g' -i $1/etc/lighttpd/lighttpd.conf 1.41 - if [ -z "$1" ]; then 1.42 - # Start Web server. 1.43 - /etc/init.d/lighttpd stop 1.44 - /etc/init.d/lighttpd start 1.45 - fi 1.46 - fi 1.47 - fi 1.48 - # Configure apache server 1.49 - if [ -f $1/etc/apache/httpd.conf ]; then 1.50 - sed -i 's/lighttpd/apache/' $1/etc/rcS.conf 1.51 - if [ ! -f $1/etc/apache/conf.d/zerobin ]; then 1.52 - cat > $1/etc/apache/conf.d/zerobin <<EOT 1.53 -<IfModule mod_alias.c> 1.54 - Alias /paste /usr/share/zerobin/ 1.55 -</IfModule> 1.56 -<DirectoryMatch /usr/share/zerobin/> 1.57 - php_value upload_max_filesize 2147483647 1.58 - DirectoryIndex index.php 1.59 - AllowOverride None 1.60 - Order allow,deny 1.61 - Allow from all 1.62 -</DirectoryMatch> 1.63 -EOT 1.64 - if [ -z "$1" ]; then 1.65 - # Start Web server. 1.66 - /etc/init.d/apache restart 1.67 - fi 1.68 - fi 1.69 - fi 1.70 -}
2.1 --- a/zerobin/stuff/zerobin.u Tue May 29 17:24:19 2012 +0200 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,15 +0,0 @@ 2.4 ---- lib/zerobin.js 2.5 -+++ lib/zerobin.js 2.6 -@@ -180,7 +180,11 @@ 2.7 - { 2.8 - if ($('textarea#message').val().length==0) return; // Do not send if no data. 2.9 - showStatus('Sending paste...',spin=true); 2.10 -- var randomkey = sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0); 2.11 -+ var randomkey = (window.location.hash.length > 2) ? 2.12 -+ // force key 2.13 -+ window.location.hash.substring(1) : 2.14 -+ // Generate a random 256 bits key, encoded in base64: 2.15 -+ sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0); 2.16 - var cipherdata = zeroCipher(randomkey,$('textarea#message').val()); 2.17 - var data_to_send = { data:cipherdata, 2.18 - expire:$('select#pasteExpiration').val(),