From 8d737ca01945665a9deb4566d355991e0650e564 Mon Sep 17 00:00:00 2001 From: milisarge Date: Tue, 18 Apr 2017 08:05:09 +0300 Subject: [PATCH 01/21] talimat.py --- bin/talimat.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/talimat.py b/bin/talimat.py index 91698f598..e6d6cc430 100755 --- a/bin/talimat.py +++ b/bin/talimat.py @@ -33,6 +33,8 @@ import shlex # Milis linux talimat sınıfı class Talimat(): + talimatname="/sources/milis.git/talimatname/" + def __init__(self): self.tanim="" self.url="" @@ -66,7 +68,10 @@ class Talimat(): def _gerekler(self): gerekstr="" for gerek in self.gerekler: - gerekstr+=gerek+" " + if os.path.exists(self.talimatname+"temel-ek/"+gerek) is False and os.path.exists(self.talimatname+"temel/"+gerek) is False: + gerekstr+=gerek+" " + if os.path.exists(self.talimatname+"genel/"+gerek) is False: + print renk.uyari+gerek+" talimatı yapılmalı!"+renk.son return gerekstr def _kaynaklar(self): @@ -102,8 +107,8 @@ class Talimat(): def olustur(self): if self.isim: - print self.isim - os.system("mkdir "+self.isim) + print renk.tamamb+self.isim+" talimatı hazırlanıyor..."+renk.son + os.system("mkdir -p "+self.isim) open(self.isim+"/talimat","w").write(self.icerik()) def icerik(self): From e811e2b4b2f6f0a583f5421518017253b6478a7f Mon Sep 17 00:00:00 2001 From: milisarge Date: Tue, 18 Apr 2017 15:37:54 +0300 Subject: [PATCH 02/21] talimat.py --- bin/talimat.py | 52 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/bin/talimat.py b/bin/talimat.py index e6d6cc430..6187ef6e3 100755 --- a/bin/talimat.py +++ b/bin/talimat.py @@ -29,6 +29,7 @@ import sys import re import os import shlex +import urllib2 # Milis linux talimat sınıfı class Talimat(): @@ -41,6 +42,7 @@ class Talimat(): self.paketci="" self.gerekler=[] self.isim="" + self._isim="" self.surum="" self.devir="" self.kaynaklar=[] @@ -52,13 +54,17 @@ class Talimat(): self.tanim=pkgbuild.description self.url=pkgbuild.url self.paketci="milisarge" - for mgerek in pkgbuild.makedepends: - if mgerek not in self.gerekler: - self.gerekler.append(mgerek) - for gerek in pkgbuild.depends: - if gerek not in self.gerekler: - self.gerekler.append(gerek) + if hasattr(pkgbuild, 'makedepends'): + for mgerek in pkgbuild.makedepends: + if mgerek not in self.gerekler: + self.gerekler.append(mgerek) + if hasattr(pkgbuild, 'depends'): + for gerek in pkgbuild.depends: + if gerek not in self.gerekler: + self.gerekler.append(gerek) self.isim=pkgbuild.name + if hasattr(pkgbuild, '_name'): + self._isim=pkgbuild._name self.surum=pkgbuild.version self.devir=pkgbuild.release self.kaynaklar=pkgbuild.sources @@ -119,6 +125,8 @@ class Talimat(): icerikstr+="# Depends on: "+self._gerekler() icerikstr+="\n"+"\n" icerikstr+="name="+self.isim+"\n" + if self._isim !="": + icerikstr+="_name="+self._isim+"\n" icerikstr+="version="+str(self.surum)+"\n" icerikstr+="release="+str(self.devir)+"\n" icerikstr+="source=("+self._kaynaklar()+")" @@ -130,6 +138,7 @@ class Talimat(): def cevir(self,dosya,tip="arch"): self.ice_aktar(dosya,tip) self.olustur() + print renk.tamamy+talimat.isim+" talimatı hazır."+renk.son # archlinux pkgbuild sınıfı @@ -154,6 +163,7 @@ class PKGBUILD(): # Symbol lookup table self._var_map = { 'pkgname': 'name', + '_pkgname': '_name', 'pkgver': 'version', 'pkgdesc': 'description', 'pkgrel': 'release', @@ -287,13 +297,37 @@ class renk: kalin = '\033[1m' altcizgili = '\033[4m' + +class Arge: + + def indir(self,link): + paket=link.split("?h=")[1] + print renk.tamamb+paket+" indiriliyor..."+renk.son + veri = urllib2.urlopen(link) + open(paket+"_pkgbuild","w").write(veri.read()) + return paket+"_pkgbuild" + + def aur_link(self,paket): + link="https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h="+paket + return link + if __name__ == '__main__': if len(sys.argv) > 1: dosya=sys.argv[1] + talimat=Talimat() + arge=Arge() if os.path.exists(dosya): - talimat=Talimat() talimat.cevir(dosya) - print renk.tamamy+talimat.isim+" talimatı hazır."+renk.son + elif "https" in dosya or "http" in dosya: + Pdosya=arge.indir(dosya) + talimat.cevir(Pdosya) + elif dosya == "-a": + if len(sys.argv) > 2: + paket=sys.argv[2] + paket=str(paket) + link=arge.aur_link(paket) + dosya=arge.indir(link) + talimat.cevir(dosya) else: - print renk.hata+dosya+" dosyası bulunamadı!"+renk.son + print renk.hata+dosya+" paremetre bulunamadı!"+renk.son From 0a04ae28ea37d72a4cf1605cdbd62e167c5ca57d Mon Sep 17 00:00:00 2001 From: milisarge Date: Tue, 18 Apr 2017 16:00:29 +0300 Subject: [PATCH 03/21] talimat.py --- bin/talimat.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/bin/talimat.py b/bin/talimat.py index 6187ef6e3..0edf03577 100755 --- a/bin/talimat.py +++ b/bin/talimat.py @@ -30,6 +30,7 @@ import re import os import shlex import urllib2 +from requests.exceptions import HTTPError # Milis linux talimat sınıfı class Talimat(): @@ -95,7 +96,7 @@ class Talimat(): blok=False onblok=False for satir in satirlar: - if "md5sums=(" in satir: + if "md5sums=(" in satir or "sha256sums=('": onblok=True if onblok is True and "')" in satir: blok=True @@ -303,10 +304,14 @@ class Arge: def indir(self,link): paket=link.split("?h=")[1] print renk.tamamb+paket+" indiriliyor..."+renk.son - veri = urllib2.urlopen(link) - open(paket+"_pkgbuild","w").write(veri.read()) - return paket+"_pkgbuild" - + try: + veri = urllib2.urlopen(link) + open(paket+"_pkgbuild","w").write(veri.read()) + return paket+"_pkgbuild" + except urllib2.HTTPError, e: + if e.code == 404: + print renk.hata+link+" bulunamadı!"+renk.son + return None def aur_link(self,paket): link="https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h="+paket return link @@ -328,6 +333,7 @@ if __name__ == '__main__': paket=str(paket) link=arge.aur_link(paket) dosya=arge.indir(link) - talimat.cevir(dosya) + if link and dosya: + talimat.cevir(dosya) else: print renk.hata+dosya+" paremetre bulunamadı!"+renk.son From d3719344c18333c9ac1196dd305d9dcef5741729 Mon Sep 17 00:00:00 2001 From: milisarge Date: Tue, 18 Apr 2017 17:57:31 +0300 Subject: [PATCH 04/21] talimat.py --- bin/talimat.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/talimat.py b/bin/talimat.py index 0edf03577..9b752df5b 100755 --- a/bin/talimat.py +++ b/bin/talimat.py @@ -96,18 +96,20 @@ class Talimat(): blok=False onblok=False for satir in satirlar: - if "md5sums=(" in satir or "sha256sums=('": + if "md5sums=(" in satir or "sha256sums=('" in satir: onblok=True if onblok is True and "')" in satir: blok=True continue if blok and satir.rstrip()!="" and satir.rstrip()!="}": if (satir not in self.derleme) and ("pkgver()" not in satir) and ("prepare()" not in satir) and ("build()" not in satir) and ("package()" not in satir): + ''' satir=satir.replace("pkgdir","PKG") satir=satir.replace("srcdir","SRC") satir=satir.replace("pkgname","name") satir=satir.replace("pkgver","version") satir=satir.replace("pkgrel","release") + ''' self.derleme+=satir+"\n" else: return "blok için gecersiz tip!" @@ -302,7 +304,10 @@ class renk: class Arge: def indir(self,link): - paket=link.split("?h=")[1] + if "packages/" in link: + paket=link.split("?h=packages/")[1] + else: + paket=link.split("?h=")[1] print renk.tamamb+paket+" indiriliyor..."+renk.son try: veri = urllib2.urlopen(link) From fcf5c3c40b5f62d87f84e0bf4d4ad403e81330c6 Mon Sep 17 00:00:00 2001 From: milisarge Date: Tue, 18 Apr 2017 18:41:47 +0300 Subject: [PATCH 05/21] vuurmuur.paketlendi --- talimatname/genel/libnetfilter_log/talimat | 18 +++ .../sync_with_kernel_headers.patch | 110 +++++++++++++++++ talimatname/genel/libnfnetlink/talimat | 18 +++ talimatname/genel/vuurmuur/modules.conf | 3 + talimatname/genel/vuurmuur/talimat | 110 +++++++++++++++++ talimatname/genel/vuurmuur/vuurmuur_servis.rc | 114 ++++++++++++++++++ 6 files changed, 373 insertions(+) create mode 100644 talimatname/genel/libnetfilter_log/talimat create mode 100644 talimatname/genel/libnfnetlink/sync_with_kernel_headers.patch create mode 100644 talimatname/genel/libnfnetlink/talimat create mode 100644 talimatname/genel/vuurmuur/modules.conf create mode 100644 talimatname/genel/vuurmuur/talimat create mode 100644 talimatname/genel/vuurmuur/vuurmuur_servis.rc diff --git a/talimatname/genel/libnetfilter_log/talimat b/talimatname/genel/libnetfilter_log/talimat new file mode 100644 index 000000000..2fbeaddad --- /dev/null +++ b/talimatname/genel/libnetfilter_log/talimat @@ -0,0 +1,18 @@ +# Description: kernel paket filtresi tarafından günlüğe kaydedilen paketlere arabirim sağlayan bir kullanıcı alanı kütüphanesi. +# URL: http://netfilter.org/projects/libnetfilter_log/ +# Packager: milisarge +# Depends on: libnfnetlink + +name=libnetfilter_log +version=1.0.1 +release=1 +source=(http://www.netfilter.org/projects/$name/files/$name-$version.tar.bz2) + +build() { + cd $name-$version + ./configure \ + --prefix=/usr \ + --disable-static + make + make DESTDIR=$PKG install +} diff --git a/talimatname/genel/libnfnetlink/sync_with_kernel_headers.patch b/talimatname/genel/libnfnetlink/sync_with_kernel_headers.patch new file mode 100644 index 000000000..985b3711e --- /dev/null +++ b/talimatname/genel/libnfnetlink/sync_with_kernel_headers.patch @@ -0,0 +1,110 @@ +From 7a1a07c0028a1c88cd7716a058697c552a563b24 Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Sat, 16 May 2015 14:49:07 +0200 +Subject: include: Sync with kernel headers + +Signed-off-by: Felix Janda +Signed-off-by: Pablo Neira Ayuso +--- + include/libnfnetlink/linux_nfnetlink.h | 44 ++++----------------------- + include/libnfnetlink/linux_nfnetlink_compat.h | 12 ++++---- + 2 files changed, 12 insertions(+), 44 deletions(-) + +diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h +index 76a8550..44a38d6 100644 +--- a/include/libnfnetlink/linux_nfnetlink.h ++++ b/include/libnfnetlink/linux_nfnetlink.h +@@ -25,9 +25,9 @@ enum nfnetlink_groups { + /* General form of address family dependent message. + */ + struct nfgenmsg { +- u_int8_t nfgen_family; /* AF_xxx */ +- u_int8_t version; /* nfnetlink version */ +- u_int16_t res_id; /* resource id */ ++ __u8 nfgen_family; /* AF_xxx */ ++ __u8 version; /* nfnetlink version */ ++ __be16 res_id; /* resource id */ + }; + + #define NFNETLINK_V0 0 +@@ -46,40 +46,8 @@ struct nfgenmsg { + #define NFNL_SUBSYS_CTNETLINK_EXP 2 + #define NFNL_SUBSYS_QUEUE 3 + #define NFNL_SUBSYS_ULOG 4 +-#define NFNL_SUBSYS_COUNT 5 ++#define NFNL_SUBSYS_OSF 5 ++#define NFNL_SUBSYS_IPSET 6 ++#define NFNL_SUBSYS_COUNT 7 + +-#ifdef __KERNEL__ +- +-#include +-#include +-#include +- +-struct nfnl_callback +-{ +- int (*call)(struct sock *nl, struct sk_buff *skb, +- struct nlmsghdr *nlh, struct nlattr *cda[]); +- const struct nla_policy *policy; /* netlink attribute policy */ +- const u_int16_t attr_count; /* number of nlattr's */ +-}; +- +-struct nfnetlink_subsystem +-{ +- const char *name; +- __u8 subsys_id; /* nfnetlink subsystem ID */ +- __u8 cb_count; /* number of callbacks */ +- const struct nfnl_callback *cb; /* callback for individual types */ +-}; +- +-extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); +-extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); +- +-extern int nfnetlink_has_listeners(unsigned int group); +-extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, +- int echo); +-extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); +- +-#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ +- MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) +- +-#endif /* __KERNEL__ */ + #endif /* _NFNETLINK_H */ +diff --git a/include/libnfnetlink/linux_nfnetlink_compat.h b/include/libnfnetlink/linux_nfnetlink_compat.h +index e145176..74b9e55 100644 +--- a/include/libnfnetlink/linux_nfnetlink_compat.h ++++ b/include/libnfnetlink/linux_nfnetlink_compat.h +@@ -1,6 +1,8 @@ + #ifndef _NFNETLINK_COMPAT_H + #define _NFNETLINK_COMPAT_H +-#ifndef __KERNEL__ ++ ++#include ++ + /* Old nfnetlink macros for userspace */ + + /* nfnetlink groups: Up to 32 maximum */ +@@ -18,10 +20,9 @@ + * ! nfnetlink use the same attributes methods. - J. Schulist. + */ + +-struct nfattr +-{ +- u_int16_t nfa_len; +- u_int16_t nfa_type; /* we use 15 bits for the type, and the highest ++struct nfattr { ++ __u16 nfa_len; ++ __u16 nfa_type; /* we use 15 bits for the type, and the highest + * bit to indicate whether the payload is nested */ + }; + +@@ -57,5 +58,4 @@ struct nfattr + + NLMSG_ALIGN(sizeof(struct nfgenmsg)))) + #define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg)) + +-#endif /* ! __KERNEL__ */ + #endif /* _NFNETLINK_COMPAT_H */ +-- +cgit v0.12 + diff --git a/talimatname/genel/libnfnetlink/talimat b/talimatname/genel/libnfnetlink/talimat new file mode 100644 index 000000000..5d0046540 --- /dev/null +++ b/talimatname/genel/libnfnetlink/talimat @@ -0,0 +1,18 @@ +# Description: Netfilter kernel/userspace iletişim kütüphnesi +# URL: http://www.netfilter.org/projects/libnfnetlink/index.html +# Packager: milisarge +# Depends on: + +name=libnfnetlink +version=1.0.1 +release=1 +source=(http://www.netfilter.org/projects/$name/files/$name-$version.tar.bz2 + sync_with_kernel_headers.patch) + +build() { + cd $name-$version + patch -p1 -i $SRC/sync_with_kernel_headers.patch + ./configure --prefix=/usr + make + make DESTDIR=$PKG install +} diff --git a/talimatname/genel/vuurmuur/modules.conf b/talimatname/genel/vuurmuur/modules.conf new file mode 100644 index 000000000..eda78a036 --- /dev/null +++ b/talimatname/genel/vuurmuur/modules.conf @@ -0,0 +1,3 @@ +# modules loaded by vuurmuur daemon +# ip_queue => not found +MODULES_TO_LOAD="ip_tables iptable_filter iptable_mangle iptable_nat ip_conntrack ipt_state ip_conntrack_ftp ip_nat_ftp" diff --git a/talimatname/genel/vuurmuur/talimat b/talimatname/genel/vuurmuur/talimat new file mode 100644 index 000000000..b94acc1d1 --- /dev/null +++ b/talimatname/genel/vuurmuur/talimat @@ -0,0 +1,110 @@ +# Description: iptables ayarlamaları için güçlü bir arayüz uygulaması +# URL: http://www.vuurmuur.org +# Packager: milisarge +# Depends on: libnetfilter_log iptables libjpeg-turbo + +name=vuurmuur +_name=Vuurmuur +version=0.7 +release=1 +source=(ftp://ftp.vuurmuur.org/releases/$version/$_name-$version.tar.gz + modules.conf + vuurmuur_servis.rc +) + +build() { +cd ${SRC}/${_name}-${version} + + for archive in libvuurmuur vuurmuur vuurmuur_conf; do + [[ ! -d "$archive" ]] && + tar xzf ${archive}-${version}.tar.gz + done + + echo "vuurmuur kütüphaneleri derleniyor..." + pushd libvuurmuur-${version} + ./configure --prefix=/usr --sysconfdir=/etc + make + popd + + echo "vuurmuur derleniyor..." + pushd vuurmuur-${version} + sed -i 's|-rpath|-rpath-link|' configure + LDFLAGS+="-L${SRC}/${_name}-${version}/lib${name}-${version}/src \ + -L${SRC}/${_name}-${version}/lib${name}-${version}/src/.libs \ + -Wl,-rpath=/usr/lib/${name}/plugins" \ + ./configure --prefix=/usr --sysconfdir=/etc \ + --with-libvuurmuur-includes="${SRC}/${_name}-${version}/lib${name}-${version}/src" \ + --with-libvuurmuur-libraries="${SRC}/${_name}-${version}/lib${name}-${version}/src" + make + popd + + echo "vuurmuur_conf derleniyor..." + pushd vuurmuur_conf-${version} + sed -i 's|-rpath|-rpath-link|' configure + LDFLAGS+="-L${SRC}/${_name}-${version}/lib${name}-${version}/src \ + -L${SRC}/${_name}-${version}/lib${name}-${version}/src/.libs \ + -Wl,-rpath=/usr/lib/${name}/plugins" \ + ./configure --prefix=/usr --sysconfdir=/etc \ + --with-libvuurmuur-includes="${SRC}/${_name}-${version}/lib${name}-${version}/src" \ + --with-libvuurmuur-libraries="${SRC}/${_name}-${version}/lib${name}-${version}/src" + make + popd + pushd libvuurmuur-${version} + make DESTDIR=${PKG} install + popd + + pushd vuurmuur-${version} + make DESTDIR=${PKG} install + popd + + pushd vuurmuur_conf-${version} + make DESTDIR=${PKG} install + popd + + # dizin yapısı + install -dm700 ${PKG}/etc/${name} + install -dm700 ${PKG}/etc/${name}/plugins + install -dm700 ${PKG}/etc/logrotate.d/ + install -dm755 ${PKG}/usr/share/${name}/textdir/{interfaces,services,zones,rules} + install -dm700 ${PKG}/var/log/${name} + + # daemon ve log + install -Dm755 ${SRC}/vuurmuur_servis.rc ${PKG}/etc/rc.d/init.d/${name} + install -Dm644 ${PKG}/usr/share/${name}/scripts/vuurmuur-logrotate ${PKG}/etc/logrotate.d/${name} + + # ayarlar /etc + install -Dm600 ${PKG}/usr/share/vuurmuur/config/config.conf.sample \ + ${PKG}/etc/${name}/config.conf + install -Dm600 ${SRC}/modules.conf ${PKG}/etc/${name}/modules.conf + install -Dm600 ${PKG}/usr/share/vuurmuur/config/vuurmuur_conf.conf.sample \ + ${PKG}/etc/${name}/${name}_conf.conf + + sed -i ${PKG}/etc/${name}/config.conf \ + -e 's|"/sbin/tc|"/usr/sbin/tc|' \ + -e 's|"/sbin/ip6tables|"/usr/sbin/ip6tables|' \ + -e 's|"/sbin/iptables|"/usr/sbin/iptables|' \ + -e 's|"/sbin/ip6tables-restore|"/usr/sbin/ip6tables-restore|' \ + -e 's|"/sbin/iptables-restore|"/usr/sbin/iptables-restore|' \ + -e 's|"/var/log/messages|"/var/log/iptables.log|' + + sed -i ${PKG}/etc/${name}/${name}_conf.conf \ + -e 's|"/usr/bin/iptrafvol.pl|"/usr/sbin/iptrafvol.pl|' + + + echo "LOCATION=\"/etc/${name}/textdir\"" > ${PKG}/etc/${name}/plugins/textdir.conf + + # default firewall setup in /usr/share + touch ${PKG}/usr/share/${name}/textdir/rules/rules.conf + touch ${PKG}/usr/share/${name}/textdir/rules/blocklist.conf + + cp -R ${SRC}/${_name}-${version}/zones/* ${PKG}/usr/share/${name}/textdir/zones/ + mv ${PKG}/usr/share/${name}/services/* ${PKG}/usr/share/${name}/textdir/services/ + + # install licenses + install -Dm644 ${SRC}/${_name}-${version}/lib${name}-${version}/COPYING \ + ${PKG}/usr/share/licenses/lib${name}/COPYING + install -Dm644 ${SRC}/${_name}-${version}/${name}-${version}/COPYING \ + ${PKG}/usr/share/licenses/${name}/COPYING + install -Dm644 ${SRC}/${_name}-${version}/${name}_conf-${version}/COPYING \ + ${PKG}/usr/share/licenses/${name}_conf/COPYING +} diff --git a/talimatname/genel/vuurmuur/vuurmuur_servis.rc b/talimatname/genel/vuurmuur/vuurmuur_servis.rc new file mode 100644 index 000000000..3b4d3e99e --- /dev/null +++ b/talimatname/genel/vuurmuur/vuurmuur_servis.rc @@ -0,0 +1,114 @@ +#!/bin/bash +# vi: ft=sh + +. /etc/rc.conf +. /etc/rc.d/functions + +# PID file +VUURMUURPID='/run/vuurmuur.pid' +VUURMUURLOGPID='/run/vuurmuur_log.pid' +case $1 in +start) + # initialize + stat_busy "Starting Vuurmuur Firewall" + STATUS="ok" + + # check if vuurmuur is configured + IFNUM=`/usr/bin/vuurmuur_script --list --interface any | wc -l` + if [ $IFNUM = 0 ]; then + stat_busy "Please configure Vuurmuur first by defining at least one interface." + stat_fail + exit 1 + fi + + # load modules + . /etc/vuurmuur/modules.conf + for MODULE in `echo $MODULES_TO_LOAD`; do + /sbin/modprobe $MODULE &>/dev/null + if [ $? != 0 ]; then + stat_busy "Error when loading module $MODULE. Check log files." + stat_fail + exit 1 + fi + done + + # start vuurmuur daemon + if [ ! -f $VUURMUURPID ]; then + /usr/bin/vuurmuur -l + if [ $? != 0 ]; then + stat_busy "Error when starting Vuurmuur daemon. Check log files." + STATUS="failed" + fi + else + PID=`cat $VUURMUURPID | cut -d " " -f 1` + stat_busy "Error when starting Vuurmuur daemon. Already running at pid $PID." + STATUS="failed" + fi + + # start vuurmuur log parsing daemon + if [ ! -f $VUURMUURLOGPID ]; then + /usr/bin/vuurmuur_log + if [ $? != 0 ]; then + stat_busy "Error when starting Vuurmuur log parsing daemon. Check log files." + STATUS="failed" + fi + else + PID=`cat $VUURMUURLOGPID | cut -d " " -f 1` + stat_busy "Error when starting Vuurmuur log parsing daemon. Already running at pid $PID." + STATUS="failed" + fi + + # finalize + if [ $STATUS = "ok" ]; then + add_daemon vuurmuur + stat_done + else + stat_fail + exit 1 + fi + ;; + +stop) + # initialize + stat_busy "Stopping Vuurmuur Firewall" + STATUS="ok" + + # stop vuurmuur log parsing daemon + PID=`cat $VUURMUURLOGPID | cut -d " " -f 1` + if [[ ! -z $PID ]] && kill "$PID" &>/dev/null; then + rm -f $VUURMUURLOGPID + else + stat_busy "Error when stopping Vuurmuur log parsing daemon. Check log files." + STATUS="failed" + fi + + # stop vuurmuur daemon + PID=`cat $VUURMUURPID | cut -d " " -f 1` + if [[ ! -z $PID ]] && kill "$PID" &>/dev/null; then + rm -f $VUURMUURPID + else + stat_busy "Error when stopping Vuurmuur daemon. Check log files." + STATUS="failed" + fi + + # finalize + if [ $STATUS = "ok" ]; then + rm_daemon vuurmuur + stat_done + else + stat_fail + exit 1 + fi + ;; + +restart) + $0 stop + $0 start + ;; + +*) + echo "Usage: $0 {start|stop|restart}" >&2 + exit 1 + +esac +exit 0 From 3b765158f7c2377f859e27a36391f1dc4120bab4 Mon Sep 17 00:00:00 2001 From: milisarge Date: Tue, 18 Apr 2017 20:02:37 +0300 Subject: [PATCH 06/21] vuurmuur.paketlendi --- talimatname/genel/vuurmuur/modules.conf | 3 - talimatname/genel/vuurmuur/talimat | 251 +++++++++++------- talimatname/genel/vuurmuur/vuurmuur_servis.rc | 114 -------- 3 files changed, 161 insertions(+), 207 deletions(-) delete mode 100644 talimatname/genel/vuurmuur/modules.conf delete mode 100644 talimatname/genel/vuurmuur/vuurmuur_servis.rc diff --git a/talimatname/genel/vuurmuur/modules.conf b/talimatname/genel/vuurmuur/modules.conf deleted file mode 100644 index eda78a036..000000000 --- a/talimatname/genel/vuurmuur/modules.conf +++ /dev/null @@ -1,3 +0,0 @@ -# modules loaded by vuurmuur daemon -# ip_queue => not found -MODULES_TO_LOAD="ip_tables iptable_filter iptable_mangle iptable_nat ip_conntrack ipt_state ip_conntrack_ftp ip_nat_ftp" diff --git a/talimatname/genel/vuurmuur/talimat b/talimatname/genel/vuurmuur/talimat index b94acc1d1..ea1ac4150 100644 --- a/talimatname/genel/vuurmuur/talimat +++ b/talimatname/genel/vuurmuur/talimat @@ -5,7 +5,7 @@ name=vuurmuur _name=Vuurmuur -version=0.7 +version=0.8rc2 release=1 source=(ftp://ftp.vuurmuur.org/releases/$version/$_name-$version.tar.gz modules.conf @@ -13,98 +13,169 @@ source=(ftp://ftp.vuurmuur.org/releases/$version/$_name-$version.tar.gz ) build() { -cd ${SRC}/${_name}-${version} - - for archive in libvuurmuur vuurmuur vuurmuur_conf; do - [[ ! -d "$archive" ]] && - tar xzf ${archive}-${version}.tar.gz - done - - echo "vuurmuur kütüphaneleri derleniyor..." - pushd libvuurmuur-${version} - ./configure --prefix=/usr --sysconfdir=/etc - make - popd - - echo "vuurmuur derleniyor..." - pushd vuurmuur-${version} - sed -i 's|-rpath|-rpath-link|' configure - LDFLAGS+="-L${SRC}/${_name}-${version}/lib${name}-${version}/src \ - -L${SRC}/${_name}-${version}/lib${name}-${version}/src/.libs \ - -Wl,-rpath=/usr/lib/${name}/plugins" \ - ./configure --prefix=/usr --sysconfdir=/etc \ - --with-libvuurmuur-includes="${SRC}/${_name}-${version}/lib${name}-${version}/src" \ - --with-libvuurmuur-libraries="${SRC}/${_name}-${version}/lib${name}-${version}/src" - make - popd - - echo "vuurmuur_conf derleniyor..." - pushd vuurmuur_conf-${version} - sed -i 's|-rpath|-rpath-link|' configure - LDFLAGS+="-L${SRC}/${_name}-${version}/lib${name}-${version}/src \ - -L${SRC}/${_name}-${version}/lib${name}-${version}/src/.libs \ - -Wl,-rpath=/usr/lib/${name}/plugins" \ - ./configure --prefix=/usr --sysconfdir=/etc \ - --with-libvuurmuur-includes="${SRC}/${_name}-${version}/lib${name}-${version}/src" \ - --with-libvuurmuur-libraries="${SRC}/${_name}-${version}/lib${name}-${version}/src" - make - popd - pushd libvuurmuur-${version} - make DESTDIR=${PKG} install - popd - - pushd vuurmuur-${version} - make DESTDIR=${PKG} install - popd - - pushd vuurmuur_conf-${version} - make DESTDIR=${PKG} install - popd - - # dizin yapısı - install -dm700 ${PKG}/etc/${name} - install -dm700 ${PKG}/etc/${name}/plugins - install -dm700 ${PKG}/etc/logrotate.d/ - install -dm755 ${PKG}/usr/share/${name}/textdir/{interfaces,services,zones,rules} - install -dm700 ${PKG}/var/log/${name} - - # daemon ve log - install -Dm755 ${SRC}/vuurmuur_servis.rc ${PKG}/etc/rc.d/init.d/${name} - install -Dm644 ${PKG}/usr/share/${name}/scripts/vuurmuur-logrotate ${PKG}/etc/logrotate.d/${name} - - # ayarlar /etc - install -Dm600 ${PKG}/usr/share/vuurmuur/config/config.conf.sample \ - ${PKG}/etc/${name}/config.conf - install -Dm600 ${SRC}/modules.conf ${PKG}/etc/${name}/modules.conf - install -Dm600 ${PKG}/usr/share/vuurmuur/config/vuurmuur_conf.conf.sample \ - ${PKG}/etc/${name}/${name}_conf.conf - - sed -i ${PKG}/etc/${name}/config.conf \ - -e 's|"/sbin/tc|"/usr/sbin/tc|' \ - -e 's|"/sbin/ip6tables|"/usr/sbin/ip6tables|' \ - -e 's|"/sbin/iptables|"/usr/sbin/iptables|' \ - -e 's|"/sbin/ip6tables-restore|"/usr/sbin/ip6tables-restore|' \ - -e 's|"/sbin/iptables-restore|"/usr/sbin/iptables-restore|' \ - -e 's|"/var/log/messages|"/var/log/iptables.log|' - - sed -i ${PKG}/etc/${name}/${name}_conf.conf \ - -e 's|"/usr/bin/iptrafvol.pl|"/usr/sbin/iptrafvol.pl|' - echo "LOCATION=\"/etc/${name}/textdir\"" > ${PKG}/etc/${name}/plugins/textdir.conf + cd Vuurmuur-$version + chown -R root:root . + for file in libvuurmuur vuurmuur vuurmuur_conf ; do + tar xfvz $file-$version.tar.gz + done + chown -R root:root . + CFLAGS="$SLKCFLAGS" \ + cd libvuurmuur-$version + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc + make + mkdir -p $PKG/usr/lib + ( cd src/.libs/ + for file in libvuurmuur.a libvuurmuur.so.0.6.0 ; do + cat $file > $PKG/usr/lib/$file + done + ) + #replace "installed=no" "installed=yes" -- $PKG/usr/lib/libvuurmuur.la + mkdir -p $PKG/usr/include + ( cd src + #strip --strip-unneeded vuurmuur.h + cat vuurmuur.h > $PKG/usr/include/vuurmuur.h + ) + + cd $PKG/usr/lib + ln -s libvuurmuur.so.0.6.0 libvuurmuur.so.0 + ln -s libvuurmuur.so.0.6.0 libvuurmuur.so - # default firewall setup in /usr/share - touch ${PKG}/usr/share/${name}/textdir/rules/rules.conf - touch ${PKG}/usr/share/${name}/textdir/rules/blocklist.conf - cp -R ${SRC}/${_name}-${version}/zones/* ${PKG}/usr/share/${name}/textdir/zones/ - mv ${PKG}/usr/share/${name}/services/* ${PKG}/usr/share/${name}/textdir/services/ - # install licenses - install -Dm644 ${SRC}/${_name}-${version}/lib${name}-${version}/COPYING \ - ${PKG}/usr/share/licenses/lib${name}/COPYING - install -Dm644 ${SRC}/${_name}-${version}/${name}-${version}/COPYING \ - ${PKG}/usr/share/licenses/${name}/COPYING - install -Dm644 ${SRC}/${_name}-${version}/${name}_conf-${version}/COPYING \ - ${PKG}/usr/share/licenses/${name}_conf/COPYING + cd $SRC/Vuurmuur-$version/vuurmuur-$version + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --with-libvuurmuur-includes=$PKG/usr/include \ + --with-libvuurmuur-libraries=$PKG/usr/lib + make + mkdir -p $PKG/usr/bin + for file in vuurmuur vuurmuur_log vuurmuur_script ; do + ( cd $file + strip --strip-unneeded $file + cat $file > $PKG/usr/bin/$file + chmod 755 $PKG/usr/bin/$file + ) + done + mkdir -p $PKG/etc/rc.d/init.d + mkdir -p $PKG/etc/logrotate.d + ( cd scripts + cat rc.vuurmuur > $PKG/etc/rc.d/init.d/vuurmuur + cat vuurmuur-logrotate > $PKG/etc/logrotate.d/vuurmuur + ) + #replace "VUURMUUR_LOCATION=/usr/local/bin" "VUURMUUR_LOCATION=/usr/bin" -- $PKG/etc/rc.d/init.d/vuurmuur + chmod +x $PKG/etc/rc.d/init.d/vuurmuur + + mkdir -p $PKG/usr/man/ru/man8 + mkdir -p $PKG/usr/man/man8 + ( cd man/en + for file in vuurmuur.8 vuurmuur_log.8 vuurmuur_script.8 ; do + cat $file > $PKG/usr/man/man8/$file + done + ) + ( cd man/ru + for file in vuurmuur.8 vuurmuur_log.8 vuurmuur_script.8 ; do + cat $file > $PKG/usr/man/ru/man8/$file + done + ) + mkdir -p $PKG/usr/share/vuurmuur/scripts + ( cd scripts + cat vuurmuur-config-setup.sh > $PKG/usr/share/vuurmuur/scripts/vuurmuur-config-setup.sh + chmod 755 $PKG/usr/share/vuurmuur/scripts/vuurmuur-config-setup.sh + ) + mkdir -p $PKG/usr/share/vuurmuur/config + mkdir -p -m 700 $PKG/etc/vuurmuur + ( cd config + cat config.conf.sample > $PKG/usr/share/vuurmuur/config/config.conf.sample + cat config.conf.sample > $PKG/etc/vuurmuur/config.conf + chmod 600 $PKG/etc/vuurmuur/config.conf + ) + + mkdir -p $PKG/usr/share/vuurmuur/services + mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/services + ( cd services ; + LIST=" cvs imaps pop3 smtp upnp + dns irc msn pop3s socks usermin + ftp jabber mysql pptp squid-proxy vnc + http ldap news razor ssh webmin + https lisa ntp rdp syslog whois + ident pcanywhere rsync telnet windowsmedia + imap ping samba traceroute" + for file in $LIST ; do + cat $file > $PKG/usr/share/vuurmuur/services/$file + cat $file > $PKG/etc/vuurmuur/textdir/services/$file + chmod 600 $PKG/etc/vuurmuur/textdir/services/$file + done + ) + + + + cd $SRC/Vuurmuur-$version/vuurmuur_conf-$version + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --with-libvuurmuur-includes=$PKG/usr/include \ + --with-libvuurmuur-libraries=$PKG/usr/lib + make + mkdir -p $PKG/usr/bin + ( cd src + cat vuurmuur_conf > $PKG/usr/bin/vuurmuur_conf + chmod 755 $PKG/usr/bin/vuurmuur_conf + ) + ( cd po + for lang in de fr nb nl no ru en@boldquot pt_BR en@quot ; do + mkdir -p $PKG/usr/share/locale/$lang/LC_MESSAGES + cat $lang.gmo > $PKG/usr/share/locale/$lang/LC_MESSAGES/vuurmuur_conf.mo + done + ) + mkdir -p $PKG/usr/share/vuurmuur/help + ( cd help + for file in vuurmuur-fr.hlp vuurmuur-ru.UTF-8.hlp vuurmuur-ru.hlp vuurmuur.hlp ; do + cat $file > $PKG/usr/share/vuurmuur/help/$file + done + ) + ( cd man/en + for file in vuurmuur_conf.8 ; do + cat $file > $PKG/usr/man/man8/$file + done + ) + ( cd man/ru + for file in vuurmuur_conf.8 ; do + cat $file > $PKG/usr/man/ru/man8/$file + done + ) + mkdir -p $PKG/usr/share/vuurmuur/scripts + ( cd scripts + cat vuurmuur-searchlog.sh > $PKG/usr/share/vuurmuur/scripts/vuurmuur-searchlog.sh + chmod 755 $PKG/usr/share/vuurmuur/scripts/vuurmuur-searchlog.sh + ) + mkdir -p $PKG/usr/share/vuurmuur/config + mkdir -p -m 700 $PKG/etc/vuurmuur + ( cd config + cat vuurmuur_conf.conf.sample > $PKG/usr/share/vuurmuur/config/vuurmuur_conf.conf.sample + cat vuurmuur_conf.conf.sample > $PKG/etc/vuurmuur/vuurmuur_conf.conf + ) + + + cd $SRC/Vuurmuur-$version/installer/zones + ( for zone in dmz inet lan vpn ; do + mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/zones/$zone/networks + cat $SRC/Vuurmuur-$version/installer/zones/$zone/zone.config > $PKG/etc/vuurmuur/textdir/zones/$zone/zone.config + done + ) + mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/zones/inet/networks/internet/groups + mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/zones/inet/networks/internet/hosts + cat $SRC/Vuurmuur-$version/installer/zones/inet/networks/internet/network.config > $PKG/etc/vuurmuur/textdir/zones/inet/networks/internet/network.config + mkdir -p -m 700 $PKG/etc/vuurmuur/plugins + touch $PKG/etc/vuurmuur/plugins/textdir.conf + chmod 600 $PKG/etc/vuurmuur/plugins/textdir.conf + echo "LOCATION=\"/etc/vuurmuur/textdir\"" > $PKG/etc/vuurmuur/plugins/textdir.conf + mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/zones + mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/interfaces + mkdir -p -m 700 $PKG/etc/vuurmuur/textdir/rules + } diff --git a/talimatname/genel/vuurmuur/vuurmuur_servis.rc b/talimatname/genel/vuurmuur/vuurmuur_servis.rc deleted file mode 100644 index 3b4d3e99e..000000000 --- a/talimatname/genel/vuurmuur/vuurmuur_servis.rc +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# vi: ft=sh - -. /etc/rc.conf -. /etc/rc.d/functions - -# PID file -VUURMUURPID='/run/vuurmuur.pid' -VUURMUURLOGPID='/run/vuurmuur_log.pid' -case $1 in -start) - # initialize - stat_busy "Starting Vuurmuur Firewall" - STATUS="ok" - - # check if vuurmuur is configured - IFNUM=`/usr/bin/vuurmuur_script --list --interface any | wc -l` - if [ $IFNUM = 0 ]; then - stat_busy "Please configure Vuurmuur first by defining at least one interface." - stat_fail - exit 1 - fi - - # load modules - . /etc/vuurmuur/modules.conf - for MODULE in `echo $MODULES_TO_LOAD`; do - /sbin/modprobe $MODULE &>/dev/null - if [ $? != 0 ]; then - stat_busy "Error when loading module $MODULE. Check log files." - stat_fail - exit 1 - fi - done - - # start vuurmuur daemon - if [ ! -f $VUURMUURPID ]; then - /usr/bin/vuurmuur -l - if [ $? != 0 ]; then - stat_busy "Error when starting Vuurmuur daemon. Check log files." - STATUS="failed" - fi - else - PID=`cat $VUURMUURPID | cut -d " " -f 1` - stat_busy "Error when starting Vuurmuur daemon. Already running at pid $PID." - STATUS="failed" - fi - - # start vuurmuur log parsing daemon - if [ ! -f $VUURMUURLOGPID ]; then - /usr/bin/vuurmuur_log - if [ $? != 0 ]; then - stat_busy "Error when starting Vuurmuur log parsing daemon. Check log files." - STATUS="failed" - fi - else - PID=`cat $VUURMUURLOGPID | cut -d " " -f 1` - stat_busy "Error when starting Vuurmuur log parsing daemon. Already running at pid $PID." - STATUS="failed" - fi - - # finalize - if [ $STATUS = "ok" ]; then - add_daemon vuurmuur - stat_done - else - stat_fail - exit 1 - fi - ;; - -stop) - # initialize - stat_busy "Stopping Vuurmuur Firewall" - STATUS="ok" - - # stop vuurmuur log parsing daemon - PID=`cat $VUURMUURLOGPID | cut -d " " -f 1` - if [[ ! -z $PID ]] && kill "$PID" &>/dev/null; then - rm -f $VUURMUURLOGPID - else - stat_busy "Error when stopping Vuurmuur log parsing daemon. Check log files." - STATUS="failed" - fi - - # stop vuurmuur daemon - PID=`cat $VUURMUURPID | cut -d " " -f 1` - if [[ ! -z $PID ]] && kill "$PID" &>/dev/null; then - rm -f $VUURMUURPID - else - stat_busy "Error when stopping Vuurmuur daemon. Check log files." - STATUS="failed" - fi - - # finalize - if [ $STATUS = "ok" ]; then - rm_daemon vuurmuur - stat_done - else - stat_fail - exit 1 - fi - ;; - -restart) - $0 stop - $0 start - ;; - -*) - echo "Usage: $0 {start|stop|restart}" >&2 - exit 1 - -esac -exit 0 From 30dda4002540d642646f16dd1cecb45d7121b4f8 Mon Sep 17 00:00:00 2001 From: milisarge Date: Tue, 18 Apr 2017 20:03:59 +0300 Subject: [PATCH 07/21] vuurmuur.paketlendi --- talimatname/genel/vuurmuur/talimat | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/talimatname/genel/vuurmuur/talimat b/talimatname/genel/vuurmuur/talimat index ea1ac4150..fed64748c 100644 --- a/talimatname/genel/vuurmuur/talimat +++ b/talimatname/genel/vuurmuur/talimat @@ -7,10 +7,7 @@ name=vuurmuur _name=Vuurmuur version=0.8rc2 release=1 -source=(ftp://ftp.vuurmuur.org/releases/$version/$_name-$version.tar.gz - modules.conf - vuurmuur_servis.rc -) +source=(ftp://ftp.vuurmuur.org/releases/$version/$_name-$version.tar.gz) build() { From d39f9adfae510f83ef238097ceb9a1da8a665d04 Mon Sep 17 00:00:00 2001 From: milisarge Date: Wed, 19 Apr 2017 01:52:27 +0300 Subject: [PATCH 08/21] talimat.py --- bin/talimat.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/talimat.py b/bin/talimat.py index 9b752df5b..633b58a9c 100755 --- a/bin/talimat.py +++ b/bin/talimat.py @@ -103,13 +103,11 @@ class Talimat(): continue if blok and satir.rstrip()!="" and satir.rstrip()!="}": if (satir not in self.derleme) and ("pkgver()" not in satir) and ("prepare()" not in satir) and ("build()" not in satir) and ("package()" not in satir): - ''' satir=satir.replace("pkgdir","PKG") satir=satir.replace("srcdir","SRC") satir=satir.replace("pkgname","name") satir=satir.replace("pkgver","version") satir=satir.replace("pkgrel","release") - ''' self.derleme+=satir+"\n" else: return "blok için gecersiz tip!" @@ -317,10 +315,15 @@ class Arge: if e.code == 404: print renk.hata+link+" bulunamadı!"+renk.son return None + def aur_link(self,paket): link="https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h="+paket return link + def arch_link(self,paket): + link="https://git.archlinux.org/svntogit/community.git/plain/trunk/PKGBUILD?h=packages/"+paket + return link + if __name__ == '__main__': if len(sys.argv) > 1: @@ -338,7 +341,10 @@ if __name__ == '__main__': paket=str(paket) link=arge.aur_link(paket) dosya=arge.indir(link) + if dosya is None: + link=arge.arch_link(paket) + dosya=arge.indir(link) if link and dosya: - talimat.cevir(dosya) + talimat.cevir(dosya) else: print renk.hata+dosya+" paremetre bulunamadı!"+renk.son From d7bbb5ee5f446ad561f908aef7a622c4eedcebb6 Mon Sep 17 00:00:00 2001 From: milisarge Date: Wed, 19 Apr 2017 02:39:05 +0300 Subject: [PATCH 09/21] firehol.paketlendi --- talimatname/genel/firehol/talimat | 21 +++++++++++++++++++++ talimatname/genel/iprange/talimat | 19 +++++++++++++++++++ talimatname/genel/ipset/talimat | 19 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 talimatname/genel/firehol/talimat create mode 100644 talimatname/genel/iprange/talimat create mode 100644 talimatname/genel/ipset/talimat diff --git a/talimatname/genel/firehol/talimat b/talimatname/genel/firehol/talimat new file mode 100644 index 000000000..b39661775 --- /dev/null +++ b/talimatname/genel/firehol/talimat @@ -0,0 +1,21 @@ +# Description: The iptables stateful packet filtering firewall builder. +# URL: http://firehol.sourceforge.net +# Packager: milisarge +# Depends on: iptables iproute2 iprange ipset + +name=firehol +version=3.1.3 +release=1.0 +source=(https://github.com/firehol/firehol/releases/download/v3.1.3/firehol-3.1.3.tar.xz) + +build() { + cd "$name-$version" + ./configure \ + --prefix=/usr \ + --sbindir=/usr/bin \ + --sysconfdir=/etc \ + --libexecdir=/usr/lib + make + make install DESTDIR="$PKG" + touch "$PKG"/etc/firehol/fire{hol,qos}.conf +} diff --git a/talimatname/genel/iprange/talimat b/talimatname/genel/iprange/talimat new file mode 100644 index 000000000..4fe710758 --- /dev/null +++ b/talimatname/genel/iprange/talimat @@ -0,0 +1,19 @@ +# Description: ip aralıklarını yönetme aracı- firehol projesinden +# URL: http://firehol.org/ +# Packager: milisarge +# Depends on: help2man + +name=iprange +version=1.0.3 +release=2.0 +source=(https://github.com/firehol/$name/archive/v$version.tar.gz +) + +build() { + cd "$name-$version" + ./autogen.sh + ./configure --disable-man --prefix="/usr" --sysconfdir="/etc" --sbindir="/usr/bin" + make + make prefix="$PKG/usr" sysconfdir="$PKG/etc" sbindir="$PKG/usr/bin" install + +} diff --git a/talimatname/genel/ipset/talimat b/talimatname/genel/ipset/talimat new file mode 100644 index 000000000..f5d2fe3ac --- /dev/null +++ b/talimatname/genel/ipset/talimat @@ -0,0 +1,19 @@ +# Description: IP veya port ayarlamaları için yetkili uygulaması +# URL: http://ipset.netfilter.org/ +# Packager: milisarge +# Depends on: iptables libmnl + +name=ipset +version=6.32 +release=1 +source=(http://$name.netfilter.org/$name-$version.tar.bz2) + +build() { + cd $name-$version + ./configure --prefix=/usr --sbindir=/usr/bin --with-kmod=no + make + make DESTDIR="$PKG" install + install -Dm644 lib/libipset.pc "$PKG/usr/lib/pkgconfig/libipset.pc" + # default config file + install -Dm 644 /dev/null "$PKG/etc/$name.conf" +} From 52741468f10b63098a72dc91bd04cfdf3681677c Mon Sep 17 00:00:00 2001 From: milisarge Date: Wed, 19 Apr 2017 03:30:40 +0300 Subject: [PATCH 10/21] talimat.py --- bin/talimat.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/talimat.py b/bin/talimat.py index 633b58a9c..41021bb2a 100755 --- a/bin/talimat.py +++ b/bin/talimat.py @@ -102,7 +102,7 @@ class Talimat(): blok=True continue if blok and satir.rstrip()!="" and satir.rstrip()!="}": - if (satir not in self.derleme) and ("pkgver()" not in satir) and ("prepare()" not in satir) and ("build()" not in satir) and ("package()" not in satir): + if (satir not in self.derleme) and ("pkgver()" not in satir) and ("prepare()" not in satir) and ("build()" not in satir) and ("package()" not in satir) and ("check()" not in satir): satir=satir.replace("pkgdir","PKG") satir=satir.replace("srcdir","SRC") satir=satir.replace("pkgname","name") @@ -320,10 +320,15 @@ class Arge: link="https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h="+paket return link - def arch_link(self,paket): + def arch2_link(self,paket): link="https://git.archlinux.org/svntogit/community.git/plain/trunk/PKGBUILD?h=packages/"+paket return link + def arch_link(self,paket): + link="https://git.archlinux.org/svntogit/packages.git/plain/trunk/PKGBUILD?h=packages/"+paket + return link + + if __name__ == '__main__': if len(sys.argv) > 1: @@ -344,6 +349,9 @@ if __name__ == '__main__': if dosya is None: link=arge.arch_link(paket) dosya=arge.indir(link) + if dosya is None: + link=arge.arch2_link(paket) + dosya=arge.indir(link) if link and dosya: talimat.cevir(dosya) else: From 43eec6a07464a040f1a951859fefea896e23eaa1 Mon Sep 17 00:00:00 2001 From: milisarge Date: Wed, 19 Apr 2017 04:03:18 +0300 Subject: [PATCH 11/21] bindutils.paketlendi --- talimatname/genel/bindutils/talimat | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 talimatname/genel/bindutils/talimat diff --git a/talimatname/genel/bindutils/talimat b/talimatname/genel/bindutils/talimat new file mode 100644 index 000000000..bd70724f1 --- /dev/null +++ b/talimatname/genel/bindutils/talimat @@ -0,0 +1,23 @@ +# Description: Bind araçları +# URL: http://www.isc.org/software/bind +# Packager: milisarge +# Depends on: + +name=bindutils +version=9.11.0 +release=1 +source=(ftp://ftp.isc.org/isc/bind9/$version/bind-$version.tar.gz) + +build() { + cd bind-$version + + ./configure --prefix=/usr \ + --disable-linux-caps \ + --with-libxml2=no + make -C lib + make -C bin/dig + install -D -m 755 bin/dig/host $PKG/usr/bin/host + install -D -m 644 bin/dig/host.1 $PKG/usr/share/man/man1/host.1 + install -D -m 755 bin/dig/dig $PKG/usr/bin/dig + install -D -m 644 bin/dig/dig.1 $PKG/usr/share/man/man1/dig.1 +} From 267f63d831008aea034b3d6a868727d9853ba7de Mon Sep 17 00:00:00 2001 From: milisarge Date: Wed, 19 Apr 2017 04:05:40 +0300 Subject: [PATCH 12/21] bindutils.gereklilere --- ayarlar/gerekli_programlar | 1 + ayarlar/gerekli_programlar_lxqt | 1 + 2 files changed, 2 insertions(+) diff --git a/ayarlar/gerekli_programlar b/ayarlar/gerekli_programlar index 8f5f68548..02ba2dd03 100644 --- a/ayarlar/gerekli_programlar +++ b/ayarlar/gerekli_programlar @@ -21,6 +21,7 @@ qemu-all worker yad cdrkit +bindutils scrot syslinux networkmanager diff --git a/ayarlar/gerekli_programlar_lxqt b/ayarlar/gerekli_programlar_lxqt index 27023331f..9808d01df 100644 --- a/ayarlar/gerekli_programlar_lxqt +++ b/ayarlar/gerekli_programlar_lxqt @@ -25,6 +25,7 @@ vlc libreoffice sysv-rc-conf rfkill +bindutils samba dosfstools os-prober From 152851debd1acefa0ae6858ddd186df31a0f6814 Mon Sep 17 00:00:00 2001 From: milisarge Date: Wed, 19 Apr 2017 22:51:51 +0300 Subject: [PATCH 13/21] squid.guncellendi --- talimatname/genel/squid/talimat | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/talimatname/genel/squid/talimat b/talimatname/genel/squid/talimat index 5d329b452..2d5d5de94 100644 --- a/talimatname/genel/squid/talimat +++ b/talimatname/genel/squid/talimat @@ -5,7 +5,7 @@ name=squid version=3.5.24 -release=1 +release=2 source=(http://www.squid-cache.org/Versions/v3/3.5/$name-$version.tar.xz squid_servisi) @@ -27,7 +27,9 @@ build () { --with-large-files \ --with-pthreads \ --with-aufs-threads=16 \ - --disable-auto-locale + --disable-auto-locale \ + --with-openssl \ + --enable-ssl-crtd make all make DESTDIR=$PKG install From 35a88ad7fe3d5a4747a93da743071cc8bcd2812c Mon Sep 17 00:00:00 2001 From: milisarge Date: Thu, 20 Apr 2017 01:44:39 +0300 Subject: [PATCH 14/21] squid-transparent --- ayarlar/squid/transparent/squid.conf | 61 +++++++++++++++++++ .../transparent/squid_iptables_yapilandir.sh | 12 ++++ ayarlar/squid/transparent/yapilacaklar | 52 ++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 ayarlar/squid/transparent/squid.conf create mode 100755 ayarlar/squid/transparent/squid_iptables_yapilandir.sh create mode 100644 ayarlar/squid/transparent/yapilacaklar diff --git a/ayarlar/squid/transparent/squid.conf b/ayarlar/squid/transparent/squid.conf new file mode 100644 index 000000000..ab31e8676 --- /dev/null +++ b/ayarlar/squid/transparent/squid.conf @@ -0,0 +1,61 @@ +http_port 3128 intercept + +https_port 3130 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/ssl_cert/myca.pem key=/etc/squid/ssl_cert/ca-key.pem + +visible_hostname milis +cache_mem 8 MB +cache_dir aufs /var/squid 900 16 256 + +http_port 3129 + +# For squid 3.5.x +#always_direct allow all +ssl_bump server-first all +#sslproxy_cert_error deny all +#sslproxy_flags DONT_VERIFY_PEER + +sslcrtd_program /usr/lib/squid/ssl_crtd -s /var/lib/ssl_db -M 4MB +sslcrtd_children 8 startup=1 idle=1 + + + +acl localnet src 10.0.0.0/8 # RFC1918 possible internal network +acl localnet src 172.16.0.0/12 # RFC1918 possible internal network +acl localnet src 192.168.0.0/16 # RFC1918 possible internal network +acl localnet src fc00::/7 # RFC 4193 local private network range +acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines + +acl SSL_ports port 443 + +acl Safe_ports port 80 # http +acl Safe_ports port 21 # ftp +acl Safe_ports port 443 # https +acl Safe_ports port 70 # gopher +acl Safe_ports port 210 # wais +acl Safe_ports port 280 # http-mgmt +acl Safe_ports port 488 # gss-http +acl Safe_ports port 591 # filemaker +acl Safe_ports port 777 # multiling http +acl Safe_ports port 1025-65535 # unregistered ports + +acl CONNECT method CONNECT + +http_access deny !Safe_ports +http_access deny CONNECT !SSL_ports +http_access allow localhost manager +http_access deny manager + +# +# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS +# + +http_access allow localnet +http_access allow localhost +http_access deny all + +coredump_dir /var/squid + +refresh_pattern ^ftp: 1440 20% 10080 +refresh_pattern ^gopher: 1440 0% 1440 +refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 +refresh_pattern . 0 20% 4320 diff --git a/ayarlar/squid/transparent/squid_iptables_yapilandir.sh b/ayarlar/squid/transparent/squid_iptables_yapilandir.sh new file mode 100755 index 000000000..a94b3e933 --- /dev/null +++ b/ayarlar/squid/transparent/squid_iptables_yapilandir.sh @@ -0,0 +1,12 @@ +# bütün kurallar temizlenir +servis iptables clear + +# değişkenler ayarlanır +SUID=$(id -u squid) +agarayuz=wlp3s0 + +# 80 ve 443 çıkışları squid e tahsis edilir.80 ve 443 çıkışları squid in ilgili portlarına yönlendirilir. +iptables -t nat -A OUTPUT -p tcp -m multiport --dports 80,443 -m owner --uid-owner 90 -j ACCEPT +iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner ! --uid-owner 90 -j REDIRECT --to-port 3128 +iptables -t nat -A OUTPUT -p tcp --dport 443 -m owner ! --uid-owner 90 -j REDIRECT --to-port 3130 +iptables -A OUTPUT -o $agarayuz -p tcp -m multiport --dports 1024:65535 -m state --state NEW -j ACCEPT diff --git a/ayarlar/squid/transparent/yapilacaklar b/ayarlar/squid/transparent/yapilacaklar new file mode 100644 index 000000000..2c7a53471 --- /dev/null +++ b/ayarlar/squid/transparent/yapilacaklar @@ -0,0 +1,52 @@ +# kendinden imzalı sertifika ayarlama + +cd /etc/squid + +mkdir ssl_cert + +chown squid:squid ssl_cert + +chmod 700 ssl_cert + +cd ssl_cert + +# sertifika oluştumak için alternatif + +#certtool --generate-privkey --outfile ca-key.pem + +#certtool --generate-self-signed --load-privkey ca-key.pem --outfile myca.pem + + + +# sertifikanın oluşturulması + +openssl req -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -extensions v3_ca -keyout ca-key.pem -out myca.pem + + + +# firefox a yüklenecek der dosyasının oluşturulması + +openssl x509 -in myca.pem -outform DER -out myca.der + + +# squid sertifika veritabanı ayarlanması + +/usr/lib/squid/ssl_crtd -c -s /var/lib/ssl_db + +chown -R squid.squid /var/lib/ssl_db + + +# yeni squid ayarlarının kopyalanması.(eskisi varsa yedekleyin.) + +cp -f /sources/milis.git/ayarlar/squid/transparent/squid.conf /etc/squid/ + + +# iptables kurallarının yüklenmesi-Not: squid_iptables_yapilandir.sh içinde ağ arayüzünü kendi arayüzünüze ayarlayın. + +./sources/milis.git/ayarlar/squid/transparent/squid_iptables_yapilandir.sh + +# squid başlatılması + +servis squid start + + From 195e56526c7f786f126cceb96336130951b067aa Mon Sep 17 00:00:00 2001 From: milisarge Date: Thu, 20 Apr 2017 02:27:55 +0300 Subject: [PATCH 15/21] saat_ayarla_ntp --- bin/saat_ayarla_ntp | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 bin/saat_ayarla_ntp diff --git a/bin/saat_ayarla_ntp b/bin/saat_ayarla_ntp new file mode 100755 index 000000000..70ab3ed73 --- /dev/null +++ b/bin/saat_ayarla_ntp @@ -0,0 +1,3 @@ +#!/bin/bash +ntpdate -s 0.pool.ntp.org +ntpdate -s 1.pool.ntp.org From 7b1ea26d7f324d05a1c190ca9f984311630c95eb Mon Sep 17 00:00:00 2001 From: milisarge Date: Thu, 20 Apr 2017 02:37:52 +0300 Subject: [PATCH 16/21] saat_ayarla_ntp --- bin/saat_ayarla_ntp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/saat_ayarla_ntp b/bin/saat_ayarla_ntp index 70ab3ed73..01f1e9c7e 100755 --- a/bin/saat_ayarla_ntp +++ b/bin/saat_ayarla_ntp @@ -1,3 +1,2 @@ #!/bin/bash -ntpdate -s 0.pool.ntp.org -ntpdate -s 1.pool.ntp.org +ntpdate -s tr.pool.ntp.org From 3c7c0420d08a2bf218a2d4a1f172fc4f42605307 Mon Sep 17 00:00:00 2001 From: milisarge Date: Thu, 20 Apr 2017 03:01:38 +0300 Subject: [PATCH 17/21] privoxy.paketlendi --- talimatname/genel/privoxy/privoxy.logrotate.d | 9 +++ talimatname/genel/privoxy/privoxy.sysusers | 1 + talimatname/genel/privoxy/talimat | 62 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 talimatname/genel/privoxy/privoxy.logrotate.d create mode 100644 talimatname/genel/privoxy/privoxy.sysusers create mode 100644 talimatname/genel/privoxy/talimat diff --git a/talimatname/genel/privoxy/privoxy.logrotate.d b/talimatname/genel/privoxy/privoxy.logrotate.d new file mode 100644 index 000000000..3f31b170f --- /dev/null +++ b/talimatname/genel/privoxy/privoxy.logrotate.d @@ -0,0 +1,9 @@ +/var/log/privoxy/logfile { + missingok + create 660 root privoxy + notifempty + compress + postrotate + /bin/kill -HUP `cat /var/run/privoxy.pid 2>/dev/null` 2> /dev/null || true + endscript +} diff --git a/talimatname/genel/privoxy/privoxy.sysusers b/talimatname/genel/privoxy/privoxy.sysusers new file mode 100644 index 000000000..fd8a377ca --- /dev/null +++ b/talimatname/genel/privoxy/privoxy.sysusers @@ -0,0 +1 @@ +u privoxy 42 "Privoxy" diff --git a/talimatname/genel/privoxy/talimat b/talimatname/genel/privoxy/talimat new file mode 100644 index 000000000..f9cefed5a --- /dev/null +++ b/talimatname/genel/privoxy/talimat @@ -0,0 +1,62 @@ +# Description: A web proxy with advanced filtering capabilities. +# URL: https://www.privoxy.org +# Packager: milisarge +# Depends on: pcre + +name=privoxy +version=3.0.26 +release=2.0 +source=(https://downloads.sourceforge.net/ijbswa/privoxy-$version-stable-src.tar.gz + privoxy.logrotate.d + privoxy.sysusers) + +build() { + cd "${SRC}/${name}-${version}-stable" + + autoheader + + autoconf + + ./configure --prefix=/usr --sysconfdir=/etc/privoxy --enable-compression + + make + + sed -i ' + + s+^confdir \.+confdir /etc/privoxy+ + + s+^logdir \.+logdir /var/log/privoxy+ + + s+^#\?user-manual .*+user-manual /usr/share/doc/privoxy/user-manual/+' config + + cd "${SRC}/${name}-${version}-stable" + + install -Dm644 "$SRC/privoxy.sysusers" "$PKG/usr/lib/sysusers.d/privoxy.conf" + + install -Dm644 "$SRC/privoxy.logrotate.d" "$PKG/etc/logrotate.d/privoxy" + + install -Dm755 {,"$PKG"/usr/bin/}privoxy + + install -Dm644 {,"$PKG"/usr/share/man/man1/}privoxy.1 + + install -d -o42 -g42 "$PKG"/var/log/privoxy + + install -d "$PKG"/etc/privoxy/ + + install -m644 config trust *.{action,filter} "$PKG"/etc/privoxy/ # -m0660 upstream + + find templates -type f -exec install -Dm644 '{}' "$PKG"/etc/privoxy/'{}' \; + + (d=$PKG/usr/share/doc/privoxy + + cd doc/webserver + + install -Dm644 {privoxy-,"$d"/}index.html + + install -m644 p_doc.css ../../{AUTHORS,README,ChangeLog} "$d"/ + + install -Dm644 {,"$d"/user-manual/}p_doc.css + + find user-manual developer-manual faq man-page \( -name '*.html' -o -name '*.jpg' \) -exec install -Dm644 '{}' "$d"/'{}' \;) + +} From 632bc1d4161b41998b0a4d2b6480c027eff3b666 Mon Sep 17 00:00:00 2001 From: milisarge Date: Thu, 20 Apr 2017 03:03:42 +0300 Subject: [PATCH 18/21] mps-try-temel --- bin/mps | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/mps b/bin/mps index aa5500ab9..b0a7165f8 100755 --- a/bin/mps +++ b/bin/mps @@ -1462,6 +1462,8 @@ ayarlar() { shift ;; -trl) tarihce_liste ;; + dos) + tarihce_yukle "temel" ;; -trs) if [ ! "$2" ]; then ryaz 31 "parametre eksik $1" From ecbb0df2d000fdae849d7c1c77f301fd013ef4f8 Mon Sep 17 00:00:00 2001 From: milisarge Date: Thu, 20 Apr 2017 03:05:01 +0300 Subject: [PATCH 19/21] privoxy.paketlendi --- talimatname/genel/privoxy/talimat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talimatname/genel/privoxy/talimat b/talimatname/genel/privoxy/talimat index f9cefed5a..9a7d3e003 100644 --- a/talimatname/genel/privoxy/talimat +++ b/talimatname/genel/privoxy/talimat @@ -5,7 +5,7 @@ name=privoxy version=3.0.26 -release=2.0 +release=1 source=(https://downloads.sourceforge.net/ijbswa/privoxy-$version-stable-src.tar.gz privoxy.logrotate.d privoxy.sysusers) From cb52dc46a23307fccd64bee0eb099db244c7db00 Mon Sep 17 00:00:00 2001 From: milisarge Date: Thu, 20 Apr 2017 05:25:27 +0300 Subject: [PATCH 20/21] hostlari_yenile --- bin/hostlari_yenile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 bin/hostlari_yenile diff --git a/bin/hostlari_yenile b/bin/hostlari_yenile new file mode 100755 index 000000000..635b84ce4 --- /dev/null +++ b/bin/hostlari_yenile @@ -0,0 +1,10 @@ +#!/bin/bash + +cd /tmp +#wget http://sbc.io/hosts/hosts +wget https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts +mv /etc/hosts /tmp/hosts-eski +mv hosts /etc/hosts +if [ -f ~/.hosts ]; then + cat ~/.hosts >> /etc/hosts +fi From 92ad44d53410d4d320b373b692aad9e4f855defc Mon Sep 17 00:00:00 2001 From: milisarge Date: Thu, 20 Apr 2017 05:28:06 +0300 Subject: [PATCH 21/21] hostlari_yenile --- bin/hostlari_yenile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/hostlari_yenile b/bin/hostlari_yenile index 635b84ce4..cb48ef529 100755 --- a/bin/hostlari_yenile +++ b/bin/hostlari_yenile @@ -1,10 +1,11 @@ #!/bin/bash - +# /etc altındaki hosts dosyasını yeniler ve istenmeyen reklam ve sitelerden korunulur. cd /tmp #wget http://sbc.io/hosts/hosts wget https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts mv /etc/hosts /tmp/hosts-eski mv hosts /etc/hosts +# eğer home dizini altında .hosts dosyanız varsa onu /etc/hosts dosyasına ekler. if [ -f ~/.hosts ]; then cat ~/.hosts >> /etc/hosts fi