Skip to main content

Install, config GitLab on Ubuntu 16.04

http://blog.cloud66.com/installing-gitlab-ubuntu/
https://stackoverflow.com/questions/31762841/how-to-serve-other-vhosts-next-to-gitlab-omnibus-server-full-step-by-step-solu

GitLab like Redmine use ruby source code. So to run with nginx we need phusion passenger.

Run gitlab alongside with many another web (PHP, NodeJS).

We need install git, ruby, recompile nginx with phusion passenger. Nginx do not load runtime lib like .so or binary. Install nodejs.

Access database (PostgreSQL)sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql/ gitlabhq_production
Here about 100 tables for gitlab. So long from the last time I use postgres :(.

gitlabhq_production=# \dt
                         List of relations
 Schema |                   Name                   | Type  | Owner  
--------+------------------------------------------+-------+--------
 public | abuse_reports                            | table | gitlab
 public | appearances                              | table | gitlab
 public | application_settings                     | table | gitlab
 public | audit_events                             | table | gitlab
 public | award_emoji                              | table | gitlab
 public | boards                                   | table | gitlab
 public | broadcast_messages                       | table | gitlab
 public | chat_names                               | table | gitlab
 public | chat_teams                               | table | gitlab
 public | ci_builds                                | table | gitlab
 public | ci_group_variables                       | table | gitlab
 public | ci_pipeline_schedule_variables           | table | gitlab
 public | ci_pipeline_schedules                    | table | gitlab
 public | ci_pipeline_variables                    | table | gitlab
 public | ci_pipelines                             | table | gitlab
 public | ci_runner_projects                       | table | gitlab
 public | ci_runners                               | table | gitlab
 public | ci_stages                                | table | gitlab
 public | ci_trigger_requests                      | table | gitlab
 public | ci_triggers                              | table | gitlab
 public | ci_variables                             | table | gitlab
 public | container_repositories                   | table | gitlab
 public | conversational_development_index_metrics | table | gitlab
 public | deploy_keys_projects                     | table | gitlab
 public | deployments                              | table | gitlab
 public | emails                                   | table | gitlab
 public | environments                             | table | gitlab
 public | events                                   | table | gitlab
 public | feature_gates                            | table | gitlab
 public | features                                 | table | gitlab
 public | forked_project_links                     | table | gitlab
 public | gpg_keys                                 | table | gitlab
 public | gpg_signatures                           | table | gitlab
 public | identities                               | table | gitlab
 public | issue_assignees                          | table | gitlab
 public | issue_metrics                            | table | gitlab
 public | issues                                   | table | gitlab
 public | keys                                     | table | gitlab
 public | label_links                              | table | gitlab
 public | label_priorities                         | table | gitlab
 public | labels                                   | table | gitlab
 public | lfs_objects                              | table | gitlab
 public | lfs_objects_projects                     | table | gitlab
 public | lists                                    | table | gitlab
 public | members                                  | table | gitlab
 public | merge_request_diff_commits               | table | gitlab
 public | merge_request_diff_files                 | table | gitlab
 public | merge_request_diffs                      | table | gitlab
 public | merge_request_metrics                    | table | gitlab
 public | merge_requests                           | table | gitlab
 public | merge_requests_closing_issues            | table | gitlab
 public | milestones                               | table | gitlab
 public | namespaces                               | table | gitlab
 public | notes                                    | table | gitlab
 public | notification_settings                    | table | gitlab
 public | oauth_access_grants                      | table | gitlab
 public | oauth_access_tokens                      | table | gitlab
 public | oauth_applications                       | table | gitlab
 public | oauth_openid_requests                    | table | gitlab
 public | pages_domains                            | table | gitlab
 public | personal_access_tokens                   | table | gitlab
 public | project_authorizations                   | table | gitlab
 public | project_auto_devops                      | table | gitlab
 public | project_features                         | table | gitlab
 public | project_group_links                      | table | gitlab
 public | project_import_data                      | table | gitlab
 public | project_statistics                       | table | gitlab
 public | projects                                 | table | gitlab
 public | protected_branch_merge_access_levels     | table | gitlab
 public | protected_branch_push_access_levels      | table | gitlab
 public | protected_branches                       | table | gitlab
 public | protected_tag_create_access_levels       | table | gitlab
 public | protected_tags                           | table | gitlab
 public | push_event_payloads                      | table | gitlab
 public | redirect_routes                          | table | gitlab
 public | releases                                 | table | gitlab
 public | routes                                   | table | gitlab
 public | schema_migrations                        | table | gitlab
 public | sent_notifications                       | table | gitlab
 public | services                                 | table | gitlab
 public | snippets                                 | table | gitlab
 public | spam_logs                                | table | gitlab
 public | subscriptions                            | table | gitlab
 public | system_note_metadata                     | table | gitlab
 public | taggings                                 | table | gitlab
 public | tags                                     | table | gitlab
 public | timelogs                                 | table | gitlab
 public | todos                                    | table | gitlab
 public | trending_projects                        | table | gitlab
 public | u2f_registrations                        | table | gitlab
 public | uploads                                  | table | gitlab
 public | user_agent_details                       | table | gitlab
 public | user_synced_attributes_metadata          | table | gitlab
 public | users                                    | table | gitlab
 public | users_star_projects                      | table | gitlab
 public | web_hook_logs                            | table | gitlab
 public | web_hooks                                | table | gitlab
(97 rows)

https://docs.gitlab.com/ce/administration/reply_by_email_postfix_setup.html
http://cybart.com/how-to-install-and-configure-postfix-on-amazon-ec2/

https://about.gitlab.com/2016/02/25/making-gitlab-faster/

https://www.bonusbits.com/wiki/HowTo:Setup_HTTPS_for_Gitlab=


                    Column                    |            Type             |
----------------------------------------------+-----------------------------+
 id                                           | integer                     |
 email                                        | character varying           |
 encrypted_password                           | character varying           |
 reset_password_token                         | character varying           |
 reset_password_sent_at                       | timestamp without time zone |
 remember_created_at                          | timestamp without time zone |
 sign_in_count                                | integer                     |
 current_sign_in_at                           | timestamp without time zone |
 last_sign_in_at                              | timestamp without time zone |
 current_sign_in_ip                           | character varying           |
 last_sign_in_ip                              | character varying           |
 created_at                                   | timestamp without time zone |
 updated_at                                   | timestamp without time zone |
 name                                         | character varying           |
 admin                                        | boolean                     |
 projects_limit                               | integer                     |
 skype                                        | character varying           |
 linkedin                                     | character varying           |
 twitter                                      | character varying           |
 authentication_token                         | character varying           |
 bio                                          | character varying           |
 failed_attempts                              | integer                     |
 locked_at                                    | timestamp without time zone |
 username                                     | character varying           |
 can_create_group                             | boolean                     |
 can_create_team                              | boolean                     |
 state                                        | character varying           |
 color_scheme_id                              | integer                     |
 password_expires_at                          | timestamp without time zone |
 created_by_id                                | integer                     |
 last_credential_check_at                     | timestamp without time zone |
 avatar                                       | character varying           |
 confirmation_token                           | character varying           |
 confirmed_at                                 | timestamp without time zone |
 confirmation_sent_at                         | timestamp without time zone |
 unconfirmed_email                            | character varying           |
 hide_no_ssh_key                              | boolean                     |
 website_url                                  | character varying           |
 notification_email                           | character varying           |
 hide_no_password                             | boolean                     |
 password_automatically_set                   | boolean                     |
 location                                     | character varying           |
 encrypted_otp_secret                         | character varying           |
 encrypted_otp_secret_iv                      | character varying           |
 encrypted_otp_secret_salt                    | character varying           |
 otp_required_for_login                       | boolean                     |
 otp_backup_codes                             | text                        |
 public_email                                 | character varying           |
 dashboard                                    | integer                     |
 project_view                                 | integer                     |
 consumed_timestep                            | integer                     |
 layout                                       | integer                     |
 hide_project_limit                           | boolean                     |
 unlock_token                                 | character varying           |
 otp_grace_period_started_at                  | timestamp without time zone |
 external                                     | boolean                     |
 incoming_email_token                         | character varying           |
 organization                                 | character varying           |
 require_two_factor_authentication_from_group | boolean                     |
 two_factor_grace_period                      | integer                     |
 ghost                                        | boolean                     |
 last_activity_on                             | date                        |
 notified_of_own_activity                     | boolean                     |
 preferred_language                           | character varying           |
 rss_token                                    | character varying           |
 theme_id                                     | smallint                    |

Indexes:
    "users_pkey" PRIMARY KEY, btree (id)
    "index_users_on_authentication_token" UNIQUE, btree (authentication_token)
    "index_users_on_confirmation_token" UNIQUE, btree (confirmation_token)
    "index_users_on_email" UNIQUE, btree (email)
    "index_users_on_reset_password_token" UNIQUE, btree (reset_password_token)
    "index_users_on_admin" btree (admin)
    "index_users_on_created_at" btree (created_at)
    "index_users_on_email_trigram" gin (email gin_trgm_ops)
    "index_users_on_ghost" btree (ghost)
    "index_users_on_incoming_email_token" btree (incoming_email_token)
    "index_users_on_name" btree (name)
    "index_users_on_name_trigram" gin (name gin_trgm_ops)
    "index_users_on_rss_token" btree (rss_token)
    "index_users_on_state" btree (state)
    "index_users_on_username" btree (username)
    "index_users_on_username_trigram" gin (username gin_trgm_ops)
Referenced by:
    TABLE "issues" CONSTRAINT "fk_05f1e72feb" FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL
    TABLE "issue_assignees" CONSTRAINT "fk_5e0c8d9154" FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
    TABLE "ci_pipeline_schedules" CONSTRAINT "fk_9ea99f58d2" FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE SET NULL
    TABLE "ci_triggers" CONSTRAINT "fk_e8e10d1964" FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE
    TABLE "events" CONSTRAINT "fk_edfd187b6f" FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE
    TABLE "personal_access_tokens" CONSTRAINT "fk_rails_08903b8f38" FOREIGN KEY (user_id) REFERENCES users(id)
    TABLE "user_synced_attributes_metadata" CONSTRAINT "fk_rails_0f4aa0981f" FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
    TABLE "project_authorizations" CONSTRAINT "fk_rails_11e7aa3ed9" FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
    TABLE "protected_tag_create_access_levels" CONSTRAINT "fk_rails_2349b78b91" FOREIGN KEY (user_id) REFERENCES users(id)
    TABLE "gpg_keys" CONSTRAINT "fk_rails_9d1f5d8719" FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE

    TABLE "u2f_registrations" CONSTRAINT "fk_rails_bfe6a84544" FOREIGN KEY (user_id) REFERENCES users(id)


sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql/ gitlabhq_production

\dt
\d+ users

Comments

Popular posts from this blog

Rand mm 10

https://stackoverflow.com/questions/2447791/define-vs-const Oh const vs define, many time I got unexpected interview question. As this one, I do not know much or try to study this. My work flow, and I believe of many programmer is that search topic only when we have task or job to tackle. We ignore many 'basic', 'fundamental' documents, RTFM is boring. So I think it is a trade off between the two way of study language. And I think there are a bridge or balanced way to extract both advantage of two method. There are some huge issue with programmer like me that prevent we master some technique that take only little time if doing properly. For example, some Red Hat certificate program, lesson, course that I have learned during Collage gave our exceptional useful when it cover almost all topic while working with Linux. I remember it called something like RHEL (RedHat Enterprise Linux) Certificate... I think there are many tons of documents, guide n books about Linux bu

Martin Fowler - Software Architecture - Making Architecture matter

  https://martinfowler.com/architecture/ One can appreciate the point of this presentation when one's sense of code smell is trained, functional and utilized. Those controlling the budget as well as developer leads should understand the design stamina hypothesis, so that the appropriate focus and priority is given to internal quality - otherwise pay a high price soon. Andrew Farrell 8 months ago I love that he was able to give an important lesson on the “How?” of software architecture at the very end: delegate decisions to those with the time to focus on them. Very nice and straight-forward talk about the value of software architecture For me, architecture is the distribution of complexity in a system. And also, how subsystems communicate with each other. A battle between craftmanship and the economics and economics always win... https://hackernoon.com/applying-clean-architecture-on-web-application-with-modular-pattern-7b11f1b89011 1. Independent of Frameworks 2. Testable 3. Indepe