diff --git a/Makefile b/Makefile index e784a36..66e7a11 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: FORCE +.PHONY: FORCE emblemscanner-release IMAGE_TAG := $(shell git rev-parse --short HEAD) IMAGE_REPO := registry.gitlab.com/euphon/themblem @@ -129,4 +129,21 @@ opencv.js: opencv/src/LICENSE FORCE --disable_single_file alg/qrtool: - make -C alg qrtool \ No newline at end of file + make -C alg qrtool + +RELEASE_VERSION := $(shell git describe --tags --abbrev=0 | sed 's/^emblemscanner-//') + +emblemscanner-release: build/emblemscanner-$(RELEASE_VERSION).tar.gz + +build/emblemscanner-$(RELEASE_VERSION).tar.gz: + # if tree dirty or git head not tagged, error out + git diff --exit-code + if test -z "$(RELEASE_VERSION)"; then \ + echo "RELEASE_VERSION is empty"; \ + exit 1; \ + fi + if [ $(shell git rev-parse emblemscanner-$(RELEASE_VERSION)) != $(shell git rev-parse HEAD) ]; then \ + echo "git head not tagged as $(RELEASE_VERSION)"; \ + exit 1; \ + fi + tar -czvf build/emblemscanner-$(RELEASE_VERSION).tar.gz -C scanner pages/emblemscanner \ No newline at end of file diff --git a/scanner/CLAUDE.md b/scanner/CLAUDE.md index f2b72b8..e292a0b 100644 --- a/scanner/CLAUDE.md +++ b/scanner/CLAUDE.md @@ -59,5 +59,5 @@ This is a WeChat Mini Program project. Development is done through WeChat Develo - `https://themblem.com/api/v1/camera-rules/` - Device-specific camera settings - `https://themblem.com/api/v1/check-auto-torch/` - Auto torch functionality -- `https://whatsmyip.hondcloud.com` - IP address detection -- `https://research.themblem.com/event/` - Event tracking endpoint \ No newline at end of file +- `https://whatsmyip.themblem.com` - IP address detection +- `https://research.themblem.com/event/` - Event tracking endpoint diff --git a/scanner/app.js b/scanner/app.js index 498db67..0dd5847 100644 --- a/scanner/app.js +++ b/scanner/app.js @@ -43,7 +43,7 @@ App({ get_real_ip() { this.globalData.real_ip = "0.0.0.0"; wx.request({ - url: "https://whatsmyip.hondcloud.com", + url: "https://whatsmyip.themblem.com", success: (res) => { var rip = res.data; console.log("my real ip:", rip); diff --git a/scanner/pages/emblemscanner/emblemscanner.js b/scanner/pages/emblemscanner/emblemscanner.js index fdac25a..3052a93 100644 --- a/scanner/pages/emblemscanner/emblemscanner.js +++ b/scanner/pages/emblemscanner/emblemscanner.js @@ -420,12 +420,12 @@ Page({ }); this.log(`Camera set initial zoom to ${initial_zoom}x, will zoom in to ${zoom}x when QR is found`); - this.camera_context.setZoom({ zoom: initial_zoom }); + this.camera_context.setZoom({ zoom: 6 }); // Set up zoom-in behavior when QR is found this.on_first_qr_found = () => { this.log(`First QR found, zoom to ${zoom}x`); - this.camera_context.setZoom({ zoom: zoom }); + this.camera_context.setZoom({ zoom: 6 }); this.setData({ zoom: zoom, qrmarkers_class: '', diff --git a/scanner/pages/emblemscanner/libemblemscanner.js b/scanner/pages/emblemscanner/libemblemscanner.js index 8d73932..51a47ff 100644 --- a/scanner/pages/emblemscanner/libemblemscanner.js +++ b/scanner/pages/emblemscanner/libemblemscanner.js @@ -98,7 +98,7 @@ function make_query(zoom, return_page, real_ip, tenant_id) { */ function fetch_real_ip(callback) { wx.request({ - url: 'https://whatsmyip.hondcloud.com', + url: 'https://whatsmyip.themblem.com', success: (res) => { const ip = res.data || ''; console.log('Real IP fetched:', ip); @@ -139,4 +139,4 @@ module.exports = { fetch_real_ip, get_tenant_id, is_emblem_qr_pattern -}; \ No newline at end of file +};