Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make default page configurable, allow to disable public.pl and customer.pl #1279

Closed
bschmalhofer opened this issue Sep 28, 2021 · 10 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bschmalhofer
Copy link
Contributor

bschmalhofer commented Sep 28, 2021

As of OTOBO 10.0.12 the default page of OTOBO is the agent interface. This is currently implemented in bin/cgi-bin/otobo.psgi. This feature can be overridden in a custom Nginx configuration. See https://otobo.de/en/forums/topic/default-page/ and https://doc.otobo.org/manual/installation/stable/en/content/installation-docker.html#custom-configuration-of-the-nginx-webproxy .

It would be nice if there were a more convenient way to do this.

@bschmalhofer bschmalhofer added this to the OTOBO 10.1 milestone Sep 28, 2021
@bschmalhofer
Copy link
Contributor Author

Alternatively the default page could be set differently in otobo.psgi and in index.html. I'm not sure what the best approach is.

Here are example files that also changes /otobo/index.pl to /index.pl and so on

index.html.txt

otobo.psgi.txt
.

@bschmalhofer bschmalhofer modified the milestones: OTOBO 10.1, OTOBO 10.1.1 Feb 17, 2022
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Feb 17, 2022

The newly implemented features are that the default page are configurable and that the public interface can be deactivated. Let's collect information about the current state and see whether anything needs to be changed. The new settings are Frontent::NotFoundRedirectPath and PublicFrontend::Active. The files index.html, robots.txt, and 404.html directly in '"$Home/var/httpd/htdocs/" are meant to be adaptable by customers and might be removed by customers.

See also #1584 and #1599.

@bschmalhofer bschmalhofer changed the title Configurable default page Make default page configurable, allow to turn off public.pl Feb 17, 2022
bschmalhofer added a commit that referenced this issue Feb 18, 2022
and use it in otobo.psgi. Previously otobo/index.pl was hardcoded.
bschmalhofer added a commit that referenced this issue Feb 18, 2022
bschmalhofer added a commit that referenced this issue Feb 18, 2022
and use it in otobo.psgi for determining whether public.pl is active
Redirect to the default page if not.
bschmalhofer added a commit that referenced this issue Feb 18, 2022
bschmalhofer added a commit that referenced this issue Feb 18, 2022
@bschmalhofer
Copy link
Contributor Author

The changes seem to work, but it would be good to have a review whether the current behavior is sane enough for a release,

@bschmalhofer bschmalhofer self-assigned this Feb 18, 2022
@bschmalhofer bschmalhofer added the enhancement New feature or request label Feb 18, 2022
@svenoe
Copy link
Contributor

svenoe commented Feb 24, 2022

After a short discussion we agreed on the following changes:

  • index.html per default redirects to /otobo (where then the SysConfig will determine where to go further (already implemented))
  • public.pl can also be chosen as a redirect option from /otobo (not actually a change in the current implementation, as it is a text field, not a selection; would be nice to change, but I am not sure whether the selection - I will write an example below - can be combined with <OTOBO_CONFIG_ScriptAlias>)
  • customer.pl can also be disabled via SysConfig (like public.pl)
  • additionally it would be nice to have the choice of default redirect in the installer. But only if it is a selection, and this only if we can change the ValueType of the SysConfig to "Select" (and still use the OTOBO_CONFIG tag)

An example for a selection is:

        <Value>
            <Item ValueType="Select" SelectedID="100">
                <Item ValueType="Option" Value="100" Translatable="1">100 (Expert)</Item>
                <Item ValueType="Option" Value="200" Translatable="1">200 (Advanced)</Item>
                <Item ValueType="Option" Value="300" Translatable="1">300 (Beginner)</Item>
            </Item>
        </Value>

@bschmalhofer bschmalhofer changed the title Make default page configurable, allow to turn off public.pl Make default page configurable, allow to disable public.pl and customer.pl Feb 24, 2022
@bschmalhofer
Copy link
Contributor Author

After more thinking, the selection of the default page can be between index.pl, customer.pl and public.pl. The redirect can be relative to otobo/ or to whatever otobo/ has been aliased to.

@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Feb 25, 2022

Also:

  • when the selected default interface is deactivated, then fall back to index.pl in order to avoid an useless extra redirect

bschmalhofer added a commit that referenced this issue Feb 25, 2022
bschmalhofer added a commit that referenced this issue Feb 25, 2022
This allows the SysConfig setting for the default page to take effect.
bschmalhofer added a commit that referenced this issue Feb 25, 2022
Rename the option from Frontend::NotFoundRedirectPath as now only interfaces can be selected.
Consider special case https:://example.com/otobo (no trailing slash).
Add tests where the DefaultInterface is changed.
bschmalhofer added a commit that referenced this issue Feb 25, 2022
Now that there is support for the non-slash case.
bschmalhofer added a commit that referenced this issue Feb 25, 2022
Do not redirect to an inactive interface
bschmalhofer added a commit that referenced this issue Feb 25, 2022
@bschmalhofer
Copy link
Contributor Author

The current state of affairs is merged. The enhancement of installer.pl has been moved to #1633 as there might more settings that should be included.

@nm583
Copy link

nm583 commented Jan 25, 2023

* [x]  index.html per default redirects to /otobo (where then the SysConfig will determine where to go further (already implemented))

This was not the case in "my" index.html after an OTRS migration.
I did a fresh install of OTOBO 10.1.6 (with docker) and completed the OTRS migration from 6.0.30. No errors during migration.
After migration I set Frontend::DefaultInterface to Customer Interface.

Behaviour:
myIP redirected to myIP/otobo/index.pl
myIP/otobo redirected to myIP/otobo/customer.pl

I checked index.html and it said:

<head>
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
    <meta http-equiv="refresh" content="0; URL=/otobo/index.pl" />
    <title>OTOBO Redirect</title>
</head>

Removing the "/index.pl" led to the correct expected redirections.

As also the Copyright of Rother OSS GmbH was missing at the bottom (only had the OTRS part), I think it could be related to the migration process.

@bschmalhofer
Copy link
Contributor Author

Hi @nm583 ,
this seems to an artefact of the migration from OTRS. An existing file var/httpd/htdocs/index.html is copied from OTRS to OTOBO. This makes sense, as var/httpd/htdocs/index.html might have been customized in OTRS. The original OTOBO file is still available in /opt/otobo_install/otobo_next/var/httpd/htdocs/index.html . Apparently the migration did some rewriting, changing "otrs/index.html" to "otobo/index.html" and "OTRS Redirect" to "OTOBO Redirect".

I'm not sure whether the migration should generally change the "/otrs/index.html" to "/otobo". I'll file it as an separate issue.

@bschmalhofer
Copy link
Contributor Author

Hi @nm583,
after a brief internal discussion we decided to keep the migration as it is now. It's hard to find a good general rule for that, as the next user might be wondering why the migration changed index.html in an unexpected way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants