cloudfoundry-community / gogs-boshrelease

Gogs is a painless self-hosted Git service
https://gogs.io/
Apache License 2.0
5 stars 5 forks source link

No initial setup presented; no default password in README #9

Closed dhaines closed 7 years ago

dhaines commented 7 years ago

I have spun up a gogs instance using the few lines of instructions from the README.md (cheers, BTW, on the brevity, given the expected functionality in return). The instance looks like its working, but when I hit the box on 8080, I am presented with a standard login screen, which expects (apparently) pre-established credentials. I am not given the opportunity, as per the gogs documentation, to create an admin account. The README.md, in its beloved brevity, is unfortunately silent on this matter.

I have attempted to logni as 'gogs' and 'admin' using 'gogs', 'admin', 'password', and the gogs-password created in the vars-store specified on the bosh command line.

Any thoughts?

dhaines commented 7 years ago

I've looked into it a bit further, and it appears that the admin user is trying to be created after gogs starts up, but gogs itself is being start up with an exec statement, so I'd wager that bash never gets to the create-user command, giving me the behavior above. I assume that this is there for purposes of monit.

Would putting the create-user in a post-start script work?

drnic commented 7 years ago

I'll also investigate more about configuration. I bumped the repo along recently to add in some new CI etc, but I haven't used the release. I should do more validation next time :)

I'm also working on a manifests/operators/routing.yml so that gogs will be setup via CF's gorouter and use its https setup.

drnic commented 7 years ago

Ok, I've changed DISABLE_REGISTRATION = false so that now a menu bar link "Register" appears. The first user created will be the initial admin.

drnic commented 7 years ago

In gogs_ctl there is:

    # Create admin user for the initial
    su git -c "${PACKAGE_DIR}/gogs admin create-user \
              --name <%= p('gogs.admin') %> \
              --password <%= p('gogs.password') %> \
              --email <%= p('gogs.email') %> \
                      --admin \
              --config ${STORE_DIR}/config/app.ini"

I'm not yet sure why we weren't previously seeing this user created or the login credentials not working.

drnic commented 7 years ago

@dhaines try https://github.com/cloudfoundry-community/gogs-boshrelease/releases/tag/v5.1.0

dhaines commented 7 years ago

@drnic I'm 99% certain that the create-user isn't happening because of the preceding exec. Again, my guess is that it could be solved with a post-start script.

The 5.1.0 release works fine. Thanks for the help!