Fossil Forum

Can't change skin

Can't change skin

(1) By Zakero (zakero) on 2020-08-29 04:51:56 [source]

Getting a database error when attempting to change the Skin. This is repeatable. Did the process change for selecting new Skins and I missed something or is this bug?

To reproduce the issue, build fossil from the top of trunk, currently 23f95bfc06.

./configure && make

From within that fossil checkout, start the UI using the just built binary.

./fossil ui

Next go to the "Admin" menu and select "Skins". Scroll to the bottom of the page and click on the "Skin Admin" link.

I installed "Enhanced Original" but installing any skin seems to cause the issue. After clicking on the "Install" button, a very long database error will appear:

Database error: not authorized: {REPLACE INTO config(name,value,mtime) VALUES('css','/* General settings for the entire page */ body { margin: 0ex 1ex; padding: 0px; background-color: white; font-family: sans-serif; -moz-text-size-adjust: none; -webkit-text-size-adjust: none; -mx-text-size-adjust: none; } /* The project logo in the upper left-hand corner of each page */ div.logo { display: table-cell; text-align: center; vertical-align: bottom; font-weight: bold; color: #558195; min-width: 200px; white-space: nowrap; } /* The page title centered at the top of each page */ div.title { display: table-cell; font-size: 2em; font-weight: bold; text-align: center; padding: 0 0 0 1em; color: #558195; vertical-align: bottom; width: 100%; } /* The login status message in the top right-hand corner */ div.status { display: table-cell; text-align: right; vertical-align: bottom; color: #558195; font-size: 0.8em; font-weight: bold; min-width: 200px; white-space: nowrap; } /* The header across the top of the page */ div.header { display: table; width: 100%; } /* The main menu bar that appears at the top of the page beneath ** the header */ div.mainmenu { padding: 5px 10px 5px 10px; font-size: 0.9em; font-weight: bold; text-align: center; letter-spacing: 1px; background-color: #558195; border-top-left-radius: 8px; border-top-right-radius: 8px; color: white; } /* The submenu bar that *sometimes* appears below the main menu */ div.submenu, div.sectionmenu { padding: 3px 10px 3px 0px; font-size: 0.9em; text-align: center; background-color: #456878; color: white; } div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, div.submenu label { padding: 3px 10px 3px 10px; color: white; text-decoration: none; } div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover { color: #558195; background-color: white; } /* All page content from the bottom of the menu or submenu down to ** the footer */ div.content { padding: 0ex 1ex 1ex 1ex; border: solid #aaa; border-width: 1px; } /* Some pages have section dividers */ div.section { margin-bottom: 0px; margin-top: 1em; padding: 1px 1px 1px 1px; font-size: 1.2em; font-weight: bold; background-color: #558195; color: white; white-space: nowrap; } /* The "Date" that occurs on the left hand side of timelines */ div.divider { background: #a1c4d4; border: 2px #558195 solid; font-size: 1em; font-weight: normal; padding: .25em; margin: .2em 0 .2em 0; float: left; clear: left; white-space: nowrap; } /* The footer at the very bottom of the page */ div.footer { clear: both; font-size: 0.8em; padding: 5px 10px 5px 10px; text-align: right; background-color: #558195; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; color: white; } /* Hyperlink colors in the footer */ div.footer a { color: white; } div.footer a:link { color: white; } div.footer a:visited { color: white; } div.footer a:hover { background-color: white; color: #558195; } /* verbatim blocks */ pre.verbatim { background-color: #f5f5f5; padding: 0.5em; white-space: pre-wrap; } /* The label/value pairs on (for example) the ci page */ table.label-value th { vertical-align: top; text-align: right; padding: 0.2ex 2ex; } ',now()); REPLACE INTO config(name,value,mtime) VALUES('header','<div class="header"> <div class="logo"> <th1> ## ## NOTE: The purpose of this procedure is to take the base URL of the ## Fossil project and return the root of the entire web site using ## the same URI scheme as the base URL (e.g. http or https). ## proc getLogoUrl { baseurl } { set idx(first) [string first // $baseurl] if {$idx(first) != -1} { ## ## NOTE: Skip second slash. ## set idx(first+1) [expr {$idx(first) + 2}] ## ## NOTE: (part 1) The [string first] command does NOT actually ## support the optional startIndex argument as specified ## in the TH1 support manual; therefore, we fake it by ## using the [string range] command and then adding the ## necessary offset to the resulting index manually ## (below). In Tcl, we could use the following instead: ## ## set idx(next) [string first / $baseurl $idx(first+1)] ## set idx(nextRange) [string range $baseurl $idx(first+1) end] set idx(next) [string first / $idx(nextRange)] if {$idx(next) != -1} { ## ## NOTE: (part 2) Add the necessary offset to the result of ## the search for the next slash (i.e. the one after ## the initial search for the two slashes). ## set idx(next) [expr {$idx(next) + $idx(first+1)}] ## ## NOTE: Back up one character from the next slash. ## set idx(next-1) [expr {$idx(next) - 1}] ## ## NOTE: Extract the URI scheme and host from the base URL. ## set scheme [string range $baseurl 0 $idx(first)] set host [string range $baseurl $idx(first+1) $idx(next-1)] ## ## NOTE: Try to stay in SSL mode if we are there now. ## if {[string compare $scheme http:/] == 0} { set scheme http:// } else { set scheme https:// } set logourl $scheme$host/ } else { set logourl $baseurl } } else { set logourl $baseurl } return $logourl } set logourl [getLogoUrl $baseurl] </th1> <a href="$logourl"> <img src="$logo_image_url" border="0" alt="$project_name"> </a> </div> <div class="title">$<title></div> <div class="status"><nobr><th1> if {[info exists login]} { puts "Logged in as $login" } else { puts "Not logged in" } </th1></nobr><small><div id="clock"></div></small></div> </div> <th1>html "<script nonce=''$nonce''>"</th1> function updateClock(){ var e = document.getElementById("clock"); if(e){ var d = new Date(); function f(n) { return n < 10 ? ''0'' + n : n; } e.innerHTML = d.getUTCFullYear()+ ''-'' + f(d.getUTCMonth() + 1) + ''-'' + f(d.getUTCDate()) + '' '' + f(d.getUTCHours()) + '':'' + f(d.getUTCMinutes()); setTimeout(updateClock,(60-d.getUTCSeconds())*1000); } } updateClock(); </script> <div class="mainmenu"> <th1> proc menulink {url name} { upvar home home html "<a href=''$home$url''>$name</a>\n" } menulink $index_page Home menulink /help Help if {[anycap jor]} { menulink /timeline Timeline } if {[anoncap oh]} { menulink /dir?ci=tip Files } if {[anoncap o]} { menulink /brlist Branches menulink /taglist Tags } if {[anycap 23456] || [anoncap 2] || [anoncap 3]} { menulink /forum Forum } if {[anoncap r]} { menulink /ticket Tickets } if {[anoncap j]} { menulink /wiki Wiki } if {[hascap s]} { menulink /setup Admin } elseif {[hascap a]} { menulink /setup_ulist Users } if {[info exists login]} { menulink /login Logout } else { menulink /login Login } </th1></div> ',now()); REPLACE INTO config(name,value,mtime) VALUES('footer','<div class="footer"> <th1> proc getTclVersion {} { if {[catch {tclEval info patchlevel} tclVersion] == 0} { return "<a href=\"\">Tcl</a> version $tclVersion" } return "" } proc getVersion { version } { set length [string length $version] return [string range $version 1 [expr {$length - 2}]] } set version [getVersion $manifest_version] set tclVersion [getTclVersion] set fossilUrl set fossilDate [string range $manifest_date 0 9]T[string range $manifest_date 11 end] </th1> This page was generated in about <th1>puts [expr {([utime]+[stime]+1000)/1000*0.001}]</th1>s by <a href="$fossilUrl/">Fossil</a> version $release_version $tclVersion <a href="$fossilUrl/index.html/info/$version">$manifest_version</a> <a href="$fossilUrl/index.html/timeline?c=$fossilDate&amp;y=ci">$manifest_date</a> </div> ',now()); REPLACE INTO config(name,value,mtime) VALUES('details','timeline-arrowheads: 1 timeline-circle-nodes: 0 timeline-color-graph-lines: 0 white-foreground: 0 ',now()); REPLACE INTO config(name,value,mtime) VALUES('js',NULL,now()); }

Using Linux (openSuSE Tumbleweed) with Google Chrome.

(2) By Stephan Beal (stephan) on 2020-08-29 05:04:31 in reply to 1 [link] [source]

Did the process change for selecting new Skins and I missed something or is this bug?

The process hasn't changed - this is a side effect of new measures being put into place to keep "rogue writes" from introducing security holes (part of the fixes related to the recent security-relevant releases).

Currently Richard is the only one who knows his way around that new API, so we'll need to wait for his timezone to wake up, but i'm sure he knows exactly which two lines need to be patched.

(3) By Stephan Beal (stephan) on 2020-08-30 06:05:57 in reply to 1 [link] [source]

Getting a database error when attempting to change the Skin.

This is now fixed in the trunk. Thank you for the report.

(4) By Zakero (zakero) on 2020-08-30 20:26:54 in reply to 3 [link] [source]

Thank you Stephan, I can confirm that changing/editing the skin from /setup_skin does work.

However, changing the skin from the /setup_skin_admin URI still results with the following error: Database error: not authorized

(5) By Stephan Beal (stephan) on 2020-08-30 20:34:56 in reply to 4 [link] [source]

However, changing the skin from the /setup_skin_admin URI still results with the following error: Database error: not authorized

i can't reproduce that with:

But it looks like Richard just checked in a change which might improve the situation for you:

(6) By Zakero (zakero) on 2020-08-30 21:08:54 in reply to 5 [link] [source]

b9fa7e28712c5981 was the fix I needed!

Thank you Richard and Stephan.