I mix a gallon at a time and store in a brown Kalt one gallon Data Botle, and store it under my bathroom sink. The last batch started looking ever so slightly dark yellowish as I used the last of it, and that was going on four months after the original mix. (negs turned out fine, FWIW)
It turns dark brown much faster when stored in a one gallon milk jug, FYI 🙂 A clean bleach bottle would probably be fine, however.
If the stuff turns brown, dump it. It will stink, and I wouldn't ignore such an indication of sourness and develop film with it. You have quite a bit of time before that happens, and the powder is so cheap for a gallon I can't see worrying about longevity. If you are really concerned, mix using the one liter package, even if that costs 3/4 the price of the gallon mix. I figure I get 22 or so rolls out of one gallon ff D-76, used 1+1 one-shot.
IMHO, if you want to keep it longer for whatever reason, mix the whole gallon, then separate into a few glass bottles filled to overflowing before capping air-tight. As I understand it, it's oxidation that causes it to go brown. Use clear bottles stored in a dark cupboard so you can keep an eye on its state without worrying that light will have a negative effect.
Honestly, unless you are talking about making a $6 package last a year or more, use HC-110. I prefer D-76 1+1, but HC-110 syrup is seriously cheap at a per roll basis. And it lasts a long, long time, apparently.