Skip to content

Commit

Permalink
feat(docs): add phonebook sync feature to README
Browse files Browse the repository at this point in the history
Add documentation for the new phonebook synchronization system in the
README. This includes an overview of the `webtop2phonebook.php` and
`pbook2webtop.php` scripts, environment variable setup, and manual
configuration steps for enabling the service and timer.
  • Loading branch information
Amygos committed Jan 27, 2025
1 parent 4a2b05f commit f0b20d0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,42 @@ modify the contents of the `./templates` directory directly, as they will
be overwritten during the next application update. Files under
`./state/webtop.properties.d/` are retained and are also added to backup.

## Phonebook feature

The phonebook synchronization system allows you to manage contacts between
**WebTop** and a centralized **Phonebook**. This feature is supported by
scripts and timer-based systemd services for automation.

### Synchronization Scripts Overview

- **`webtop2phonebook.php`:**
- Extracts contacts from WebTop.
- Processes the contacts and removes pre-existing WebTop entries in the
phonebook.
- Inserts the cleaned and updated contacts into the phonebook database.

- **`pbook2webtop.php`:**
- Extracts contacts from the phonebook database.
- Cleans up the WebTop contacts folder and replaces its contents with
updated contacts.

Both scripts use environment variables (`PHONEBOOK_DB_HOST`,
`PHONEBOOK_DB_PASSWORD`) for connecting to the databases. The sync process to
run daily at 23:00.

### Manual Configuration Steps

Follow these steps to manually configure and use the phonebook synchronization:
1. Set the environment variables for the phonebook database connection.
- **`PHONEBOOK_DB_HOST`**: The hostname or IP address of the phonebook
database, formatted as `host:port`.
- **`PHONEBOOK_DB_PASSWORD`**: The password for the phonebook database user.
1. Enable and start the service and timer, eg.:
```bash
runagent -m webtop1 systemctl --user enable phonebook.service
runagent -m webtop1 systemctl --user enable phonebook.timer
runagent -m webtop1 systemctl --user start phonebook.timer
```
## Uninstall

To uninstall the instance:
Expand Down

0 comments on commit f0b20d0

Please sign in to comment.