Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-08-08 10:38:29

firehit
New Member
Registered: 2021-08-08
Posts: 4

Admin panel is avialable on public IP; change it to a local IP?

Can the admin login page be made to be available only on a local IP? I am guessing some URL stuff with the web server but does Textpattern itself provide any such option?

Offline

#2 2021-08-08 13:23:44

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 271
Website GitHub GitLab Twitter

Re: Admin panel is avialable on public IP; change it to a local IP?

I have set two virtual hosts for the same website, and then

Match ^/textpattern/ DenyAccess

for the public one. You could adapt the syntax for your Caddy, mine is Hiawatha. Smarter sysadmins might advise a simpler solution. And such option would be appropriate to the core of CMS.

Last edited by Vienuolis (2021-08-08 13:27:56)

Offline

#3 2021-08-08 14:52:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,724
Website GitHub Twitter

Re: Admin panel is avialable on public IP; change it to a local IP?

firehit wrote #331237:

Can the admin login page be made to be available only on a local IP? I am guessing some URL stuff with the web server but does Textpattern itself provide any such option?

Not that I know of but you may be able to restrict it to your IP. In your textpattern folder, add the following in your htaccess

ErrorDocument 403 /error_page.html
Order Allow,Deny
Deny from all
Allow from 111.222.333.444 
# change 111.222.333.444 with your IP

I’m not sure how this may affect the functionality of your site for your visitors or even if the diagnostics tab will work.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Online

#4 2021-08-11 19:03:18

firehit
New Member
Registered: 2021-08-08
Posts: 4

Re: Admin panel is avialable on public IP; change it to a local IP?

Vienuolis wrote #331239:

I have set two virtual hosts for the same website, and then

for the public one. You could adapt the syntax for your Caddy, mine is Hiawatha. Smarter sysadmins might advise a simpler solution. And such option would be appropriate to the core of CMS.

How does multiple domains names work here? I have setup Text Pattern using my server address. but even after I setup a proper domain all the links on the page are hardcoded with the server IP address. Is there a way to make Text Pattern use relative paths.. not care under which domain it runs?

Offline

#5 2021-08-12 04:23:55

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,724
Website GitHub Twitter

Re: Admin panel is avialable on public IP; change it to a local IP?

firehit wrote #331308:

I have setup Text Pattern using my server address. but even after I setup a proper domain all the links on the page are hardcoded with the server IP address. Is there a way to make Text Pattern use relative paths.. not care under which domain it runs?

There are a number of techniques you can use

For example <txp:permlink id="xx" /> for individual articles, or use relative paths for sections and/or categories. There are of course many more options such as using <txp:site_url />, shortcodes etc.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Online

#6 2021-08-12 08:43:53

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: Admin panel is avialable on public IP; change it to a local IP?

firehit wrote #331308:

Is there a way to make Text Pattern use relative paths.. not care under which domain it runs?

Not sure what links you mean (public, admin?), but you can try either

  • empty Site URL pref
  • set global $prefs['url_base'] = ''
  • wrap pages in
<txp:page_url root="">
...
</txp:page_url>

Offline

#7 2021-08-12 10:06:12

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 271
Website GitHub GitLab Twitter

Re: Admin panel is avialable on public IP; change it to a local IP?

firehit wrote #331308:

How does multiple domains names work here? […] Is there a way to make Text Pattern use relative paths.

Textpattern Preferencies: Site: Site URL

I have set az.on.lt for public access domain, and another a-z.on.lt for an internal back-end — for editors only. That is sufficient. Links are consistent, and https://az.on.lt/textpattern/ is not available for visitors of the public site.

Offline

#8 2021-08-12 10:23:45

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 271
Website GitHub GitLab Twitter

Re: Admin panel is avialable on public IP; change it to a local IP?

I also leave access to my website by an open HTTP or encrypted HTTPS to decide this option by the reader. But forced editors to login via TLS only (to another domain for back-end).

Offline

Board footer

Powered by FluxBB