master 88e7aa9ff385 cached
24 files
28.9 KB
8.8k tokens
1 requests
Download .txt
Repository: crazy-max/docker-firefox-syncserver
Branch: master
Commit: 88e7aa9ff385
Files: 24
Total size: 28.9 KB

Directory structure:
gitextract_j8dwbbq_/

├── .dockerignore
├── .editorconfig
├── .gitattributes
├── .github/
│   ├── CODEOWNERS
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   └── bug_report.md
│   ├── SUPPORT.md
│   ├── dependabot.yml
│   ├── 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

================================================
FILE CONTENTS
================================================

================================================
FILE: .dockerignore
================================================
/.dev
/.idea
/*.iml

/.git
/.github
/examples
/.editorconfig
/.gitattributes
/.gitignore
/CHANGELOG.md
/LICENSE
/README.md


================================================
FILE: .editorconfig
================================================
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false


================================================
FILE: .gitattributes
================================================
/*.sh linguist-detectable=false


================================================
FILE: .github/CODEOWNERS
================================================
*	@crazy-max


================================================
FILE: .github/FUNDING.yml
================================================
github: crazy-max
custom: https://www.paypal.me/crazyws


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
---

### Behaviour

#### Steps to reproduce this issue

1.
2.
3.

#### Expected behaviour

> Tell me what should happen

#### Actual behaviour

> Tell me what happens instead

### Configuration

* Docker version (type `docker --version`) :
* Docker compose version if applicable (type `docker-compose --version`) : 
* Platform (Debian 9, Ubuntu 18.04, ...) : 
* System info (type `uname -a`) : 
* Include all necessary configuration files : `docker-compose.yml`, `.env`, ...

### Docker info

```
> Output of command `docker info`
```

### Logs

```
> Container logs (set FF_SYNCSERVER_LOGLEVEL to debug if applicable)
```


================================================
FILE: .github/SUPPORT.md
================================================
# Support [![](https://isitmaintained.com/badge/resolution/crazy-max/docker-firefox-syncserver.svg)](https://isitmaintained.com/project/crazy-max/docker-firefox-syncserver)

## Reporting an issue

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.

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.

:+1: - upvote

:-1: - downvote

If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below.

## Writing good bug reports and feature requests

File a single issue per problem and feature request.

* Do not enumerate multiple bugs or feature requests in the same issue.
* 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.

The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix.

You are now ready to [create a new issue](https://github.com/crazy-max/docker-firefox-syncserver/issues/new/choose)!

## Closure policy

* Support directly related to Firefox Syncserver will not be provided if your problem is not related to the operation of this image.
* Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines.
* Issues that go a week without a response from original poster are subject to closure at my discretion.


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "daily"
      time: "08:00"
      timezone: "Europe/Paris"
    labels:
      - ":game_die: dependencies"
      - ":robot: bot"


================================================
FILE: .github/labels.yml
================================================
## more info https://github.com/crazy-max/ghaction-github-labeler
- # automerge
  name: ":bell: automerge"
  color: "8f4fbc"
  description: ""
- # bot
  name: ":robot: bot"
  color: "69cde9"
  description: ""
- # bug
  name: ":bug: bug"
  color: "b60205"
  description: ""
- # dependencies
  name: ":game_die: dependencies"
  color: "0366d6"
  description: ""
- # documentation
  name: ":memo: documentation"
  color: "c5def5"
  description: ""
- # duplicate
  name: ":busts_in_silhouette: duplicate"
  color: "cccccc"
  description: ""
- # enhancement
  name: ":sparkles: enhancement"
  color: "0054ca"
  description: ""
- # feature request
  name: ":bulb: feature request"
  color: "0e8a16"
  description: ""
- # feedback
  name: ":mega: feedback"
  color: "03a9f4"
  description: ""
- # future maybe
  name: ":rocket: future maybe"
  color: "fef2c0"
  description: ""
- # good first issue
  name: ":hatching_chick: good first issue"
  color: "7057ff"
  description: ""
- # help wanted
  name: ":pray: help wanted"
  color: "4caf50"
  description: ""
- # invalid
  name: ":no_entry_sign: invalid"
  color: "e6e6e6"
  description: ""
- # investigate
  name: ":mag: investigate"
  color: "e6625b"
  description: ""
- # needs more info
  name: ":thinking: needs more info"
  color: "795548"
  description: ""
- # pinned
  name: ":pushpin: pinned"
  color: "28008e"
  description: ""
- # question
  name: ":question: question"
  color: "3f51b5"
  description: ""
- # sponsor
  name: ":sparkling_heart: sponsor"
  color: "fedbf0"
  description: ""
- # stale
  name: ":skull: stale"
  color: "237da0"
  description: ""
- # upstream
  name: ":eyes: upstream"
  color: "fbca04"
  description: ""
- # wontfix
  name: ":coffin: wontfix"
  color: "ffffff"
  description: ""


================================================
FILE: .github/workflows/build.yml
================================================
name: build

concurrency:
  group: build-${{ github.ref }}
  cancel-in-progress: true

on:
  push:
    branches:
      - 'master'
    tags:
      - '*'
    paths-ignore:
      - '**.md'
  pull_request:
    branches:
      - 'master'
    paths-ignore:
      - '**.md'

env:
  DOCKERHUB_SLUG: crazymax/firefox-syncserver
  GHCR_SLUG: ghcr.io/crazy-max/firefox-syncserver

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
      -
        name: Docker meta
        id: meta
        uses: docker/metadata-action@v4
        with:
          images: |
            ${{ env.DOCKERHUB_SLUG }}
            ${{ env.GHCR_SLUG }}
          tags: |
            type=match,pattern=(.*)-r,group=1
            type=ref,event=pr
            type=edge
          labels: |
            org.opencontainers.image.title=Firefox Sync Server
            org.opencontainers.image.description=Firefox Sync Server
            org.opencontainers.image.vendor=CrazyMax
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      -
        name: Login to DockerHub
        if: github.event_name != 'pull_request'
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
      -
        name: Login to GHCR
        if: github.event_name != 'pull_request'
        uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.GITHUB_TOKEN }}
      -
        name: Build
        uses: docker/bake-action@v3
        with:
          files: |
            ./docker-bake.hcl
            ${{ steps.meta.outputs.bake-file }}
          targets: image-all
          push: ${{ github.event_name != 'pull_request' }}
      -
        name: Check manifest
        if: github.event_name != 'pull_request'
        run: |
          docker buildx imagetools inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
          docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
      -
        name: Inspect image
        if: github.event_name != 'pull_request'
        run: |
          docker pull ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
          docker image inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
          docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
          docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}


================================================
FILE: .github/workflows/labels.yml
================================================
name: labels

on:
  push:
    branches:
      - 'master'
    paths:
      - '.github/labels.yml'
      - '.github/workflows/labels.yml'

jobs:
  labeler:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
      -
        name: Run Labeler
        uses: crazy-max/ghaction-github-labeler@v4


================================================
FILE: .github/workflows/test.yml
================================================
name: test

on:
  push:
    branches:
      - 'master'
    paths-ignore:
      - '**.md'
  pull_request:
    branches:
      - 'master'
    paths-ignore:
      - '**.md'

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
      -
        name: Prepare
        id: prep
        run: |
          echo ::set-output name=build_tag::test
          echo ::set-output name=container_name::firefox-syncserver
          echo ::set-output name=running_timeout::120
          echo ::set-output name=running_log_check::Listening at
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      -
        name: Build
        uses: docker/bake-action@v3
        with:
          targets: image-local
        env:
          DEFAULT_TAG: ${{ steps.prep.outputs.build_tag }}
      -
        name: Start container
        run: |
          docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true
          docker run -d --name ${{ steps.prep.outputs.container_name }} \
            -e "FF_SYNCSERVER_SECRET=5up3rS3kr1t" \
            ${{ steps.prep.outputs.build_tag }}
      -
        name: Test run
        run: |
          TIMEOUT=$((SECONDS + ${{ steps.prep.outputs.running_timeout }}))
          while read LOGLINE; do
            echo ${LOGLINE}
            if [[ ${LOGLINE} == *"${{ steps.prep.outputs.running_log_check }}"* ]]; then
              echo "🎉 Container up!"
              break
            fi
            if [[ $SECONDS -gt ${TIMEOUT} ]]; then
              >&2 echo "❌ Failed to run ${{ steps.prep.outputs.container_name }} container"
              docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true
              exit 1
            fi
          done < <(docker logs -f ${{ steps.prep.outputs.container_name }} 2>&1)

          CONTAINER_STATUS=$(docker container inspect --format "{{.State.Status}}" ${{ steps.prep.outputs.container_name }})
          if [[ ${CONTAINER_STATUS} != "running" ]]; then
            >&2 echo "❌ Container ${{ steps.prep.outputs.container_name }} returned status '$CONTAINER_STATUS'"
            docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true
            exit 1
          fi
          docker rm -f ${{ steps.prep.outputs.container_name }} > /dev/null 2>&1 || true
          echo


================================================
FILE: .gitignore
================================================
/.dev

# JetBrains
/.idea
/*.iml


================================================
FILE: CHANGELOG.md
================================================
# Changelog

## 1.8.0-r15 (2021/03/04)

* Renamed `yasu` (more info https://github.com/crazy-max/yasu#yet-another)

## 1.8.0-r14 (2021/03/02)

* Switch to `gosu`

## 1.8.0-RC13 (2020/12/12)

* Add postgres support (#42)

## 1.8.0-RC12 (2019/12/07)

* Fix timezone

## 1.8.0-RC11 (2019/11/17)

* Allow to set custom `PUID`/`PGID`
* Allow to use Docker secrets for `FF_SYNCSERVER_SECRET`
* mozilla-services/syncserver@5932c46

## 1.8.0-RC10 (2019/09/26)

* Switch to GitHub Actions
* :warning: Stop publishing Docker image on Quay
* Multi-platform Docker image
* mozilla-services/syncserver@e9b63a0
* :warning: Run as non-root user
* Fix access log issue if not defined
* Implicit timezone through tzdata package

> :warning: **UPGRADE NOTES**
> As the Docker container now runs as a non-root user, you have to first stop the container and change permissions to `data` volume:
> ```
> docker-compose stop
> chown -R 1000:1000 data/
> docker-compose pull
> docker-compose up -d
> ```

## 1.8.0-RC9 (2019/08/05)

* Option to enable access log (`FF_SYNCSERVER_ACCESSLOG`)
* Option to tune log level (`FF_SYNCSERVER_LOGLEVEL`)
* Issue with healthcheck, remove for now (#10)

## 1.8.0-RC8 (2019/08/04)

* Add healthcheck
* Alpine Linux 3.10

## 1.8.0-RC7 (2019/06/23)

* mozilla-services/syncserver@ac7b29c

## 1.8.0-RC6 (2019/03/21)

* Option to allow forwarded IPs (PR #7)

## 1.8.0-RC5 (2019/03/20)

* Switch to Alpine 3.9 based image

## 1.8.0-RC4 (2019/02/04)

* Fix build (pypa/pip#6158)

## 1.8.0-RC3 (2019/01/22)

* Add `FF_SYNCSERVER_SQLURI` env var (#5)
* No need to put `syncserver.ini` in data folder

## 1.8.0-RC2 (2018/07/27)

* Switch to Alpine 3.8 based image

## 1.8.0-RC1 (2018/05/25)

* Firefox Sync Server 1.8.0

## 1.7.0-RC2 (2018/05/25)

* Come back to Firefox Sync Server 1.7.0

## 1.6.0-RC3 (2018/05/25)

* Wrong tag pushed (1.7.0)
* No need of Supervisor

## 1.7.0-RC1 (2018/02/17)

* Firefox Sync Server 1.7.0
* No need of Supervisor

## 1.6.0-RC2 (2018/01/10)

* Python image updated

## 1.6.0-RC1 (2017/12/25)

* Initial version based on Firefox Sync Server 1.6.0


================================================
FILE: Dockerfile
================================================
ARG SYNCSERVER_VERSION=1.8.0
ARG SHA1_COMMIT=5932c464d70ec9cf0344b1d3e970b3711de6a98e

FROM crazymax/yasu:latest AS yasu
FROM python:2.7-alpine3.10

ARG SYNCSERVER_VERSION
ARG SHA1_COMMIT
RUN apk --update --no-cache add \
    bash \
    curl \
    libffi \
    libressl \
    libstdc++ \
    mariadb-client \
    postgresql-client \
    shadow \
    tzdata \
  && apk --update --no-cache add -t build-dependencies \
    build-base \
    gcc \
    git \
    libffi-dev \
    libressl-dev \
    mariadb-dev \
    musl-dev \
    postgresql-dev \
    python-dev \
  && git clone https://github.com/mozilla-services/syncserver app \
  && cd app \
  && git reset --hard $SHA1_COMMIT \
  && pip install --upgrade --no-cache-dir -r requirements.txt \
  && pip install --upgrade --no-cache-dir -r dev-requirements.txt \
  && pip install psycopg2 pymysql \
  && apk del build-dependencies \
  && rm -rf /tmp/* /var/cache/apk/* \
  && python ./setup.py develop

ENV TZ="UTC" \
  PUID="1000" \
  PGID="1000"

COPY --from=yasu / /
COPY entrypoint.sh /entrypoint.sh

RUN chmod a+x /entrypoint.sh \
  && mkdir -p /data /opt/syncserver \
  && addgroup -g ${PGID} syncserver \
  && adduser -u ${PUID} -G syncserver -h /data -s /bin/sh -D syncserver \
  && chown -R syncserver. /data /opt/syncserver

EXPOSE 5000
VOLUME [ "/data" ]

ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "/usr/local/bin/gunicorn", "--paste", "/opt/syncserver/syncserver.ini" ]


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2017-2023 CrazyMax

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
<p align="center"><a href="https://github.com/crazy-max/docker-firefox-syncserver" target="_blank"><img height="128" src="https://raw.githubusercontent.com/crazy-max/docker-firefox-syncserver/master/.github/docker-firefox-syncserver.jpg"></a></p>

<p align="center">
  <a href="https://hub.docker.com/r/crazymax/firefox-syncserver/tags?page=1&ordering=last_updated"><img src="https://img.shields.io/github/v/tag/crazy-max/docker-firefox-syncserver?label=version&style=flat-square" alt="Latest Version"></a>
  <a href="https://github.com/crazy-max/docker-firefox-syncserver/actions?workflow=build"><img src="https://img.shields.io/github/actions/workflow/status/crazy-max/docker-firefox-syncserver/build.yml?branch=master&label=build&logo=github&style=flat-square" alt="Build Status"></a>
  <a href="https://hub.docker.com/r/crazymax/firefox-syncserver/"><img src="https://img.shields.io/docker/stars/crazymax/firefox-syncserver.svg?style=flat-square&logo=docker" alt="Docker Stars"></a>
  <a href="https://hub.docker.com/r/crazymax/firefox-syncserver/"><img src="https://img.shields.io/docker/pulls/crazymax/firefox-syncserver.svg?style=flat-square&logo=docker" alt="Docker Pulls"></a>
  <br /><a href="https://github.com/sponsors/crazy-max"><img src="https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github&style=flat-square" alt="Become a sponsor"></a>
  <a href="https://www.paypal.me/crazyws"><img src="https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square" alt="Donate Paypal"></a>
</p>

## ⚠️ Abandoned project

This project is not maintained anymore and is abandoned. Feel free to fork and
make your own changes if needed.

## About

[Firefox Sync Server](http://moz-services-docs.readthedocs.io/en/latest/howtos/run-sync-1.5.html)
Docker image.

> **Note**
> 
> Want to be notified of new releases? Check out 🔔 [Diun (Docker Image Update Notifier)](https://github.com/crazy-max/diun)
> project!

___

* [Features](#features)
* [Build locally](#build-locally)
* [Image](#image)
* [Environment variables](#environment-variables)
* [Volumes](#volumes)
* [Ports](#ports)
* [Usage](#usage)
  * [Docker Compose](#docker-compose)
  * [Command line](#command-line)
* [Notes](#notes)
  * [Use with MySQL database](#use-with-mysql-database)
  * [Use with PostgreSQL database](#use-with-postgresql-database)
* [Upgrade](#upgrade)
* [Contributing](#contributing)
* [License](#license)

## Features

* Run as non-root user
* Multi-platform image
* [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates (see [this template](examples/traefik))

## Build locally

```shell
git clone https://github.com/crazy-max/docker-firefox-syncserver.git
cd docker-firefox-syncserver

# Build image and output to docker (default)
docker buildx bake

# Build multi-platform image
docker buildx bake image-all
```

## Image

| Registry                                                                                         | Image                           |
|--------------------------------------------------------------------------------------------------|---------------------------------|
| [Docker Hub](https://hub.docker.com/r/crazymax/firefox-syncserver/)                                            | `crazymax/firefox-syncserver`                 |
| [GitHub Container Registry](https://github.com/users/crazy-max/packages/container/package/firefox-syncserver)  | `ghcr.io/crazy-max/firefox-syncserver`        |

Following platforms for this image are available:

```
$ docker run --rm mplatform/mquery crazymax/firefox-syncserver:latest
Image: crazymax/firefox-syncserver:latest
 * Manifest List: Yes
 * Supported platforms:
   - linux/amd64
   - linux/arm/v6
   - linux/arm/v7
   - linux/arm64
   - linux/386
   - linux/ppc64le
   - linux/s390x
```

## Environment variables

* `TZ`: The timezone assigned to the container (default `UTC`)
* `PUID`: Process UID (default `1000`)
* `PGID`: Process GID (default `1000`)
* `FF_SYNCSERVER_ACCESSLOG`: Display access log (default `false`)
* `FF_SYNCSERVER_LOGLEVEL`: Log level output (default `info`)
* `FF_SYNCSERVER_PUBLIC_URL`: Must be edited to point to the public URL of your server (default `http://localhost:5000`).
* `FF_SYNCSERVER_SECRET`: This is a secret key used for signing authentication tokens. It should be long and randomly-generated.
* `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`).
* `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`).
* `FF_SYNCSERVER_SQLURI`: Defines the database in which to store all server data (default `sqlite:///data/syncserver.db`).
* `FF_SYNCSERVER_FORWARDED_ALLOW_IPS`: Set this to `*` or an IP range if you use an Nginx reverse proxy (optional). 

> 💡 `FF_SYNCSERVER_SECRET_FILE` can be used to fill in the value from a file, especially for Docker's secrets feature.

## Volumes

* `/data`: Contains SQLite database if `FF_SYNCSERVER_SQLURI` is untouched

> :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.

## Ports

* `5000`: Gunicorn port

## Usage

### Docker Compose

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:

```bash
docker-compose up -d
docker-compose logs -f
```

### Command line

You can also use the following minimal command:

```bash
$ docker run -d -p 5000:5000 --name firefox_syncserver \
  -e TZ="Europe/Paris" \
  -e FF_SYNCSERVER_SECRET="5up3rS3kr1t" \
  -v $(pwd)/data:/data \
  crazymax/firefox-syncserver:latest
```

## Notes

### Use with MySQL database

Set `FF_SYNCSERVER_SQLURI=pymysql://user:password@mysql_server_ip/db_name`

### Use with PostgreSQL database

Set `FF_SYNCSERVER_SQLURI=postgresql://user:password@postgresql_server_ip/db_name`

## Upgrade

Recreate the container whenever I push an update:

```bash
docker-compose pull
docker-compose up -d
```

## Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You
can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) or by making
a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! :pray:

## License

MIT. See `LICENSE` for more details.


================================================
FILE: docker-bake.hcl
================================================
variable "DEFAULT_TAG" {
  default = "msmtpd:local"
}

// Special target: https://github.com/docker/metadata-action#bake-definition
target "docker-metadata-action" {
  tags = ["${DEFAULT_TAG}"]
}

// Default target if none specified
group "default" {
  targets = ["image-local"]
}

target "image" {
  inherits = ["docker-metadata-action"]
}

target "image-local" {
  inherits = ["image"]
  output = ["type=docker"]
}

target "image-all" {
  inherits = ["image"]
  platforms = [
    "linux/amd64",
    "linux/arm/v6",
    "linux/arm/v7",
    "linux/arm64",
    "linux/386",
    "linux/ppc64le",
    "linux/s390x"
  ]
}


================================================
FILE: entrypoint.sh
================================================
#!/bin/bash

TZ=${TZ:-UTC}

FF_SYNCSERVER_ACCESSLOG=${FF_SYNCSERVER_ACCESSLOG:-false}
FF_SYNCSERVER_LOGLEVEL=${FF_SYNCSERVER_LOGLEVEL:-info}
FF_SYNCSERVER_PUBLIC_URL=${FF_SYNCSERVER_PUBLIC_URL:-http://localhost:5000/}
FF_SYNCSERVER_ALLOW_NEW_USERS=${FF_SYNCSERVER_ALLOW_NEW_USERS:-true}
FF_SYNCSERVER_FORCE_WSGI_ENVIRON=${FF_SYNCSERVER_FORCE_WSGI_ENVIRON:-false}
FF_SYNCSERVER_SQLURI=${FF_SYNCSERVER_SQLURI:-sqlite:///data/syncserver.db}

# From https://github.com/docker-library/mariadb/blob/master/docker-entrypoint.sh#L21-L41
# usage: file_env VAR [DEFAULT]
#    ie: file_env 'XYZ_DB_PASSWORD' 'example'
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
#  "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() {
  local var="$1"
  local fileVar="${var}_FILE"
  local def="${2:-}"
  if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
    echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
    exit 1
  fi
  local val="$def"
  if [ "${!var:-}" ]; then
    val="${!var}"
  elif [ "${!fileVar:-}" ]; then
    val="$(< "${!fileVar}")"
  fi
  export "$var"="$val"
  unset "$fileVar"
}

if [ -n "${PGID}" ] && [ "${PGID}" != "$(id -g syncserver)" ]; then
  echo "Switching to PGID ${PGID}..."
  sed -i -e "s/^syncserver:\([^:]*\):[0-9]*/syncserver:\1:${PGID}/" /etc/group
  sed -i -e "s/^syncserver:\([^:]*\):\([0-9]*\):[0-9]*/syncserver:\1:\2:${PGID}/" /etc/passwd
fi
if [ -n "${PUID}" ] && [ "${PUID}" != "$(id -u syncserver)" ]; then
  echo "Switching to PUID ${PUID}..."
  sed -i -e "s/^syncserver:\([^:]*\):[0-9]*:\([0-9]*\)/syncserver:\1:${PUID}:\2/" /etc/passwd
fi

# Timezone
echo "Setting timezone to ${TZ}..."
ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime
echo ${TZ} > /etc/timezone

# Check secret
echo "Checking prerequisites..."
file_env 'FF_SYNCSERVER_SECRET'
if [ -z "$FF_SYNCSERVER_SECRET" ] ; then
  >&2 echo "ERROR: Either FF_SYNCSERVER_SECRET or FF_SYNCSERVER_SECRET_FILE must be defined"
  exit 1
fi

SYNCSERVER_INI_PATH="/opt/syncserver/syncserver.ini"

GU_ACCESSLOG="accesslog = -"
if [ "$FF_SYNCSERVER_ACCESSLOG" != true ]; then
  GU_ACCESSLOG=
fi

# Config
echo "Generating configuration..."
cat > "$SYNCSERVER_INI_PATH" <<EOL
[server:main]
use = egg:gunicorn
host = 0.0.0.0
port = 5000
workers = 1
timeout = 30
loglevel = ${FF_SYNCSERVER_LOGLEVEL}
${GU_ACCESSLOG}

[app:main]
use = egg:syncserver

[syncserver]
# This must be edited to point to the public URL of your server,
# i.e. the URL as seen by Firefox.
public_url = ${FF_SYNCSERVER_PUBLIC_URL}

# This defines the database in which to store all server data.
sqluri = ${FF_SYNCSERVER_SQLURI}

# This is a secret key used for signing authentication tokens.
# It should be long and randomly-generated.
# The following command will give a suitable value on *nix systems:
#
#    head -c 20 /dev/urandom | sha1sum
#
# If not specified then the server will generate a temporary one at startup.
secret = ${FF_SYNCSERVER_SECRET}

# Set this to "false" to disable new-user signups on the server.
# Only request by existing accounts will be honoured.
allow_new_users = ${FF_SYNCSERVER_ALLOW_NEW_USERS}

# 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.  It will overwrite the WSGI environ dict with the
# details from public_url.  This could have security implications if e.g.
# you tell the app that it's on HTTPS but it's really on HTTP, so it should
# only be used as a last resort and after careful checking of server config.
force_wsgi_environ = ${FF_SYNCSERVER_FORCE_WSGI_ENVIRON}

# Uncomment and edit the following to use a local BrowserID verifier
# rather than posting assertions to the mozilla-hosted verifier.
# Audiences should be set to your public_url without a trailing slash.
#[browserid]
#backend = tokenserver.verifiers.LocalVerifier
#audiences = https://localhost:5000

EOL

if [ -n "$FF_SYNCSERVER_FORWARDED_ALLOW_IPS" ]; then
  cat >> "$SYNCSERVER_INI_PATH" <<EOL
# If you are running Nginx on a different host than the ff sync server the ff snyc server have to trust the X-Forwarded-* headers sent by Nginx.
forwarded_allow_ips = ${FF_SYNCSERVER_FORWARDED_ALLOW_IPS}
EOL
fi

echo "Fixing perms..."
chown -R syncserver:syncserver /data /opt/syncserver

exec yasu syncserver:syncserver "$@"


================================================
FILE: examples/compose/docker-compose.yml
================================================
version: "3.2"

services:
  firefox-syncserver:
    image: crazymax/firefox-syncserver:latest
    container_name: firefox_syncserver
    ports:
      - target: 5000
        published: 5000
        protocol: tcp
    volumes:
      - "firefox-syncserver:/data"
    env_file:
      - "./firefox-syncserver.env"
    restart: always

volumes:
  firefox-syncserver:


================================================
FILE: examples/compose/firefox-syncserver.env
================================================
TZ=Europe/Paris
PUID=1000
PGID=1000
FF_SYNCSERVER_PUBLIC_URL=http://firefox-syncserver.example.com:5000
FF_SYNCSERVER_SECRET=5up3rS3kr1t
FF_SYNCSERVER_ALLOW_NEW_USERS=true
FF_SYNCSERVER_FORCE_WSGI_ENVIRON=false


================================================
FILE: examples/traefik/README.md
================================================
## Usage

```bash
touch acme.json
chmod 600 acme.json
docker-compose up -d
docker-compose logs -f
```


================================================
FILE: examples/traefik/docker-compose.yml
================================================
version: "3.2"

services:
  traefik:
    image: traefik:2.3
    container_name: traefik
    command:
      - "--global.checknewversion=false"
      - "--global.sendanonymoususage=false"
      - "--log=true"
      - "--log.level=INFO"
      - "--entrypoints.http=true"
      - "--entrypoints.http.address=:80"
      - "--entrypoints.http.http.redirections.entrypoint.to=https"
      - "--entrypoints.http.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.https=true"
      - "--entrypoints.https.address=:443"
      - "--certificatesresolvers.letsencrypt"
      - "--certificatesresolvers.letsencrypt.acme.storage=acme.json"
      - "--certificatesresolvers.letsencrypt.acme.email=webmaster@example.com"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http"
      - "--providers.docker"
      - "--providers.docker.watch=true"
      - "--providers.docker.exposedbydefault=false"
    ports:
      - target: 80
        published: 80
        protocol: tcp
      - target: 443
        published: 443
        protocol: tcp
    volumes:
      - "./acme.json:/acme.json"
      - "/var/run/docker.sock:/var/run/docker.sock"
    restart: always

  firefox-syncserver:
    image: crazymax/firefox-syncserver:latest
    container_name: firefox_syncserver
    volumes:
      - "firefox-syncserver:/data"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.firefox-syncserver.entrypoints=https"
      - "traefik.http.routers.firefox-syncserver.rule=Host(`firefox-syncserver.example.com`)"
      - "traefik.http.routers.firefox-syncserver.tls=true"
      - "traefik.http.routers.firefox-syncserver.tls.certresolver=letsencrypt"
      - "traefik.http.routers.firefox-syncserver.tls.domains[0].main=firefox-syncserver.example.com"
      - "traefik.http.services.firefox-syncserver.loadbalancer.server.port=5000"
    env_file:
      - "./firefox-syncserver.env"
    restart: always

volumes:
  firefox-syncserver:


================================================
FILE: examples/traefik/firefox-syncserver.env
================================================
TZ=Europe/Paris
PUID=1000
PGID=1000
FF_SYNCSERVER_PUBLIC_URL=https://firefox-syncserver.example.com
FF_SYNCSERVER_SECRET=5up3rS3kr1t
FF_SYNCSERVER_ALLOW_NEW_USERS=true
FF_SYNCSERVER_FORCE_WSGI_ENVIRON=false
Download .txt
gitextract_j8dwbbq_/

├── .dockerignore
├── .editorconfig
├── .gitattributes
├── .github/
│   ├── CODEOWNERS
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   └── bug_report.md
│   ├── SUPPORT.md
│   ├── dependabot.yml
│   ├── 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
Condensed preview — 24 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (32K chars).
[
  {
    "path": ".dockerignore",
    "chars": 123,
    "preview": "/.dev\n/.idea\n/*.iml\n\n/.git\n/.github\n/examples\n/.editorconfig\n/.gitattributes\n/.gitignore\n/CHANGELOG.md\n/LICENSE\n/README."
  },
  {
    "path": ".editorconfig",
    "chars": 207,
    "preview": "# editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_"
  },
  {
    "path": ".gitattributes",
    "chars": 32,
    "preview": "/*.sh linguist-detectable=false\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "chars": 13,
    "preview": "*\t@crazy-max\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 56,
    "preview": "github: crazy-max\ncustom: https://www.paypal.me/crazyws\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 686,
    "preview": "---\nname: Bug report\nabout: Create a report to help us improve\n---\n\n### Behaviour\n\n#### Steps to reproduce this issue\n\n1"
  },
  {
    "path": ".github/SUPPORT.md",
    "chars": 1716,
    "preview": "# Support [![](https://isitmaintained.com/badge/resolution/crazy-max/docker-firefox-syncserver.svg)](https://isitmaintai"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 236,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"daily\"\n   "
  },
  {
    "path": ".github/labels.yml",
    "chars": 1765,
    "preview": "## more info https://github.com/crazy-max/ghaction-github-labeler\n- # automerge\n  name: \":bell: automerge\"\n  color: \"8f4"
  },
  {
    "path": ".github/workflows/build.yml",
    "chars": 2671,
    "preview": "name: build\n\nconcurrency:\n  group: build-${{ github.ref }}\n  cancel-in-progress: true\n\non:\n  push:\n    branches:\n      -"
  },
  {
    "path": ".github/workflows/labels.yml",
    "chars": 342,
    "preview": "name: labels\n\non:\n  push:\n    branches:\n      - 'master'\n    paths:\n      - '.github/labels.yml'\n      - '.github/workfl"
  },
  {
    "path": ".github/workflows/test.yml",
    "chars": 2465,
    "preview": "name: test\n\non:\n  push:\n    branches:\n      - 'master'\n    paths-ignore:\n      - '**.md'\n  pull_request:\n    branches:\n "
  },
  {
    "path": ".gitignore",
    "chars": 33,
    "preview": "/.dev\n\n# JetBrains\n/.idea\n/*.iml\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 2085,
    "preview": "# Changelog\n\n## 1.8.0-r15 (2021/03/04)\n\n* Renamed `yasu` (more info https://github.com/crazy-max/yasu#yet-another)\n\n## 1"
  },
  {
    "path": "Dockerfile",
    "chars": 1426,
    "preview": "ARG SYNCSERVER_VERSION=1.8.0\nARG SHA1_COMMIT=5932c464d70ec9cf0344b1d3e970b3711de6a98e\n\nFROM crazymax/yasu:latest AS yasu"
  },
  {
    "path": "LICENSE",
    "chars": 1070,
    "preview": "MIT License\n\nCopyright (c) 2017-2023 CrazyMax\n\nPermission is hereby granted, free of charge, to any person obtaining a c"
  },
  {
    "path": "README.md",
    "chars": 6804,
    "preview": "<p align=\"center\"><a href=\"https://github.com/crazy-max/docker-firefox-syncserver\" target=\"_blank\"><img height=\"128\" src"
  },
  {
    "path": "docker-bake.hcl",
    "chars": 618,
    "preview": "variable \"DEFAULT_TAG\" {\n  default = \"msmtpd:local\"\n}\n\n// Special target: https://github.com/docker/metadata-action#bake"
  },
  {
    "path": "entrypoint.sh",
    "chars": 4367,
    "preview": "#!/bin/bash\n\nTZ=${TZ:-UTC}\n\nFF_SYNCSERVER_ACCESSLOG=${FF_SYNCSERVER_ACCESSLOG:-false}\nFF_SYNCSERVER_LOGLEVEL=${FF_SYNCSE"
  },
  {
    "path": "examples/compose/docker-compose.yml",
    "chars": 360,
    "preview": "version: \"3.2\"\n\nservices:\n  firefox-syncserver:\n    image: crazymax/firefox-syncserver:latest\n    container_name: firefo"
  },
  {
    "path": "examples/compose/firefox-syncserver.env",
    "chars": 211,
    "preview": "TZ=Europe/Paris\nPUID=1000\nPGID=1000\nFF_SYNCSERVER_PUBLIC_URL=http://firefox-syncserver.example.com:5000\nFF_SYNCSERVER_SE"
  },
  {
    "path": "examples/traefik/README.md",
    "chars": 102,
    "preview": "## Usage\n\n```bash\ntouch acme.json\nchmod 600 acme.json\ndocker-compose up -d\ndocker-compose logs -f\n```\n"
  },
  {
    "path": "examples/traefik/docker-compose.yml",
    "chars": 2024,
    "preview": "version: \"3.2\"\n\nservices:\n  traefik:\n    image: traefik:2.3\n    container_name: traefik\n    command:\n      - \"--global.c"
  },
  {
    "path": "examples/traefik/firefox-syncserver.env",
    "chars": 207,
    "preview": "TZ=Europe/Paris\nPUID=1000\nPGID=1000\nFF_SYNCSERVER_PUBLIC_URL=https://firefox-syncserver.example.com\nFF_SYNCSERVER_SECRET"
  }
]

About this extraction

This page contains the full source code of the crazy-max/docker-firefox-syncserver GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 24 files (28.9 KB), approximately 8.8k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!