Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building from sources miss packr2 steps #1857

Closed
arapaho opened this issue May 16, 2020 · 0 comments · Fixed by #1858
Closed

Building from sources miss packr2 steps #1857

arapaho opened this issue May 16, 2020 · 0 comments · Fixed by #1858

Comments

@arapaho
Copy link
Contributor

arapaho commented May 16, 2020

Describe the bug
Building from source is broken: the resulting hydra binary is not usable to missing schema.

The procedure https://www.ory.sh/hydra/docs/install#building-from-source does not contain the step to install packr2 binary beforehand and the Makefile does not include the necessary calls to packr2 in install-stable and install targets.

Reproducing the bug

Steps to reproduce the behavior:

  1. Clone repository: git checkout -b v1.4.10 https://github.com/ory/hydra
  2. Build hydra: make install-stable
  3. Rename .schema directory located in sources: mv .schema{,.test}
  4. Start hydra with a test configuration file $(go env GOPATH)/bin/hydra --config /path/to/test_config.yml serve all and get the error.

Server logs

FATA[0000] Unable to open configuration JSON Schema.     error="stat /path/to/cloned/hydra/.schema/config.schema.json: no such file or directory"`

Server configuration

dsn: memory
log:
    level: debug
oauth2:
    expose_internal_errors: true
    hashers:
        bcrypt:
            cost: 10
secrets:
    cookie:
    - plopplopekujghibGajsiod8Ob
    system:
    - hahahaekujghibGajsiod8Ob
serve:
    admin:
        host: 127.0.0.1
        port: 4445
    public:
        cors:
            enabled: true
        host: 127.0.0.1
        port: 4444
strategies:
    scope: exact
ttl:
    access_token: 3m
    auth_code: 1m
    id_token: 3m
    login_consent_request: 1h
    refresh_token: 10m

Expected behavior

Resulting binary must run without the sources being present.

Environment

  • Version: v1.4.10
  • Environment: Debian testing and Ubuntu 18.04

Additional context

The problem has been discovered while building Ory Hydra with the goal of producing internal Debian/Ubuntu packages.

aeneasr pushed a commit that referenced this issue May 16, 2020
packr2 binary is a needed pre-requisite used to generate .go files that
pack the static files of the project into bytes that can be bundled.

Invokes packr2 in install-stable and install targets of Makefile in
order to generate the .go files that pack the static files into bytes
that can be bundled.

Closes #1857
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 a pull request may close this issue.

1 participant