Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c40a7e1
Added support to v6 format using external rmc tool
joagonca Sep 30, 2025
262f700
Prior detection of format
joagonca Oct 1, 2025
7092b5a
Added debug logging lines
joagonca Oct 1, 2025
3183b7a
Updated Dockerfile to add Python packages
joagonca Oct 1, 2025
fb6a3a4
Merge branch 'ddvk:master' into v6_rmc
joagonca Oct 29, 2025
558e4bb
Implemented support for rmc-go library
joagonca Oct 29, 2025
d160991
Removed Python legacy code
joagonca Oct 29, 2025
3cc43ec
Removed implementation details files
joagonca Oct 29, 2025
1c1cac4
Mod tidy
joagonca Oct 29, 2025
5886605
Multipage v6 support
joagonca Nov 3, 2025
732bd9e
Fix page ordering
joagonca Nov 3, 2025
326d317
Bump rmc-go to v1.1.1
joagonca Nov 3, 2025
88fc73c
Addressing PR comments
joagonca Nov 3, 2025
a9ce4a1
Removed unipdf+rmcairo dependencies by changing to go-cairo
joagonca Nov 27, 2025
5d546cf
Dockerfile cleanup
joagonca Nov 27, 2025
def773c
Removed legacy naming calls from rmapi
joagonca Nov 27, 2025
6aa15b8
Fix build process (forgot to update Makefile)
joagonca Nov 27, 2025
075a90a
Fix Github action pipeline
joagonca Nov 27, 2025
9d7e58c
Merge v6_rmc into v6_nounipdf
joagonca Apr 22, 2026
e99c9f4
Merge remove_rmapi_unipdf into v6_nounipdf
joagonca Apr 22, 2026
3139b10
go mod tidy: remove rmapi, unipdf, and unused dependencies
joagonca Apr 22, 2026
8b14499
Fix fslock API: migrate remaining danjacques/gofslock calls to juju/f…
joagonca Apr 22, 2026
9afca7f
Sanitize document id in RemoveDocument to prevent path traversal
joagonca Apr 22, 2026
e57b274
Merge pull request #2 from joagonca/v6_nounipdf
joagonca Apr 22, 2026
a56e26d
Merge upstream/master (ddvk/rmfakecloud)
joagonca Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Install Cairo dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev pkg-config

- name: Build
run: make build

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ jobs:
version: 9
run_install: false

- name: Build
- name: Install Cairo dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev pkg-config

- name: Build
run: make all

- name: Release
Expand Down
25 changes: 18 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,25 @@ RUN pnpm install && pnpm build
FROM golang:bookworm AS gobuilder
ARG VERSION
WORKDIR /src

# Install Cairo development dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libcairo2-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

COPY . .
COPY --from=uibuilder /src/dist ./ui/dist
#RUN apk add git
RUN go generate ./... && CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=${VERSION}" -o rmfakecloud-docker ./cmd/rmfakecloud/
RUN go generate ./... && CGO_ENABLED=1 go build -tags cairo -ldflags "-s -w -X main.version=${VERSION}" -o rmfakecloud-docker ./cmd/rmfakecloud/

FROM scratch
FROM debian:bookworm-slim
EXPOSE 3000
ADD ./docker/rootfs.tar /
COPY --from=gobuilder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=gobuilder /src/rmfakecloud-docker /
ENTRYPOINT ["/rmfakecloud-docker"]

# Install Cairo runtime libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libcairo2 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=gobuilder /src/rmfakecloud-docker /rmfakecloud
ENTRYPOINT ["/rmfakecloud"]
9 changes: 8 additions & 1 deletion Dockerfile.make
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
FROM scratch
FROM debian:bookworm-slim
EXPOSE 3000

# Install Cairo runtime libraries
RUN apt-get update && apt-get install -y \
ca-certificates \
libcairo2 \
&& rm -rf /var/lib/apt/lists/*

#ENV RMAPI_HWR_HMAC
#ENV RM_SMTP_SERVER=""
#ENV RM_SMTP_USERNAME=""
Expand Down
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ LDFLAGS := "-s -w -X main.version=$(VERSION)"
OUT_DIR := dist
CMD := ./cmd/rmfakecloud
BINARY := rmfakecloud
BUILD = go build -ldflags $(LDFLAGS) -o $(@) $(CMD)
BUILD = CGO_ENABLED=1 go build -tags cairo -ldflags $(LDFLAGS) -o $(@) $(CMD)
BUILD_CAIRO = $(BUILD)
ASSETS = ui/dist
GOFILES := $(shell find . -iname '*.go' ! -iname "*_test.go")
GOFILES += $(ASSETS)
Expand All @@ -13,10 +14,12 @@ UIFILES += ui/package.json
TARGETS := $(addprefix $(OUT_DIR)/$(BINARY)-, x64 armv6 armv7 arm64 win64 docker)
PNPM = cd ui; pnpm

.PHONY: all run runui clean test testgo testui
.PHONY: all run runui clean test testgo testui build-cairo

build: $(OUT_DIR)/$(BINARY)-x64

build-cairo: $(OUT_DIR)/$(BINARY)-cairo-x64

all: $(TARGETS)

$(OUT_DIR)/$(BINARY)-x64:$(GOFILES)
Expand All @@ -35,13 +38,20 @@ $(OUT_DIR)/$(BINARY)-arm64:$(GOFILES)
GOARCH=arm64 $(BUILD)

$(OUT_DIR)/$(BINARY)-docker:$(GOFILES)
CGO_ENABLED=0 $(BUILD)
$(BUILD)

# Cairo-enabled builds (native rmc-go support)
$(OUT_DIR)/$(BINARY)-cairo-x64:$(GOFILES)
GOOS=linux $(BUILD_CAIRO)

$(OUT_DIR)/$(BINARY)-cairo-arm64:$(GOFILES)
GOOS=linux GOARCH=arm64 $(BUILD_CAIRO)

container: $(OUT_DIR)/$(BINARY)-docker
docker build -t rmfakecloud -f Dockerfile.make .

run: $(ASSETS)
go run $(CMD) $(ARG)
go run -tags cairo $(CMD) $(ARG)

$(ASSETS): $(UIFILES) ui/pnpm-lock.yaml
#@cp ui/node_modules/pdfjs-dist/build/pdf.worker.js ui/public/
Expand Down Expand Up @@ -70,5 +80,5 @@ testui:
#CI=true $(PNPM) test

testgo:
go test ./...
go test -tags cairo ./...

54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ See the [documentation](https://ddvk.github.io/rmfakecloud/remarkable/setup/) fo
| Messaging integration to Slack | 🟡 | Not directly, use a webhook with zapier/make/n8n |
| Archive document to cloud | 🟡 | It works but the information is not saved |
| [Passcode (PIN) reset](https://ddvk.github.io/rmfakecloud/usage/passcode-reset/) | ✅ | reMarkable 1 / reMarkable 2 only |
| Document rendering in web interface | ❌ | [WIP](https://github.com/ddvk/rmfakecloud/issues/255) |
| Document rendering in web interface | ✅ | |
| v6 file format support (software 3.0+) | ✅ | Native in-process rendering with rmc-go |


## Breaking Changes
Expand All @@ -50,6 +51,57 @@ See the [documentation](https://ddvk.github.io/rmfakecloud/remarkable/setup/) fo
or modify the profile and add `sync15:true`
a full resync will be needed (the tablet will do it), the old files are kept as they were and everything is put in a new directory

## v6 File Format Support

rmfakecloud natively supports v6 file format (introduced in reMarkable software 3.0+) for PDF export via the web UI.

### How It Works

- **v5 files** (software < 3.0): Rendered using built-in rmapi library
- **v6 files** (software >= 3.0): Rendered natively using integrated rmc-go library with Cairo

### Requirements

**Docker (recommended)**: All dependencies included automatically.

**Manual installation**:
- Cairo development libraries for building:
- macOS: `brew install cairo pkg-config`
- Ubuntu/Debian: `apt-get install libcairo2-dev pkg-config`
- Fedora: `dnf install cairo-devel`
- Cairo runtime library for running (installed automatically on most systems)

### Building

```bash
# Build with native v6 support (Cairo)
make build-cairo

# Or for standard build
make build
```

### Docker Usage

The Docker image includes native v6 support:

```bash
docker run -d -p 3000:3000 \
-v $PWD/data:/data \
ddvk/rmfakecloud:latest
```

### Performance

- **v6 rendering**: ~100-500ms per page (in-process, no external dependencies)
- **v5 rendering**: Similar performance with rmapi
- **Caching**: Results cached for faster subsequent access

### Known Limitations

- Multi-page v6 documents: Fully supported
- Text rendering: Fully supported

## Development

run `./dev.sh` which should start the UI and backend
Expand Down
7 changes: 7 additions & 0 deletions docs/install/source.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ To be able to compile from source, you'll need the following dependencies:
* [pnpm](https://pnpm.io/)
* [go](https://go.dev/) version 1.16 at least
* make
* **Cairo graphics library** (required for PDF rendering with annotations)
- On Debian/Ubuntu: `sudo apt-get install libcairo2-dev pkg-config`
- On Fedora/RHEL: `sudo dnf install cairo-devel pkgconfig`
- On macOS: `brew install cairo pkg-config`
- On Arch Linux: `sudo pacman -S cairo pkgconf`

Build
-----
Expand All @@ -20,6 +25,8 @@ cd rmfakecloud
make all
```

**Note:** The build process requires Cairo to be installed, as it's used for rendering reMarkable annotations to PDF. The build uses the `-tags cairo` flag to enable Cairo support. If you encounter build errors related to Cairo, ensure the Cairo development libraries are properly installed on your system.

Installing
==========

Expand Down
40 changes: 17 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
module github.com/ddvk/rmfakecloud

go 1.23.3

toolchain go1.24.1
go 1.25.1

require (
github.com/danjacques/gofslock v0.0.0-20240212154529-d899e02bfe22
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5
github.com/gin-gonic/gin v1.9.1
github.com/golang-jwt/jwt/v4 v4.5.2
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.1
github.com/juruen/rmapi v0.0.25
github.com/joagonca/rmc-go v1.1.1
github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b
github.com/mochi-mqtt/server/v2 v2.7.9
github.com/pdfcpu/pdfcpu v0.11.1
github.com/poundifdef/go-remarkable2pdf v0.2.0
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
github.com/secsy/goftp v0.0.0-20200609142545-aa2de14babf4
github.com/sirupsen/logrus v1.9.3
github.com/soheilhy/cmux v0.1.5
github.com/stretchr/testify v1.9.0
github.com/studio-b12/gowebdav v0.9.0
github.com/unidoc/unipdf/v3 v3.56.0
golang.org/x/crypto v0.36.0
github.com/ungerik/go-cairo v0.0.0-20240304075741-47de8851d267
golang.org/x/crypto v0.43.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/adrg/strutil v0.3.1 // indirect
github.com/adrg/sysfont v0.1.2 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/bytedance/sonic v1.11.3 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/clipperhouse/uax29/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
Expand All @@ -40,32 +36,30 @@ require (
github.com/go-playground/validator/v10 v10.19.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/gorilla/i18n v0.0.0-20150820051429-8b358169da46 // indirect
github.com/hhrutter/lzw v1.0.0 // indirect
github.com/hhrutter/pkcs7 v0.2.0 // indirect
github.com/hhrutter/tiff v1.0.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/jung-kurt/gofpdf v1.16.2 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/pelletier/go-toml/v2 v2.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/xid v1.4.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/unidoc/freetype v0.2.3 // indirect
github.com/unidoc/pkcs7 v0.2.0 // indirect
github.com/unidoc/timestamp v0.0.0-20200412005513-91597fd3793a // indirect
github.com/unidoc/unichart v0.3.0 // indirect
github.com/unidoc/unitype v0.4.0 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/image v0.18.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/image v0.32.0 // indirect
golang.org/x/net v0.45.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/text v0.30.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading
Loading