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

Instance Reboot at Admin/Instance/Setting doesn't reboot and block auto login from login pages #383

Closed
glendonyeo opened this issue Dec 12, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@glendonyeo
Copy link

CloudPanel version(s) affected

2.4.0

Description

When rebooting server from Admin/Instance/Setting page server doesn't really reboot, it only log event and redirecting back to /login page and when attempt to relogin, it will keep checking on /admin/instance/restart endpoint & redirect back to login page

How to reproduce

  1. Go to /admin/instance/settings
  2. Click on Reboot
  3. Redirected to /login but server does not reboot
  4. Attempt to login but /login page keep refreshing
    image
  5. Manually go to portal by removing /login from url, INSTANCE_REBOOT logged in EVENT but server doesn't really reboot

Possible Solution

  1. Restart button at Admin/Instance contains token, but Admin/Instance/Settings does not contain token
  2. /login page supposing to auto redirect to login when the user its authenticated (this behavior should be the same for normal scenario, authenticated user shall redirected to home page if they already authenticated)

Additional Context

No response

@cloudpanel-io
Copy link
Owner

The problem cannot be reproduced, the reboot works fine, we have tested over Ubuntu 22 and Debian 11 with X86 and ARM64 architectures.

@glendonyeo
Copy link
Author

glendonyeo commented Dec 13, 2023

@cloudpanel-io are you sure you tested the reboot from /admin/instance/settings instead of /admin/instance/services?

the Reboot button at /admin/instance/settings is missing CSRF Token and cause it only redirect to /login instead of actual rebooting the server

also in the source code source code itself admin/instance/services.html.twig come with csrf token but admin/instance/settings.html.twig does not pass in csrf token, it should be 100% replicate-able from your side

There are another issues with login page that should auto login when user is already authenticated

@cloudpanel-io cloudpanel-io reopened this Dec 13, 2023
@cloudpanel-io cloudpanel-io added the bug Something isn't working label Dec 13, 2023
@cloudpanel-io
Copy link
Owner

Thanks, @glendonyeo, for testing the patch with me on Discord.

The bug will be fixed with the next version, 2.4.1, at the end of January.

If you don't want to wait, you can do the following:

Login to your server via SSH as root user and execute the following command2:

  1. curl -s https://gist.githubusercontent.com/swieczorek/75099815a23137c62a9d8432793e6c70/raw/2c1cc68be17454bb246b4f3d381e58c59287116e/gistfile1.txt > /home/clp/htdocs/app/files/templates/Admin/Instance/settings.html.twig

  2. rm -rf /home/clp/htdocs/app/files/var/cache/prod/*

@cloudpanel-io
Copy link
Owner

Fixed in v2.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants