Skip to content

Commit 7f41a4e

Browse files
committed
Dialog to input mysql database server address/name
1 parent 76eaf3d commit 7f41a4e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

configs/database.yml.mysql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ production:
99
pool: 5
1010
username: gitlab
1111
password: 'gitlab'
12-
# host: localhost
12+
host: localhost
1313
# socket: /tmp/mysql.sock
1414

1515
#
@@ -23,6 +23,7 @@ development:
2323
pool: 5
2424
username: gitlab
2525
password: 'gitlab'
26+
host: localhost
2627
# socket: /tmp/mysql.sock
2728

2829
# Warning: The database defined as "test" will be erased and
@@ -36,4 +37,5 @@ test: &test
3637
pool: 5
3738
username: gitlab
3839
password: 'gitlab'
40+
host: localhost
3941
# socket: /tmp/mysql.sock

configs/database.yml.postgresql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ production:
88
pool: 5
99
username: gitlab
1010
password: 'gitlab'
11-
# host: localhost
11+
host: localhost
1212
# port: 5432
1313
# socket: /tmp/postgresql.sock
1414

@@ -22,6 +22,7 @@ development:
2222
pool: 5
2323
username: gitlab
2424
password: 'gitlab'
25+
host: localhost
2526
# socket: /tmp/postgresql.sock
2627

2728
#
@@ -34,6 +35,7 @@ staging:
3435
pool: 5
3536
username: gitlab
3637
password: 'gitlab'
38+
host: localhost
3739
# socket: /tmp/postgresql.sock
3840

3941
# Warning: The database defined as "test" will be erased and
@@ -46,4 +48,5 @@ test: &test
4648
pool: 5
4749
username: gitlab
4850
password: 'gitlab'
51+
host: localhost
4952
# socket: /tmp/postgresql.sock

gitlab.postinst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ gitlab_shell_install() {
8888
#
8989
gitlab_db_initialize() {
9090
# determine needed database values
91-
DB_ADAPTER=$(dialog --radiolist "Choose Databse-Adapter for GitLab" 0 0 0 "mysql" "MySQL-Database Adapter" on "postgresql" "PostgreSQL-Database Adapter" off 3>&1 1>&2 2>&3 3>&-)
91+
DB_ADAPTER=$(dialog --radiolist "Choose Database-Adapter for GitLab" 0 0 0 "mysql" "MySQL-Database Adapter" on "postgresql" "PostgreSQL-Database Adapter" off 3>&1 1>&2 2>&3 3>&-)
92+
DB_SERVER=$(dialog --inputbox "Please enter the Database-Servername for GitLab." 0 0 "localhost" 3>&1 1>&2 2>&3 3>&-)
9293
DB_DATABASE=$(dialog --inputbox "Please enter the Database for GitLab." 0 0 "gitlab" 3>&1 1>&2 2>&3 3>&-)
9394
DB_USER=$(dialog --inputbox "Please enter the Database-User for GitLab." 0 0 "gitlab" 3>&1 1>&2 2>&3 3>&-)
9495
DB_PASS=$(dialog --inputbox "Please enter the Database-Password for GitLab." 0 0 "gitlab" 3>&1 1>&2 2>&3 3>&-)
@@ -133,6 +134,7 @@ gitlab_db_initialize() {
133134
fi
134135

135136
# place values into databse configuration
137+
sed -i "s/host: localhost/host: $DB_SERVER/g" /etc/gitlab/database.yml.$DB_ADAPTER
136138
sed -i "s/database: gitlab/database: $DB_DATABASE/g" /etc/gitlab/database.yml.$DB_ADAPTER
137139
sed -i "s/username: gitlab/username: $DB_USER/g" /etc/gitlab/database.yml.$DB_ADAPTER
138140
sed -i "s/password: 'gitlab'/password: '$DB_PASS'/g" /etc/gitlab/database.yml.$DB_ADAPTER

0 commit comments

Comments
 (0)