Skip to content

Commit

Permalink
New post!
Browse files Browse the repository at this point in the history
  • Loading branch information
FarisZR committed Nov 30, 2024
1 parent 678740a commit b03d8ec
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 10 deletions.
119 changes: 119 additions & 0 deletions content/post/contact-calendar-dav-sync-Radicale-docker/index.ar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
title: تثبيت خادم Radicale لمزامنة جهات الاتصال والتقويم مع Docker.
categories:
- guides
tags:
- docker
- دوكر
- compose
- Linux
- caldav
date: 2024-11-30
canonicalurl: https://discourse.aosus.org/t/topic/3583
slug: contact-calendar-dav-sync-Radicale-docker
summary: شرح لطريقة تثبيت خادم Radicale لمزامنة جهات الاتصال والتقويم باستخدام Docker مع اعدادات الأمان والربط مع Caddy
image: thumbnail.jpg
keywords:
- Radicale
- davx
- docker
---

كنت استخدم Etesync لمزامنة جهات الاتصال, لكن للاسف تطبيقهم على iOS لم يعد يعمل.

لحسن الحظ وجدت Radicale, خادم مفتوح المصدر يستخدم بروتوكول Caldav/cardav المعروف لمزامنة جهات الاتصال و التقويم و حتى قوائم المهام وحتى ايضا الملاحظات.
طبعا مقال من FarisZR لازم نستخدم فيه دوكر.

مشروع Radicale ليس لديه صورة دوكر رسمية, لكن [tomesquest](https://github.com/tomsquest/docker-radicale) وفر علينا الوقت وانشئ صورة دوكر جاهزة.

## docker-compose.yml
* استخدمت شبكة خارجية باسم Web لربط الخدمة بCaddy, بامكانك كشف المنفذ 5232 مباشرة اذا احتجت.

```yaml
networks:
web:
external: true

services:
radicale:
image: tomsquest/docker-radicale:latest
container_name: radicale
# ports:
# - 127.0.0.1:5232:5232
init: true
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- SETUID
- SETGID
- CHOWN
- KILL
deploy:
resources:
limits:
memory: 256M
pids: 50
healthcheck:
test: curl -f http://127.0.0.1:5232 || exit 1
interval: 30s
retries: 3
restart: unless-stopped
volumes:
- ./data:/data
- ./config:/config
networks:
- web
```
## config
هناك ملف Config مضمن بشكل افتراضي, لكن سنحتاج لتعديله لنضيف خيارات تسجيل الدخول وكلمات المرور.
أستخدم قالب م[لف config من Github](https://github.com/tomsquest/docker-radicale/blob/master/config), لتنشئ الملف محليا دخل مجلد `config`, قم بتعديله كما يناسبك, لكن تاكد من عدم تعديل اماكن الملفات.

### Auth

تاكد ان قسم Auth في مِلَفّ config يحتوي على هذه الإعدادات:

```ini
[auth]
type = htpasswd
htpasswd_filename = /config/users
htpasswd_encryption = bcrypt
```

### عمل hash لكلمة السر مع bcrypt
في اعدادات auth استخدمنا bcrypt كصيغة الhash لكلمة المرور.
لعمل هاش لكلمة المرور الخاص بك استخدم هذا الامر

```bash
echo -n "your password" | mkpasswd --method=bcrypt
```

ثم انشئ ملف `users` داخل مجلد `config` المربوط بالبرمجية.
محتواه يجب ان يكون مثل هكذا:

```htpasswd
john:$2a$10$l1Se4qIaRlfOnaC1pGt32uNe/Dr61r4JrZQCNnY.kTx2KgJ70GPSm
```

والان بامكانك تشغيل الخادم!

```bash
docker compose up -d
```

## Caddy reverse proxy
```json
sync.example.com {
reverse_proxy radicale:5232
encode zstd gzip
}
```
## استيراد البيانات
من تجربتي استيراد البيانات عبر واجهه الويب لم يعمل, قمت باستيراد جهات الاتصال على هاتفي ثم زامنتها وهكذا حللت المشكلة.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
title: Setup Contact and Calendar sync using Radicale and Docker compose.
title: Setup Contact and Calendar (dav)sync using Radicale and Docker compose.
categories:
- guides
tags:
- docker
- compose
- Linux
draft: true
date: 2024-11-29
slug: contact-calendar-sync-Radicale-docker
summary: Sometimes there are issues with flatpak apps not following Dark mode on gnome, here are few fixes and workarounds for this.
image: thumbnail.png
- caldav
date: 2024-11-30
slug: contact-calendar-dav-sync-Radicale-docker
summary: How to setup contact and calendar syncing across devices using Radicale server and Docker compose, with authentication and reverse proxy configuration.
image: thumbnail.jpg
keywords:
- Radicale
- davx
Expand Down Expand Up @@ -71,11 +71,12 @@ services:
There's a template config file for the docker image, we still need to change something to be able to set up htpasswd auth.
Create a file named config with the raw content of [the config file from github](https://github.com/tomsquest/docker-radicale/blob/master/config)
Create a file named config inside the mounted config directory with the raw content of [the config file from github](https://github.com/tomsquest/docker-radicale/blob/master/config)
and modify it to your liking, if you want to change the data directory, make sure to adjust the mount points in docker compose accordingly.
and modify it to your liking
## Auth
Make sure the auth section looks something like this:
We need to adjust the auth section to enable authentication with a password, here's an example:
```ini
[auth]
Expand All @@ -91,7 +92,7 @@ Now, as you probably noticed, htpasswd encryption is set to bcrypt, which means
echo -n "your password" | mkpasswd --method=bcrypt
```

and then create a file called `users' in the mounted `config' directory.
Then create a file called `users` in the mounted `config` directory.
It should be formatted like this:

```htpasswd
Expand All @@ -107,5 +108,6 @@ sync.example.com {
encode zstd gzip
}
```

## Importing data
For me, importing data from the web UI didn't work, I just re-imported my contacts on my phone and it worked.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b03d8ec

Please sign in to comment.