WonderCMS / wondercms

Fast and small flat file CMS (5 files). Built with PHP, JSON database.
https://wondercms.com
MIT License
650 stars 164 forks source link

Synology NAS Support #304

Closed goney3 closed 10 months ago

goney3 commented 1 year ago

WonderCMS would be amazing if it could work with Synology NAS devices, which are some people's "server". WonderCMS appears to load the main landing page correctly with "Welcome to your website" and the generated password, however clicking on the login button returns "404 The page you are looking for cannot be found." The button points to: http://192.168.###.###/userfolder/loginURL

So, I am not sure if this is a bug with WonderCMS running on Synology Web Station, or just an issue with Synology Web Station in general (that isn't supported by WonderCMS).

I am not a programmer, my apologies for not having a more in-depth explanation of the issue.

joho1968 commented 1 year ago

Just out of curiosity, have you tried entering the URL manually like:

http://192.0.0.168/###.###/userfolder/login http://192.0.0.168/###.###/userfolder/admin

(assuming your WCMS is actually installed in /userfolder/ of course)

goney3 commented 1 year ago

Great suggestion! I tried /login and /admin as well as /how-to and still get a 404 for all three :( Only the home page seems fine.

Here are the Synology Web Station specs, hopefully it'll have something that stands out as to why WonderCMS doesn't behave as expected: https://www.synology.com/en-us/dsm/7.2/software_spec/web_station

Thank you for your time.

joho1968 commented 1 year ago

When you go to the "site", is the address "http://192.0.0.168/###.###/userfolder"?

goney3 commented 1 year ago

Not exactly, more like: http://192.168.##.##/username/ I didn't realize that it should have a number folder in between the IP address?

joho1968 commented 1 year ago

Do you have other web applications on your synology? If so, which URL do you use to access them?

You don't really need to worry about typing out the full URL if it starts with 192.168.x.x as that is a private IP address only visible to you.

So, you go to http://192.168.something.something/your_user_name to see your WonderCMS site?

goney3 commented 1 year ago

Correct http://192.168.something.something/your_user_name No other web applications running, they offer automatic installs for Joomla and Wordpress, but that felt like overkill for a personal page to play around on.

joho1968 commented 1 year ago

So try http://192.168.something.something/your_user_name/admin So try http://192.168.something.something/your_user_name/login

(replacing something.something with numbers and your_user_name with your actual username)

goney3 commented 1 year ago

Right, I tried http://192.168.something.something/your_user_name/admin and http://192.168.something.something/your_user_name/login and still get 404 (with my correct IP and user name)

However, http://192.168.something.something/your_user_name/ Will load the "Welcome to your website" WonderCMS page.

Strange issue no?

joho1968 commented 1 year ago

Can you access the website installation's directory and file structure via Synology's file manager?

If so, there's a directory called data, and in that directory, there's a file called database.js. You can open that file with a text editor, I think Synology has one. You can look for an entry that reads something like:

"login": "this_is_what_you_need_to_append_to_login"

goney3 commented 1 year ago

hmmm, should be the default unzipped file from the WonderCMS download, I don't think anything was changed? Does this look correct?

{
    "config": {
        "siteTitle": "Website title",
        "theme": "sky",
        "defaultPage": "home",
        "login": "loginURL",
        "forceLogout": false,
        "forceHttps": false,
        "saveChangesPopup": false,
        "password": "REDACTED",
        "lastLogins": {},
        "lastModulesSync": null,
        "customModules": {
            "themes": {},
            "plugins": {}
        },
        "menuItems": {
            "0": {
                "name": "Home",
                "slug": "home",
                "visibility": "show",
                "subpages": {}
            },
            "1": {
                "name": "How to",
                "slug": "how-to",
                "visibility": "show",
                "subpages": {}
            }
        }
    },
    "pages": {
        "404": {
            "title": "404",
            "keywords": "404",
            "description": "404",
            "content": "<center><h1>404 - Page not found<\/h1><\/center>",
            "subpages": {}
        },
        "home": {
            "title": "Home",
            "keywords": "Enter, page, keywords, for, search, engines",
            "description": "A page description is also good for search engines.",
            "content": "<h1>Welcome to your website<\/h1>\n\n<p>Your password for editing everything is: <b>AJFY1eW3<\/b><\/p>\n\n<p><a href=\"http:\/\/192.168.86.68\/keith\/loginURL\" class=\"button\">Click here to login<\/a><\/p>\n\n<p>To install an awesome editor, open Settings\/Plugins and click Install Summernote.<\/p>",
            "subpages": {}
        },
        "how-to": {
            "title": "How to",
            "keywords": "Enter, keywords, for, this page",
            "description": "A page description is also good for search engines.",
            "content": "<h2>Easy editing<\/h2>\n<p>After logging in, click anywhere to edit and click outside to save. Changes are live and shown immediately.<\/p>\n\n<h2>Create new page<\/h2>\n<p>Pages can be created in the Settings.<\/p>\n\n<h2>Start a blog or change your theme<\/h2>\n<p>To install, update or remove themes\/plugins, visit the Settings.<\/p>\n\n<h2><b>Support WonderCMS<\/b><\/h2>\n<p>WonderCMS is free for over 12 years.<br>\n<a href=\"https:\/\/swag.wondercms.com\" target=\"_blank\"><u>Click here to support us by getting a T-shirt<\/u><\/a> or <a href=\"https:\/\/www.wondercms.com\/donate\" target=\"_blank\"><u>with a donation<\/u><\/a>.<\/p>",
            "subpages": {}
        }
    },
    "blocks": {
        "subside": {
            "content": "<h2>About your website<\/h2>\n\n<br>\n<p>Website description, contact form, mini map or anything else.<\/p>\n<p>This editable area is visible on all pages.<\/p>"
        },
        "footer": {
            "content": "&copy;2023 Your website"
        }
    }
}
joho1968 commented 1 year ago

So it seems like nothing has been set as far as the "login URL" yet.

So, repeat your previous attempt, but use /loginURL (verbatim) instead.

goney3 commented 1 year ago

Still ends up at 404 page unfortunately.

joho1968 commented 1 year ago

That's quite odd I have to say.

When you go to the site, does it show the warning about "Change your login URL and save it for later use..."?

(This is what WCMS does when you have not configured a specific login URL.)

robiso commented 11 months ago

@goney3 What happens if you try: http://192.168.something.something/your_user_name/?page=admin

WonderCMS uses page rewrites and I’m assumkng this might be your issue.

goney3 commented 11 months ago

@robiso thank you for the suggestion, however it still goes to a 404 page not found. I wish I knew what a page rewrite was, if I can be more helpful, please let me know if there is anything I should be copy-pasting to assist with this. Thank you for your time!

robiso commented 11 months ago

:) What is the exact URL where you can see WonderCMS being installed?

http://192.0.0.168/#%23.%23%23/username/

try adding “?page=loginURL” without the quotes at the end and let me know what you see? Make sure to add this to the page URL you see the your WonderCMS.