diff --git a/Makefile b/Makefile index 3b50301..a59d8cf 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,7 @@ install-data: @$(INSTALL_DATA) etc/autodist/distdb.d/* $(DESTDIR)$(configdir)/distdb.d/ @$(INSTALL_DATA) etc/sudoers.d/autoport $(DESTDIR)$(sysconfdir)/sudoers.d/autoport @$(INSTALL_DATA) webbuild/webbuild-sudoers $(DESTDIR)$(sysconfdir)/sudoers.d/webbuild + @$(INSTALL_DATA) webbuild/webbuild-admin $(DESTDIR)$(localstatedir)/webbuild/users/admin.conf @$(INSTALL_SCRIPT) etc/sysconfig/autoport $(DESTDIR)$(sysconfdir)/sysconfig/autoport @$(INSTALL_SCRIPT) etc/cron.hourly/60-autodist-update $(DESTDIR)$(sysconfdir)/cron.hourly/ @$(INSTALL_SCRIPT) etc/cron.hourly/65-autoport-native $(DESTDIR)$(sysconfdir)/cron.hourly/ diff --git a/webbuild/html/webbuild.html b/webbuild/html/webbuild.html index 80c5042..a12afd9 100644 --- a/webbuild/html/webbuild.html +++ b/webbuild/html/webbuild.html @@ -209,7 +209,7 @@ function ajax_getvalues(request,confirm) {
-
+ diff --git a/webbuild/webbuild-admin b/webbuild/webbuild-admin new file mode 100644 index 0000000..64ed065 --- /dev/null +++ b/webbuild/webbuild-admin @@ -0,0 +1,6 @@ +USER_ENABLED=1 +USER_ADMIN=1 +USER_CANINSTALL=1 +USER_CANMAINTAIN=1 +USER_ALLENVIRONMENTS=1 +USER_ALLREPOSITORIES=1 diff --git a/webbuild/webbuild-cgi b/webbuild/webbuild-cgi index dce4bf2..412c828 100755 --- a/webbuild/webbuild-cgi +++ b/webbuild/webbuild-cgi @@ -29,6 +29,9 @@ USER_ADMIN= USER_CANMAINTAIN= USER_CANSENDMESSAGES= USER=${USER/.*\/} +if [ "$REMOTE_ADDR" = "127.0.0.1" -a "$USER" = "" ]; then + USER=admin +fi if [ "$USER" ]; then if [ -r "$WEBBUILD_STATEDIR/users/$USER.conf" ]; then . $WEBBUILD_STATEDIR/users/$USER.conf @@ -36,7 +39,7 @@ if [ "$USER" ]; then if [ "$USER_ENABLED" ]; then USER_ENABLED= if [ "$SECRET" = "$USER_SECRET" ]; then - USER_ENABLED=1 + [ "$REMOTE_ADDR" = "127.0.0.1" -o "$USER_SECRET" ] && USER_ENABLED=1 || USER_ENABLED= elif [ "$REQUEST" = "password" ]; then if [ "$USER_SECRET" ]; then /usr/libexec/webbuild-checkpassword "$PASSWORD" "$USER_SECRET" 2>/dev/null @@ -56,7 +59,10 @@ if [ "$USER" ]; then fi elif [ "$REQUEST" != "refresh" ]; then # no "$USER_SECRET" set; require password - echo -n "" + echo -n "" echo -n " " @@ -74,7 +80,10 @@ if [ "$USER" ]; then fi fi elif [ "$REQUEST" != "refresh" ]; then - echo -n "" + echo -n "" echo -n " "