Turn the ad system on per installation, with ADS_ENABLED - #2247
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
:ads_enabledlived only inconfig/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 inVutuv.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.exsnow readsADS_ENABLED, documented indocs/ADMINS.md, and the shipped default stays off.Only the exact word
trueswitches it on. A flag past which members start getting invoices must not read a typo, a shell's1, or a shoutedYESas consent.test/vutuv/ads/enabled_env_test.exsevaluates the condition out ofruntime.exsinstead of restating it — that file is never loaded in the test env, so this is the only place the branch runs before production.