Showing posts with label openbsd. Show all posts
Showing posts with label openbsd. Show all posts

Thursday, September 03, 2015

OpenBSD 5.8 radical CalDAV/CardDAV installation


pkg_add -iv radicale
with auth htpasswd radicale does not start

what is missing?

/usr/local/lib/python2.7/site-packages/radicale # python2.7 -m radicale                               
Starting Radicale
Authentication type is htpasswd

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/site-packages/radicale/__main__.py", line 191, in module
    run()
  File "/usr/local/lib/python2.7/site-packages/radicale/__main__.py", line 133, in run
    make_server(address, port, Application(),
  File "/usr/local/lib/python2.7/site-packages/radicale/__init__.py", line 133, in __init__
    auth.load()
  File "/usr/local/lib/python2.7/site-packages/radicale/auth/__init__.py", line 43, in load
    "auth.%s" % auth_type, globals=globals(), level=2)
  File "/usr/local/lib/python2.7/site-packages/radicale/auth/htpasswd.py", line 33, in module
    import bcrypt
ImportError: No module named bcrypt

pkg_add -iv py-bcrypt

later on...

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python2.7/site-packages/radicale/__init__.py", line 289, in __call__
    is_authenticated = auth.is_authenticated(user, password)
  File "/usr/local/lib/python2.7/site-packages/radicale/auth/htpasswd.py", line 80, in is_authenticated
    return globals()["_%s" % ENCRYPTION](hash_value, password)
  File "/usr/local/lib/python2.7/site-packages/radicale/auth/htpasswd.py", line 68, in _bcrypt
    return bcrypt.checkpw(password, hash_value)
ValueError: Invalid hashed_password salt

py-bcrypt has problems with $2b$ hashes :(




Thursday, August 27, 2015

OpenBSD prevent out of memory

diff --git a/login.conf b/login.conf
index d20803f..edda211 100644
--- a/login.conf
+++ b/login.conf
@@ -70,7 +70,7 @@ daemon:\
 # Staff have fewer restrictions and can login even when nologins are set.
 #
 staff:\
-       :datasize-cur=1536M:\
+       :datasize-cur=4096M:\
        :datasize-max=infinity:\
        :maxproc-max=512:\
        :maxproc-cur=256:\

Monday, August 24, 2015

Friday, August 07, 2015

forwarding mail with changed sender/from address

Sometimes I want to relay cron mails over an external mail server. In this cases the mail is delivered faster if I set the FROM to the real address that corresponds to the smtp credentials.

all mails to root are forwarded to alex@other-domain.com
But the FROM is changed to alex@strato-mail-account.de

# cat /etc/mail/aliases
...
root: mycron
mycron: "|/usr/bin/mail -s 'Cron <root@example.com>' -r alex@strato-mail-account.de alex@other-domain.com"
...

# newaliases



# cat /etc/mail/smtpd.conf
...
table secrets db:/etc/mail/secrets.db

accept from local for local alias <aliases> deliver to maildir
accept from local for any relay via tls+auth://label@smtp.strato.de auth <secrets>
...

Friday, June 12, 2015

OpenBSD overwrite DHCP values delivered from server

Sometimes the DHCP-Server returns wrong values.
To overwrite the search domain:

# cat /etc/dhclient.conf
...
supersede domain-name "my-new-domain.net"
...

then
# reboot
or
# dhclient  

Now the new value is in the /etc.resolv.conf