Ich war noch gar nicht fertig... ich habe noch fleissig korrigiert.... *lol*... lies bitte jetzt noch mal....
Nicht widersprüchlich... bin heute nur etwas angeschlagen... wie heisst es so schön...?... influenza oder so...
Ich war noch gar nicht fertig... ich habe noch fleissig korrigiert.... *lol*... lies bitte jetzt noch mal....
Nicht widersprüchlich... bin heute nur etwas angeschlagen... wie heisst es so schön...?... influenza oder so...
Radicale? Schau mal ob du hier fündig wirst!
Servus,
bin neu hier im Forum und knabber gerade an dem gleichem Problem: Der radicale Server läuft und ist unter http://localhost:5232/.web/ im Browser auf dem Raspberry erreichbar.
Die Portweiterleitung des Routers für 5232 ist ebenfalls eingerichtet, aber nicht über http://meine-ip.com:5232/.web/ erreichbar?
In der config Datei habe ich folgendes eingetragen:
Das sollte doch jetzt richtig sein oder?
Nur den Port auf den PI weiterzuleiten reicht nicht.... das ohne fundierte Kenntnisse zur Härtung eines PI zu tun ist auch nur das zweitunvernüftigste.... es fehlt noch das unvernünftigste ... und zwar auch auf dem Router... der Port für TCP muss noch generell geöffnet werden.
Ein paar gut gemeinte Hinweise noch. Wenn die Setup-Konfiguration nur um die Aktivierung des SSH-Servers verändert wurde, kannst Du davon ausgehen, dass Dein PI in weniger als 24 Stunden gekapert ist und fremde Leute nach gutdünken Deine Daten abtransportieren. Du solltest also darauf aufpassen, dass der PI nicht via SSH als "Gateway" zu anderen Rechnern bei Dir genutzt werden kann, die dann ebenfalls ausgelesen werden. Wenn Du also irgendwo Passwörter gespeichert hast, würde ich die zur Sicherheit ausdrucken und die Datei mit XXX überschreiben und dann löschen. Na ja, wird schon gut gehen... viel Glück.
Hallo ThomasL,
vielen Dank für Deine Antwort, aber die hilft mir überhaupt nicht.
Ich weiß immer noch nicht welche IP Adresse ich in der config unter hosts für meine Zwecke eintragen muss bzw was genau folgender Satz der Radicale Dokumentation bedeutet:
Zitat
A comma separated list of addresses that the server will bind to.
Bzgl. Deiner Hinweise: bisher ist der PI stromlos, da er meine Zwecke nicht erfüllt.
Vorerst möchte ich die eigentliche Aufgabe erfüllen, bevor ich mich um Sicherheit kümmere.
EDIT: Es liegt an der Konfiguration des Webservers oder?
Ich weiß immer noch nicht welche IP Adresse ich in der config unter hosts für meine Zwecke eintragen muss bzw was genau folgender Satz der Radicale Dokumentation bedeutet:
Die von Dir angegebene und verwendete Adresse ist so richtig und der Satz bedeutet, dass Du einschränken kannst, auf welche NICs gelauscht wird . Die angegebene Adresse lauscht einfach auf allen vorhandenen NICs.... was ja auch erwünscht und sogar sinnvoll ist.
Wenn radicale gestartet ist, kannst Du auf dem PI überprüfen, ob der Dienst auf Port 5232 lauscht:
Und wenn ja, ist er grundsätzlich erreichbar. Wenn er trotzdem nicht erreichbar ist, liegt es an etwas anderes... eine Firewall, Client oder Server, oder eben am Router, wenn der Port noch geschlossen ist und der Zugriff von außen erfolgen soll. Aber mit dem Router hatte ich ja oben schon gesagt.Innerhalb es Netzes, also nur ein anderer PC im LAN, ist die Port-Öffnung nicht notwendig.
Hallo ThomasL,
ich habe mich weiterhin an dem Problem versucht, aber ich komme nicht weiter. Wenn ich den Radicale Server starte kommt folgende Rückmeldung:
pi@raspberrypi:~ $ python3 -m radicale --config "" --storage-filesystem-folder=~/.var/lib/radicale/collections --debug
[76fa2010] INFO: Starting Radicale
[76fa2010] INFO: Authentication type is 'none'
[76fa2010] INFO: Storage type is 'multifilesystem'
[76fa2010] INFO: Rights type is 'None'
[76fa2010] INFO: Web type is 'internal'
[76fa2010] INFO: Listening to 'localhost' on port 5232
[76fa2010] INFO: Radicale server ready
Dann kann ich unter http://localhost:5232/.web/ auf dem Raspi mich auch mit den angelegten Usern anmelden. Kalender anlegen etc. funktioniert dort wunderbar.
Aber ich kann von keinem meiner Geräte von außerhalb zugreifen, sogar mit unterschiedlichen Clients ausprobiert. Nach dem Starten des Radicale-Servers gibt netstat folgendes aus:
pi@raspberrypi:~ $ netstat -tulpn
(Es konnten nicht alle Prozesse identifiziert werden; Informationen über
nicht-eigene Processe werden nicht angezeigt; Root kann sie anzeigen.)
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:5232 0.0.0.0:* LISTEN 2829/python3
tcp6 0 0 :::80 :::* LISTEN -
udp 0 0 0.0.0.0:5353 0.0.0.0:* 998/libpepflashplay
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp 0 0 0.0.0.0:49005 0.0.0.0:* -
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp6 0 0 :::5353 :::* 998/libpepflashplay
udp6 0 0 :::5353 :::* -
udp6 0 0 :::40741 :::* -
udp6 0 0 :::546 :::*
Alles anzeigen
Die config von Radicale sieht wie folgt aus:
[server]
# CalDAV server hostnames separated by a comma
# IPv4 syntax: address:port
# IPv6 syntax: [address]:port
# For example: 0.0.0.0:9999, [::]:9999
# IPv6 adresses are configured to only allow IPv6 connections
hosts = 0.0.0.0:5232
# Daemon flag
daemon = True
# File storing the PID in daemon mode
pid = /home/radicale/radicale.pid
# SSL flag, enable HTTPS protocol
ssl = True
# SSL certificate path
certificate = /etc/ssl/server.crt
# SSL private key
key = /etc/ssl/server.key
# SSL Protocol used. See python's ssl module for available values
protocol = PROTOCOL_SSLv23
# Ciphers available. See python's ssl module for available ciphers
ciphers =
# Reverse DNS to resolve client address in logs
dns_lookup = True
# Root URL of Radicale (starting and ending with a slash)
base_prefix = /
# Possibility to allow URLs cleaned by a HTTP server, without the base_prefix
can_skip_base_prefix = False
# Message displayed in the client when a password is needed
realm = Radicale - Password Required
[encoding]
# Encoding for responding requests
request = utf-8
# Encoding for storing local collections
stock = utf-8
[auth]
# Authentication method
# Value: None | htpasswd | IMAP | LDAP | PAM | courier | http | remote_user | custom
type = htpasswd
# Htpasswd filename
htpasswd_filename = /etc/radicale/users
# Htpasswd encryption method
# Value: plain | sha1 | crypt | bcrypt
htpasswd_encryption = bcrypt
[rights]
# Rights backend
# Value: None | authenticated | owner_only | owner_write | from_file | custom
type = owner_write
[storage]
# Storage backend
# Value: filesystem | multifilesystem | database | custom
type = filesystem
# Folder for storing local collections, created if not present
filesystem_folder = ~/home/radicale/collections
[logging]
# Logging configuration file
# If no config is given, simple information is printed on the standard output
# For more information about the syntax of the configuration file, see:
# http://docs.python.org/library/logging.config.html
config = /etc/radicale/logging
# Set the default logging level to debug
debug = False
# Store all environment variables (including those set in the shell)
full_environment = False
Alles anzeigen
Hmmm, wenn ich gerade die Ausgabe des Radicale-Servers mit dem config-File vergleiche, scheinen die Konfigurationen ja überhaupt nicht geladen zu werden...
Scheinbar ist mein Start-Befehl falsch...
Du übergibst radicale --config "" also leer, deswegen wird deine config nicht benutzt.
--config=~/etc/radicale/config
Liegt die bei dir wirklich in /home/pi/etc/radicale?
Ich nehme eher mal an in /etc/radicale (ansonsten anpassen), also:
... --config "/etc/radicale/config" ...
oder
... -C "/etc/radicale/config" ...
Mehr Info:
radicale --help
ne, quatsch... lag tatsächlich in etc/radicale/config.
Jetzt läuft es lokal alles so wie es soll...
Ich habe das config file nochmal angepasst:
[server]
# CalDAV server hostnames separated by a comma
# IPv4 syntax: address:port
# IPv6 syntax: [address]:port
# For example: 0.0.0.0:9999, [::]:9999
# IPv6 adresses are configured to only allow IPv6 connections
hosts = 0.0.0.0:5232
[encoding]
# Encoding for responding requests
request = utf-8
# Encoding for storing local collections
stock = utf-8
[auth]
# Authentication method
# Value: None | htpasswd | IMAP | LDAP | PAM | courier | http | remote_user | custom
type = htpasswd
# Htpasswd filename
htpasswd_filename = /etc/radicale/users
# Htpasswd encryption method
# Value: plain | sha1 | crypt | bcrypt
htpasswd_encryption = bcrypt
[rights]
# Rights backend
# Value: None | authenticated | owner_only | owner_write | from_file | custom
type = owner_write
[storage]
# Storage backend
# Value: filesystem | multifilesystem | database | custom
type = multifilesystem
Alles anzeigen
Für eine SSL-Verbindung habe ich folgenden Codeblock unter [server] hinter hosts = 0.... eingefügt (mit angepassten Pfaden):
ssl = True
certificate = /home/pi/server_cert.pem
key = /home/pi/server_key.pem
certificate_authority = /home/pi/client_cert.pem
Aber da bekomme ich nur folgende Fehlermeldung:
ERROR: Invalid configuration: Invalid option '\u200b# ipv4 syntax' in section 'server' in config
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/pi/.local/lib/python3.5/site-packages/radicale/__main__.py", line 291, in <module>
run()
File "/home/pi/.local/lib/python3.5/site-packages/radicale/__main__.py", line 93, in run
ignore_missing_paths=ignore_missing_paths)
File "/home/pi/.local/lib/python3.5/site-packages/radicale/config.py", line 247, in load
"config" % (option, section))
RuntimeError: Invalid option '\u200b# ipv4 syntax' in section 'server' in config
Alles anzeigen
Die Zertifikate habe ich wie in der offiziellen Dokumentation von Radicale angelegt...
Okay, ich hab's nu geschafft. Folgende Dinge musste ich an den Raspi ändern:
1. Die Firewall mit folgenden Skript konfigurieren, damit auf den Port von Radicale gehört wird:
#!/bin/bash
# flush all existing chains and delete non default-chains
iptables -F
iptables -X
ip6tables -F
ip6tables -X
# custom chains
iptables -N TCP_IN
iptables -N UDP_IN
ip6tables -N TCP_IN
ip6tables -N UDP_IN
# FORWARD, OUTPUT and INPUT chain
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -P INPUT DROP
ip6tables -P FORWARD DROP
ip6tables -P OUTPUT ACCEPT
ip6tables -P INPUT DROP
# allow existing established connections for INPUT and OUTPUT
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
ip6tables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# allow loopback interface for INPUT and OUTPUT
iptables -A INPUT -i lo -j ACCEPT
ip6tables -A INPUT -i lo -j ACCEPT
# drop invalid packages
iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
ip6tables -A INPUT -m conntrack --ctstate INVALID -j DROP
# ICMP
iptables -A INPUT -p icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT
ip6tables -A INPUT -p icmpv6 --icmpv6-type 128 -m conntrack --ctstate NEW -j ACCEPT
# DHCPv6
ip6tables -A INPUT -s fe80::/10 -j ACCEPT
ip6tables -A OUTPUT -s fe80::/10 -j ACCEPT
# set TCP_IN and UDP_IN chain as INPUT chain
iptables -A INPUT -p udp -m conntrack --ctstate NEW -j UDP_IN
iptables -A INPUT -p tcp --syn -m conntrack --ctstate NEW -j TCP_IN
ip6tables -A INPUT -p udp -m conntrack --ctstate NEW -j UDP_IN
ip6tables -A INPUT -p tcp --syn -m conntrack --ctstate NEW -j TCP_IN
# reject incomming connections if ports are not opened
iptables -A INPUT -p udp -m recent --set --rsource --name UDP-PORTSCAN -j REJECT --reject-with icmp-port-unreachable
iptables -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
iptables -A INPUT -p tcp -j REJECT --reject-with tcp-reset
ip6tables -A INPUT -p udp -j REJECT --reject-with icmp6-port-unreachable
ip6tables -A INPUT -p tcp -j REJECT --reject-with tcp-reset
iptables -A INPUT -j REJECT --reject-with icmp-proto-unreachable
ip6tables -A INPUT -j REJECT
# allow incomming traffic
iptables -A TCP_IN -p tcp --dport 22 -j ACCEPT
iptables -A TCP_IN -p tcp --dport 80 -j ACCEPT
iptables -A TCP_IN -p tcp --dport 443 -j ACCEPT
iptables -A TCP_IN -p tcp --dport 5232 -j ACCEPT
ip6tables -A TCP_IN -p tcp --dport 22 -j ACCEPT
ip6tables -A TCP_IN -p tcp --dport 80 -j ACCEPT
ip6tables -A TCP_IN -p tcp --dport 443 -j ACCEPT
ip6tables -A TCP_IN -p tcp --dport 5232 -j ACCEPT
# save the firewall rules
iptables-save > /etc/iptables/iptables.rules
ip6tables-save > /etc/iptables/ip6tables.rules
Alles anzeigen
2. Die Konfigdatei von Radicale sieht bei mir so aus:
[server]
# CalDAV server hostnames separated by a comma
# IPv4 syntax: address:port
# IPv6 syntax: [address]:port
# For example: 0.0.0.0:9999, [::]:9999
# IPv6 adresses are configured to only allow IPv6 connections
hosts = 0.0.0.0:5232
ssl = True
# SSL certificate path
certificate = /home/pi/server_cert.pem
# SSL private key
key = /home/pi/server_key.pem
#certificate_authority = /home/pi/client_cert.pem
# SSL Protocol used. See python's ssl module for available values
#protocol = PROTOCOL_SSLv23
[encoding]
# Encoding for responding requests
request = utf-8
# Encoding for storing local collections
stock = utf-8
[auth]
# Authentication method
# Value: None | htpasswd | IMAP | LDAP | PAM | courier | http | remote_user | custom
type = htpasswd
# Htpasswd filename
htpasswd_filename = /etc/radicale/users
# Htpasswd encryption method
# Value: plain | sha1 | crypt | bcrypt
htpasswd_encryption = bcrypt
[rights]
# Rights backend
# Value: None | authenticated | owner_only | owner_write | from_file | custom
type = owner_only
[storage]
# Storage backend
# Value: filesystem | multifilesystem | database | custom
type = multifilesystem
Alles anzeigen
3. Die ssl Zertifikate anlegen, wie zum Beispiel hier unter Schritt 7 beschrieben: https://jankarres.de/2015/01/raspbe…r-installieren/
4. Dann den gewünschten Port von https://meineRaspiWunschadresse.org auf den Radical Port 5232 im Router umleiten.
5. Radicale starten.
Ich glaube ich werde noch die Ports der Firewall 22, 80, 443 schließen, da ich die eigentlich nicht benötige...
Als nächstes würde ich gerne:
Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!