Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Opera DNS UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blep.cz
Docker Images
Opera DNS UI
Commits
76029b71
Commit
76029b71
authored
4 years ago
by
Mike Beattie
Browse files
Options
Downloads
Patches
Plain Diff
Add support for specifying Postgres port
Signed-off-by:
Mike Beattie
<
mike@ethernal.org
>
parent
06b728ae
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
config.ini
+1
-1
1 addition, 1 deletion
config.ini
docker-compose.yml
+1
-0
1 addition, 0 deletions
docker-compose.yml
entrypoint.sh
+3
-2
3 additions, 2 deletions
entrypoint.sh
with
6 additions
and
3 deletions
README.md
+
1
−
0
View file @
76029b71
...
...
@@ -12,6 +12,7 @@ An initial user is created during database initialisation by the application, sp
|
`ADMIN_USER`
|
`admin`
|Initial admin username for DNS UI|
|
`MAIL_SERVER`
|
`smtp`
|SMTP mail server hostname for outgoing mail|
|
`POSTGRES_HOST`
|
`postgres`
|Postgresql database host|
|
`POSTGRES_PORT`
|
`5432`
|Postgresql database port|
|
`POSTGRES_DB`
|
`dnsui`
|Database name|
|
`POSTGRES_USER`
|
`dnsui`
|Database user/role|
|
`POSTGRES_PASSWORD`
|
`dnsui`
|Database password|
...
...
This diff is collapsed.
Click to expand it.
config.ini
+
1
−
1
View file @
76029b71
...
...
@@ -28,7 +28,7 @@ report_name = "Domain administrator"
[database]
; Connection details to the Postgres database
dsn
=
"pgsql:host=__POSTGRES_HOST__;dbname=__POSTGRES_DB__"
dsn
=
"pgsql:host=__POSTGRES_HOST__;
port=__POSTGRES_PORT__;
dbname=__POSTGRES_DB__"
username
=
"__POSTGRES_USER__"
password
=
"__POSTGRES_PASSWORD__"
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
1
−
0
View file @
76029b71
...
...
@@ -9,6 +9,7 @@ services:
environment
:
-
ADMIN_USER=admin
-
POSTGRES_HOST=dnsui-db
-
POSTGRES_PORT=5432
-
POSTGRES_DB=dnsui
-
POSTGRES_USER=dnsui
-
POSTGRES_PASSWORD=dnsui
...
...
This diff is collapsed.
Click to expand it.
entrypoint.sh
+
3
−
2
View file @
76029b71
...
...
@@ -5,6 +5,7 @@ set -e
ADMIN_USER
=
${
ADMIN_USER
:-
admin
}
MAIL_SERVER
=
${
MAIL_SERVER
:-
smtp
}
POSTGRES_HOST
=
${
POSTGRES_HOST
:-
postgres
}
POSTGRES_PORT
=
${
POSTGRES_PORT
:-
5432
}
POSTGRES_DB
=
${
POSTGRES_DB
:-
pdns
}
POSTGRES_USER
=
${
POSTGRES_USER
:-
pdns
}
POSTGRES_PASSWORD
=
${
POSTGRES_PASSWORD
:-
pdns
}
...
...
@@ -24,7 +25,7 @@ ln -sf /data/config.ini /srv/dns-ui/config/
if
grep
-q
'^; AUTOCONFIG_ENABLED=yes$'
/data/config.ini
;
then
echo
"Updating configuration..."
sed
-e
"s/^
\(
dsn
\s
*=
\s
*
\"
pgsql:host=
\)
[^;]
\+\(
;dbname=
\)
[^;]
\+\"
$/
\1
${
POSTGRES_HOST
}
\2
${
POSTGRES_DB
}
\"
/"
\
sed
-e
"s/^
\(
dsn
\s
*=
\s
*
\"
pgsql:host=
\)
[^;]
\+\(
;
port=
\)
[^;]
\+\(
;
dbname=
\)
[^;]
\+\"
$/
\1
${
POSTGRES_HOST
}
\2
${
POSTGRES_
PORT
}
\3
${
POSTGRES_
DB
}
\"
/"
\
-e
"s/^
\(
username
\s
*=
\s
*
\"\)
.*
\"
$/
\1
${
POSTGRES_USER
}
\"
/"
\
-e
"s/^
\(
password
\s
*=
\s
*
\"\)
.*
\"
$/
\1
${
POSTGRES_PASSWORD
}
\"
/"
\
-e
"s/^
\(
api_url
\s
*=
\s
*
\"
http:
\/\/\)
.*
\(\/
api
\/
v1
\/
servers
\/
localhost
\"\)
$/
\1
${
PDNS_API_HOST
}
:
${
PDNS_API_PORT
}
\2
/"
\
...
...
@@ -46,7 +47,7 @@ if ! grep -q 'INSERT INTO "user"' /srv/dns-ui/migrations/002.php; then
EOF
fi
while
!
nc
-z
"
$POSTGRES_HOST
"
5432
;
do
while
!
nc
-z
"
$POSTGRES_HOST
"
"
$POSTGRES_PORT
"
;
do
echo
"Waiting for database..."
sleep
1
done
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment