Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: azaghul33 on July 25, 2020, 04:27:11 PM

Title: Activation URL
Post by: azaghul33 on July 25, 2020, 04:27:11 PM
First time user...

Is there a way to set the URL in activation emails?

I'm running SMF 2.0.17 on my home network on a 192.168.x.y address, but need to advertise my public IP with port number (eg: 250.250.250.250:8080) in the email for people to respond to. Running port forwarding.

Under Configuration->Database and Paths->Server Settings I can see Forum URL, which I'd think would do what I want, but cannot get that value to save (eg: 250.250.250.250:8080), it just sticks with the 192.168 address.

I've installed again and added my public IP, without success.
I've edited Settings.php and changed the $boardurl value, without success.
I've added the Email Template Editor, and as a work-around can hard code the public address. ACTIVATIONLINK holds the old URL and the USER u=x variable...which I'm sure there is a separate defined variable for, but don't know the inner workings of SMF.

Had a quick search of the forum, but not knowing exactly what to search for...any assistance appreciated.
Title: Re: Activation URL
Post by: Illori on July 25, 2020, 04:44:05 PM
we really dont recommend anyone to run their own server for SMF as it may lead them to be hacked easier.
Title: Re: Activation URL
Post by: Gary on July 25, 2020, 08:27:04 PM
^ Clarification: using ones PC as their server is a bad idea. (Except for development purposes)

Owning a dedicated server in a data center is different and fine. (eg. co-locating)
Title: Re: Activation URL
Post by: azaghul33 on July 25, 2020, 08:31:41 PM
Just looking at self hosting as a VM under ESXi, just for a local community residence of maybe 15-20 users...
Title: Re: Activation URL
Post by: Gary on July 25, 2020, 08:50:13 PM
Even then it's still not recommended to use your PC in any capacity (even in a VM) for hosting an SMF forum. You're better off using a cheap-ish webhost instead.
Title: Re: Activation URL
Post by: Arantor on July 27, 2020, 11:57:31 AM
Quote from: azaghul33 on July 25, 2020, 04:27:11 PM
First time user...

Is there a way to set the URL in activation emails?

I'm running SMF 2.0.17 on my home network on a 192.168.x.y address, but need to advertise my public IP with port number (eg: 250.250.250.250:8080) in the email for people to respond to. Running port forwarding.

Under Configuration->Database and Paths->Server Settings I can see Forum URL, which I'd think would do what I want, but cannot get that value to save (eg: 250.250.250.250:8080), it just sticks with the 192.168 address.

I've installed again and added my public IP, without success.
I've edited Settings.php and changed the $boardurl value, without success.
I've added the Email Template Editor, and as a work-around can hard code the public address. ACTIVATIONLINK holds the old URL and the USER u=x variable...which I'm sure there is a separate defined variable for, but don't know the inner workings of SMF.

Had a quick search of the forum, but not knowing exactly what to search for...any assistance appreciated.

Since the users are not on your network anyway, they presumably won't be able to use the 192.x.x.x IP address to visit the forum generally, hence your question.

Just set the URL of the site to the externally facing details (since they'll need that to actually visit anyway) and then activation emails will work.

In any case, hosting this on your own machine is still generally a bad idea unless it's a dedicated machine that isn't shared with anything else you run (e.g. using a a Raspberry Pi)
Title: Re: Activation URL
Post by: azaghul33 on July 28, 2020, 06:07:07 AM
I appreciate its not the preferred option to self-host, but until I'm certain the board will get used, I'd rather not take the added plunge of external hosting.

It's probably staring me in the face, but where do I set the site URL (IP and port)...preferably without having to reinstall  :) All I can see is the Forum URL in the Server settings.
Title: Re: Activation URL
Post by: Arantor on July 28, 2020, 08:25:09 AM
That's where you set it, the server settings themselves. You're setting the master board URL for everything to use the public IP so activations work - no point having activations work if nothing else works!

*YOU* can use your internal IP, you're on your own network, but all the other users won't be, so you will have to use the public facing IP as the URL. I'd honestly suggest forwarding port 80 though you can set that in the URL too.
Title: Re: Activation URL
Post by: azaghul33 on July 29, 2020, 01:49:21 AM
No success unfortunately...

I'm changing the Forum URL to my external IP and port (eg: hxxps://100.100.100.100:8082), and saving it, but it keeps reverting to my internal 192.168 IP address of the LAN interface. If I change the IP of the device, the Forum URL will follow it (from 192.168.100.100 to 192.168.100.101)
Title: Re: Activation URL
Post by: Arantor on July 29, 2020, 02:15:10 AM
Change it in Settings.php directly.
Title: Re: Activation URL
Post by: azaghul33 on July 29, 2020, 02:46:27 AM
I'd tried that in the original post...changed the $boardurl value. Yep, I never do anything the easy way :)
Title: Re: Activation URL
Post by: Arantor on July 29, 2020, 05:07:26 AM
You then need to access it via the same URL yourself. Exclusively.
Title: Re: Activation URL
Post by: azaghul33 on July 29, 2020, 06:50:19 AM
That works, just means all admin needs to be done via the public IP, a little more complicated but just a drawback of self hosting.

Thanks for the assist... :) :)
Title: Re: Activation URL
Post by: Arantor on July 29, 2020, 07:45:23 AM
I don't know why you think that would give you additional protection, it's all routed through the same code (intentionally, to be able to give some delegated admin powers to non admins)

Almost no PHP app is architected the way you're suggesting, either.