Difference between pages "Portage Git Mirror" and "Package:Clamav"

(Difference between pages)
(Git-daemon configuration)
 
m (finish up ebuild)
 
Line 1: Line 1:
=Setting up local git mirror =
+
{{Ebuild
 +
|Summary=Clam Anti-Virus Scanner
 +
|CatPkg=app-antivirus/clamav
 +
|Homepage=http://www.clamav.net/
 +
}}
 +
Clamav is an open source antivirus solution.
  
This tutorial explains how to save bandwidth when several local computers need to pull updates from a single remote git repository.
+
=== Installation ===
 +
{{console|body=###i## emerge app-antivirus/clamav}}
  
== Use case ==
+
Virus definitions need to be installed before starting the clamd service
 +
{{console|body=###i## freshclam}}
  
This tutorial will be about hosting a local mirror of funtoo git based portage tree.
+
=== Configuration ===
 +
Configuration files are located at {{c|/etc/conf.d/clamd}}, {{c|/etc/clamd.conf}}, and {{c|/etc/freshclam.conf}}
  
Following terms should be adapted
+
=== Runtime ===
 +
{{console|body=###i## rc-update add clamd default
 +
###i## rc}}
  
<table border="1">
+
==== Testing ====
<tr class="header">
+
To make sure things are installed correctly, test this harmless file:
<th align="left">Terms</th>
+
{{console|body=###i## wget -O- http://www.eicar.org/download/eicar.com.txt | clamscan -
<th align="left">Definition</th>
+
###i##rm eicar.com.txt}}
</tr>
+
<tr class="odd">
+
<td align="left">git.lan</td>
+
<td align="left">The git-daemon local mirror host</td>
+
</tr>
+
<tr class="even">
+
<td align="left">localhost</td>
+
<td align="left">Any local host</td>
+
</tr>
+
<tr class="odd">
+
<td align="left">nobody</td>
+
<td align="left">Owner user of .git files</td>
+
</tr>
+
<tr class="even">
+
<td align="left">/home/git-mirrors</td>
+
<td align="left">Base path of git-daemon</td>
+
</tr>
+
</table>
+
  
== Local mirror ==
+
==== Usage ====
 +
To scan single files:
 +
{{console|body=###i## clamscan /usr/bin/portageq}}
  
==== Prepare directories and get portage tree====
+
To scan a directory:
<console>
+
{{console|body=###i## clamscan -ir /var/www/localhost/htdocs/
###i## mkdir /home/git-mirrors
+
----------- SCAN SUMMARY -----------
###i## chown nobody /home/git-mirrors
+
Known viruses: 3736482
###i## su -s /bin/sh nobody
+
Engine version: 0.98.6
$##bl## cd /home/git-mirrors
+
Scanned directories: 663
$##bl## git clone --mirror --bare git://github.com/funtoo/ports-2012.git portage.git
+
Scanned files: 6067
</console>
+
Infected files: 0
For a security reason we use a nobody user .
+
Total errors: 8
==== git-daemon configuration====
+
Data scanned: 58.61 MB
{{file|name=/etc/conf.d/git-daemon|desc=|body=
+
Data read: 36.59 MB (ratio 1.60:1)
GITDAEMON_OPTS=--syslog --verbose --enable=receive-pack --export-all
+
Time: 42.691 sec (0 m 42 s)
GITDAEMON_OPTS=${GITDAEMON_OPTS} --base-path=/home/git-mirrors /home/git-mirrors
+
GIT_USER=nobody
+
GIT_GROUP=nobody
+
 
}}
 
}}
  
====Service configuration====
+
=== External Resources ===
To start daemon with a mirror machine boot add <code>git-daemon</code> to OpenRC's default runlevel
+
http://www.clamav.net/doc/install.html
<console>
+
{{EbuildFooter}}
###i## rc-update add git-daemon default
+
</console>
+
To make changes start immediately just run <code>rc</code>
+
<console>
+
###i## rc
+
</console>
+
 
+
=== Pull from remote ===
+
 
+
Add the following to <code>/etc/cron.daily/funtoo-sync.sh</code>:
+
 
+
<pre>
+
#!/bin/sh
+
cd /home/git-mirrors/portage.git
+
su nobody -s "/bin/sh" -c "git pull"
+
</pre>
+
 
+
== Cloning from local git-daemon ==
+
 
+
Local clone from <code>git.lan</code>:
+
<console>
+
###i## mv /usr/portage /usr/portage.old
+
###i## git clone git://git.lan/portage.git /usr/portage
+
###i## cd /usr/portage
+
###i## git checkout funtoo.org
+
</console>
+
 
+
[[Category:HOWTO]]
+

Revision as of 10:36, February 3, 2015

app-antivirus/clamav


Source Repository:Repository:Gentoo Portage Tree

http://www.clamav.net/

Summary: Clam Anti-Virus Scanner

Use Flags

clamdtop
A Top like tool which shows what clamd is currently scanning amongst other things
metadata-analysis-api
Enables collection of file property metadata using ClamAV API for analysis by ClamAV bytecode programs.

News

Drobbins

Keychain 2.8.2 Released

Keychain 2.8.2, a maintenance and bug fix release, is now available.
2015-11-16 by Drobbins
Drobbins

Unfork Tree is Live!

The "unfork" tree is now merged into the main Funtoo Linux tree, and Funtoo Linux is now using shards for core packages, x11 (including media libraries), KDE, GNOME, python and perl.
2015-10-12 by Drobbins
Drobbins

OpenSSH 7 Disables DSA Keys By Default

Please be aware of this important change to avoid getting locked out of your Funtoo server.
2015-10-07 by Drobbins
More...

Clamav

Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Clamav is an open source antivirus solution.

Installation

# emerge app-antivirus/clamav
Virus definitions need to be installed before starting the clamd service

# freshclam

Configuration

Configuration files are located at /etc/conf.d/clamd, /etc/clamd.conf, and /etc/freshclam.conf

Runtime

# rc-update add clamd default
# rc

Testing

To make sure things are installed correctly, test this harmless file:

# wget -O- http://www.eicar.org/download/eicar.com.txt

Usage

To scan single files:

# clamscan /usr/bin/portageq
To scan a directory:

# clamscan -ir /var/www/localhost/htdocs/
----------- SCAN SUMMARY -----------
Known viruses: 3736482
Engine version: 0.98.6
Scanned directories: 663
Scanned files: 6067
Infected files: 0
Total errors: 8
Data scanned: 58.61 MB
Data read: 36.59 MB (ratio 1.60:1)
Time: 42.691 sec (0 m 42 s)

External Resources

http://www.clamav.net/doc/install.html