]> git.llucax.com Git - software/pymin.git/commitdiff
bug fixes to proxy service
authorFede <fedux@linux-kt9u.site>
Sat, 6 Oct 2007 15:32:50 +0000 (12:32 -0300)
committerFede <fedux@linux-kt9u.site>
Sat, 6 Oct 2007 15:32:50 +0000 (12:32 -0300)
pymin/services/proxy/__init__.py
pymin/services/proxy/templates/squid.conf

index 2740cc8c8ab0f8d546cf6b8986d19bb37d825b17..54ff3797eb5db436662cf3488c446663687fffb2 100644 (file)
@@ -98,12 +98,14 @@ class UserHandler(Handler):
 
     def __init__(self, users):
         self.users = users
-
+       
+    @handler('Adds a user')
     def add(self, user, password):
         if user in self.users:
             raise UserAlreadyExistsError(user)
         self.users[user] = crypt.crypt(password,'BA')
-
+    
+    @handler('Deletes a user')
     def delete(self, user):
         if not user in self.users:
             raise UserNotFound(user)
@@ -156,4 +158,4 @@ if __name__ == '__main__':
     px.host.delete('192.168.0.25.27')
     px.user.add('lala','soronga')
     px.user.add('culo','sarasa')
-    px.commit()
\ No newline at end of file
+    px.commit()
index 3ad5cf4400b2fb9d66d456723de0e4b751c045e4..d986f72b3b6eef77a5acc892d503b0663dc67b03 100644 (file)
@@ -1,4 +1,4 @@
-auth_param basic program /usr/libexec/squid/ncsa_auth /usr/local/Squid/etc/passwd
+auth_param basic program /usr/sbin/ncsa_auth /etc/squid/users.conf
 auth_param basic children 5
 auth_param basic realm Proxy
 auth_param basic credentialsttl 2 hours
@@ -23,6 +23,8 @@ acl Safe_ports port 901         # SWAT
 acl purge method PURGE
 acl CONNECT method CONNECT
 
+acl users proxy_auth REQUIRED
+
 % for host in hosts:
 acl proxy_hosts src ${host.ip}/32
 % endfor
@@ -34,7 +36,10 @@ http_access deny purge
 http_access deny !Safe_ports
 http_access deny CONNECT !SSL_ports
 http_access allow localhost
+% if hosts:
 http_access allow proxy_hosts
+% endif
+http_access allow users
 http_access deny all
 
 http_port ${ip}:${port}
@@ -62,4 +67,4 @@ icp_port 0
 error_directory /usr/share/squid/errors/Spanish
 
 forwarded_for off
-coredump_dir /var/cache/squid
\ No newline at end of file
+coredump_dir /var/cache/squid