commit d793691c4f2274d639e3cce0dc254f352a0777942a4c8bb8015abc04e83ac0fc from: Stefan Sperling date: Sat Jan 31 10:39:29 2026 UTC add show_repo_age option to gotsysd.conf web server config We now disable the repository age column only for our tests via the configuration file and leave it enabled in all other cases. commit - 50f79295d8fcb016595bfc3bd40f4e10bc0a61f2da790486835ef8ca64ace2ee commit + d793691c4f2274d639e3cce0dc254f352a0777942a4c8bb8015abc04e83ac0fc blob - c57738289a4c439e13e7e3220b194f87fa65deb37a041718113468d5c1adf0c3 blob + 3cc5356bb1bc38e0e7c2cdaf4d5bb803a491c4d9be5b60b4e24a8c602e443189 --- gotsysd/gotsysd.conf.5 +++ gotsysd/gotsysd.conf.5 @@ -507,6 +507,9 @@ However, deliberately lacks the .Ic insecure keyword. +.It Ic show_repo_age Ar on | off +Toggle display of last repository modification date. +Enabled by default. .El .Pp Additional parameters for web servers can be set in blob - a8c9701b6544c78acfd9d7d564ca108ca3b8ecaccc6b9546738a962e521195dd blob + 63765fdf80169fd36e5e5f8bddcb9d6ce50c40bdba8db1d4403a54276dbd482e --- gotsysd/gotsysd.h +++ gotsysd/gotsysd.h @@ -151,6 +151,7 @@ struct gotsysd_web_server { enum gotsysd_web_auth_config auth_config; int hide_repositories; + int show_repo_age; }; STAILQ_HEAD(gotsysd_web_serverlist, gotsysd_web_server); blob - 65b850289a84e3b641977ce12f155951e8312fce71bf53e047fd79b74c6f32fc blob + 9171a9ae307f324ed57415a349f60aa7870b05f23d276988ba0a96d083fea977 --- gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c +++ gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c @@ -1396,18 +1396,18 @@ write_gotwebd_conf(void) } } - /* - * Repository age and owner currently need to be off - * to keep our regression tests passing: And these - * options cannot be controlled via gotsys.conf yet. - */ - ret = dprintf(fd, "\tshow_repo_age off\n"); - if (ret == -1) - return got_error_from_errno2("dprintf", path); - if (ret != 18 + 1) { - return got_error_fmt(GOT_ERR_IO, - "short write to %s", path); + if (!srv_cfg->show_repo_age) { + ret = dprintf(fd, "\tshow_repo_age off\n"); + if (ret == -1) { + return got_error_from_errno2("dprintf", + path); + } + if (ret != 18 + 1) { + return got_error_fmt(GOT_ERR_IO, + "short write to %s", path); + } } + ret = dprintf(fd, "\tshow_repo_owner off\n"); if (ret == -1) return got_error_from_errno2("dprintf", path); blob - 7da236c2ce23f75f73a8b176d1e4335cfe4d206a22b39626f30b02138952aa84 blob + 1840729815167cee388cf8d878cfca9e88ae239209c607eb8b5bed469a5e0889 --- gotsysd/parse.y +++ gotsysd/parse.y @@ -116,7 +116,7 @@ typedef struct { %} %token AUTHENTICATION CHROOT GOTSYSD_CONTROL GOTWEB_URL_ROOT GOTWEB -%token HTDOCS INSECURE PORT PREFORK SERVER NAME SOCKET WWW HINT +%token HTDOCS INSECURE PORT PREFORK SERVER NAME SOCKET WWW HINT SHOW_REPO_AGE %token ERROR LISTEN ON USER GOTD DIRECTORY REPOSITORY UID RANGE PERMIT %token DENY RO RW WEB GOTSYSD_LOGIN ENABLE DISABLE HIDE REPOSITORIES @@ -710,6 +710,13 @@ webserveropts1 : GOTWEB_URL_ROOT STRING { srv->hide_repositories = $3; } + | SHOW_REPO_AGE boolean { + struct gotsysd_web_server *srv; + + srv = STAILQ_LAST(&gotsysd->web.servers, + gotsysd_web_server, entry); + srv->show_repo_age = $2; + } ; webserveropts2 : webserveropts2 webserveropts1 nl @@ -783,6 +790,7 @@ lookup(char *s) { "ro", RO }, { "rw", RW }, { "server", SERVER }, + { "show_repo_age", SHOW_REPO_AGE }, { "socket", SOCKET }, { "uid", UID }, { "user", USER }, @@ -1327,6 +1335,7 @@ conf_new_web_server(const char *name) } srv->hide_repositories = -1; + srv->show_repo_age = 1; STAILQ_INSERT_TAIL(&gotsysd->web.servers, srv, entry); return NULL; } blob - de29d8a852876e6cd93b9148b83d5401d43e5db70d7a09c1c481a1a4ae671aad blob + 6fd1cbe4540d20332ee16bcae92b69ee52ff0526e8214571736d227180c6e88e --- regress/gotsysd/Makefile +++ regress/gotsysd/Makefile @@ -206,7 +206,9 @@ ${GOTSYSD_CONF}: @${UNPRIV} "printf '\tlisten on 127.0.0.1 port 9000\n' >> $@" @${UNPRIV} "printf '\tlisten on ::1 port 9000\n' >> $@" @${UNPRIV} "echo '}' >> $@" - @${UNPRIV} "echo 'web server \"VMIP\"' >> $@" + @${UNPRIV} "echo 'web server \"VMIP\" {' >> $@" + @${UNPRIV} "printf '\tshow_repo_age off\n' >> $@" + @${UNPRIV} "echo '}' >> $@" ${GOTSYS_CONF}: ${GOTSYSD_SSH_PUBKEY} @${UNPRIV} "echo user ${GOTSYSD_TEST_USER} { >> $@"