[squeak-dev] How to change the update URL for Trunk HTTPS?

Levente Uzonyi leves at caesar.elte.hu
Wed Sep 9 08:57:08 UTC 2020


Hi Christoph,

On Tue, 8 Sep 2020, Thiede, Christoph wrote:

> 
> Hi Marcel, hi all,
> 
> 
> phew, this turned out to be a bit more complicated than I had assumed.
> 
> 
> The attached script should patch every in the image required to upgrade the update URLs to HTTPS. Eventually, I would like to ship it via a postscript in a regular trunk version.

I just checked your script. It's behavior seems to match what I wrote a 
while ago. My variant changes all source.squeak.org urls to https:

MCMcmUpdater allInstances
 	select: [ :each | each repository beginsWith: 'http://source.squeak.org' ]
 	thenDo: [ :httpUpdater |
 		| httpsUrl newUpdater |
 		httpsUrl := 'https', (httpUpdater repository allButFirst: 4).
 		newUpdater := MCMcmUpdater
 			repository: httpsUrl
 			updateMap: httpUpdater updateMapName
 			lastUpdateMap: (Dictionary new
 				at: httpsUrl
 					put: (httpUpdater lastUpdateMap at: httpUpdater repository);
 				yourself).
 		newUpdater register.
 		httpUpdater unregister ].
MCRepositoryGroup default repositories
 	select: [ :each |
 		(each isKindOf: MCHttpRepository)
 			and: [ each description beginsWith: 'http://source.squeak.org' ]]
 	thenDo: [ :repository |
 		repository location: 'https', (repository description allButFirst: 4) ].
MCMcmUpdater defaultUpdateURL in: [ :updateUrl |
 	(updateUrl beginsWith: 'http://source.squeak.org') ifTrue: [
 		MCMcmUpdater defaultUpdateURL: 'https', (updateUrl allButFirst: 4) ] ]


However, such scripts on their own are not enough. Besides the update 
maps, the image has several references to the http urls. Most of those 
need to be updated as well.


Levente

> 
> Still, the server code must be updated, because unfortunately, it returns URLs with hard-coded HTTP, even if the request is made via HTTPS:
> 
>
>       (
> name 'update-eem.477'
> repository ('http://source.squeak.org/trunk')
> dependency ('Squeak-Version' 'Squeak-Version-mt.5252' 'b9a3cd5b-b708-8646-a99f-5f3ae294ceb1')
> ...
> 
> 
> I don't have access to the server code, but apparently the protocol should be checked there. And isn't it a general convention to favor relative over absolute URLs? Why doesn't the server simply return '/trunk' here?
> 
> Best,
> Christoph
> 
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
> Gesendet: Freitag, 12. Juni 2020 16:17 Uhr
> An: squeak-dev
> Betreff: Re: [squeak-dev] How to change the update URL for Trunk HTTPS?  
> I suppose it is because the update map has "http" in it for each package version. And maybe also because your repositories in Monticello are configured as "http". So, the mechanism does not find any previous versions?
> Seems like bug to me.
> 
> Best,
> Marcel
>
>       Am 12.06.2020 15:51:51 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
>
>       Hi all,
> 
>
>       I spent a number of attempts during the latest months on changing my image's update URL to use HTTPS, but unfortunately, it gets reset each time.
> 
>
>       Shouldn't I be able to simply change the update URL in the preferences by adding a small "s" behind the "http"? But if I do so, when I press the update button the next time, Squeak starts loading all packages from
>       their initial version (Tools-xyz.1, Morphic-xyz.1, ...). Is there a way to easily change the URL?
> 
>
>       Best,
>
>       Christoph
> 
> 
>


More information about the Squeak-dev mailing list