# HG changeset patch # User Eric Joseph-Alexandre # Date 1331769394 -3600 # Node ID b51b9432c52595c86e0041ed472d1d5b77c69f31 # Parent 8c447807f5ed40735b6dc90f234acd679a073b9c Add Proxy (squid + sqduidclamav + SquidGuard + sarg) diff -r 8c447807f5ed -r b51b9432c525 proxy/distro.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/proxy/distro.sh Thu Mar 15 00:56:34 2012 +0100 @@ -0,0 +1,93 @@ +#!/bin/sh +# distro.sh, changet set for slitaz-dolibarr +# +# Eric Joseph-Alexandre + +ROOTFS=$PWD/rootfs +HOSTNAME="proxy" +AUTOSTART="dropbear squid c-icapd lighttpd" +DONTSTART="httpd" +ALLOW_ROOT_LOGIN="1" +BLOCKED_PACKAGES="" + +# Disable auto-install dependencies +sed -i s/AUTO_INSTALL.*/AUTO_INSTALL_DEPS=\"no\"/ $ROOTFS/etc/slitaz/tazpkg.conf + +## +## +if [ ! -z "$BLOCKED_PACKAGES" ]; then + touch $ROOTFS/var/lib/tazpkg/blocked-packages.list + for i in $BLOCKED_PACKAGES + do + echo $i >> $ROOTFS/var/lib/tazpkg/blocked-packages.list + done +fi + + +# Set static IP config: IP=92.168.1.6/24. Gateway=192.168.1.1 DNS: 192.168.1.1 + +if [ ! -z $IP_STATIC ]; then + sed -i -e 's/DHCP=.*/DHCP=\"no\"/' \ + -e 's/STATIC=.*/STATIC=\"yes\"/' \ + -e 's/IP=.*/IP=\"192.168.1.6\"/' \ + -e 's/GATEWAY=.*/GATEWAY=\"192.168.1.1\"/' \ + -e 's/DNS_SERVER=.*/DNS_SERVER=\"192.168.1.1\"/' $ROOTFS/etc/network.conf +fi + +# Change default hostname +if [ ! -z "$HOSTNAME" ]; then + echo "* Setting hostname to $HOSTNAME" + echo "$HOSTNAME" > $ROOTFS/etc/hostname + # Change hosts + sed -i -e "s/slitaz/$HOSTNAME/" $ROOTFS/etc/hosts +fi + +# Start daemons at boot time +if [ ! -z "$AUTOSTART" ]; then + echo "* Enabling daemons at boot" + sed -i -e "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"\1 $AUTOSTART\"/" \ + $ROOTFS/etc/rcS.conf +fi + +# Dont start daemons at boot time +if [ ! -z "$DONTSTART" ]; then + echo "* Disabling daemons at boot" + sed -i -e "s/$DONTSTART//" \ + $ROOTFS/etc/rcS.conf +fi + +## +## Custom config +## + +# Allow SSH root login from remote computer. +if [ $ALLOW_ROOT_LOGIN = "1" ]; then + echo "Allow root login using SSH" + sed -i 's!DROPBEAR_OPTIONS=.*!DROPBEAR_OPTIONS="-b /etc/dropbear/banner"!' \ + $ROOTFS/etc/daemons.conf +fi + +# Fix Apache config +sed -i '/#ServerName/ { + a\ServerName localhost +}' $ROOTFS/etc/apache/httpd.conf + +# +#sed -i 's/DirectoryMatch/Directory/' $ROOTFS/etc/apache/conf.d/phpmyadmin + +# Remove extra files +rm -rf $ROOTFS/etc/apache/phpinfo +rm -rf $ROOTFS/usr/share/applications/lua.* +rm -rf $ROOTFS/usr/share/applications/sqlite.* +rm -rf $ROOTFS/usr/share/applications/gtkdialog.* +rm -rf $ROOTFS/usr/share/applications/php.* +rm -rf $ROOTFS/usr/share/applications/dialog.* + +# Default config +sed -i 's/tazweb/midori/' $ROOTFS/etc/slitaz/applications.conf +sed -i 's/tazweb/midori/' $ROOTFS/usr/share/lxpanel/profile/default/panels/panel +sed -i 's/tazweb/midori/' $ROOTFS/etc/lxpanel/default/panels/panel +sed -i 's/tazweb/midori/' $ROOTFS/etc/lxpanel/original/panels/panel + +# Add shorcut on the Desktop +#cp $ROOTFS/usr/share/applications/dolibarr.desktop $ROOTFS/etc/skel/Desktop diff -r 8c447807f5ed -r b51b9432c525 proxy/packages.list --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/proxy/packages.list Thu Mar 15 00:56:34 2012 +0100 @@ -0,0 +1,214 @@ +915resolution +acl +alsa-lib +alsaplayer +alsa-utils +asunder +atk +atkmm +attr +busybox +bzlib +cairo +cairomm +cdparanoia-III +cdrkit +clearlooks +cookutils +dbus +dbus-glib +depmod +desktop-file-utils +dialog +dropbear +e2fsprogs +enchant +epdfview +expat +firmware-rt2x00 +fontconfig +freetype +fuse +galculator +gamin +gcc-lib-base +gcolor2 +gdk-pixbuf +gettext-base +glib +glibc-base +glibmm +gparted +gpxe +grub4dos-linux +gtk+ +gtkdialog +gtkmm +hal +hardinfo +hicolor-icon-theme +isapnptools +isomaster +jpeg +kbd-base +lcms +leafpad +libcap +libcddb +libcomerr +libcrypto +libgcrypt +libgio +libgiomm +libglade +libgnutls +libgpg-error +libjpeg +libmad +libnotify +libogg +libpng +libsexy +libsigc++ +libsoup +libsqlite +libssl +libtasn1 +libtaz +libunique +libusb +libusb-compat +libvorbis +libwebkit +libxcb +libxml2 +libxslt +linux +linux-crypto +linux-firmware +linux-sound +linux-wireless +locale-de +locale-es +locale-fr +locale-it +locale-pt_BR +lxappearance +lxpanel +lxrandr +lxtask +lzlib +lzma +menu-cache +midori +mtpaint +nano +ncurses +ncurses-common +ncursesw +ntfs-3g +ntfsprogs +obconf +openbox +pango +pangomm +parcellite +parted +pciutils +pcmanfm +pcmciautils +pcre +pixman +poppler +popt +readline +retawq +shared-mime-info +slim +slitaz-base-files +slitaz-boot-scripts +slitaz-configs +slitaz-configs-base +slitaz-doc +slitaz-icon +slitaz-menus +slitaz-polar-cursors +slitaz-tools +slitaz-tools-boxes +sqlite +startup-notification +sysfsutils +syslinux +syslinux-extra +tazlito +tazpanel +tazpkg +tazusb +tazwikiss +tazweb +tiff +transset-df +ttf-dejavu +udev +util-linux-ng-blkid +util-linux-ng-getopt +util-linux-ng-uuid +viewnior +wireless_tools +wpa_supplicant +xcb-util +xorg +xorg-base-fonts +xorg-libfontenc +xorg-libICE +xorg-libpciaccess +xorg-libSM +xorg-libX11 +xorg-libXau +xorg-libXaw +xorg-libXcomposite +xorg-libXcursor +xorg-libXdamage +xorg-libXdmcp +xorg-libXext +xorg-libXfixes +xorg-libXfont +xorg-libXft +xorg-libXi +xorg-libXinerama +xorg-libxkbfile +xorg-libXmu +xorg-libXpm +xorg-libXrandr +xorg-libXrender +xorg-libXss +xorg-libXt +xorg-libXtst +xorg-libXxf86vm +xorg-rgb +xorg-server +xorg-setxkbmap +xorg-xauth +xorg-xcompmgr +xorg-xf86-input-evdev +xorg-xf86-input-synaptics +xorg-xf86-video-geode +xorg-xf86-video-intel +xorg-xf86-video-nv +xorg-xf86-video-vesa +xorg-xkbcomp +xorg-xkeyboard-config +xterm +yad +zlib +logrotate +sudo +squid +squid-auth-helpers +squid-langpack +squidguard +squidclamav +sarg +tor +lighttpd + diff -r 8c447807f5ed -r b51b9432c525 proxy/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/proxy/receipt Thu Mar 15 00:56:34 2012 +0100 @@ -0,0 +1,7 @@ +# SliTaz flavor receipt. + +FLAVOR="proxy" +SHORT_DESC="Content Web filtering server" +VERSION="1.0" +MAINTAINER="erjo@slitaz.org" + diff -r 8c447807f5ed -r b51b9432c525 proxy/rootcd/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/proxy/rootcd/README Thu Mar 15 00:56:34 2012 +0100 @@ -0,0 +1,26 @@ +README SliTaz GNU/Linux CD +=============================================================================== + + +Check the index.html page for more information + + +LICENSE +------- + +Copyright (c) 2006-2012 SliTaz GNU/Linux + +SliTaz is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +SliTaz 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with SliTaz; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 +USA diff -r 8c447807f5ed -r b51b9432c525 proxy/rootcd/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/proxy/rootcd/index.html Thu Mar 15 00:56:34 2012 +0100 @@ -0,0 +1,84 @@ + + + + SliTaz GNU/Linux - CD + + + + + + + + + + +
+ + +
+

LiveCD information

+ +

English

+

+ Welcome to the SliTaz GNU/Linux cdrom. To boot SliTaz from a cdrom + just burn the ISO image onto a blank disc. Then reboot your computer + with the disc in your cdrom drive. +

+

+ SliTaz is a micro GNU/Linux distro using BusyBox, a Linux kernel, + and GNU free software. SliTaz also uses goodies from the Debian + project. The goal of SliTaz is to have a GNU/Linux distro working + entirely in memory (RAM) and fully installable to a HD for desktop or + server usage. +

+

+ On the system you will find documentation in /usr/share/doc and the + full GPL license in /usr/share/licenses. +

+ +

Français

+

+ Bienvenue sur la page d'index d'un cdrom de SliTaz GNU/Linux. + Vous devez démarrez votre ordinateur avec le cdrom dans le lecteur + CD ou DVD, pour lancer SliTaz en RAM et sans risques pour la + machine hôte. +

+

+ SliTaz peut fonctionner des mois entiers sans redémarrer, le système + peut fonctionner dans 144 Mb de mémoire vive et sur des machines + sans disque dur. Mais SliTaz est aussi pleinement installable sur + un disque dur et largement extensible via le gestionnaire de + paquets et la compilation de nouvelles applications depuis les + sources. +

+ + +
+ + + + + + diff -r 8c447807f5ed -r b51b9432c525 proxy/rootcd/style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/proxy/rootcd/style.css Thu Mar 15 00:56:34 2012 +0100 @@ -0,0 +1,77 @@ +/* CSS style for SliTaz GNU/Linux generic xHTML files. */ + +html { min-height: 102%; } + +body { + background: #ffffff; + color: black; + font: 13px sans-serif, vernada, arial; + margin: 0; + min-width: 640px; +} + +a { text-decoration: underline; color: #215090; } +a:hover { text-decoration: none; color: blue; } +img { border: 0pt none; vertical-align: middle; } +h2 { color: #444; } +h3 { color: #666; font-size: 140%; } + +#header { + height: 40px; + background: #351a0a; +} + +#header h1 { + margin: 0; + padding: 8px 0 0 8px; + width: 250px; + color: white; + font-size: 20px; + font-style: italic; +} + +#header h1 a { + color: white; + text-decoration: none; + font-size: 20px; + font-style: italic; +} + +#header h1 a:hover, #network a:hover { + color: #d66018; +} + +#network { + float: right; + padding: 12px 5px 0; + font-size: 12px; +} + +#network a { padding: 0 6px; } + +#network a { + color: #fff; + font-weight: bold; + text-decoration: none; +} + +#block { + min-height: 8px; + background: #d66018; + padding: 0; + border-bottom: 1px solid #f5f5f5; +} + +#content { + padding: 30px 80px; + text-align: justify; +} + +#footer { + text-align: center; + border-top: 1px solid #ddd; + padding: 40px; + color: #666; +} + +#footer a { color: #666; padding: 0 2px; } diff -r 8c447807f5ed -r b51b9432c525 proxy/rootfs/usr/bin/tazctl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/proxy/rootfs/usr/bin/tazctl Thu Mar 15 00:56:34 2012 +0100 @@ -0,0 +1,227 @@ +#!/bin/sh +# Tazadmin - SliTaz System Configuration +# +# +# Author : Eric Joseph-Alexandre (Erjo) +# + +#export DIALOGRC=$PWD/rc/slackware.rc + +VERSION=1.0 + +: ${DIALOG=dialog} + +BACKTITLE="SliTaz Configuration Tools v.${VERSION}" +COMMAND=$1 +LOG=/tmp/$(basename $0).log +OUT=/tmp/_retval_ +DATADIR=/usr/share/slitaz-tools/tazadmin/ +#DATADIR=./ + +BS="15 50" + +# Messages language setting +# Switch to default English if $LANG.msg doesn't exist. +set_locale() +{ + if [ -f ${LANG%%_*}.msg ]; then + . ${DATADIR}${LANG%%_*}.msg + fi +} + +# use --msgbox. +# syntax: msg ["Title"] "Message text" +msg() +{ + if [ $# -gt 1 ]; then + TITLE=$1 + shift + MSG="$@" + else + MSG="$@" + fi + $DIALOG --title " ${TITLE:-Message} " \ + --colors --backtitle "$BACKLIST" \ + --clear --msgbox "\n$MSG" 0 0 +} + +# Exit install if user is not root. +check_root() +{ + if test $(id -u) != 0 ; then + error_message "$ERR_CHK_ROOT" + exit 0 + fi +} + +# functions +# +trim(){ + read LINE + echo $LINE +} + +get_argc() +{ + echo $# +} + + + + +get_hostname() +{ + # Set hostname + HOSTNAME=$(cat /etc/hostname) + exec 3>&1 + HOSTNAME=`$DIALOG --backtitle "$BACKTITLE" --title "Hostname" --clear \ + --inputbox "Enter your computer hostname" $BS "${HOSTNAME}" 2>&1 1>&3` + ret=$? + exec 3>&- + # if $HOSTNAME is set we update /etc/hostname + # and change current hostname. + if [ ! -z ${HOSTNAME} ]; then + echo ${HOSTNAME} > /etc/hostname + hostname $(cat /etc/hostname) + fi +} + +set_ip_adress() +{ + # Set static configuration for Network. + . /etc/network.conf + exec 3>&1 + IPCONFIG=`$DIALOG --ok-label "Submit" \ + --backtitle "$backtitle" --extra-button --extra-label "${BTN_DHCP:-Use DHCP server}"\ + --form "Here is a possible piece of a configuration program." \ + 15 55 0 \ + "IP Adress:" 1 1 "$IP" 1 20 20 0 \ + "Network mask:" 2 1 "$NETMASK" 2 20 20 0 \ + "Default gateway:" 3 1 "$GATEWAY" 3 20 20 0 \ + "DNS server(s):" 4 1 "$DNS_SERVER" 4 20 20 0 \ + 2>&1 1>&3` + ret=$? + exec 3>&- + + case "$ret" in + 0) + if [[ "`get_argc $IPCONFIG`" -gt "1" ]]; then + set_static_ip $IPCONFIG + else + msg "${ERR_BED_IP:-Invalid values.}" + fi + ;; + 3) + get_dhcp_lease ;; + esac +} + +get_dhcp_lease() +{ + sed -i 's/DHCP=.*/DHCP="yes"/' /etc/network.conf + sed -i 's/STATIC=.*/STATIC="no"/' /etc/network.conf + /sbin/udhcpc -b -i $INTERFACE -p /var/run/udhcpc.$INTERFACE.pid & +} + +set_static_ip() +{ + sed -i 's/DHCP=.*/DHCP="no"/' /etc/network.conf + sed -i 's/STATIC=.*/STATIC="yes"/' /etc/network.conf + sed -i -e "s/IP=".*"/IP=\"$1\"/" /etc/network.conf + sed -i -e "s/NETMASK=".*"/NETMASK=\"$2\"/" /etc/network.conf + sed -i -e "s/GATEWAY=".*"/GATEWAY=\"$3\"/" /etc/network.conf + sed -i -e "s/DNS_SERVER=".*"/DNS_SERVER=\"$4\"/" /etc/network.conf +} + +network_menu() +{ + ret=0 + until [ $ret -eq 1 ];do + $DIALOG --title "$MENU_TITLE" \ + --backtitle "$BACKTITLE" --clear \ + --cancel-label "Quitter" \ + --colors \ + --menu "$TAZ_CMD_MSG" 15 50 40\ + "adress" " Network settings" \ + "hostname" " Set your hostname" \ + 2> $OUT + ret=$? + case `cat $OUT` in + hostname) + get_hostname ;; + adress) + set_ip_adress ;; + esac + done +} + +set_password() +{ + SEP=' +' + exec 3>&1 + PASSWORD=`$DIALOG --backtitle "$BACKTITLE" --title "Set password" --clear \ + --separate-widget "$SEP" \ + --insecure --passwordbox "Enter new password for user below: \n\n" 10 50 \ + --title "Confirme password" \ + --insecure --passwordbox "Confirme new password for user below: \n\n" 10 50 2>&1 1>&3` + ret=$? + exec 3>&- + if [ -z "${PASSWORD}" ]; then + msg "Password not set" + else + PASS1="$(echo $PASSWORD | cut -d ' ' -f1)" + PASS2="$(echo $PASSWORD | cut -d ' ' -f2)" + if [ "$PASS1" != "$PASS2" ]; then + msg "Passwords don't match.\nNothing change." + else + echo "root:$PASS1" | chpasswd + fi + fi +} + +## +# Program sequence +# +set_locale +check_root + +until [ $retval -eq 1 ];do + $DIALOG --title "$MENU_TITLE" \ + --backtitle "$BACKTITLE" --clear \ + --cancel-label "Quitter" \ + --colors \ + --menu "$TAZ_CMD_MSG" 15 50 40\ + "keymap" " Keyboard mapping" \ + "locale" " Language setting" \ + "network" " Netwok configuration" \ + "password" " Change root password" \ + 2> $OUT + + retval=$? + + # Execute commands + # + case `cat $OUT` in + keymap) + if [ -x /sbin/tazkeymap ]; then + tazkeymap + else + msg "Unable to find tazkeymap !" + fi + ;; + locale) + if [ -x /sbin/tazlocale ]; then + tazlocale + else + msg "Unable to find tazlocale !" + fi + ;; + network) + network_menu;; + password) + set_password ;; + esac +done + +exit 0