Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* new netatalk version - 3.0.3 allows symlinks \o/

  • Loading branch information...
commit 92324186561025430d9b11c57bb8fc675645f24f 1 parent d2ce0ad
@dudemeister authored
Showing with 41 additions and 53 deletions.
  1. +16 −53 netatalk.rb
  2. +25 −0 netatalk/afp.conf.erb
View
69 netatalk.rb
@@ -1,7 +1,7 @@
dep "netatalk.complete" do
requires "cups.managed", "libpam0g-dev.managed",
"libdb4.8.managed", "libdb4.8-dev.managed",
- "netatalk.source", "netatalk config", "netatalk permissions", "enable timemachine volumes"
+ "netatalk.source", "netatalk config", "libavahi-client-dev.managed"
end
dep "libssl-dev.managed" do
@@ -36,72 +36,35 @@
provides []
end
+dep "libavahi-client-dev.managed" do
+ provides []
+end
+
dep "netatalk.source" do
met? {
- which('netatalk-config')
+ which('netatalk-config') && shell("netatalk-config --version") == "3.0.2"
}
meet {
cd('/tmp') { |path|
- log_shell "downloading netatalk", "curl -LO http://prdownloads.sourceforge.net/netatalk/netatalk-2.2.4.tar.gz", {:spinner => true}
- log_shell "expanding", "tar xzf netatalk-2.2.4.tar.gz", {:spinner => true}
- # hostapd needs to build in the hostapd dir
- cd("netatalk-2.2.4") {
- log_shell "configuring", "./configure --enable-debian --with-pam"
+ log_shell "downloading netatalk", "curl -LO http://downloads.sourceforge.net/project/netatalk/netatalk/3.0.2/netatalk-3.0.2.tar.gz", {:spinner => true}
+ log_shell "expanding", "tar xzf netatalk-3.0.2.tar.gz", {:spinner => true}
+ cd("netatalk-3.0.2") {
+ log_shell "configuring", "./configure --enable-debian --with-pam --with-init-style=debian"
log_shell "making", "make", {:spinner => true}
log_shell "installing", "make install", {:spinner => true, :sudo => true}
}
}
}
-
end
dep "netatalk config" do
-
- def config_path
- "/usr/local/etc/netatalk/afpd.conf"
- end
-
- met? {
- section_exists?(config_path, 'protonet-pam')
+ met? {
+ babushka_config? ""
}
- meet {
- append_to_file_with_section("- -tcp -noddp -uamlist uams_dhx_pam.so,uams_dhx2_pam.so", config_path, 'protonet-pam', :sudo => true)
- }
-
-end
-
-dep "netatalk permissions" do
- def config_path
- "/usr/local/etc/netatalk/AppleVolumes.default"
- end
-
- met? {
- grep(/:DEFAULT: options:upriv,usedots dperm:0770 fperm:0660 umask:0007/, "#{config_path}")
+ meet {
+ render_erb "netatalk/netatalk.conf.erb", :to => "/usr/local/etc/afp.conf", :sudo => true
}
- meet{
- old_defaults = ":DEFAULT: options:upriv,usedots"
- new_defaults = ":DEFAULT: options:upriv,usedots dperm:0770 fperm:0660 umask:0007"
- ruby = which("ruby")
- sudo("#{ruby} -pi -e \"gsub(/^#{old_defaults}$/, '#{new_defaults}')\" #{config_path}")
+ after {
+ sudo "/etc/init.d/netatalk restart"
}
end
-
-dep "enable timemachine volumes" do
-
- def config_path
- "/usr/local/etc/netatalk/AppleVolumes.default"
- end
-
- met? {
- grep(/^~ options:tm$/, "#{config_path}")
- }
- meet {
- ruby = which("ruby")
- sudo("#{ruby} -pi -e \"gsub(/^~$/, '~ options:tm')\" #{config_path}")
- sudo("/etc/init.d/netatalk restart")
- }
-end
-
-# sudo /etc/init.d/netatalk restart
-
-# add to monitoring
View
25 netatalk/afp.conf.erb
@@ -0,0 +1,25 @@
+;
+; Netatalk 3.x configuration file
+;
+
+[Global]
+; Global server settings
+vol preset = default_for_all_vol
+log file = /var/log/netatalk.log
+uam list = uams_dhx.so,uams_dhx2.so
+save password = no
+
+[default_for_all_vol]
+file perm = 0660
+directory perm = 0770
+cnid scheme = dbd
+;valid users = @protonet
+
+[Homes]
+basedir regex = /home
+follow symlinks = yes
+
+;[TimeMachine]
+;path = /afp/tm_backup
+;time machine = yes
+;vol size limit = 350000
Please sign in to comment.
Something went wrong with that request. Please try again.