Photo by jason hafso on Unsplash

Photo by jason hafso on Unsplash

Open source calendar synchronization

Synchronicity

Article from ADMIN 60/2020
By
If you use your Google account to synchronize appointments between your smartphone and your desktop computer, you can do this just as easily with an open source solution.

Almost everyone has a Google account, so synchronizing calendars (such as your Thunderbird calendar) between your computer and an Android device with Google seems like an obvious solution. If you enter a date on your Thunderbird calendar, it automatically appears on your smartphone calendar. However, this choice comes with drawbacks: Google makes its money by collecting and evaluating your data, among other things.

Luckily, an alternative based on open source software gives you another option. This alternative option involves Nextcloud [1] on the server, Thunderbird and its Lightning Calendar extension on the desktop [2], and DAVx5 [3] and Etar [4] on the Android device. I did not test the Nextcloud alternative ownCloud [5], but calendar sharing may also work with ownCloud due to its similarity to Nextcloud.

In Figure 1, the user (Kris) shares a calendar (see the box "Sharing Several Calendars") with other users (Alice and Bob) The shared calendar ends up on the Android devices of all participants, as well as on their desktops, which are also running Thunderbird and Lightning in this test. All participants have their own Nextcloud accounts to store their calendars. This not only offers the option of securing the calendars with access data, but each participant can also opt out of the shared calendar and run their own calendars to which other users have no access.

Sharing Several Calendars

There are actually some advantages to sharing multiple calendars. On the one hand, each calendar can be assigned a different color, which improves clarity. Birthdays appear in blue, vacations and public holidays in green, and so on. In addition, many calendar programs let you hide individual calendars. The calendar then shows only the next vacations or the next appointments.

Figure 1: Kris shares a calendar with Alice and Bob. Their devices then access the shared calendars via their individual Nextcloud accounts.

I tested the Nextcloud instance on a virtual server on the web, but this is not a requirement. An alternative is to have Nextcloud hosted by a third-party provider. However, your calendar data might end up with the third-party provider, which is not desirable.

You can choose to run the Nextcloud software on a private network, such as network-attached storage (NAS) or a Raspberry Pi. The disadvantage is that if the calendars cannot be accessed via the Internet, they only synchronize when the users' smartphones and computers connect to the private network. Using port forwarding, DDNS, and NAS-specific solutions can remedy this by making a private Nextcloud instance accessible via the Internet.

Adding a Calendar

I will show calendar sharing using two calendars: one with holidays (MyHolidays ), which the admin keeps private, and one with appointments (OurDates ), which is shared with other users.

I'll assume that you, functioning as the calendar admin, have already installed the Lightning Calendar extension in Thunderbird (using Thunderbird 68.10.0 installed with Ubuntu 20.04) and are running a calendar locally.

To open the calendar view, go to Appointments and Tasks | Calendar or use Ctrl+Shift+C. Next, select the existing calendar with appointments on the left, right click on it, and choose Export Calendar . This creates an .ics file, which you will store as OurDates in a folder. For the MyHolidays calendar, you can download a ready-to-use ICS file [6] from the Internet.

Nextcloud Calendar Setup

Next, you need to integrate the calendars into Nextcloud. The calendar app may still be missing in Nextcloud. To install the calendar app, log in as the Nextcloud administrator, click on the profile picture top right, and select Apps from the drop-down menu. Then locate the Calendar app and enable it. A calendar icon now should appear in the top pane of all Nextcloud accounts.

You can go ahead and create your two calendars in the Nextcloud admin account, but this would require giving Thunderbird and DAVx5 the Nextcloud admin's access data so that the programs can access the calendars. To avoid this unnecessary risk, you should create a separate Nextcloud account for each user that only manages the calendars.

Next, you create a new user account for yourself (kris in the example) and two employees (alice and bob ) by selecting User from the menu in the upper right corner. Then you log off as admin and log on again as kris . A click on the calendar icon in the menubar at the top opens the calendar on the screen.

In the calendar view, you will see a calendar named Personal . Ignore this and click on New Calendar | New Calendar with Task List and create two empty calendars named OurDates and MyHolidays .

Next, you import the local ICS files into your kris profile by clicking on Settings & import in the lower left corner and then on Import Calendar . Search the hard disk for the MyHolidays.ics file and click Open . An import window prompts you to decide which calendar to use to import MyHolidays.ics . On the right side of the window, the two calendars created in Nextcloud are available for selection. Choose MyHolidays and then repeat the procedure for OurDates . Depending on the number of appointments, the import can take a couple of minutes. Finally, the dates appear in the Nextcloud calendar (Figure 2).

Figure 2: After importing the two ICS files from the kris profile, the dates appear in the Nextcloud calendar.

Sharing Calendars

To now share the OurDates calendar as the user kris with Alice and Bob, just click on the link-sharing icon to the right of the calendar name. An input field appears where you first enter alice to share the calendar with Alice. Nextcloud automatically completes the profile name. Check the Can edit box and then click on the empty space below the calendars. Repeat this procedure for Bob (entering bob ). When Bob and Alice log in to their Nextcloud accounts, they will find the shared calendar waiting for them.

Remain logged in as kris to integrate your Nextcloud calendars in Thunderbird and Android in the next step. For this, you need the direct link to the calendars. To the right of the calendar name, click on the symbol with the three dots and choose Copy private link . The links for the two calendars should look like the ones shown in Listing 1.

Listing 1

Calendar Links

https://nextcloud.<example.com>/remote.php/dav/calendars/kris/ourdates/
https://nextcloud.<example.com>/remote.php/dav/calendars/kris/myholidays/

Armed with these URLs, you now switch to Thunderbird and again call the calendar module. A right-click on the free space below opens a selection menu. Choose New Calendar , which displays a window where you can include either a local or a remote calendar. Select On the Network and click Next .

In the next window, select CalDAV for Format and paste the first URL from Listing 1 to access the Nextcloud calendar (Figure 3). You can then customize your calendar by entering a name , selecting a color , checking the Show Reminders box, and entering an email address that matches the calendar.

Figure 3: Thunderbird's calendar expects a private link to the Nextcloud calendar followed by kris's login data in the next window.

A click on Next finally takes you to a login window, where you enter the access data for the kris Nextcloud account. The calendars now appear on the left side of the Lightning module in Thunderbird.

Alice and Bob follow the same procedure, each logging on to Nextcloud and copying the links to their calendars. Their links differ (Listing 2) from those shown in Listing 1. Alice and Bob provide their own Nextcloud credentials during the final step of Thunderbird configuration.

Listing 2

Bob's Calendar Links

https://nextcloud.<example.com>/remote.php/dav/calendars/bob/ourdates_shared_by_kris/
https://nextcloud.<example.com>/remote.php/dav/calendars/bob/myholidays/

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=