coorasse / passkit

Wallet Pass generation for Ruby On Rails
MIT License
90 stars 27 forks source link

Make PASSKIT_ env variables not mandatory #34

Open dzirtusss opened 6 months ago

dzirtusss commented 6 months ago

Making PASSKIT_... variables mandatory makes Docker flow very strange:

RUN RAILS_ENV=production \
    NODE_ENV=production \
    PASSKIT_WEB_SERVICE_HOST=https://example.com \
    PASSKIT_CERTIFICATE_KEY=NOT_USED_NON_BLANK \
    PASSKIT_PRIVATE_P12_CERTIFICATE=NOT_USED_NON_BLANK \
    PASSKIT_APPLE_INTERMEDIATE_CERTIFICATE=NOT_USED_NON_BLANK \
    PASSKIT_APPLE_TEAM_IDENTIFIER=NOT_USED_NON_BLANK \
    PASSKIT_PASS_TYPE_IDENTIFIER=NOT_USED_NON_BLANK \
    bundle exec rails assets:precompile

Because those variables should not exists and/or be injected into Dockerfile. But, just because they are mandatory, assets:precompile crashes with error. However, on practice, they are not used at all by assets compilation.

As well a bit similar situation is with say db:migrate, which may crash in envs w/o such vars (again some simple one-off containers w/o full env).

I guess any other type of solution may be ok (later "normal" run errors, log warnigns, etc), but not the crash of the rails app if env is missing. I mean no any other gem in my memory seems to have such behaviour.

Thanks.

coorasse commented 6 months ago

Yes, I agree. Maybe you have a bit of time to help and start from https://github.com/coorasse/passkit/pull/5 ? This would solve the issue I believe