-
Notifications
You must be signed in to change notification settings - Fork 1
HART Setup
Richly edited this page May 21, 2019
·
14 revisions
This page will try to give you a complete overview on how to setup HART. This setup is written for UNIXoid systems, Windows is currently not supported.
- Clone the HART repository
git clone https://github.com/hpi-swt2/vm-portal.git
By default, every user that logs in the first time, its role will be User
. But for changing other users roles, we need to have an admin. Therefore, we need to create the first Admin
.
- Open the rails console in the production environment
rails console -e production
- Get the user you want to appoint as an admin by typing
user = User.find_by_email("<E-mail address>")
- Make him an admin
user.role="admin"
- And save it by typing
user.save!
(this might take some time)- If you have not yet set up Git, a few errors regarding git will be printed when you execute this command. Don't worry, your command will still execute and set the admin role correctly.
- Now exit the console via
exit
and you have your first admin.
In order to have HART working with Git (let it store its Puppet files in the Git), follow these steps
- Create a GitHub user you want to use to perform the pushes.
- For this user create a repository on GitHub you want to use to store your Puppet files in.
- Add a SSH-Key following this example. The E-Mail has to be the one of the GitHub user, which will perform the pushes to the repository in the end.
Save the key in~/.ssh/id_rsa_<GitHub username>
and make sure not to enter a passphrase. - Add the key to the key agent and your GitHub account following these instructions
- Edit or create a ssh config file at
~/.ssh/config
containing the following:
Host github.com-<GitHub username>
HostName github.com
User git
ServerAliveInterval 30
ServerAliveCountMax 120
IdentityFile ~/.ssh/id_rsa_<GitHub username>
-
git clone [email protected]<GitHub username>:<Repository owner>/<Repository name>.git
once to make sure it works, and to add it to your trusted ssh hosts. You can remove the cloned folder afterward. - Open up HART and enter the Git settings which can be found here:
/app_settings/1/edit
(Admins only, therefore create the first admin first). They have to look as following:
- Repository URL:
[email protected]<GitHub username>:<Repository owner>/<Repository name>.git
- Repository Name:
<Repository name>
- Git Branch: should be
master
, but you can also define another one - Github Username:
<GitHub username>
- Github User E-Mail:
<Github user e-mail>
To enable the user authentification via HPI OpenID Connect, the following steps are necessary. The configuration of the Devise gem for the communication with the OpenID service is done in config/initializers/devise.rb.
- Register a new client on
https://oidc.hpi.de
. The redirect uri must have the following schema:<url>/users/auth/hpi/callback
- Execute
EDITOR=vim rails credentials:edit
in the root folder of the application to edit the encrypted credentials - Add the following information:
hpi_openid:
client_id: <client_id>
client_secret: <secret>
redirect_uri: <base_url>/users/auth/hpi/callback