{"id":23832088,"url":"https://github.com/linagora/esn-sabre","last_synced_at":"2025-09-07T11:31:37.787Z","repository":{"id":31598510,"uuid":"35163372","full_name":"linagora/esn-sabre","owner":"linagora","description":"SabreDAV for OpenPaaS ESN","archived":false,"fork":false,"pushed_at":"2024-06-25T21:43:32.000Z","size":1170,"stargazers_count":8,"open_issues_count":2,"forks_count":8,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-06-25T22:33:09.110Z","etag":null,"topics":["caldav-server","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ftyers/ftyers.github.io","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linagora.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-AGPL-v3-OPENPAAS.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-06T14:26:48.000Z","updated_at":"2024-06-25T21:09:18.000Z","dependencies_parsed_at":"2022-09-15T13:02:21.753Z","dependency_job_id":"5c3bbca3-12d7-4cd2-92bf-dc2c662fe0fa","html_url":"https://github.com/linagora/esn-sabre","commit_stats":null,"previous_names":[],"tags_count":109,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linagora%2Fesn-sabre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linagora%2Fesn-sabre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linagora%2Fesn-sabre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linagora%2Fesn-sabre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linagora","download_url":"https://codeload.github.com/linagora/esn-sabre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232206388,"owners_count":18488512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caldav-server","php"],"created_at":"2025-01-02T14:17:59.205Z","updated_at":"2025-09-07T11:31:37.773Z","avatar_url":"https://github.com/linagora.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenPaaS ESN Frontend for SabreDAV\n\nWelcome to the OpenPaaS frontend for [SabreDAV](http://sabre.io/). This frontend adds calendaring and address book capabilities to your OpenPaaS instance and allows you to access them via standard CalDAV and CardDAV clients like Lightning.\n\n## Setting up the Environment\n\nThose are the steps needed on an [Ubuntu](http://ubuntu.com/) distribution, but the equivalent can be found for any Linux flavor.\n\n### Install esn-sabre\n\n```bash\ncd /var/www/html\ngit clone https://ci.linagora.com/linagora/lgs/openpaas/esn-sabre.git\n```\n\nThe OpenPaaS frontend is managed through [composer](https://getcomposer.org/), all requirements can easily be set up using:\n\n```bash\ncd esn-sabre\ncomposer update\n```\n\nThis command can be repeated to update package versions.\n\n### create the configuration file\n\nThe configuration file can be created from the example file.\n\n```bash\ncp config.json.default config.json\n```\n\nor by running the generation script:\n\n```bash\nsh ./scripts/generate_config.sh \u003e config.json\n```\n\nYou then have to modify the configuration to match your setup.\n\n-\t**webserver.baseUri**\n\nThe local part of the url that bring the esn.php file.\n\nFrom apache, if you reach esn.php through http://YOUR_ESN_SABRE_IP/esn-sabre/esn.php then your baseUri is **/esn-sabre/esn.php**.\n\nBy using Docker your baseUri is only **/**.\n\n-\t**webserver.allowOrigin**\n\nThis setting is used to configure the headers returned by the CalDAV server. It's usefull to configure CORS. Either set the hostname of your ESN server, or leave \"*\".\n\n-\t**database.esn**\n\nThis is the configuration to access the ESN datastore\n\n-\t**database.sabre**\n\nThis is the configuration where the CalDAV server will store its data.\n\n-\t**esn.apiRoot**\n\nThis is the URL the Caldav server will use to access the OpenPaaS ESN API.\n\n-\t**mail**\n\nThis is the configuration the Caldav server will use to send emails.\n\n### Configure advanced logging\n\nSabre can use [Monolog](https://github.com/Seldaek/monolog) to push log to standard file.\n\nTo configure logger add the `\"logger\"` item in config file with each logger needed\n\nYou can add ENV fields, these fields will add ENV variables values to each log entry in the `extras` field.\nENV fields define a field name that contains ENV variable value.\n\nFull configuration is:\n```json\n{\n        \"logger\" : {\n                \"fileLogger\": {\n                        \"path\": \"Path to the file (required)\",\n                        \"level\": \"debug level (default ERROR)\"\n                },\n                \"envFields\": {\n                        \"myFirstEnvFieldName\": \"MY_FIRST_ENV_VARIABLE_NAME\",\n                        \"mySecandEnvFieldName\": \"MY_SECOND_ENV_VARIABLE_NAME\",\n                        ...\n                }\n        }\n}\n```\n\nDate format is specified by php date format [here](http://php.net/manual/fr/function.date.php)\n\nLog level can be :\n\n * ALERT\n * CRITICAL\n * ERROR\n * WARNING\n * NOTICE\n * INFO\n * DEBUG\n\n\n### System \u0026 Apache environment\n\nesn-sabre requires an Apache server to work.\n\n-\tInstall PHP5 support into Apache\n\n```bash\napt-get install libapache2-mod-php5\n```\n\nUbuntu 16.04\n\n```bash\napt install php5.6 php5.6-bcmath libapache2-mod-php5.6\n```\n\n-\tInstall mongodb \u0026 curl support in PHP\n\n```bash\napt-get install php5-mongo php5-curl\n```\n\nUbuntu 16.04\n\n```bash\napt-get install php5.6-mongo php5.6-curl\n```\n\nIf **composer update** throws an error, you might want to use PECL\n\n```bash\napt-get install php5-dev php-pear \u0026\u0026 pecl install mongo\n```\nUbuntu 16.04\n\n```bash\napt-get install php5.6-dev php-pear \u0026\u0026 pecl install mongo\n```\n\nDepending on your linux version you may need to add mongo extension in php.ini\n\n```bash\nextension=mongo.so\nextension=mbstring.so\n```\n\n-\tRestart Apache\n\n```bash\n/etc/init.d/apache2 restart\n```\n\n-\tTest your environment by pointing a browser to the \"esn.php\" file\n\n    http://your.server.example.com/esn-sabre/esn.php\n\n### Enable the Caldav support in OpenPaaS ESN\n\nThe caldav support in OpenPaaS ESN is enabled by telling the system where to find the caldav server. To do so, create a document in the configuration collection, having this structure:\n\n```json\n{\n        \"_id\" : \"davserver\",\n        \"backend\" : {\n                \"url\" : \"http://192.168.7.6/esn-sabre/esn.php\" // replace 192.168.7.6 by your localhost\n        },\n        \"frontend\" : {\n                \"url\" : \"http://my-caldav-server.example.com/esn-sabre/esn.php\"  // replace my-caldav-server.example.com by your localhost\n        }\n}\n```\n\nThe backend url is used by the ESN SERVER to access the caldav server. The frontend url is used by the user's browser to access the caldav server.\n\n## Unit tests and codestyle\n\nA simple Makefile exists to make it easier to run the tests and check code style. The following commands are available:\n\n```bash\nmake test                        # Run all tests\nmake test TARGET=tests/CalDAV/   # Run only certain tests\nmake test-report                 # Run tests and create a coverage report\n\n# run tests with docker compose\n./run_test.sh\n\nmake lint                        # Check code style for the whole project\nmake lint TARGET=lib/            # Check only certain files for lint\n```\n\nThe coverage report will be placed in the `tests/report` directory, a clickable link will be presented when done.\n\n## Docker\n\n### Build\n\n```\ndocker build -t linagora/esn-sabre .\n```\n\n### Run\n\nIn order to run, the ESN sabre instance must access to the ESN, and mongo instances. They can be configured from the run command using these optional environment variables:\n\n- SABRE_MONGO_HOST: Mongodb instance used to store sabre data, defaults to 'sabre_mongo'\n- SABRE_MONGO_PORT: Port used by the Mongodb instance defined above, defaults to '27017'\n- SABRE_MONGO_DBNAME: Sabre database name in the MongoDB instance, defaults to 'sabre'\n- SABRE_ENV: Specify if Sabre is in `dev` mode or `production` mode (default).\n- ESN_MONGO_HOST: Mongodb instance of the ESN, used to create principals, defaults to 'esn_mongo'\n- ESN_MONGO_PORT: Port of the ESN Mongodb instance, defaults to '27017'\n- ESN_MONGO_DBNAME: Database name of the ESN Mongodb instance, defaults to 'esn'\n- ESN_HOST: Hostname of the ESN API, defaults to 'esn_host'\n- ESN_PORT: Port of the ESN API, defaults to '8080'\n- AMQP_HOST: AMQP instance used by Sabre and the ESN, defaults to 'amqp_host'\n- AMQP_PORT: Port of the instance defined just above, defaults to '5672'\n- AMQP_LOGIN: login used to connect to the message broker defined above, defaults to 'guest'\n- AMQP_PASSWORD: password used to connect to the message broker defined above, defaults to 'guest'\n- MONGO_TIMEOUT: Timeout to connect to Mongodb, defaults to 10000 ms\n\nFor example:\n\n```\ndocker run -d -p 8001:80 -e \"SABRE_MONGO_HOST=192.168.0.1\" -e \"ESN_MONGO_HOST=192.168.0.1\" linagora/esn-sabre .\n```\n\nThis will launch the Sabre container, create its configuration, launch Sabre and expose on port 8001 on your host.\n\n### Test\n\nYou can run the unit test with Docker to avoid to install all the PHP tools and dependencies locally.\nUnit tests need a MongoDB container to run:\n\n```\ndocker network create esn-sabre-net\n```\nThen using this network\n```\ndocker run --hostname=\"sabre_mongo\" --name sabre_mongo --network=esn-sabre-net -v  sabre_mongo:/data/db -d docker.io/library/mongo:3.4.0\ndocker run --hostname=\"esn_mongo\" --name esn_mongo --network=esn-sabre-net -v  esn_mongo:/data/db -d docker.io/library/mongo:3.4.0\ndocker run --hostname=\"amqp_host\" --name amqp_host --network esn-sabre-net -d docker.io/library/rabbitmq:3\ndocker run --hostname=\"esn_host\" --name esn_host -p 8001:80 -d -v ./:/var/www --network esn-sabre-net linagora/esn-sabre ./scripts/start.sh\n```\n\nYou may use also docker-compose:\n```\ndocker-compose -f ./compose-minimal.yml up -d\n```\n\nOnce MongoDB container is started, you can run the unit test like this:\n\n```\ndocker exec -it esn_host /bin/bash\n$ make\n```\n\n\n\nIt will use the `linagora/esn-sabre` image, you may need to rebuid it in some cases, but the `make` command will update composer dependencies automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinagora%2Fesn-sabre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinagora%2Fesn-sabre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinagora%2Fesn-sabre/lists"}