fix: no need for unnecessary dependencies
fix(vsftpd): a few bugs
This commit is contained in:
parent
5550b17522
commit
46eaf3e4f6
@ -18,7 +18,6 @@ executable mongodb
|
|||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
build-depends: base >= 4.7 && < 5
|
build-depends: base >= 4.7 && < 5
|
||||||
, data-default-class
|
, data-default-class
|
||||||
, mtl
|
|
||||||
, mongoDB >= 2.1.1.1 && < 3
|
, mongoDB >= 2.1.1.1 && < 3
|
||||||
, bytestring
|
, bytestring
|
||||||
, text
|
, text
|
||||||
|
@ -18,5 +18,4 @@ executable mysql
|
|||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
build-depends: base >= 4.7 && < 5
|
build-depends: base >= 4.7 && < 5
|
||||||
, data-default-class
|
, data-default-class
|
||||||
, mtl
|
|
||||||
, mysql >= 0.1.4 && < 1
|
, mysql >= 0.1.4 && < 1
|
||||||
|
@ -19,6 +19,4 @@ executable nginx
|
|||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
build-depends: base >= 4.7 && < 5
|
build-depends: base >= 4.7 && < 5
|
||||||
, data-default-class
|
, data-default-class
|
||||||
, monad-control
|
|
||||||
, mtl
|
|
||||||
, free
|
, free
|
||||||
|
@ -18,4 +18,3 @@ executable vsftpd
|
|||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
build-depends: base >= 4.7 && < 5
|
build-depends: base >= 4.7 && < 5
|
||||||
, data-default-class
|
, data-default-class
|
||||||
, mtl
|
|
||||||
|
@ -14,7 +14,7 @@ module Main (call, main) where
|
|||||||
import Control.Monad.Free
|
import Control.Monad.Free
|
||||||
import Data.List
|
import Data.List
|
||||||
import Data.Either
|
import Data.Either
|
||||||
import Control.Monad.State
|
import Control.Monad.State hiding (liftIO)
|
||||||
|
|
||||||
|
|
||||||
call :: Service -> App ()
|
call :: Service -> App ()
|
||||||
@ -33,10 +33,13 @@ module Main (call, main) where
|
|||||||
(Right opensslResponse) <- execute "openssl" ["passwd", "-1", pass] "" True
|
(Right opensslResponse) <- execute "openssl" ["passwd", "-1", pass] "" True
|
||||||
let encryptedPassword = head . lines $ opensslResponse
|
let encryptedPassword = head . lines $ opensslResponse
|
||||||
|
|
||||||
executeRoot "useradd" [user, "-d", directory, "-G", "ftp", "-p", encryptedPassword] "" True
|
executeRoot "groupadd" ["-f", "ftp"] "" False
|
||||||
|
executeRoot "useradd" [user, "-d", directory, "-G", "ftp", "-p", encryptedPassword] "" False
|
||||||
|
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
renameFileIfMissing original (original ++ ".backup")
|
execIfExists original $ do
|
||||||
|
renameFileIfMissing original (original ++ ".backup")
|
||||||
|
|
||||||
writeFile original content
|
writeFile original content
|
||||||
writeFile userList user
|
writeFile userList user
|
||||||
|
|
||||||
|
@ -35,21 +35,21 @@ module Types ( FileSharingParams (..)
|
|||||||
, anonymousWrite = False
|
, anonymousWrite = False
|
||||||
, recreateUser = False
|
, recreateUser = False
|
||||||
}
|
}
|
||||||
|
|
||||||
instance Show FileSharingParams where
|
instance Show FileSharingParams where
|
||||||
show (FileSharingParams { directory, user, pass, port, writable, anonymous, anonymousWrite }) =
|
show (FileSharingParams { directory, user, pass, port, writable, anonymous, anonymousWrite }) =
|
||||||
let boolToEnglish True = "YES"
|
let boolToEnglish True = "YES"
|
||||||
boolToEnglish False = "NO"
|
boolToEnglish False = "NO"
|
||||||
in
|
in
|
||||||
keyvalue [ ("anonymous_enable", boolToEnglish anonymous)
|
keyvalue [ ("anonymous_enable", boolToEnglish anonymous)
|
||||||
, ("write_enable", boolToEnglish writable)
|
, ("write_enable", boolToEnglish writable)
|
||||||
, ("allow_writeable_chroot", boolToEnglish writable)
|
, ("allow_writeable_chroot", boolToEnglish writable)
|
||||||
, ("anon_upload_enable", boolToEnglish anonymousWrite)
|
, ("anon_upload_enable", boolToEnglish anonymousWrite)
|
||||||
, ("anon_mkdir_write_enable", boolToEnglish anonymousWrite)
|
, ("anon_mkdir_write_enable", boolToEnglish anonymousWrite)
|
||||||
, ("listen", "YES")
|
, ("listen", "YES")
|
||||||
, ("userlist_enable", "YES")
|
, ("userlist_enable", "YES")
|
||||||
, ("userlist_file", "/etc/vsftpd-serverman-user-list")
|
, ("userlist_file", "/etc/vsftpd-serverman-user-list")
|
||||||
, ("userlist_deny", "NO")
|
, ("userlist_deny", "NO")
|
||||||
, ("chroot_local_user", "YES")
|
, ("local_root", directory)
|
||||||
, ("xferlog_enable", "YES")
|
, ("xferlog_enable", "YES")
|
||||||
, ("local_enable", "YES")] "="
|
, ("local_enable", "YES")
|
||||||
|
, ("pam_service_name", "ftp")] "="
|
||||||
|
Loading…
Reference in New Issue
Block a user