Advertisement:

Author Topic: Question on using HEAD and some observations  (Read 966 times)

Offline BigMoneyJim

  • Semi-Newbie
  • *
  • Posts: 19
  • Just some guy who wandered in off the Internet.
Question on using HEAD and some observations
« on: January 08, 2018, 03:17:36 PM »
Is there a reason not to git clone the release-2.1 branch instead of using beta 3? I cloned out of habit, and i only now figured out why my test site doesn't say "beta 3".

Some observations (not criticisms or pleas for help):

The writable file/directory detection seems a bit wonky. I had php running in a container as root, so it should have had write access to everything, but the upgrade and install scripts wanted to change permissions before proceeding. I then assigned everything to root group with group write, but the upgrade and install scripts didn't like that, either. So I just slapped a+w on the specified files and directories and completed the install/upgrade. (I'll change permissions the way I want after the upgrade script, and I'll also change the container to run php as a user.)

I'm using a front-end web server that terminates ssl. The back-end nginx server calling php-fpm is just http:80. The upgrade process seemed to notice I was using https urls and set force_ssl to 2, but after the upgrade I couldn't log in because php thought I wasn't using ssl when I was but terminating at the front end server. I had to `update smf_settings set value=0 where variable = 'force_ssl';` to get the site going. This won't affect most people, but it could affect those using a CDN.

Moving urls, paths and database hosts is still a pain, but there's probably no way around that. And I was doing all three since the motivator here was to migrate my forum to a different db & server, and I changed the url to test the upgrade and install processes while not disturbing the running forum. Now that I think of it, there used to be a script that updated Settings.php and the necessary database entries in smf_settings and smf_themes; I'll go see if that's still around.

I have a tiny private forum that's on 1.1.11 with no mods aside from some extra smileys and avatars, and maybe a Google Analytics snippet edited into the template. 2.1 is surprisingly similar in feel, unlike 2.0 which looked and felt different to me. I'll probably go straight to 2.1 beta so I can use php7 on the new server.

Edit: Ah, repair_settings.php was the tool to fix the urls and paths. Does that work with 2.1? I might try it out.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,084
Re: Question on using HEAD and some observations
« Reply #1 on: January 08, 2018, 03:31:00 PM »
Well, you could, but then you'd have to keep track of what version you were on versus the released beta 3 (and likely worry about handling the upgrade yourself)

As far as detection goes, it's not wonky. It literally tries to do it and then says 'oh hey, I can't'. Is the web server in the container? Is the web server also running as root? Apache? nginx? PHP as a module, or php-fpm? Any of these variables can and will affect which user the files run as, because it's almost certainly actually root.

The force_ssl setting is a touch buggy and could have failed for any number of reasons.

Note that you can safely use SMF 2.0 with PHP 7 without waiting around for a stable release of 2.1.

Offline albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 616
Re: Question on using HEAD and some observations
« Reply #2 on: January 08, 2018, 04:26:21 PM »
The force_ssl stuff should work with pr from today,
when you server is configurated right.

You should use the github version and never the beta version which is provided to download here.

Offline BigMoneyJim

  • Semi-Newbie
  • *
  • Posts: 19
  • Just some guy who wandered in off the Internet.
Re: Question on using HEAD and some observations
« Reply #3 on: January 08, 2018, 04:50:50 PM »
As far as detection goes, it's not wonky. It literally tries to do it and then says 'oh hey, I can't'.

Oh, ok, this one was my fault. I'm launching php-fpm as root in the container, but the config has it switching to www-data, so I am simultaneously dumber (for not realizing this) and smarter (for already running non-root) than I thought.

You should use the github version and never the beta version which is provided to download here.

Hmm, I'm getting mixed messages here. I don't necessarily mind running the bleeding edge for a while, but I want to avoid a situation where upgrading the db is a problem when I go from HEAD to the next release.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 52,598
Re: Question on using HEAD and some observations
« Reply #4 on: January 08, 2018, 04:53:45 PM »
unless you have time to debug issues when they come up, we really dont recommend using SMF 2.1 on a live forum.