├── .dockerignore ├── .editorconfig ├── .gitattributes ├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ └── bug_report.md ├── SUPPORT.md ├── dependabot.yml ├── docker-firefox-syncserver.jpg ├── labels.yml └── workflows │ ├── build.yml │ ├── labels.yml │ └── test.yml ├── .gitignore ├── CHANGELOG.md ├── Dockerfile ├── LICENSE ├── README.md ├── docker-bake.hcl ├── entrypoint.sh └── examples ├── compose ├── docker-compose.yml └── firefox-syncserver.env └── traefik ├── README.md ├── docker-compose.yml └── firefox-syncserver.env /.dockerignore: -------------------------------------------------------------------------------- 1 | /.dev 2 | /.idea 3 | /*.iml 4 | 5 | /.git 6 | /.github 7 | /examples 8 | /.editorconfig 9 | /.gitattributes 10 | /.gitignore 11 | /CHANGELOG.md 12 | /LICENSE 13 | /README.md 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /*.sh linguist-detectable=false 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @crazy-max 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: crazy-max 2 | custom: https://www.paypal.me/crazyws 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | --- 5 | 6 | ### Behaviour 7 | 8 | #### Steps to reproduce this issue 9 | 10 | 1. 11 | 2. 12 | 3. 13 | 14 | #### Expected behaviour 15 | 16 | > Tell me what should happen 17 | 18 | #### Actual behaviour 19 | 20 | > Tell me what happens instead 21 | 22 | ### Configuration 23 | 24 | * Docker version (type `docker --version`) : 25 | * Docker compose version if applicable (type `docker-compose --version`) : 26 | * Platform (Debian 9, Ubuntu 18.04, ...) : 27 | * System info (type `uname -a`) : 28 | * Include all necessary configuration files : `docker-compose.yml`, `.env`, ... 29 | 30 | ### Docker info 31 | 32 | ``` 33 | > Output of command `docker info` 34 | ``` 35 | 36 | ### Logs 37 | 38 | ``` 39 | > Container logs (set FF_SYNCSERVER_LOGLEVEL to debug if applicable) 40 | ``` 41 | -------------------------------------------------------------------------------- /.github/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support [](https://isitmaintained.com/project/crazy-max/docker-firefox-syncserver) 2 | 3 | ## Reporting an issue 4 | 5 | Please do a search in [open issues](https://github.com/crazy-max/docker-firefox-syncserver/issues?utf8=%E2%9C%93&q=) to see if the issue or feature request has already been filed. 6 | 7 | If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment. 8 | 9 | :+1: - upvote 10 | 11 | :-1: - downvote 12 | 13 | If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below. 14 | 15 | ## Writing good bug reports and feature requests 16 | 17 | File a single issue per problem and feature request. 18 | 19 | * Do not enumerate multiple bugs or feature requests in the same issue. 20 | * Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes. 21 | 22 | The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix. 23 | 24 | You are now ready to [create a new issue](https://github.com/crazy-max/docker-firefox-syncserver/issues/new/choose)! 25 | 26 | ## Closure policy 27 | 28 | * Support directly related to Firefox Syncserver will not be provided if your problem is not related to the operation of this image. 29 | * Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines. 30 | * Issues that go a week without a response from original poster are subject to closure at my discretion. 31 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | time: "08:00" 8 | timezone: "Europe/Paris" 9 | labels: 10 | - ":game_die: dependencies" 11 | - ":robot: bot" 12 | -------------------------------------------------------------------------------- /.github/docker-firefox-syncserver.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazy-max/docker-firefox-syncserver/88e7aa9ff3857c6aa171a73378d0b4dc561ab0e5/.github/docker-firefox-syncserver.jpg -------------------------------------------------------------------------------- /.github/labels.yml: -------------------------------------------------------------------------------- 1 | ## more info https://github.com/crazy-max/ghaction-github-labeler 2 | - # automerge 3 | name: ":bell: automerge" 4 | color: "8f4fbc" 5 | description: "" 6 | - # bot 7 | name: ":robot: bot" 8 | color: "69cde9" 9 | description: "" 10 | - # bug 11 | name: ":bug: bug" 12 | color: "b60205" 13 | description: "" 14 | - # dependencies 15 | name: ":game_die: dependencies" 16 | color: "0366d6" 17 | description: "" 18 | - # documentation 19 | name: ":memo: documentation" 20 | color: "c5def5" 21 | description: "" 22 | - # duplicate 23 | name: ":busts_in_silhouette: duplicate" 24 | color: "cccccc" 25 | description: "" 26 | - # enhancement 27 | name: ":sparkles: enhancement" 28 | color: "0054ca" 29 | description: "" 30 | - # feature request 31 | name: ":bulb: feature request" 32 | color: "0e8a16" 33 | description: "" 34 | - # feedback 35 | name: ":mega: feedback" 36 | color: "03a9f4" 37 | description: "" 38 | - # future maybe 39 | name: ":rocket: future maybe" 40 | color: "fef2c0" 41 | description: "" 42 | - # good first issue 43 | name: ":hatching_chick: good first issue" 44 | color: "7057ff" 45 | description: "" 46 | - # help wanted 47 | name: ":pray: help wanted" 48 | color: "4caf50" 49 | description: "" 50 | - # invalid 51 | name: ":no_entry_sign: invalid" 52 | color: "e6e6e6" 53 | description: "" 54 | - # investigate 55 | name: ":mag: investigate" 56 | color: "e6625b" 57 | description: "" 58 | - # needs more info 59 | name: ":thinking: needs more info" 60 | color: "795548" 61 | description: "" 62 | - # pinned 63 | name: ":pushpin: pinned" 64 | color: "28008e" 65 | description: "" 66 | - # question 67 | name: ":question: question" 68 | color: "3f51b5" 69 | description: "" 70 | - # sponsor 71 | name: ":sparkling_heart: sponsor" 72 | color: "fedbf0" 73 | description: "" 74 | - # stale 75 | name: ":skull: stale" 76 | color: "237da0" 77 | description: "" 78 | - # upstream 79 | name: ":eyes: upstream" 80 | color: "fbca04" 81 | description: "" 82 | - # wontfix 83 | name: ":coffin: wontfix" 84 | color: "ffffff" 85 | description: "" 86 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | concurrency: 4 | group: build-${{ github.ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | push: 9 | branches: 10 | - 'master' 11 | tags: 12 | - '*' 13 | paths-ignore: 14 | - '**.md' 15 | pull_request: 16 | branches: 17 | - 'master' 18 | paths-ignore: 19 | - '**.md' 20 | 21 | env: 22 | DOCKERHUB_SLUG: crazymax/firefox-syncserver 23 | GHCR_SLUG: ghcr.io/crazy-max/firefox-syncserver 24 | 25 | jobs: 26 | build: 27 | runs-on: ubuntu-latest 28 | steps: 29 | - 30 | name: Checkout 31 | uses: actions/checkout@v3 32 | - 33 | name: Docker meta 34 | id: meta 35 | uses: docker/metadata-action@v4 36 | with: 37 | images: | 38 | ${{ env.DOCKERHUB_SLUG }} 39 | ${{ env.GHCR_SLUG }} 40 | tags: | 41 | type=match,pattern=(.*)-r,group=1 42 | type=ref,event=pr 43 | type=edge 44 | labels: | 45 | org.opencontainers.image.title=Firefox Sync Server 46 | org.opencontainers.image.description=Firefox Sync Server 47 | org.opencontainers.image.vendor=CrazyMax 48 | - 49 | name: Set up QEMU 50 | uses: docker/setup-qemu-action@v2 51 | - 52 | name: Set up Docker Buildx 53 | uses: docker/setup-buildx-action@v2 54 | - 55 | name: Login to DockerHub 56 | if: github.event_name != 'pull_request' 57 | uses: docker/login-action@v2 58 | with: 59 | username: ${{ secrets.DOCKER_USERNAME }} 60 | password: ${{ secrets.DOCKER_PASSWORD }} 61 | - 62 | name: Login to GHCR 63 | if: github.event_name != 'pull_request' 64 | uses: docker/login-action@v2 65 | with: 66 | registry: ghcr.io 67 | username: ${{ github.repository_owner }} 68 | password: ${{ secrets.GITHUB_TOKEN }} 69 | - 70 | name: Build 71 | uses: docker/bake-action@v3 72 | with: 73 | files: | 74 | ./docker-bake.hcl 75 | ${{ steps.meta.outputs.bake-file }} 76 | targets: image-all 77 | push: ${{ github.event_name != 'pull_request' }} 78 | - 79 | name: Check manifest 80 | if: github.event_name != 'pull_request' 81 | run: | 82 | docker buildx imagetools inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }} 83 | docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} 84 | - 85 | name: Inspect image 86 | if: github.event_name != 'pull_request' 87 | run: | 88 | docker pull ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }} 89 | docker image inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }} 90 | docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} 91 | docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} 92 | -------------------------------------------------------------------------------- /.github/workflows/labels.yml: -------------------------------------------------------------------------------- 1 | name: labels 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'master' 7 | paths: 8 | - '.github/labels.yml' 9 | - '.github/workflows/labels.yml' 10 | 11 | jobs: 12 | labeler: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - 16 | name: Checkout 17 | uses: actions/checkout@v3 18 | - 19 | name: Run Labeler 20 | uses: crazy-max/ghaction-github-labeler@v4 21 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'master' 7 | paths-ignore: 8 | - '**.md' 9 | pull_request: 10 | branches: 11 | - 'master' 12 | paths-ignore: 13 | - '**.md' 14 | 15 | jobs: 16 | test: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - 20 | name: Checkout 21 | uses: actions/checkout@v3 22 | - 23 | name: Prepare 24 | id: prep 25 | run: | 26 | echo ::set-output name=build_tag::test 27 | echo ::set-output name=container_name::firefox-syncserver 28 | echo ::set-output name=running_timeout::120 29 | echo ::set-output name=running_log_check::Listening at 30 | - 31 | name: Set up QEMU 32 | uses: docker/setup-qemu-action@v2 33 | - 34 | name: Set up Docker Buildx 35 | uses: docker/setup-buildx-action@v2 36 | - 37 | name: Build 38 | uses: docker/bake-action@v3 39 | with: 40 | targets: image-local 41 | env: 42 | DEFAULT_TAG: ${{ steps.prep.outputs.build_tag }} 43 | - 44 | name: Start container 45 | run: | 46 | docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true 47 | docker run -d --name ${{ steps.prep.outputs.container_name }} \ 48 | -e "FF_SYNCSERVER_SECRET=5up3rS3kr1t" \ 49 | ${{ steps.prep.outputs.build_tag }} 50 | - 51 | name: Test run 52 | run: | 53 | TIMEOUT=$((SECONDS + ${{ steps.prep.outputs.running_timeout }})) 54 | while read LOGLINE; do 55 | echo ${LOGLINE} 56 | if [[ ${LOGLINE} == *"${{ steps.prep.outputs.running_log_check }}"* ]]; then 57 | echo "🎉 Container up!" 58 | break 59 | fi 60 | if [[ $SECONDS -gt ${TIMEOUT} ]]; then 61 | >&2 echo "❌ Failed to run ${{ steps.prep.outputs.container_name }} container" 62 | docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true 63 | exit 1 64 | fi 65 | done < <(docker logs -f ${{ steps.prep.outputs.container_name }} 2>&1) 66 | 67 | CONTAINER_STATUS=$(docker container inspect --format "{{.State.Status}}" ${{ steps.prep.outputs.container_name }}) 68 | if [[ ${CONTAINER_STATUS} != "running" ]]; then 69 | >&2 echo "❌ Container ${{ steps.prep.outputs.container_name }} returned status '$CONTAINER_STATUS'" 70 | docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true 71 | exit 1 72 | fi 73 | docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true 74 | echo 75 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.dev 2 | 3 | # JetBrains 4 | /.idea 5 | /*.iml 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.8.0-r15 (2021/03/04) 4 | 5 | * Renamed `yasu` (more info https://github.com/crazy-max/yasu#yet-another) 6 | 7 | ## 1.8.0-r14 (2021/03/02) 8 | 9 | * Switch to `gosu` 10 | 11 | ## 1.8.0-RC13 (2020/12/12) 12 | 13 | * Add postgres support (#42) 14 | 15 | ## 1.8.0-RC12 (2019/12/07) 16 | 17 | * Fix timezone 18 | 19 | ## 1.8.0-RC11 (2019/11/17) 20 | 21 | * Allow to set custom `PUID`/`PGID` 22 | * Allow to use Docker secrets for `FF_SYNCSERVER_SECRET` 23 | * mozilla-services/syncserver@5932c46 24 | 25 | ## 1.8.0-RC10 (2019/09/26) 26 | 27 | * Switch to GitHub Actions 28 | * :warning: Stop publishing Docker image on Quay 29 | * Multi-platform Docker image 30 | * mozilla-services/syncserver@e9b63a0 31 | * :warning: Run as non-root user 32 | * Fix access log issue if not defined 33 | * Implicit timezone through tzdata package 34 | 35 | > :warning: **UPGRADE NOTES** 36 | > As the Docker container now runs as a non-root user, you have to first stop the container and change permissions to `data` volume: 37 | > ``` 38 | > docker-compose stop 39 | > chown -R 1000:1000 data/ 40 | > docker-compose pull 41 | > docker-compose up -d 42 | > ``` 43 | 44 | ## 1.8.0-RC9 (2019/08/05) 45 | 46 | * Option to enable access log (`FF_SYNCSERVER_ACCESSLOG`) 47 | * Option to tune log level (`FF_SYNCSERVER_LOGLEVEL`) 48 | * Issue with healthcheck, remove for now (#10) 49 | 50 | ## 1.8.0-RC8 (2019/08/04) 51 | 52 | * Add healthcheck 53 | * Alpine Linux 3.10 54 | 55 | ## 1.8.0-RC7 (2019/06/23) 56 | 57 | * mozilla-services/syncserver@ac7b29c 58 | 59 | ## 1.8.0-RC6 (2019/03/21) 60 | 61 | * Option to allow forwarded IPs (PR #7) 62 | 63 | ## 1.8.0-RC5 (2019/03/20) 64 | 65 | * Switch to Alpine 3.9 based image 66 | 67 | ## 1.8.0-RC4 (2019/02/04) 68 | 69 | * Fix build (pypa/pip#6158) 70 | 71 | ## 1.8.0-RC3 (2019/01/22) 72 | 73 | * Add `FF_SYNCSERVER_SQLURI` env var (#5) 74 | * No need to put `syncserver.ini` in data folder 75 | 76 | ## 1.8.0-RC2 (2018/07/27) 77 | 78 | * Switch to Alpine 3.8 based image 79 | 80 | ## 1.8.0-RC1 (2018/05/25) 81 | 82 | * Firefox Sync Server 1.8.0 83 | 84 | ## 1.7.0-RC2 (2018/05/25) 85 | 86 | * Come back to Firefox Sync Server 1.7.0 87 | 88 | ## 1.6.0-RC3 (2018/05/25) 89 | 90 | * Wrong tag pushed (1.7.0) 91 | * No need of Supervisor 92 | 93 | ## 1.7.0-RC1 (2018/02/17) 94 | 95 | * Firefox Sync Server 1.7.0 96 | * No need of Supervisor 97 | 98 | ## 1.6.0-RC2 (2018/01/10) 99 | 100 | * Python image updated 101 | 102 | ## 1.6.0-RC1 (2017/12/25) 103 | 104 | * Initial version based on Firefox Sync Server 1.6.0 105 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG SYNCSERVER_VERSION=1.8.0 2 | ARG SHA1_COMMIT=5932c464d70ec9cf0344b1d3e970b3711de6a98e 3 | 4 | FROM crazymax/yasu:latest AS yasu 5 | FROM python:2.7-alpine3.10 6 | 7 | ARG SYNCSERVER_VERSION 8 | ARG SHA1_COMMIT 9 | RUN apk --update --no-cache add \ 10 | bash \ 11 | curl \ 12 | libffi \ 13 | libressl \ 14 | libstdc++ \ 15 | mariadb-client \ 16 | postgresql-client \ 17 | shadow \ 18 | tzdata \ 19 | && apk --update --no-cache add -t build-dependencies \ 20 | build-base \ 21 | gcc \ 22 | git \ 23 | libffi-dev \ 24 | libressl-dev \ 25 | mariadb-dev \ 26 | musl-dev \ 27 | postgresql-dev \ 28 | python-dev \ 29 | && git clone https://github.com/mozilla-services/syncserver app \ 30 | && cd app \ 31 | && git reset --hard $SHA1_COMMIT \ 32 | && pip install --upgrade --no-cache-dir -r requirements.txt \ 33 | && pip install --upgrade --no-cache-dir -r dev-requirements.txt \ 34 | && pip install psycopg2 pymysql \ 35 | && apk del build-dependencies \ 36 | && rm -rf /tmp/* /var/cache/apk/* \ 37 | && python ./setup.py develop 38 | 39 | ENV TZ="UTC" \ 40 | PUID="1000" \ 41 | PGID="1000" 42 | 43 | COPY --from=yasu / / 44 | COPY entrypoint.sh /entrypoint.sh 45 | 46 | RUN chmod a+x /entrypoint.sh \ 47 | && mkdir -p /data /opt/syncserver \ 48 | && addgroup -g ${PGID} syncserver \ 49 | && adduser -u ${PUID} -G syncserver -h /data -s /bin/sh -D syncserver \ 50 | && chown -R syncserver. /data /opt/syncserver 51 | 52 | EXPOSE 5000 53 | VOLUME [ "/data" ] 54 | 55 | ENTRYPOINT [ "/entrypoint.sh" ] 56 | CMD [ "/usr/local/bin/gunicorn", "--paste", "/opt/syncserver/syncserver.ini" ] 57 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2023 CrazyMax 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 11 | 12 | ## ⚠️ Abandoned project 13 | 14 | This project is not maintained anymore and is abandoned. Feel free to fork and 15 | make your own changes if needed. 16 | 17 | ## About 18 | 19 | [Firefox Sync Server](http://moz-services-docs.readthedocs.io/en/latest/howtos/run-sync-1.5.html) 20 | Docker image. 21 | 22 | > **Note** 23 | > 24 | > Want to be notified of new releases? Check out 🔔 [Diun (Docker Image Update Notifier)](https://github.com/crazy-max/diun) 25 | > project! 26 | 27 | ___ 28 | 29 | * [Features](#features) 30 | * [Build locally](#build-locally) 31 | * [Image](#image) 32 | * [Environment variables](#environment-variables) 33 | * [Volumes](#volumes) 34 | * [Ports](#ports) 35 | * [Usage](#usage) 36 | * [Docker Compose](#docker-compose) 37 | * [Command line](#command-line) 38 | * [Notes](#notes) 39 | * [Use with MySQL database](#use-with-mysql-database) 40 | * [Use with PostgreSQL database](#use-with-postgresql-database) 41 | * [Upgrade](#upgrade) 42 | * [Contributing](#contributing) 43 | * [License](#license) 44 | 45 | ## Features 46 | 47 | * Run as non-root user 48 | * Multi-platform image 49 | * [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates (see [this template](examples/traefik)) 50 | 51 | ## Build locally 52 | 53 | ```shell 54 | git clone https://github.com/crazy-max/docker-firefox-syncserver.git 55 | cd docker-firefox-syncserver 56 | 57 | # Build image and output to docker (default) 58 | docker buildx bake 59 | 60 | # Build multi-platform image 61 | docker buildx bake image-all 62 | ``` 63 | 64 | ## Image 65 | 66 | | Registry | Image | 67 | |--------------------------------------------------------------------------------------------------|---------------------------------| 68 | | [Docker Hub](https://hub.docker.com/r/crazymax/firefox-syncserver/) | `crazymax/firefox-syncserver` | 69 | | [GitHub Container Registry](https://github.com/users/crazy-max/packages/container/package/firefox-syncserver) | `ghcr.io/crazy-max/firefox-syncserver` | 70 | 71 | Following platforms for this image are available: 72 | 73 | ``` 74 | $ docker run --rm mplatform/mquery crazymax/firefox-syncserver:latest 75 | Image: crazymax/firefox-syncserver:latest 76 | * Manifest List: Yes 77 | * Supported platforms: 78 | - linux/amd64 79 | - linux/arm/v6 80 | - linux/arm/v7 81 | - linux/arm64 82 | - linux/386 83 | - linux/ppc64le 84 | - linux/s390x 85 | ``` 86 | 87 | ## Environment variables 88 | 89 | * `TZ`: The timezone assigned to the container (default `UTC`) 90 | * `PUID`: Process UID (default `1000`) 91 | * `PGID`: Process GID (default `1000`) 92 | * `FF_SYNCSERVER_ACCESSLOG`: Display access log (default `false`) 93 | * `FF_SYNCSERVER_LOGLEVEL`: Log level output (default `info`) 94 | * `FF_SYNCSERVER_PUBLIC_URL`: Must be edited to point to the public URL of your server (default `http://localhost:5000`). 95 | * `FF_SYNCSERVER_SECRET`: This is a secret key used for signing authentication tokens. It should be long and randomly-generated. 96 | * `FF_SYNCSERVER_ALLOW_NEW_USERS`: Set this to `false` to disable new-user signups on the server. Only request by existing accounts will be honoured (default `true`). 97 | * `FF_SYNCSERVER_FORCE_WSGI_ENVIRON`: Set this to `true` to work around a mismatch between public_url and the application URL as seen by python, which can happen in certain reverse-proxy hosting setups (default `false`). 98 | * `FF_SYNCSERVER_SQLURI`: Defines the database in which to store all server data (default `sqlite:///data/syncserver.db`). 99 | * `FF_SYNCSERVER_FORWARDED_ALLOW_IPS`: Set this to `*` or an IP range if you use an Nginx reverse proxy (optional). 100 | 101 | > 💡 `FF_SYNCSERVER_SECRET_FILE` can be used to fill in the value from a file, especially for Docker's secrets feature. 102 | 103 | ## Volumes 104 | 105 | * `/data`: Contains SQLite database if `FF_SYNCSERVER_SQLURI` is untouched 106 | 107 | > :warning: Note that the volumes should be owned by the user/group with the specified `PUID` and `PGID`. If you don't give the volume correct permissions, the container may not start. 108 | 109 | ## Ports 110 | 111 | * `5000`: Gunicorn port 112 | 113 | ## Usage 114 | 115 | ### Docker Compose 116 | 117 | Docker compose is the recommended way to run this image. You can use the following [docker compose template](examples/compose/docker-compose.yml), then run the container: 118 | 119 | ```bash 120 | docker-compose up -d 121 | docker-compose logs -f 122 | ``` 123 | 124 | ### Command line 125 | 126 | You can also use the following minimal command: 127 | 128 | ```bash 129 | $ docker run -d -p 5000:5000 --name firefox_syncserver \ 130 | -e TZ="Europe/Paris" \ 131 | -e FF_SYNCSERVER_SECRET="5up3rS3kr1t" \ 132 | -v $(pwd)/data:/data \ 133 | crazymax/firefox-syncserver:latest 134 | ``` 135 | 136 | ## Notes 137 | 138 | ### Use with MySQL database 139 | 140 | Set `FF_SYNCSERVER_SQLURI=pymysql://user:password@mysql_server_ip/db_name` 141 | 142 | ### Use with PostgreSQL database 143 | 144 | Set `FF_SYNCSERVER_SQLURI=postgresql://user:password@postgresql_server_ip/db_name` 145 | 146 | ## Upgrade 147 | 148 | Recreate the container whenever I push an update: 149 | 150 | ```bash 151 | docker-compose pull 152 | docker-compose up -d 153 | ``` 154 | 155 | ## Contributing 156 | 157 | Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You 158 | can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) or by making 159 | a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! 160 | 161 | Thanks again for your support, it is much appreciated! :pray: 162 | 163 | ## License 164 | 165 | MIT. See `LICENSE` for more details. 166 | -------------------------------------------------------------------------------- /docker-bake.hcl: -------------------------------------------------------------------------------- 1 | variable "DEFAULT_TAG" { 2 | default = "msmtpd:local" 3 | } 4 | 5 | // Special target: https://github.com/docker/metadata-action#bake-definition 6 | target "docker-metadata-action" { 7 | tags = ["${DEFAULT_TAG}"] 8 | } 9 | 10 | // Default target if none specified 11 | group "default" { 12 | targets = ["image-local"] 13 | } 14 | 15 | target "image" { 16 | inherits = ["docker-metadata-action"] 17 | } 18 | 19 | target "image-local" { 20 | inherits = ["image"] 21 | output = ["type=docker"] 22 | } 23 | 24 | target "image-all" { 25 | inherits = ["image"] 26 | platforms = [ 27 | "linux/amd64", 28 | "linux/arm/v6", 29 | "linux/arm/v7", 30 | "linux/arm64", 31 | "linux/386", 32 | "linux/ppc64le", 33 | "linux/s390x" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TZ=${TZ:-UTC} 4 | 5 | FF_SYNCSERVER_ACCESSLOG=${FF_SYNCSERVER_ACCESSLOG:-false} 6 | FF_SYNCSERVER_LOGLEVEL=${FF_SYNCSERVER_LOGLEVEL:-info} 7 | FF_SYNCSERVER_PUBLIC_URL=${FF_SYNCSERVER_PUBLIC_URL:-http://localhost:5000/} 8 | FF_SYNCSERVER_ALLOW_NEW_USERS=${FF_SYNCSERVER_ALLOW_NEW_USERS:-true} 9 | FF_SYNCSERVER_FORCE_WSGI_ENVIRON=${FF_SYNCSERVER_FORCE_WSGI_ENVIRON:-false} 10 | FF_SYNCSERVER_SQLURI=${FF_SYNCSERVER_SQLURI:-sqlite:///data/syncserver.db} 11 | 12 | # From https://github.com/docker-library/mariadb/blob/master/docker-entrypoint.sh#L21-L41 13 | # usage: file_env VAR [DEFAULT] 14 | # ie: file_env 'XYZ_DB_PASSWORD' 'example' 15 | # (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of 16 | # "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) 17 | file_env() { 18 | local var="$1" 19 | local fileVar="${var}_FILE" 20 | local def="${2:-}" 21 | if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then 22 | echo >&2 "error: both $var and $fileVar are set (but are exclusive)" 23 | exit 1 24 | fi 25 | local val="$def" 26 | if [ "${!var:-}" ]; then 27 | val="${!var}" 28 | elif [ "${!fileVar:-}" ]; then 29 | val="$(< "${!fileVar}")" 30 | fi 31 | export "$var"="$val" 32 | unset "$fileVar" 33 | } 34 | 35 | if [ -n "${PGID}" ] && [ "${PGID}" != "$(id -g syncserver)" ]; then 36 | echo "Switching to PGID ${PGID}..." 37 | sed -i -e "s/^syncserver:\([^:]*\):[0-9]*/syncserver:\1:${PGID}/" /etc/group 38 | sed -i -e "s/^syncserver:\([^:]*\):\([0-9]*\):[0-9]*/syncserver:\1:\2:${PGID}/" /etc/passwd 39 | fi 40 | if [ -n "${PUID}" ] && [ "${PUID}" != "$(id -u syncserver)" ]; then 41 | echo "Switching to PUID ${PUID}..." 42 | sed -i -e "s/^syncserver:\([^:]*\):[0-9]*:\([0-9]*\)/syncserver:\1:${PUID}:\2/" /etc/passwd 43 | fi 44 | 45 | # Timezone 46 | echo "Setting timezone to ${TZ}..." 47 | ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime 48 | echo ${TZ} > /etc/timezone 49 | 50 | # Check secret 51 | echo "Checking prerequisites..." 52 | file_env 'FF_SYNCSERVER_SECRET' 53 | if [ -z "$FF_SYNCSERVER_SECRET" ] ; then 54 | >&2 echo "ERROR: Either FF_SYNCSERVER_SECRET or FF_SYNCSERVER_SECRET_FILE must be defined" 55 | exit 1 56 | fi 57 | 58 | SYNCSERVER_INI_PATH="/opt/syncserver/syncserver.ini" 59 | 60 | GU_ACCESSLOG="accesslog = -" 61 | if [ "$FF_SYNCSERVER_ACCESSLOG" != true ]; then 62 | GU_ACCESSLOG= 63 | fi 64 | 65 | # Config 66 | echo "Generating configuration..." 67 | cat > "$SYNCSERVER_INI_PATH" <