Skip to content

Turn the ad system on per installation, with ADS_ENABLED - #2247

Merged
wintermeyer merged 2 commits into
mainfrom
ads-enabled-env
Sep 19, 2026
Merged

wintermeyer merged 2 commits into
mainfrom
ads-enabled-env

Conversation

@wintermeyer

Copy link
Copy Markdown
Owner

:ads_enabled lived only in config/config.exs, so switching ads on for vutuv.de would have switched them on for everyone who installs vutuv. That is not a small default: the prices are hardcoded in Vutuv.Ads.tiers/0 (350 € a day, 2.000 € a week, 7.500 € a month) and the booking notices that reach the operator are fixed German, so a third-party installation would inherit a shop billing in euros at our rates.

So config/runtime.exs now reads ADS_ENABLED, documented in docs/ADMINS.md, and the shipped default stays off.

Only the exact word true switches it on. A flag past which members start getting invoices must not read a typo, a shell's 1, or a shouted YES as consent. test/vutuv/ads/enabled_env_test.exs evaluates the condition out of runtime.exs instead of restating it — that file is never loaded in the test env, so this is the only place the branch runs before production.

Der Schalter lag nur in config.exs, also hätte "an für vutuv.de" bedeutet: an
für jeden, der vutuv installiert. Das wäre keine Kleinigkeit, denn die Preise
stehen fest im Code und die Betreiber-Mails sind fest deutsch — eine fremde
Installation bekäme einen Laden, der in Euro zu unseren Sätzen abrechnet. Also
liest runtime.exs jetzt ADS_ENABLED, der ausgelieferte Default bleibt aus.

Nur das exakte Wort "true" schaltet an. Ein Schalter, ab dem Mitgliedern Geld in
Rechnung gestellt wird, darf einen Tippfehler, ein "1" aus der Shell oder ein
gebrülltes YES nicht als Zustimmung lesen. Der Test liest die Bedingung aus
runtime.exs statt sie abzuschreiben, weil eine Kopie weiterläuft, wenn das
Original abgedriftet ist; runtime.exs wird im Test-Env sonst nie ausgeführt.

Diesen Text hat ein KI-Agent in meinem Namen geschrieben. Ich weiß, dass das problematisch ist.
Der Test-Helfer verschob die Zeilen eines Blocks einzeln und las sie ohne
order_by, also in der Reihenfolge, die Postgres gerade einfiel. Wird eine Woche
um weniger als sieben Tage zurückdatiert, landet jede Zeile auf einem Tag, den
der Block selbst noch hält — kommt eine spätere zuerst dran, schlägt
ads_day_index mit 23505 zu. Hier war es wochenlang die Einfügereihenfolge und
auf CI dann etwas anderes, also älteste Zeile zuerst.

Diesen Text hat ein KI-Agent in meinem Namen geschrieben. Ich weiß, dass das problematisch ist.
@wintermeyer
wintermeyer merged commit 807a5b5 into main Sep 19, 2026
1 check passed
@wintermeyer
wintermeyer deleted the ads-enabled-env branch September 19, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant