WisdomSky / CasaOS-LinuxServer-AppStore

A CasaOS custom Appstore containing over 100+ LinuxServer.io images.
https://casaos-appstore.paodayag.dev/linuxserver
GNU General Public License v3.0
287 stars 35 forks source link

"Error: 401 Unauthorized - Unauthorized" error #6

Closed DaarKrakan closed 1 year ago

DaarKrakan commented 1 year ago

I am getting the following error while installing the script via SSH.

root@xxx:~# casaos-cli app-management register app-store https://casaos-appstore.paodayag.dev/linuxserver.zip -u 92.XX.XX.XX:85

Error: 401 Unauthorized - Unauthorized

OS: Debian 11 CasaOS: 0.4.4

I have proxied nginx to the default server location. So my CasaOS domain address start with https://xxx.mydomain.com by editing "/etc/nginx/sites-available/default" as below

server {
 server_name  xxx.mydomain.com;

 location / {
   proxy_pass http://92.XX.XX.XX:85;
   proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection 'upgrade';
   proxy_set_header Host $host;
   proxy_cache_bypass $http_upgrade;
 }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/xxx.mydomain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/xxx.mydomain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = xxx.mydomain.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

 listen       80;
 server_name  xxx.mydomain.com;
    return 404; # managed by Certbot

Therefore how to fix this issue? I have tried deleting the above lines. and the same error appears.

WisdomSky commented 1 year ago

It would be best if you report this issue to https://github.com/IceWhaleTech/CasaOS/issues instead. As this might be CasaOS-related rather than caused by this Appstore.

WisdomSky commented 1 year ago

Also, it seems that you are using a Public IP (92.XX.XX.XX). You should use localhost or 127.0.0.1 instead (e.g. localhost:85).

casaos-cli app-management register app-store https://casaos-appstore.paodayag.dev/linuxserver.zip -u "localhost:85"
DaarKrakan commented 1 year ago

It is working after using localhost instead of my public IP. Thank you!