Browse Source

Add NAT rules

Julien VAUBOURG 10 years ago
parent
commit
3904d3d4eb

+ 211 - 0
conf/init_ynh-piratebox

@@ -0,0 +1,211 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides: ynh-piratebox
+# Required-Start:    $network $remote_fs $syslog $all
+# Required-Stop:     $network $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Set prerequisites for wifi piratebox.
+# Description:       Set prerequisites for wifi piratebox.
+### END INIT INFO
+
+# PirateBox app for YunoHost 
+# Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
+# Contribute at https://github.com/jvaubourg/piratebox_ynh
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Functions
+## State functions
+
+has_hotspot_app() {
+  [ -e /tmp/.ynh-hotspot-started ]
+}
+
+is_nat4_dns_set() {
+  iptables -nvt nat -L PREROUTING | grep 'udp dpt:53' | grep -q "${ynh_wifi_device}" \
+  && iptables -nvt nat -L POSTROUTING | grep MASQUERADE | grep -q "${ynh_wifi_device}"
+}
+
+is_nat4_web_set() {
+  iptables -nvt nat -L PREROUTING | grep 'tcp dpt:80' | grep -q "${ynh_wifi_device}"
+}
+
+is_fakedns_running() {
+  ps aux | grep -v grep | grep -q piratebox_fakedns
+}
+
+is_running() {
+  has_hotspot_app \
+  && is_nat4_dns_set && is_nat4_web_set \
+  && is_fakedns_running
+}
+
+## Setters
+
+# The IPv6 NAT features are not available available before the kernel 3.8
+# therefore the IPv6-compliance will be add when Debian Stable has a
+# compliant kernel
+
+set_nat4_dns() {
+  iptables -t nat -A PREROUTING -i "${ynh_wifi_device}" -p udp --dport 53 -j DNAT --to-destination "${ynh_ip4_nat_prefix}.1:4253"
+  iptables -t nat -A POSTROUTING -o "${ynh_wifi_device}" -j MASQUERADE
+}
+
+set_nat4_web() {
+  iptables -t nat -A PREROUTING -i "${ynh_wifi_device}" -p tcp --dport 80 -j REDIRECT --to-port 4280
+}
+
+start_fakedns() {
+  /usr/local/bin/piratebox_fakedns "${ynh_ip4_nat_prefix}.1" 2>&1 > /dev/null &
+}
+
+## Unsetters
+
+unset_nat4_dns() {
+  iptables -t nat -D PREROUTING -i "${ynh_wifi_device}" -p udp --dport 53 -j DNAT --to-destination "${ynh_ip4_nat_prefix}.1:4253"
+  iptables -t nat -D POSTROUTING -o "${ynh_wifi_device}" -j MASQUERADE
+}
+
+unset_nat4_web() {
+  iptables -t nat -D PREROUTING -i "${ynh_wifi_device}" -p tcp --dport 80 -j REDIRECT --to-port 4280
+}
+
+stop_fakedns() {
+  kill $(ps aux | grep piratebox_fakedns | awk '{ print $2 }' | head -n1)
+}
+
+## Tools
+
+moulinette_hotspot_get() {
+  var=${1}
+
+  value=$(yunohost app setting hotspot "${var}")
+
+  if [[ "${value}" =~ "An instance is already running" ]]; then
+    echo "${value}" >&2
+    exit 1
+  fi
+
+  echo "${value}"
+}
+
+if [ "$1" != restart ]; then
+
+  # Restart php5-fpm at the first start (it needs to be restarted after the slapd start)
+  if [ ! -e /tmp/.ynh-piratebox-boot ]; then
+    touch /tmp/.ynh-piratebox-boot
+    service php5-fpm restart
+  fi
+  
+  # Variables
+  
+  echo -n "Retrieving Yunohost settings... "
+  
+  ynh_wifi_device=$(moulinette_hotspot_get wifi_device)
+  ynh_ip4_nat_prefix=$(moulinette_hotspot_get ip4_nat_prefix)
+  
+  echo "OK"
+fi
+
+# Script
+
+case "$1" in
+  start)
+    if is_running; then
+      echo "Already started"
+    else
+      echo "[piratebox] Starting..."
+      touch /tmp/.ynh-piratebox-started
+
+      # Set IPv4 DNS NAT
+      if ! is_nat4_dns_set; then
+        echo "Set IPv4 DNS NAT"
+        set_nat4_dns
+      fi
+
+      # Set IPv4 Web NAT
+      if ! is_nat4_web_set; then
+        echo "Set IPv4 DNS NAT"
+        set_nat4_web
+      fi
+
+      # Run fakedns
+      if ! is_fakedns_running; then
+        echo "Run fakedns"
+        start_fakedns
+      fi
+    fi
+  ;;
+  stop)
+    echo "[piratebox] Stopping..."
+    rm -f /tmp/.ynh-piratebox-started
+
+    if is_nat4_dns_set; then
+      echo "Unset IPv4 DNS NAT"
+      unset_nat4_dns
+    fi
+
+    if is_nat4_web_set; then
+      echo "Unset IPv4 Web NAT"
+      unset_nat4_web
+    fi
+
+    if is_fakedns_running; then
+      echo "Stop fakedns"
+      stop_fakedns
+    fi
+  ;;
+  restart)
+    $0 stop
+    $0 start
+  ;;
+  status)
+    exitcode=0
+
+    if ! has_hotspot_app; then
+      echo "[ERR] Hotspot is not running"
+      exitcode=1
+    fi
+
+    if is_nat4_dns_set; then
+      echo "[OK] IPv4 DNS NAT set"
+    else
+      echo "[ERR] No IPv4 DNS NAT set"
+      exitcode=1
+    fi
+
+    if is_nat4_web_set; then
+      echo "[OK] IPv4 Web NAT set"
+    else
+      echo "[ERR] No IPv4 Web NAT set"
+      exitcode=1
+    fi
+
+    if is_fakedns_running; then
+      echo "[OK] Fakedns is running"
+    else
+      echo "[ERR] Fakedns is not running"
+      exitcode=1
+    fi
+
+    exit ${exitcode}
+  ;;
+  *)
+    echo "Usage: $0 {start|stop|restart|status}"
+    exit 1
+  ;;
+esac
+
+exit 0

+ 34 - 0
conf/nginx_dropcenter.conf

@@ -0,0 +1,34 @@
+# PirateBox app for YunoHost 
+# Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
+# Contribute at https://github.com/jvaubourg/piratebox_ynh
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+location <TPL:NGINX_LOCATION> {
+  alias <TPL:NGINX_REALPATH>;
+
+  client_max_body_size 10G;
+  index index.php;
+  try_files $uri $uri/ index.php;
+
+  location ~ [^/]\.php(/|$) {
+    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+    fastcgi_pass unix:/var/run/php5-fpm-<TPL:PHP_NAME>.sock;
+    fastcgi_index index.php;
+    include fastcgi_params;
+    fastcgi_read_timeout 600;
+    fastcgi_param REMOTE_USER $remote_user;
+    fastcgi_param PATH_INFO $fastcgi_path_info;
+  }
+}

+ 21 - 21
conf/nginx_piratebox.conf

@@ -1,40 +1,40 @@
-# PirateBox app for YunoHost 
+# PirateBox app for YunoHost
 # Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
 # Contribute at https://github.com/jvaubourg/piratebox_ynh
-# 
+#
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU Affero General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-location <TPL:NGINX_LOCATION> {
-  alias <TPL:NGINX_REALPATH>;
+server {
+  listen 4280 default_server;
+  listen [::]:4280 default_server;
 
-  if ($scheme = http) {
-    rewrite ^ https://$server_name$request_uri? permanent;
+  if ($host != '<TPL:DOMAIN>') {
+    rewrite ^ http://<TPL:DOMAIN><TPL:URL_PATH>;
   }
 
-  client_max_body_size 10G;
-  index index.php;
-  try_files $uri $uri/ index.php;
-
-  location ~ [^/]\.php(/|$) {
-    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
-    fastcgi_pass unix:/var/run/php5-fpm-<TPL:PHP_NAME>.sock;
-    fastcgi_index index.php;
-    include fastcgi_params;
-    fastcgi_read_timeout 600;
-    fastcgi_param REMOTE_USER $remote_user;
-    fastcgi_param PATH_INFO $fastcgi_path_info;
+  location ~ {
+    proxy_pass http://127.0.0.1:80;
+    proxy_set_header Host $host;
+    proxy_set_header X-Real-IP $remote_addr;
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    proxy_connect_timeout 90;
+    proxy_send_timeout 90;
+    proxy_read_timeout 90;
+    proxy_buffers 32 4k;
+    client_body_buffer_size 128k;
   }
 
-  include conf.d/yunohost_panel.conf.inc;
+  access_log /dev/null;
+  error_log /dev/null;
 }

conf/phpfpm_piratebox.conf → conf/phpfpm_dropcenter.conf


+ 34 - 0
conf/piratebox_fakedns

@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+ 
+use strict;
+use warnings;
+use Net::DNS::Nameserver;
+
+my $ip4_addr = shift @ARGV;
+ 
+sub reply_handler {
+  my ($qname, $qclass, $qtype, $peerhost,$query,$conn) = @_;
+  my ($rcode, @ans, @auth, @add);
+ 
+  if($qtype eq "A") {
+      my ($ttl, $rdata) = (1, $ip4_addr);
+      my $rr = new Net::DNS::RR("$qname $ttl $qclass $qtype $rdata");
+      push @ans, $rr;
+      $rcode = "NOERROR";
+
+  } else {
+      $rcode = "NXDOMAIN";
+  }
+ 
+  return ($rcode, \@ans, \@auth, \@add, { aa => 1 });
+}
+ 
+my $ns = new Net::DNS::Nameserver(
+  LocalPort    => 4253,
+  ReplyHandler => \&reply_handler,
+  Verbose      => 0
+  ) || die "Couldn't create fake nameserver object.\n";
+ 
+$ns->main_loop;
+
+exit 0;

+ 42 - 22
scripts/install

@@ -28,7 +28,8 @@ if [ ! $? -eq 0 ]; then
 fi
 
 # Install packages
-packages='php5-fpm iptables'
+packages='php5-fpm iptables libnet-dns-perl'
+export DEBIAN_FRONTEND=noninteractive
 
 sudo apt-get --assume-yes --force-yes install ${packages}
 
@@ -38,52 +39,71 @@ if [ $? -ne 0 ]; then
 fi
 
 # Create web user
-sudo useradd -r piratebox
+sudo useradd -r dropcenter
 
 # Copy confs
-sudo install -b -o root -g root -m 0644 ../conf/nginx_piratebox.conf "/etc/nginx/conf.d/${domain}.d/piratebox.conf"
-sudo install -b -o root -g root -m 0644 ../conf/phpfpm_piratebox.conf /etc/php5/fpm/pool.d/piratebox.conf
+sudo install -b -o root -g root -m 0644 ../conf/nginx_piratebox.conf "/etc/nginx/conf.d/piratebox.conf"
+sudo install -b -o root -g root -m 0644 ../conf/nginx_dropcenter.conf "/etc/nginx/conf.d/${domain}.d/dropcenter.conf"
+sudo install -b -o root -g root -m 0644 ../conf/phpfpm_dropcenter.conf /etc/php5/fpm/pool.d/dropcenter.conf
 
 # Copy web sources
-sudo mkdir -pm 0755 /var/www/piratebox/
-sudo cp -a ../sources/* /var/www/piratebox/
-sudo mkdir /var/www/piratebox/tpl/tmp/
+sudo mkdir -pm 0755 /var/www/dropcenter/
+sudo cp -a ../sources/* /var/www/dropcenter/
+sudo mkdir /var/www/dropcenter/tpl/tmp/
 
-sudo chown -R root: /var/www/piratebox/
-sudo chmod -R 0644 /var/www/piratebox/*
-sudo find /var/www/piratebox/ -type d -exec chmod +x {} \;
+sudo chown -R root: /var/www/dropcenter/
+sudo chmod -R 0644 /var/www/dropcenter/*
+sudo find /var/www/dropcenter/ -type d -exec chmod +x {} \;
 
 # Fix permissions
-sudo chown -R piratebox: /var/www/piratebox/tpl/tmp/
-sudo chown -R piratebox: /var/www/piratebox/uploads/
+sudo chown -R dropcenter: /var/www/dropcenter/tpl/tmp/
+sudo chown -R dropcenter: /var/www/dropcenter/uploads/
 
 # Create fixed DC user
-sudo tee /var/www/piratebox/uploads/.dc/.user.dc.php > /dev/null << EOF
+sudo tee /var/www/dropcenter/uploads/.dc/.user.dc.php > /dev/null << EOF
 <?php /*{"login":"pirate","avatar":"","password":"","rank":"admin","mail":"","notifMail":"off","lang":"en - English"}*/ ?>
 EOF
 
-sudo touch /var/www/piratebox/uploads/avatars/pirate.jpg
+sudo touch /var/www/dropcenter/uploads/avatars/pirate.jpg
 
 # Fix confs
 ## nginx
-sudo sed "s|<TPL:NGINX_LOCATION>|${url_path}|g" -i "/etc/nginx/conf.d/${domain}.d/piratebox.conf"
-sudo sed 's|<TPL:NGINX_REALPATH>|/var/www/piratebox/|g' -i "/etc/nginx/conf.d/${domain}.d/piratebox.conf"
-sudo sed 's|<TPL:PHP_NAME>|piratebox|g' -i "/etc/nginx/conf.d/${domain}.d/piratebox.conf"
+sudo sed "s|<TPL:URL_PATH>|${url_path}|g" -i "/etc/nginx/conf.d/piratebox.conf"
+sudo sed "s|<TPL:DOMAIN>|${domain}|g" -i "/etc/nginx/conf.d/piratebox.conf"
+
+sudo sed "s|<TPL:NGINX_LOCATION>|${url_path}|g" -i "/etc/nginx/conf.d/${domain}.d/dropcenter.conf"
+sudo sed 's|<TPL:NGINX_REALPATH>|/var/www/dropcenter/|g' -i "/etc/nginx/conf.d/${domain}.d/dropcenter.conf"
+sudo sed 's|<TPL:PHP_NAME>|dropcenter|g' -i "/etc/nginx/conf.d/${domain}.d/dropcenter.conf"
 
 ## php-fpm
-sudo sed 's|<TPL:PHP_NAME>|piratebox|g' -i /etc/php5/fpm/pool.d/piratebox.conf
-sudo sed 's|<TPL:PHP_USER>|piratebox|g' -i /etc/php5/fpm/pool.d/piratebox.conf
-sudo sed 's|<TPL:PHP_GROUP>|piratebox|g' -i /etc/php5/fpm/pool.d/piratebox.conf
-sudo sed 's|<TPL:NGINX_REALPATH>|/var/www/piratebox/|g' -i /etc/php5/fpm/pool.d/piratebox.conf
+sudo sed 's|<TPL:PHP_NAME>|dropcenter|g' -i /etc/php5/fpm/pool.d/dropcenter.conf
+sudo sed 's|<TPL:PHP_USER>|dropcenter|g' -i /etc/php5/fpm/pool.d/dropcenter.conf
+sudo sed 's|<TPL:PHP_GROUP>|dropcenter|g' -i /etc/php5/fpm/pool.d/dropcenter.conf
+sudo sed 's|<TPL:NGINX_REALPATH>|/var/www/dropcenter/|g' -i /etc/php5/fpm/pool.d/dropcenter.conf
 sudo sed 's|^;\?\s*max_execution_time.\+|max_execution_time = 600|' -i /etc/php5/fpm/php.ini
 
+# Install fakedns
+sudo install -o root -g root -m 0755 ../conf/piratebox_fakedns /usr/local/bin/
+
+# Copy init script
+sudo install -o root -g root -m 0755 ../conf/init_ynh-piratebox /etc/init.d/ynh-piratebox
+
+# Update firewall
+sudo yunohost firewall allow --no-upnp UDP 4253
+sudo yunohost firewall allow --no-upnp TCP 4280
+
+# Set default inits
 sudo yunohost service add php5-fpm
 sudo yunohost service enable php5-fpm
 
 sudo service php5-fpm restart
 sudo service nginx reload
 
-# Update SSO for piratebox
+sudo yunohost service add ynh-piratebox
+sudo yunohost service enable ynh-piratebox
+sudo service ynh-piratebox start
+
+# Update SSO for wifiadmin
 sudo yunohost app ssowatconf
 
 exit 0

+ 18 - 4
scripts/remove

@@ -20,9 +20,23 @@
 # Retrieve arguments
 domain=$(sudo yunohost app setting piratebox domain)
 
+# The End
+sudo service ynh-piratebox stop
+sudo yunohost service remove ynh-piratebox
+sudo rm -f /etc/init.d/ynh-piratebox
+sudo rm -f /tmp/.ynh-piratebox-*
+
+# Update firewall
+sudo yunohost firewall disallow UDP 4253
+sudo yunohost firewall disallow TCP 4280
+
 # Remove confs
-sudo rm -f /etc/nginx/conf.d/${domain}.d/piratebox.conf
-sudo rm -f /etc/php5/fpm/pool.d/piratebox.conf
+sudo rm -f /etc/nginx/conf.d/piratebox.conf
+sudo rm -f /etc/nginx/conf.d/${domain}.d/dropcenter.conf
+sudo rm -f /etc/php5/fpm/pool.d/dropcenter.conf
+
+# Delete fakedns
+sudo rm -f /usr/local/bin/piratebox_fakedns
 
 # Restart services
 sudo yunohost service stop php5-fpm
@@ -30,9 +44,9 @@ sudo yunohost service start php5-fpm
 sudo service nginx reload
 
 # Remove web user
-sudo userdel piratebox
+sudo userdel dropcenter
 
 # Remove sources
-sudo rm -rf /var/www/piratebox/
+sudo rm -rf /var/www/dropcenter/
 
 exit 0

+ 58 - 0
sources.patch

@@ -22,6 +22,63 @@ diff -ur ../dropcenter/header.php sources/header.php
 -?>
 \ No newline at end of file
 +?>
+diff -ur ../dropcenter/php/config.php sources/php/config.php
+--- ../dropcenter/php/config.php	2015-03-14 16:01:45.805821759 +0100
++++ sources/php/config.php	2015-03-15 18:18:21.767535511 +0100
+@@ -1,14 +1,14 @@
+ <?php
+ 
+ 
+-define('DC_TITLE','DropCenter');//Titre du dropCenter
+-define('DC_DESCRIPTION','File drop center kiss n\'fun');//description du dropCenter
++define('DC_TITLE','PirateBox');//Titre du dropCenter
++define('DC_DESCRIPTION','Upload and download freely');//description du dropCenter
+ define('DC_LOGO','img/logo.png');//logo central du dropCenter (Si rien n'est mis, le logo par défaut apparaît)
+ define('DC_LICENCE','CC BY NC SA');//License de votre dropCenter
+ define('UPLOAD_FOLDER','uploads/');//chemin vers le dossier d'upload (ne pas oublier de mettre les droits d'écriture sur ce dossier)
+ define('NAME_LIMIT',25);//Nombre maximal de caractères affichés pour les fichiers
+ define('NAME_LIMIT_BORDER','..');//Les caractères qui s'afficheront pour signifier qu'un nom est raccourci
+-define('MAX_SIZE',1000);//Taille maximale authorisée par fichier en Mo (Pensez a configurer post_max_size et upload_max_size dans le fichier php.ini de votre serveur si vous voulez uploader de gros fichiers).
++define('MAX_SIZE',1024);//Taille maximale authorisée par fichier en Mo (Pensez a configurer post_max_size et upload_max_size dans le fichier php.ini de votre serveur si vous voulez uploader de gros fichiers).
+ define('FORBIDEN_FORMAT','exe,php,sh,bin,htaccess,htm,html,asp');//Les extensions interdites à l'exécution séparées par des virgules (les fichiers seront bien envoyés mais un .txt sera rajouté à l'extension afin d'empêcher les utilisateurs d'exécuter leurs fichiers sur le serveur
+ define('AVATAR_DEFAULT','defaultAvatar.png'); //chemin de l'avatar par défaut
+ define('AVATARFOLDER',UPLOAD_FOLDER.'avatars/'); //dossier contenant les avatars
+@@ -17,8 +17,8 @@
+ define('READ_FOR_ANONYMOUS',false);// Définit si les visiteurs non authentifiés peuvent lire le contenu du dropCenter (true = lecture possible, false = lecture interdite)
+ define('DC_LANG','fr - Francais');//Définit la langue par défaut
+ define('DIR_LANG','lang/');//Dossier des fichiers de langue
+-define('MAIL',true);//Autorise les notifications par e-mail
+-define('DISPLAY_DOTFILES',false);//Affiche ou non les dossiers/fichiers commençant par un point
++define('MAIL',false);//Autorise les notifications par e-mail
++define('DISPLAY_DOTFILES',true);//Affiche ou non les dossiers/fichiers commençant par un point
+ define('DISPLAY_UPDATE',false);//Activer la vérification des mises-à-jour
+ define('DISPLAY_AVATAR_FOLDER',false);//Afficher le dossier des avatars
+ define('DEFAULT_THEME','UnderBlack');//Afficher le dossier des avatars
+diff -ur ../dropcenter/tpl/UnderBlack/footer.html sources/tpl/UnderBlack/footer.html
+--- ../dropcenter/tpl/UnderBlack/footer.html	2015-03-14 16:01:45.809821797 +0100
++++ sources/tpl/UnderBlack/footer.html	2015-03-15 21:49:44.413627821 +0100
+@@ -18,13 +18,6 @@
+ 	{if="$FORTUNE"}<br/><br/>{function="chuckQuote()"}<br/><br/>{/if}
+ 	
+ 
+-	{if="isset($user)"}
+-	<a class="rssFeed tooltips" target="_blank"
+-		href="php/action.php?action=login&token={function="getToken($user)"}" alt="<?php t("Flux RSS");?>"
+-		title="{function="t("Abonnez vous au flux rss pour suivre les evenements du DropCenter")"}"><i class="icon-rss"></i>{function="t("Flux RSS")"}
+-	</a>
+-	{/if}
+-
+ </footer>
+ 
+ 
+@@ -53,4 +46,4 @@
+ {/if}
+ 
+ </body>
+-</html>
+\ No newline at end of file
++</html>
+Binary files ../dropcenter/tpl/UnderBlack/img/logo.png and sources/tpl/UnderBlack/img/logo.png differ
 diff -ur ../dropcenter/tpl/UnderBlack/index.html sources/tpl/UnderBlack/index.html
 --- ../dropcenter/tpl/UnderBlack/index.html	2015-03-14 16:01:45.813821833 +0100
 +++ sources/tpl/UnderBlack/index.html	2015-03-14 18:21:24.470657608 +0100
@@ -34,3 +91,4 @@ diff -ur ../dropcenter/tpl/UnderBlack/index.html sources/tpl/UnderBlack/index.ht
  			</div>
  
  
+Only in ../dropcenter/uploads: .htaccess

+ 5 - 5
sources/php/config.php

@@ -1,14 +1,14 @@
 <?php
 
 
-define('DC_TITLE','DropCenter');//Titre du dropCenter
-define('DC_DESCRIPTION','File drop center kiss n\'fun');//description du dropCenter
+define('DC_TITLE','PirateBox');//Titre du dropCenter
+define('DC_DESCRIPTION','Upload and download freely');//description du dropCenter
 define('DC_LOGO','img/logo.png');//logo central du dropCenter (Si rien n'est mis, le logo par défaut apparaît)
 define('DC_LICENCE','CC BY NC SA');//License de votre dropCenter
 define('UPLOAD_FOLDER','uploads/');//chemin vers le dossier d'upload (ne pas oublier de mettre les droits d'écriture sur ce dossier)
 define('NAME_LIMIT',25);//Nombre maximal de caractères affichés pour les fichiers
 define('NAME_LIMIT_BORDER','..');//Les caractères qui s'afficheront pour signifier qu'un nom est raccourci
-define('MAX_SIZE',1000);//Taille maximale authorisée par fichier en Mo (Pensez a configurer post_max_size et upload_max_size dans le fichier php.ini de votre serveur si vous voulez uploader de gros fichiers).
+define('MAX_SIZE',1024);//Taille maximale authorisée par fichier en Mo (Pensez a configurer post_max_size et upload_max_size dans le fichier php.ini de votre serveur si vous voulez uploader de gros fichiers).
 define('FORBIDEN_FORMAT','exe,php,sh,bin,htaccess,htm,html,asp');//Les extensions interdites à l'exécution séparées par des virgules (les fichiers seront bien envoyés mais un .txt sera rajouté à l'extension afin d'empêcher les utilisateurs d'exécuter leurs fichiers sur le serveur
 define('AVATAR_DEFAULT','defaultAvatar.png'); //chemin de l'avatar par défaut
 define('AVATARFOLDER',UPLOAD_FOLDER.'avatars/'); //dossier contenant les avatars
@@ -17,8 +17,8 @@ define('RSS_MAIL','rss@mail.com');
 define('READ_FOR_ANONYMOUS',false);// Définit si les visiteurs non authentifiés peuvent lire le contenu du dropCenter (true = lecture possible, false = lecture interdite)
 define('DC_LANG','fr - Francais');//Définit la langue par défaut
 define('DIR_LANG','lang/');//Dossier des fichiers de langue
-define('MAIL',true);//Autorise les notifications par e-mail
-define('DISPLAY_DOTFILES',false);//Affiche ou non les dossiers/fichiers commençant par un point
+define('MAIL',false);//Autorise les notifications par e-mail
+define('DISPLAY_DOTFILES',true);//Affiche ou non les dossiers/fichiers commençant par un point
 define('DISPLAY_UPDATE',false);//Activer la vérification des mises-à-jour
 define('DISPLAY_AVATAR_FOLDER',false);//Afficher le dossier des avatars
 define('DEFAULT_THEME','UnderBlack');//Afficher le dossier des avatars

+ 1 - 8
sources/tpl/UnderBlack/footer.html

@@ -18,13 +18,6 @@
 	{if="$FORTUNE"}<br/><br/>{function="chuckQuote()"}<br/><br/>{/if}
 	
 
-	{if="isset($user)"}
-	<a class="rssFeed tooltips" target="_blank"
-		href="php/action.php?action=login&token={function="getToken($user)"}" alt="<?php t("Flux RSS");?>"
-		title="{function="t("Abonnez vous au flux rss pour suivre les evenements du DropCenter")"}"><i class="icon-rss"></i>{function="t("Flux RSS")"}
-	</a>
-	{/if}
-
 </footer>
 
 
@@ -53,4 +46,4 @@
 {/if}
 
 </body>
-</html>
+</html>

BIN
sources/tpl/UnderBlack/img/logo.png


+ 0 - 1
sources/uploads/.htaccess

@@ -1 +0,0 @@
-deny from all