Skip to content

Commit 41a9064

Browse files
committed
- [nginx](src/gitweb/envsubst/nginx.conf.envsubst) Now let envvar SERVER_NAME control the nginx server_name which is visible in the browser tab.
1 parent 55980dd commit 41a9064

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.7
2+
3+
- [nginx](src/gitweb/envsubst/nginx.conf.envsubst) Now let envvar `SERVER_NAME` control the nginx server_name which is visible in the browser tab.
4+
15
# 1.0.6
26

37
- [demo](demo/Makefile) Remove obsolete element version in docker-compose.yml.

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ ENV DOCKER_ENTRY_DIR=/etc/docker/entry.d \
1919
DOCKER_ENVSUBST_DIR=usr/share/misc \
2020
DOCKER_HIGHLIGHT_CMT='#' \
2121
PROJECTROOT=/var/lib/git/repositories \
22-
PROJECTS_LIST=/var/lib/git/projects.list
22+
PROJECTS_LIST=/var/lib/git/projects.list \
23+
SERVER_NAME=localhost
2324

2425
#
2526
# Copy config files to image
2627
#
2728

2829
COPY src/*/bin $DOCKER_BIN_DIR/
2930
COPY src/*/entry.d $DOCKER_ENTRY_DIR/
30-
COPY src/*/config $DOCKER_CONF_DIR/
3131
COPY src/*/envsubst $DOCKER_ENVSUBST_DIR/
3232

3333
#

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ Default: `PROJECTROOT=/var/lib/git/repositories`
108108
Define which file Gitweb reads to learn the git projects. If set to empty string; Gitweb simply scan the `PROJECTROOT` directory.
109109
Default: `PROJECTS_LIST=/var/lib/git/projects.list`
110110

111+
#### `SERVER_NAME`
112+
113+
The nginx [server_name](https://nginx.org/en/docs/http/server_names.html) directive and determine which server block is used for a given request. Since there only one block in this application the server_name is not important and can be anyting but empty.
114+
115+
With gitweb the Nginx server_name is displayed in the browser tab. And since it can be chosen freely, it can be seen to have a decorative function.
116+
111117
## Gitolite
112118

113119
If you have [Gitolie](https://gitolite.com/gitolite/) and Gitweb running on the same machine, you will be able to browse the Gitolite repositories simply by having the services sharing file systems. The [docker compose example](#docker-compose-example) above is doing exactly that.
@@ -137,6 +143,5 @@ The entry scripts, discussed above, as well as other utility scrips are copied t
137143
```dockerfile
138144
COPY src/*/bin $DOCKER_BIN_DIR/
139145
COPY src/*/entry.d $DOCKER_ENTRY_DIR/
140-
COPY src/*/config $DOCKER_CONF_DIR/
141146
COPY src/*/envsubst $DOCKER_ENVSUBST_DIR/
142147
```

demo/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
- "${CNT_BIND-127.0.0.1:8080}:80" # HTTP port
88
environment:
99
- PROJECTS_LIST= # Scan repos when list is empty
10+
- SERVER_NAME=demo # Nginx server_name visible in the browser tab
1011
cap_add:
1112
- sys_ptrace # Only here to help testing
1213
volumes:

src/gitweb/entry.d/50-gitweb-generate-conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
#
77
envsubst '$PROJECTROOT$PROJECTS_LIST$DOCKER_HIGHLIGHT_CMT' < \
88
$DOCKER_ENVSUBST_DIR/gitweb.conf.envsubst > /etc/gitweb.conf
9+
envsubst '$SERVER_NAME' < \
10+
$DOCKER_ENVSUBST_DIR/nginx.conf.envsubst > $DOCKER_CONF_DIR/nginx.conf

src/gitweb/config/gitweb.conf renamed to src/gitweb/envsubst/nginx.conf.envsubst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
server {
22
listen *:80;
3-
server_name localhost;
3+
server_name ${SERVER_NAME};
44
access_log off;
55

66
location /gitweb.cgi {

0 commit comments

Comments
 (0)