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

please update tasmoadmin #6805

Closed
Boebbele opened this issue Dec 15, 2023 · 14 comments
Closed

please update tasmoadmin #6805

Boebbele opened this issue Dec 15, 2023 · 14 comments
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Milestone

Comments

@Boebbele
Copy link

Boebbele commented Dec 15, 2023

Dietpi-Software [27] Tasmoadmin

It installs an old Version v3.2.0
Newest release is 3.3.0.

The intern self update funktion in tasmoadmin v3.2.0 Webinterface dont work.

Error:

Warning: Undefined array key "release_url" in /var/www/tasmoadmin/pages/selfupdate.php on line 20

Warning: Undefined array key "latest_tag" in /var/www/tasmoadmin/pages/selfupdate.php on line 20

Fatal error: Uncaught TypeError: TasmoAdmin\SelfUpdate::update(): Argument #1 ($releaseUrl) must be of type string, null given, called in /var/www/tasmoadmin/pages/selfupdate.php on line 20 and defined in /var/www/tasmoadmin/src/SelfUpdate.php:28 Stack trace: #0 /var/www/tasmoadmin/pages/selfupdate.php(20): TasmoAdmin\SelfUpdate->update() #1 /var/www/tasmoadmin/index.php(66): include('...') #2 /var/www/tasmoadmin/index.php(111): render_template() #3 {main} thrown in /var/www/tasmoadmin/src/SelfUpdate.php on line 28
@MichaIng
Copy link
Owner

MichaIng commented Dec 15, 2023

It works well here:

# curl -sSfL 'https://api.github.com/repos/TasmoAdmin/TasmoAdmin/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/tasmoadmin_v[^"\/]*\.tar\.gz"$/{print $4}'
https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.3.0/tasmoadmin_v3.3.0.tar.gz

I guess the GitHub API was offline when you installed TasmoAdmin, and dietpi-software should have printed a block of [FAILED] informing you that obtaining the latest version failed and v3.2.0 was used as fallback, the latest known version when DietPi v8.24 was released.

Probably the web updater fails for the same reason. Can you try the above command?

curl -sSfL 'https://api.github.com/repos/TasmoAdmin/TasmoAdmin/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/tasmoadmin_v[^"\/]*\.tar\.gz"$/{print $4}'

@Boebbele
Copy link
Author

Boebbele commented Dec 15, 2023

Strange...
I did an "dietpi-software reinstall 27"
And yet it is tasmoadmin v3.2.0 installed and no 3.3.0

I use the native PC uefi image.

This is the output from curl:

root@homeassistant:~# curl -sSfL 'https://api.github.com/repos/Tasm
oAdmin/TasmoAdmin/releases/latest' | mawk -F\" '/^ *"browser_downlo
ad_url": ".*\/tasmoadmin_v[^"\/]*\.tar\.gz"$/{print $4}'
https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.3.0/t
asmoadmin_v3.3.0.tar.gz

Strange....

Screenshot_20231215-173906_Iodé Browser

@MichaIng
Copy link
Owner

Ah right, a reinstall won't update TasmoAdmin due to the existence of the web updater. The web updater does still not work?

@Boebbele
Copy link
Author

Yes the webupdater dont work.

@Boebbele
Copy link
Author

Screenshot_20231215-175247_Iodé Browser

@Boebbele
Copy link
Author

I uninstalled tasmoadmin with dietpi-software and installed it again.
Yet i have 3.3.0

But the self webupdater dont work. Same errorlog (Screenshot)

@MichaIng
Copy link
Owner

I am currently trying to replicate the error.

@MichaIng
Copy link
Owner

MichaIng commented Dec 15, 2023

Hmm, the web updater worked well here:
image
image

There is a setting where the IP of the TasmoAdmin server needs to be set:
image

It seems the browser/client does a dedicated request to trigger the update. So if you try this from outside your LAN, or if the IP of the server changed, the default entry might not be correct. Or does this always contain the IP you are connecting with (which would be actually a clever default)?

@Boebbele
Copy link
Author

Boebbele commented Dec 15, 2023

the IP addresses fit. tasmoadmin runs on a headless device local in my LAN. no access from outside my lan.

@Boebbele
Copy link
Author

Screenshot_20231215-181801_Iodé Browser

@Boebbele
Copy link
Author

Is it a problem with PHP?

@Boebbele
Copy link
Author

i have additionally installed Homer and baikal an lighthtpd is everything on port 80. is that the problem?

MichaIng added a commit that referenced this issue Dec 16, 2023
- DietPi-Software | TasmoAdmin: Resolved an issue where the web updater did not work with Lighttpd, due to a wrong rewrite rule. Many thanks to @Boebbele for reporting this issue: #6805
@MichaIng
Copy link
Owner

Ah, I could reproduce it with Lighttpd! A new problem with the rewrites. Found and solved the issue:

  • I was expecting that rewrites require path elements passed to the backend, like /tasmoadmin/selfupdate => /tasmoadmin/index.php/selfupdate.
  • We already recognised previously that this rewrite causes issues with Lighttpd, since it has no way to pass FastCGI variables to tell the backend that /tasmoadmin is still the base path. So the backend then produces asset URLs like /tasmoadmin/index.php/resources/css/style.css, which of course does not exist, so pages load without styles, images and scripts. Apache2 and Nginx do this automatically, respectively have ways to tell the backend about which part is the base path to generate other URLs from.
  • What worked with all other pages is to just append everything as query string: /tasmoadmin/selfupdate => /tasmoadmin/index.php?selfupdate. I was already wondering about this, since this did not happen in the Nginx config they use for their Docker image: https://github.com/TasmoAdmin/TasmoAdmin/blob/master/.docker/rootfs/etc/nginx/nginx.conf
  • I actually thought that path elements are implied in the $args parameter, but rereading the docs and testing turns out this really is the query string only, while the path is completely omitted in the rewrite. I first did not understand how this can even work, but it is simple: The backend takes the path/route from the original request URL, which is always passed, instead of from the rewrite URL. So the rewrite URL must only contain /tasmoadmin/index.php, in case appended with the query string (rarely or not used by TasmoAdmin), and no path needs to be part of that rewrite URL.

Fixed with: b345081

Please update your config like this:

curl -sSfo /etc/lighttpd/conf-available/99-dietpi-tasmoadmin.conf 'https://raw.githubusercontent.com/MichaIng/DietPi/dev/.conf/dps_27/lighttpd.tasmoadmin.3.conf'
systemctl restart lighttpd

@MichaIng MichaIng added Bug 🐞 Solution available 🥂 Definite solution has been done labels Dec 16, 2023
@MichaIng MichaIng added this to the v8.25 milestone Dec 16, 2023
@Boebbele
Copy link
Author

It works! You are the best! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

2 participants