ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - ramortegui/clamxir: CalmAV wrapper for elixir
CalmAV wrapper for elixir. Contribute to ramortegui/clamxir development by creating an account on GitHub.
Visit Site

GitHub - ramortegui/clamxir: CalmAV wrapper for elixir

GitHub - ramortegui/clamxir: CalmAV wrapper for elixir

Clamxir Build Status

ClamAV wrapper for elixir based on clamby

This package depends of clamav installed on your system. Please refer to: https://www.clamav.net/documents/installing-clamav.

As recomendation, use the daemonize flag on the configs, in order to improve performance.

Installation

The package can be installed by adding clamxir to your list of dependencies in mix.exs:

def deps do
  [
    {:clamxir, "~> 0.1.8"}
  ]
end

Usage

Clamxir receive the configs on each public method, and based on the configs, will perform their task.

The config file by default is the struct %Clamxir{}. The default values of the structure are:

%Clamxir{
  daemonize: false,
  stream: false,
  check: fase
}

daemonize is a flag to use one instance of the clamav instead of the creation of new instances for each request.

iex> Clamxir.safe?(%Clamxir{}, "/path/file")

stream will pass the argument --stream to clamdscan, this will help to avoid permission issues.

iex> Clamxir.safe?(%Clamxir{stream: true}, "/path/file")

check flag will add validation of the scanner availability before try to run it.

iex> Clamxir.safe?(%Clamxir{check: true}, "/path/file")

Integration with Phoenix

  1. Install as dependency mix.exs
{:clamxir, "~> 0.1.8"}
  1. Use in the controller action where the files are uploaded
def upload(conn, params) do
  file = params["index"]["file"]
  # Requires to have clamavdscann to work
  case Clamxir.safe?(%Clamxir{daemonize: true}, file.path) do
    true ->
      # Process the file and ...
      conn
      |> put_flash(:info,  "Created successfully")
      |> redirect(to: "/")
    false -> conn
      |> put_flash(:error,  "Virus!!")
     |> redirect(to: "/")
  end
end

For a working sample please refer to: https://github.com/ramortegui/sample_phoenix_clamxir

Docs can be found at https://hexdocs.pm/clamxir.

TODO

  • Add Logger features

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory