diff --git a/.env b/.env new file mode 100644 index 0000000000000000000000000000000000000000..d6dd77dca234b80819e81526da2d4badcd0938a4 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +COMPOSE_PROJECT_NAME=syncevolution diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..f92da7b142f506a53baa2e4028ac3e501c5919d9 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,4 @@ +--- +include: + - project: shore/ci-templates + file: templates/pre-commit.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..491c03fe90d58ef938e463db4c9e846df9647f84 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,41 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks.git + rev: v3.4.0 + hooks: + - id: check-added-large-files + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-symlinks + - id: trailing-whitespace + + - repo: https://github.com/Yelp/detect-secrets + rev: v0.14.3 + hooks: + - id: detect-secrets + + - repo: https://github.com/adrienverge/yamllint + rev: v1.25.0 + hooks: + - id: yamllint + + - repo: https://github.com/executablebooks/mdformat.git + rev: 0.5.3 + hooks: + - id: mdformat + + - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git + rev: v0.6.0 + hooks: + - id: shell-lint + + - repo: https://github.com/shellcheck-py/shellcheck-py.git + rev: v0.7.1.1 + hooks: + - id: shellcheck + + - repo: https://git.shore.co.il/nimrod/docker-pre-commit.git/ + rev: v0.3.0 + hooks: + - id: hadolint + - id: docker-compose diff --git a/Dockerfile b/Dockerfile index 1e9fcd227cfc674b90e699b162c9161c8ba5a946..7fa9e0bb168aeea49e801473aa040fdbec367c7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ -FROM ubuntu:xenial -ENV DEBIAN_FRONTEND noninteractive +FROM debian:buster-slim +# hadolint ignore=DL3008 RUN apt-get update && \ - apt-get install -y syncevolution-http syncevolution && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ - mkdir /syncevolution + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + syncevolution-http \ + syncevolution \ + && \ + rm -rf /tmp/* /var/tmp/* /var/cache/apt/archives/* /var/lib/apt/lists/* && \ + install -d -m 777 /syncevolution VOLUME /syncevolution COPY entrypoint.sh /entrypoint.sh EXPOSE 9000 diff --git a/README.md b/README.md index bb0347540c514d8aa1a5955007c78475aafe6155..81e4b7073b036e81f5b1f440411e188322372161 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,24 @@ # SyncEvolution Docker +[](https://git.shore.co.il/nimrod/syncevolution-docker/-/commits/master) + SyncML over HTTP using SyncEvolution and Docker. ## On the server -Edit the IMEI variable inside the `docker-compose.yml` and run `docker-compose -up`. +Edit the IMEI variable inside the `docker-compose.yml` and run +`docker-compose up`. ## On the phone -Server URL: `http://servername:9000/syncevolution` -SyncML version: 1.1 -Contacts remote database: `addressbook` -Calendar remote database: `calendar+todo` +Server URL: `http://servername:9000/syncevolution` +SyncML version: 1.1 +Contacts remote database: `addressbook` +Calendar remote database: `calendar+todo` Notes remote database: `memo` For more information visit <https://syncevolution.org/wiki/http-server-howto>. - # License This software is licensed under the MIT license (see the `LICENSE.txt` file). @@ -26,5 +27,5 @@ This software is licensed under the MIT license (see the `LICENSE.txt` file). Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my [website](https://www.shore.co.il/). Patches are welcome via -[git send-email](http://git-scm.com/book/en/v2/Git-Commands-Email). The -repository is located at: <https://git.shore.co.il/explore/>. +[`git send-email`](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository +is located at: <https://git.shore.co.il/explore/>. diff --git a/docker-compose.yml b/docker-compose.yml index 2d42d6a498b176d836890b271ebc69da74edb154..640ca4d10b00d43c402cef82ca909a592e9f5a07 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,12 @@ -syncevolution: - build: ./ +--- +version: '3.7' +services: + syncevolution: + build: + context: ./ environment: - IMEI: "352724041305912" + IMEI: "352724041305912" ports: - - 9000:9000 + - 9000:9000 volumes: - - ./syncevolution:/syncevolution + - $PWD/syncevolution:/syncevolution diff --git a/entrypoint.sh b/entrypoint.sh index 424c9bf5c107d3f5acfcd9a467fd4b6f6a6ba678..a0f52af6e1058758d16b572edefcb43269b2df82 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ syncevolution --configure \ --template default \ --sync-property syncURL= \ --sync-property peerIsClient=1 \ - --sync-property remoteDeviceId=IMEI:$IMEI \ + --sync-property "remoteDeviceId=IMEI:$IMEI" \ --sync-property preventSlowSync=False \ --source-property uri= \ --source-property sync=none cellphone @@ -31,4 +31,4 @@ syncevolution --configure \ syncevolution --configure \ --source-property sync=slow \ cellphone addressbook calendar todo memo calendar+todo -eval exec $@ +eval exec "$@"