PolaricServer / webapp2

Re-write of client app. Based on OpenLayers 5+
GNU Affero General Public License v3.0
15 stars 4 forks source link

Clean install - unable to log in #42

Closed daniel-tickell closed 2 months ago

daniel-tickell commented 8 months ago

I have a clean install of polaric following the install instructions here

After the install I set the password & callsign and restarted the server

The webpage loads, but there is no option to login and when I click on the 3 line menu in the tool bar a small square appears and nothing else.

Using chrome and no ad blockers etc enabled, I also tried this with Safari

ohanssen commented 8 months ago

It seems like there is some error in the client code. I need some more information to find out what is going on. Do you have access to the browser-log or a developer-tool?

daniel-tickell commented 8 months ago

Dev tools console shows the following errors [image: image.png]

On Thu, Feb 15, 2024 at 10:43 AM Øyvind Hanssen (LA7ECA) < @.***> wrote:

It seems like there is some error in the client code. I need some more information to find out what is going on. Do you have access to the browser-log or a developer-tool?

— Reply to this email directly, view it on GitHub https://github.com/PolaricServer/webapp2/issues/42#issuecomment-1946925901, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUXXWQ46K5QMJWTUYMQWXWLYTZJN5AVCNFSM6AAAAABDIUECK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBWHEZDKOJQGE . You are receiving this because you authored the thread.Message ID: @.***>

ohanssen commented 8 months ago

Sorry, I can't see the image here..

daniel-tickell commented 8 months ago

Failed to load resource: the server responded with a status of 404 (Not Found) jquery-ui.min.js:1

   Failed to load resource: the server responded with a status of 404

(Not Found) jquery.min.js:1

   Failed to load resource: the server responded with a status of 404

(Not Found) jquery.ui.table.min.js:1 Uncaught ReferenceError: jQuery is not defined at jquery.ui.table.min.js:1:103 at jquery.ui.table.min.js:1:112 jquery.ui.touch-punch.min.js:12 Uncaught ReferenceError: jQuery is not defined at jquery.ui.touch-punch.min.js:12:1083 featureedit-min.js:6 Uncaught ReferenceError: $ is not defined at featureedit-min.js:6:1 mapbrowser-min.js:19 ADD_PROJECTION: EPSG:32633, +proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs mapbrowser-min.js:19 ADD_PROJECTION: EPSG:32633, +proj=utm +zone=33 +ellps=EUREF89 +datum=EUREF89 +units=m +no_defs mapbrowser-min.js:19 ADD_PROJECTION: EPSG:32632, +proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs mapbrowser-min.js:19 ADD_PROJECTION: EPSG:3006, +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs mapbrowser-min.js:6 PROJ= EPSG:900913 application.js:41 Uncaught ReferenceError: $ is not defined at application.js:41:5 all.min.css:1

   Failed to load resource: the server responded with a status of 404

(Not Found)

On Thu, Feb 15, 2024 at 1:00 PM Øyvind Hanssen (LA7ECA) < @.***> wrote:

Sorry, I can't see the image here..

— Reply to this email directly, view it on GitHub https://github.com/PolaricServer/webapp2/issues/42#issuecomment-1947331000, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUXXWQYL37J4ITMOA4QL6F3YTZZNTAVCNFSM6AAAAABDIUECK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBXGMZTCMBQGA . You are receiving this because you authored the thread.Message ID: @.***>

daniel-tickell commented 8 months ago

It looks like its failing to load the JQuery library (its installed) if I change this to the Google CDN hosted url I am able to log in but get all sorts of other errors

On Thu, Feb 15, 2024 at 1:04 PM Daniel Tickell @.***> wrote:

Failed to load resource: the server responded with a status of 404 (Not Found) jquery-ui.min.js:1

   Failed to load resource: the server responded with a status of 404

(Not Found) jquery.min.js:1

   Failed to load resource: the server responded with a status of 404

(Not Found) jquery.ui.table.min.js:1 Uncaught ReferenceError: jQuery is not defined at jquery.ui.table.min.js:1:103 at jquery.ui.table.min.js:1:112 jquery.ui.touch-punch.min.js:12 Uncaught ReferenceError: jQuery is not defined at jquery.ui.touch-punch.min.js:12:1083 featureedit-min.js:6 Uncaught ReferenceError: $ is not defined at featureedit-min.js:6:1 mapbrowser-min.js:19 ADD_PROJECTION: EPSG:32633, +proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs mapbrowser-min.js:19 ADD_PROJECTION: EPSG:32633, +proj=utm +zone=33 +ellps=EUREF89 +datum=EUREF89 +units=m +no_defs mapbrowser-min.js:19 ADD_PROJECTION: EPSG:32632, +proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs mapbrowser-min.js:19 ADD_PROJECTION: EPSG:3006, +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs mapbrowser-min.js:6 PROJ= EPSG:900913 application.js:41 Uncaught ReferenceError: $ is not defined at application.js:41:5 all.min.css:1

   Failed to load resource: the server responded with a status of 404

(Not Found)

On Thu, Feb 15, 2024 at 1:00 PM Øyvind Hanssen (LA7ECA) < @.***> wrote:

Sorry, I can't see the image here..

— Reply to this email directly, view it on GitHub https://github.com/PolaricServer/webapp2/issues/42#issuecomment-1947331000, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUXXWQYL37J4ITMOA4QL6F3YTZZNTAVCNFSM6AAAAABDIUECK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBXGMZTCMBQGA . You are receiving this because you authored the thread.Message ID: @.***>

ohanssen commented 8 months ago

If you install the latest version of Polaric, it uses https and installs a self-signed certificate. You use https to access the server and has made an exception in the browser to accept the certificate?

daniel-tickell commented 8 months ago

I followed this guide for the exception https://www.pico.net/kb/how-do-you-get-chrome-to-accept-a-self-signed-certificate/ Chrome is still showing it as Not Secure.

But yes I did do a clean install and added the exception

daniel-tickell commented 8 months ago

Ok an update I edited /var/lib/polaric/webapp2/index.html to use CDN hosted libraries again and this seems to be working now

it now looks like this

<!doctype html>
<meta charset="UTF-8">
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height">

<html lang="en">
  <head>
    <link rel="stylesheet" href="lib/ol.css"   type="text/css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"  type="text/css">
    <link rel="stylesheet" href="lib/pikaday.css"   type="text/css">
    <link rel="stylesheet" href="style/style-min.css"   type="text/css">
    <link rel="stylesheet" href="style/xstyle.css"   type="text/css">
    <style>
    </style>

  </head>
  <body>
    <div id="map" class="map"></div>
  </body>
    <script src="lib/proj4.js"></script>
    <script src="lib/ol.js"></script>

   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
   <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js"></script>

    <script src="lib/jquery.ui.table.min.js"></script>
    <script src="lib/mithril.min.js"></script>
    <script src="lib/mithril-stream.js"></script>
    <script src="lib/moment.min.js"></script>
    <script src="lib/pikaday.min.js"></script>
    <script src="lib/jquery.ui.touch-punch.min.js"></script>
    <script src="lib/echarts.min.js"></script>

    <script src="mapbrowser-min.js"></script>
    <script src="layeredit-min.js"></script>
    <script src="tracking-min.js"></script>
    <script src="featureedit-min.js"></script>
    <script src="psadmin-min.js"></script>

    <script src="config.js"></script>
    <script src="application.js"></script>
</html>
ohanssen commented 8 months ago

Ok, thanks for the info. Are you on a recent Debian distro? If you install the libjs-jquery and libjs-jquery-ui packages, it should set up the Apache server to serve the js files under /javascript/. This setup is done by the javascript-common package.

daniel-tickell commented 8 months ago

Yeah this is a clean install of raspbian (Bookworm) Interestingly all three packages were already installed (javascript-common, libjs-jquery and libjs-jquery-ui) apt reinstall javascript-common seems to have resolved this.

Thanks for the help here.

On Fri, Feb 16, 2024 at 11:45 AM Øyvind Hanssen (LA7ECA) < @.***> wrote:

Ok, thanks for the info. Are you on a recent Debian distro? If you install the libjs-jquery and libjs-jquery-ui packages, it should set up the Apache server to serve the js files under /javascript/. This setup is done by the javascript-common package.

— Reply to this email directly, view it on GitHub https://github.com/PolaricServer/webapp2/issues/42#issuecomment-1949221912, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUXXWQ6QGT3JUU7BBENRJBTYT6ZOPAVCNFSM6AAAAABDIUECK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGIZDCOJRGI . You are receiving this because you authored the thread.Message ID: @.***>

joakimsk commented 5 months ago

Ok, thanks for the info. Are you on a recent Debian distro? If you install the libjs-jquery and libjs-jquery-ui packages, it should set up the Apache server to serve the js files under /javascript/. This setup is done by the javascript-common package.

I am also seeing this issue using Raspberry Pi 5 and the most current Raspbian OS (Bookworm). After apt-get reinstall javascript-common, the libraries are accessible again.

Is it possible to place a fix in the webapp2-install?

I was following this: https://polaricserver.readthedocs.io/en/latest/install.html

Also note, commands need to be updated in the text: polaric-setcall instead of polaric-setpasswd

You may mention this too: polaric-passwd

Thank you and have a good day.

ohanssen commented 2 months ago

javacript-common is just a helper-package that adds a config to the apache2 setup if it exists. If it is installed before apache2, you may need to enable it in the apache2 server:

a2enconf javascript-common

I can put this in the postinst script of the deb package to make sure this is done.