statusengine / interface

AngularJS based Web Interface for Statusengine
https://statusengine.org/ui/#overview
GNU General Public License v3.0
18 stars 7 forks source link

Allow subpath for login #36

Closed duylong closed 4 years ago

duylong commented 4 years ago

Hi,

I have a problem when I click on the button Sign in. It redirect me to /login.html, but my real url is /subpath/login.html

Can you add a option for this feature?

Best regards,

nook24 commented 4 years ago

I added support for this. Unfortunately for now it is required to manually patch the file /public/index.html

https://github.com/statusengine/interface/blob/d81e1884e160df6bbf562da7dbd3d6df3aae15ff/public/index.html#L6-L13

For example:

<base href="/statusengine/">

Why is there no config option yet?

For now the index.html is a HTML file. So no PHP is available. Renaming the file to .php could break some web server configurations which I do not want. Maybe I will change this with the next larger version update.

Example Apache Config

Alias /statusengine /usr/share/interface/public

<Directory /usr/share/interface/public>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.html

    <IfModule mod_php7.c>
        php_admin_value open_basedir /usr/share/interface
    </IfModule>

</Directory>

Use subdomains

I would recommend to use a subdomain statusengine.example.org instead of a subdirectory example.org/statusengine. I was used to subdirectories in times where SSL certificates costs money. Since we have Let’s Encrypt subdomains are a much smoother way. At least for me.

duylong commented 4 years ago

I avoid creating an application by subdomain. I prefer to group by family of products. Thanks for the tip, it suits me too :)