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

Add support of push and pull over ssh #303

Merged
merged 16 commits into from
Aug 19, 2015
Merged

Conversation

sonalkr132
Copy link
Collaborator

  • add keys model
  • add fingerprint to keys
  • changes in UI to allow users to add keys
  • integrate gitlab-shell
  • add api for shell to use
  • customize shell so that it authenticates using api
  • tests for keys
  • tests for api
  • test for lib files

git shell(customized version of gitlab-shell) will use keys for authorization
before git pull and push. Users can add multiple keys to their accounts.
@sonalkr132 sonalkr132 force-pushed the ssh branch 2 times, most recently from c2ccf9b to ad45ec2 Compare July 22, 2015 04:52
Keys' form is added to same page as index. Moved aside bar on user
settings page to a partial. A few changes in style to set active class.
A few gotchas:
Make sure username and path in gitlab-shell config matches the username
used for hosting.
If using fedora install ruby with `yum/dnf install ruby` even if you have
ruby gem avilable.
Make sure you have access rights to ~/.ssh/authorized_keys.
gitlab-shell makes call to api of gg app for verification of access
during push and pull.
Make sure that api is working with ./bin/check from gitlab-shell.
We don't have same directory structure as gitlab, so directory test
will fail. We don't use redis either so it will fail too.
Gotcha: Generate a secure random key and add it to .gitlab_shell_secret
in gitlab-shell root folder.
Create branch and remotes in satellite repo after push to empty
repo is made.Added symlink to hooks dir in gitlab-shell/hooks in each
project's bare repo. There hooks make call to gg api and inforce authorization.
ShellEnv passes user-id to gitlab-shell.
Sync of satellite and authorization from hooks required mulitple
processes to run concurrently.
post-recieve hook makes api call for sync
…ands

GitAccess checks membership relationship of user with projects.
GitAccessStatus builds the response to be send.
@sonalkr132 sonalkr132 force-pushed the ssh branch 4 times, most recently from 93ea9fb to 0ec5f7d Compare July 31, 2015 06:47
Puma required that we use 4 workers while unicorn needs only 2. Feel
free to bump this number to CPU+1
To start the server use in development mode:
RAILS_ENV=development bundle exec unicorn -c config/unicorn.rb
@sonalkr132
Copy link
Collaborator Author

@rohitpaulk I have a few concerns about test, especially about getting travis to work. This branch depends heavily on environment outside of app. For ex: to test successful creation of keys, I need a OpenSSH server set up for generation of fingerprint.
Next, to test successful push and pull requests I need myfork of gitlab-shell exist in parent directory of gg app.
I am not sure how I am going to get travis to allow all of it.
As an alternate solution, I guess I can stub the behavior whenever I need to do something outside of app. However then it feel like I am losing whole point of testing.

Add shoulda-matcher for easier validation checking.
Removed project method from keys model cause we are not using it.
Stub callback methods of keys model to save hassel.
@sonalkr132 sonalkr132 force-pushed the ssh branch 2 times, most recently from aeae7cf to 91ba245 Compare August 3, 2015 08:00
@sonalkr132 sonalkr132 changed the title ssh - WIP Add support of push and pull over ssh Aug 4, 2015
@sonalkr132
Copy link
Collaborator Author

closes #162, #161 and #150

We can close #150 as "won't fix". We need to remove openshift specific files (for ex: .openshift/) from our repo.

@sonalkr132
Copy link
Collaborator Author

behold: http://glittergallery-dev.fedorainfracloud.org/

  • Make your own profile.
  • Go to settings -> click ssh key tab -> add a name of your key and paste your sparkleshare key -> click on add key
  • Make a new project
  • Open sparkleshare and go to add hosted projects. In address type: ssh://[email protected] and in remote path: /<username>/<project_name>.git
  • Click add and wait

Known issues:

  • sucky design/style ( will do in a new PR as this needs fixing at quite a few places)
  • first time sparkleshare sync it will upload non-image files as well, so no thumbnail images will be generated. (will do in PR where we add support for non-image files)
  • error page on using empty dir name (on web ui)
  • pick username, project name and branch name without spaces in it. This needs to be enforced with validation.
  • broken history page
  • no nignx config file (will do in PR where all the openshift specific files and config is removed)

Please report any other issue you come across.

EmilyDirsh added a commit that referenced this pull request Aug 19, 2015
Add support of push and pull over ssh
@EmilyDirsh EmilyDirsh merged commit a15647d into glittergallery:master Aug 19, 2015
@sonalkr132 sonalkr132 deleted the ssh branch November 9, 2015 18:28
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 this pull request may close these issues.

2 participants