Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@ See [`docs/versioning.md`](docs/versioning.md) for what the numbers mean and

## Unreleased

### Changed

- The texts say what they mean. The message field placeholder was "One
place a day, one pin"; it now says to press Play or send a location.
"Until the truth" is "until the result", the pin toasts and the loading
line say what happened instead of joking, and a quiet group is told how
to resume without a nap and an emoji. All sixteen languages.
- Ukrainian calls the map pin "мітка" instead of "шпилька", and the
profile's "hide me" note no longer says that nobody, the owner
included, can open the profile.
- The privacy page names the site by `APP_URL` instead of a fixed
`maply.ws04.cc`, so moving the domain needs no text change.

### Added

- The privacy page says what the data is used for, what maply gets from
Google and how it is kept and erased, and who runs maply. Google's brand
verification asked for it.

## v0.1.0-beta.1 - 2026-11-23

For the operator: this release applies migrations 031 and 032. Pull the image
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">maply</h1>

<p align="center"><strong>One place a day. Pin it on the map. The answer comes at 20:00.</strong><br/>A daily geo-guessing game for Telegram groups, built as a Go bot with a Mini App.</p>
<p align="center"><strong>A daily geo-guessing game for Telegram.</strong><br/>Every morning one street panorama, the same for every chat. Everyone drops a pin in the Mini App; the place, the scores and the chat's table come at 20:00.</p>

<p align="center">
<a href="#status"><img src="https://img.shields.io/badge/status-beta-245A3C?style=for-the-badge&labelColor=0f172a" alt="status"></a>
Expand Down Expand Up @@ -35,10 +35,9 @@ maply is deliberately narrow:
| Not another chatterbot | At most three group messages a day: post, intrigue, result |
| Something to talk about | One honest hint between 16:00 and 18:00, then the reveal |
| A reason to come back | Streaks, a chat leaderboard, free play between days, a share line without spoilers |
| Familiar stack | Go, the family's `tg` client, shared Asterfield `core` |

> **Result:** a five-minute ritual that the whole chat plays at its own pace and
> argues about in the evening.
> **Result:** one short game a day inside the chat, with the place, the scores
> and the chat's table at 20:00.

---

Expand All @@ -49,7 +48,7 @@ maply is deliberately narrow:
| Stable | — | Nothing stable yet |
| Beta | `v0.1.0-beta.1` | Play as [@maplyin_bot](https://t.me/maplyin_bot) or on [maply.ws04.cc](https://maply.ws04.cc/): the daily round, free play with leaderboards, profiles and sign-in on the site |

The game is playable end to end: the morning post, the answer and its score,
Each day brings the morning post, the answer and its score,
the evening result with a map card, the world ranking and a website where
anyone can play without Telegram. Between days there is free play: alone,
against the clock, from the archive of past days, as a challenge or with
Expand Down
23 changes: 22 additions & 1 deletion internal/account/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestPrivacyGivesTheOwnersTelegram(t *testing.T) {
svc.Privacy().ServeHTTP(rec, httptest.NewRequest("GET", "/privacy?lang="+lang, nil))
body := rec.Body.String()
if rec.Code != http.StatusOK || strings.Count(body, `<a href="https://t.me/amtiyo" dir="ltr">@amtiyo</a>`) != 1 ||
strings.Contains(body, "{contact}") || strings.Contains(body, "github.com") || strings.Contains(body, "&lt;a") {
strings.Contains(body, "{contact}") || strings.Contains(body, "github.com") || strings.Contains(body, "&lt;a href") {
t.Errorf("privacy in %s = %d, the contact is missing or broken", lang, rec.Code)
}
// Navigation is not CSP's to stop, and nothing here may name a target.
Expand All @@ -137,6 +137,27 @@ func TestPrivacyGivesTheOwnersTelegram(t *testing.T) {
}
}

// The page names the site by APP_URL, so a move of the domain needs no text
// change; without APP_URL it names the host it was asked on.
func TestPrivacyNamesTheSiteFromAppURL(t *testing.T) {
for _, tc := range []struct{ appURL, host, want string }{
{"https://maply.example.org/", "other.example", "maply.example.org"},
{"", "maply.example.net", "maply.example.net"},
} {
svc := New(Config{Key: []byte("k1"), AppURL: tc.appURL})
for _, lang := range i18n.Codes() {
rec := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/privacy?lang="+lang, nil)
req.Host = tc.host
svc.Privacy().ServeHTTP(rec, req)
body := rec.Body.String()
if !strings.Contains(body, tc.want) || strings.Contains(body, "{site}") || strings.Contains(body, "ws04.cc") {
t.Errorf("privacy in %s with APP_URL %q does not name %s", lang, tc.appURL, tc.want)
}
}
}
}

// The page covers what other players see of free play and the public link,
// in the words the app's own switches and tables use.
func TestPrivacyNamesTheAppsOwnWords(t *testing.T) {
Expand Down
16 changes: 15 additions & 1 deletion internal/account/privacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"bytes"
"html/template"
"net/http"
"net/url"
"strings"

"github.com/asterfield-dev/maply/internal/i18n"
Expand Down Expand Up @@ -72,6 +73,16 @@ type privacyLang struct {
Current bool
}

// siteHost is the site's address as the privacy page names it: the host of
// APP_URL, else the host the page was asked on. The domain may move, so no
// text carries it.
func (s *Service) siteHost(r *http.Request) string {
if u, err := url.Parse(s.cfg.AppURL); err == nil && u.Host != "" {
return u.Host
}
return r.Host
}

// Privacy serves /privacy in ?lang=, else the browser's first language maply
// speaks, else English.
func (s *Service) Privacy() http.Handler {
Expand All @@ -86,13 +97,16 @@ func (s *Service) Privacy() http.Handler {
}
data := map[string]any{
"Lang": lang, "Dir": "ltr",
"Title": i18n.T(lang, "acct.privacy.title"), "Intro": i18n.T(lang, "acct.privacy.intro"),
"Title": i18n.T(lang, "acct.privacy.title"), "Intro": i18n.T(lang, "acct.privacy.intro", "site", s.siteHost(r)),
"Back": i18n.T(lang, "acct.privacy.back"), "Languages": i18n.T(lang, "acct.privacy.languages"),
"Sections": []privacySection{
{i18n.T(lang, "acct.privacy.keep_h"), items("acct.privacy.keep")},
{i18n.T(lang, "acct.privacy.use_h"), items("acct.privacy.use")},
{i18n.T(lang, "acct.privacy.google_h"), items("acct.privacy.google")},
{i18n.T(lang, "acct.privacy.see_h"), items("acct.privacy.see")},
{i18n.T(lang, "acct.privacy.not_h"), items("acct.privacy.not")},
{i18n.T(lang, "acct.privacy.delete_h"), items("acct.privacy.delete")},
{i18n.T(lang, "acct.privacy.who_h"), items("acct.privacy.who")},
},
}
if lang == "ar" {
Expand Down
4 changes: 2 additions & 2 deletions internal/bot/world_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ func TestRefreshWorld(t *testing.T) {
calls int
toast string
}{
{"drawing", schedule.RefreshDrawing, press(tg.Chat{ID: 9, Type: "private"}, 9), 1, "Drawing the map with the new answers, this takes up to a minute."},
{"drawing", schedule.RefreshDrawing, press(tg.Chat{ID: 9, Type: "private"}, 9), 1, "Updating the map with the new answers. This takes up to a minute."},
{"nothing new", schedule.RefreshSame, press(tg.Chat{ID: 9, Type: "private"}, 9), 1, "No new answers yet."},
{"final", schedule.RefreshFinal, press(tg.Chat{ID: 9, Type: "private"}, 9), 1, "World places are final now."},
{"final", schedule.RefreshFinal, press(tg.Chat{ID: 9, Type: "private"}, 9), 1, "The world ranking is final now."},
{"gone", schedule.RefreshGone, press(tg.Chat{ID: 9, Type: "private"}, 9), 1, ""},
{"in a group", schedule.RefreshDrawing, press(tg.Chat{ID: -100, Type: "supergroup"}, 9), 0, ""},
} {
Expand Down
Loading