error on wifi-login-pages

135 views
Skip to first unread message

Michele Salerno

unread,
May 15, 2022, 6:45:11 AM5/15/22
to OpenWISP
Hi,

In a new installation I have the blank page.

I copy default organization ed i modify only this vars:
---
name: "Basilicata"
slug: "default"

settings:
  mobile_phone_verification: false
  subscriptions: false

# configuration variables for the server app
server:
  # put the URL of openwisp-radius here
  host: "http://127.0.0.1:8000"
  uuid: "UID-OF-MY-ORG"
  secret_key: "TOKEN-MY-ORG-RADIUS-SETTINGS"

I looked in the logs and: cat /opt/openwisp2/wifi-login-pages/log/server.log

yarn run v1.22.19
$ node config/setup.js && node config/build-translations.js
node:internal/fs/utils:345
    throw err;
    ^

Error: EACCES: permission denied, open
'/opt/openwisp2/wifi-login-pages/client/configs/default.json'
    at Object.openSync (node:fs:585:3)
    at Object.writeFileSync (node:fs:2170:35)
    at /opt/openwisp2/wifi-login-pages/config/setup.js:238:8
    at Array.forEach (<anonymous>)
    at writeConfigurations
(/opt/openwisp2/wifi-login-pages/config/setup.js:236:17)
    at Object.<anonymous>
(/opt/openwisp2/wifi-login-pages/config/setup.js:275:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js
(node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: '/opt/openwisp2/wifi-login-pages/client/configs/default.json'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about
this command.

Federico Capoano

unread,
May 16, 2022, 8:00:57 AM5/16/22
to open...@googlegroups.com
Permission denied indicates a linux permission issue, do not change things manually, use the playbook:
https://github.com/openwisp/ansible-openwisp-wifi-login-pages

Or alternatively, I use this script to rebuild after changes if I need to operate manually without the ansible playbook:

#!/bin/bash
set -e
yarn
# everything owned by www-data
chown -R www-data:www-data .
# remove any world permission
chmod -R o-rwx .
sudo -u www-data yarn build --mode production
supervisorctl restart wifi_login_pages

Set this in the same directory of the WiFI login pages app.

Best regards
Federico Capoano

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/99b5e849-393d-c06b-baff-20781cd86732%40gmail.com.

Michele Salerno

unread,
May 21, 2022, 7:09:45 PM5/21/22
to open...@googlegroups.com

I install wifi-pages with ansible and have blank page.
I tried the script to correct permissions and it doesn't change.
I opened port 3030 in OUTPUT and INPUT and I have error 502.
I also tried not putting rules in iptables...idem.

[INFO 2022-05-22 01:00:37:037] Server started on port 3030
::::::::::::::
log/info.log
::::::::::::::

[INFO 2022-05-22 01:00:37:037] Server started on port 3030
::::::::::::::
log/nginx.access.log
::::::::::::::

5.91.110.179 - - [22/May/2022:01:00:21 +0200] "GET / HTTP/2.0" 502 552 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36"
5.91.110.179 - - [22/May/2022:01:00:21 +0200] "GET /robots.txt HTTP/2.0" 502 552 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36"
5.91.110.179 - - [22/May/2022:01:00:21 +0200] "GET /favicon.ico HTTP/2.0" 502 552 "https://wifi.nnxx.ninux.org/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36"
5.91.110.179 - - [22/May/2022:01:00:21 +0200] "GET /favicon.ico HTTP/2.0" 502 552 "https://wifi.nnxx.ninux.org/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36"
5.91.110.179 - - [22/May/2022:01:00:22 +0200] "GET /favicon.ico HTTP/2.0" 502 552 "https://wifi.nnxx.ninux.org/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36"
::::::::::::::
log/nginx.error.log
::::::::::::::

2022/05/22 01:00:21 [error] 1914#1914: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 5.91.110.179, server: wifi.nnxx.ninux.org, request: "GET / HTTP/2.0", upstream: "http://127.0.0.1:3030/", host: "wifi.nn
xx.ninux.org"
2022/05/22 01:00:21 [error] 1914#1914: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 5.91.110.179, server: wifi.nnxx.ninux.org, request: "GET /robots.txt HTTP/2.0", upstream: "http://127.0.0.1:3030/robots.
txt", host: "wifi.nnxx.ninux.org"
2022/05/22 01:00:21 [error] 1914#1914: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 5.91.110.179, server: wifi.nnxx.ninux.org, request: "GET /favicon.ico HTTP/2.0", upstream: "http://127.0.0.1:3030/favico
n.ico", host: "wifi.nnxx.ninux.org", referrer: "https://wifi.nnxx.ninux.org/"
2022/05/22 01:00:21 [error] 1914#1914: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 5.91.110.179, server: wifi.nnxx.ninux.org, request: "GET /favicon.ico HTTP/2.0", upstream: "http://127.0.0.1:3030/favico
n.ico", host: "wifi.nnxx.ninux.org", referrer: "https://wifi.nnxx.ninux.org/"
2022/05/22 01:00:22 [error] 1914#1914: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 5.91.110.179, server: wifi.nnxx.ninux.org, request: "GET /favicon.ico HTTP/2.0", upstream: "http://127.0.0.1:3030/favico
n.ico", host: "wifi.nnxx.ninux.org", referrer: "https://wifi.nnxx.ninux.org/"
::::::::::::::
log/server.log
::::::::::::::

yarn run v1.22.19
$ node config/setup.js && node config/build-translations.js
Done in 54.13s.
[INFO 2022-05-22 01:00:37:037] Server started on port 3030
::::::::::::::
log/warn.log
::::::::::::::

My playbok is:

- hosts: CaptivePortal
  become: "{{ become | default('yes') }}"
  roles:
    - geerlingguy.certbot
    - openwisp-wifi-login-pages
  vars:
    # Captive Portal
    wifi_login_pages_domains: ["wifi.nnxx.ninux.org"]
    wifi_login_pages_ssl_cert: "/etc/letsencrypt/live/{{ inventory_hostname }}/fullchain.pem"
    wifi_login_pages_ssl_key: "/etc/letsencrypt/live/{{ inventory_hostname }}/privkey.pem"
      
    # certbot configuration
    certbot_auto_renew_minute: "20"
    certbot_auto_renew_hour: "5"
    certbot_create_if_missing: true
    certbot_auto_renew_user: "root"
    certbot_certs:
      - email: "openwisp....@gmail.com"
        domains:
          - "{{ inventory_hostname }}"

and files:

michele@mikytux:/git/new-server$ ls files/owlp_
owlp_i18n/          owlp_organizations/ 
michele@mikytux:/git/new-server$ ls files/owlp_*
files/owlp_i18n:
de.po  en.po  fur.po  it.po  ru.po  sl.po

files/owlp_organizations:
default  js



Il 16/05/22 14:00, Federico Capoano ha scritto:
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/CAAGgX6JOKH%3DpXLhKVufr3DZDiZc_qt_D_hcYFAtGTi-CL4eiRg%40mail.gmail.com.
-- 
Informativa Privacy - Ai sensi del D. Lgs n. 196/2003 (Codice Privacy) si precisa che le informazioni contenute in questo messaggio sono riservate e ad uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.

Privacy Information - This message, for the D. Lgs n. 196/2003 (Privacy Code), may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.

Michele Salerno

unread,
May 25, 2022, 1:45:19 PM5/25/22
to open...@googlegroups.com

No, i try bat not working.

I try yarn check on direcotry of wifi-login-pages and i have this error:
I installed wifi-login-pages with role ansible.

root@controller:wifi-login-pages # yarn check
yarn check v1.22.19
warning "@babel/helper-create-class-features-plugin#@babel/helper-annotate-as-pure@^7.14.5" could be deduped from "7.15.4" to "@babel/helper-anno...@7.15.4"
warning "@babel/helper-create-class-features-plugin#@babel/helper-replace-supers@^7.14.5" could be deduped from "7.15.4" to "@babel/helper-rep...@7.15.4"
warning "@babel/helper-create-class-features-plugin#@babel/helper-split-export-declaration@^7.14.5" could be deduped from "7.15.4" to "@babel/helper-split-ex...@7.15.4"
warning "@babel/helper-module-transforms#@babel/helper-replace-supers@^7.15.0" could be deduped from "7.15.4" to "@babel/helper-rep...@7.15.4"
warning "@babel/helper-module-transforms#@babel/helper-simple-access@^7.14.8" could be deduped from "7.15.4" to "@babel/helper-sim...@7.15.4"
warning "@babel/helper-module-transforms#@babel/helper-split-export-declaration@^7.14.5" could be deduped from "7.15.4" to "@babel/helper-split-ex...@7.15.4"
warning "@babel/traverse#@babel/helper-hoist-variables@^7.14.5" could be deduped from "7.15.4" to "@babel/helper-hois...@7.15.4"
warning "@babel/traverse#@babel/helper-split-export-declaration@^7.14.5" could be deduped from "7.15.4" to "@babel/helper-split-ex...@7.15.4"
error "acorn" is wrong version: expected "8.4.1", got "7.4.1"
warning "autoprefixer#browserslist@^4.12.0" could be deduped from "4.16.7" to "browse...@4.16.7"
warning "@babel/polyfill#regenerator-runtime@^0.13.4" could be deduped from "0.13.9" to "regenerat...@0.13.9"
warning "@babel/preset-env#@babel/plugin-transform-spread@^7.14.6" could be deduped from "7.15.8" to "@babel/plugin-tran...@7.15.8"
warning "@babel/runtime#regenerator-runtime@^0.13.4" could be deduped from "0.13.9" to "regenerat...@0.13.9"
warning "copy-webpack-plugin#fast-glob@^3.2.4" could be deduped from "3.2.11" to "fast...@3.2.11"
warning "eslint#@babel/code-frame#@babel/highlight@^7.10.4" could be deduped from "7.14.5" to "@babel/high...@7.14.5"
warning "@babel/code-frame#@babel/highlight#@babel/helper-validator-identifier@^7.14.5" could be deduped from "7.14.9" to "@babel/helper-valida...@7.14.9"
warning "autoprefixer#browserslist#electron-to-chromium@^1.3.723" could be deduped from "1.3.808" to "electron-t...@1.3.808"
warning "autoprefixer#browserslist#node-releases@^1.1.71" could be deduped from "1.1.74" to "node-r...@1.1.74"
warning "enzyme#cheerio#tslib@^2.2.0" could be deduped from "2.3.0" to "ts...@2.3.0"
warning "ttag-cli#koa-router#http-errors@^1.7.3" could be deduped from "1.8.1" to "http-...@1.8.1"
warning "ttag-cli#koa#http-errors@^1.6.3" could be deduped from "1.8.1" to "http-...@1.8.1"
warning "@babel/core#@babel/helper-compilation-targets#browserslist@^4.16.6" could be deduped from "4.16.7" to "browse...@4.16.7"
warning "@babel/preset-env#@babel/plugin-transform-object-super#@babel/helper-replace-supers@^7.14.5" could be deduped from "7.15.4" to "@babel/helper-rep...@7.15.4"
warning "@babel/plugin-transform-async-to-generator#@babel/helper-remap-async-to-generator#@babel/helper-annotate-as-pure@^7.14.5" could be deduped from "7.15.4" to "@babel/helper-anno...@7.15.4"
warning "eslint#@babel/code-frame#@babel/highlight#@babel/helper-validator-identifier@^7.14.0" could be deduped from "7.14.9" to "@babel/helper-valida...@7.14.9"
warning "aria-query#@babel/runtime-corejs3#regenerator-runtime@^0.13.4" could be deduped from "0.13.9" to "regenerat...@0.13.9"
error "acorn-globals#acorn" not installed
error "espree#acorn" not installed
warning "@babel/helper-compilation-targets#browserslist#electron-to-chromium@^1.3.723" could be deduped from "1.3.808" to "electron-t...@1.3.808"
warning "@babel/helper-compilation-targets#browserslist#node-releases@^1.1.71" could be deduped from "1.1.74" to "node-r...@1.1.74"
warning "koa-body#co-body#raw-body@^2.2.0" could be deduped from "2.4.2" to "raw-...@2.4.2"
warning "@babel/plugin-proposal-unicode-property-regex#@babel/helper-create-regexp-features-plugin#@babel/helper-annotate-as-pure@^7.14.5" could be deduped from "7.15.4" to "@babel/helper-anno...@7.15.4"
error "espree#acorn-jsx" not installed
warning "cssnano-preset-default#postcss-colormin#browserslist@^4.16.6" could be deduped from "4.16.7" to "browse...@4.16.7"
warning "cssnano-preset-default#postcss-merge-rules#browserslist@^4.16.6" could be deduped from "4.16.7" to "browse...@4.16.7"
warning "postcss-colormin#browserslist#electron-to-chromium@^1.3.723" could be deduped from "1.3.808" to "electron-t...@1.3.808"
warning "postcss-colormin#browserslist#node-releases@^1.1.71" could be deduped from "1.1.74" to "node-r...@1.1.74"
warning "postcss-merge-rules#browserslist#electron-to-chromium@^1.3.723" could be deduped from "1.3.808" to "electron-t...@1.3.808"
warning "postcss-merge-rules#browserslist#node-releases@^1.1.71" could be deduped from "1.1.74" to "node-r...@1.1.74"
warning "babel-preset-jest#babel-plugin-jest-hoist#@types/babel__core@^7.0.0" could be deduped from "7.1.15" to "@types/babel...@7.1.15"
info Found 36 warnings.
error Found 4 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.


Il 16/05/22 14:00, Federico Capoano ha scritto:
Permission denied indicates a linux permission issue, do not change things manually, use the playbook:

Federico Capoano

unread,
May 26, 2022, 9:55:36 AM5/26/22
to open...@googlegroups.com
I recommend looking at the logs of the application and also look at the javascript browser console if you can find anything.

Did you define the organization YAML file correctly?

If you're in doubt, follow the install instructions in the README to run the app locally on your machine, play with it a little bit there and then try to deploy it again.

Federico

Michele Salerno

unread,
May 26, 2022, 4:15:06 PM5/26/22
to open...@googlegroups.com

Try open page on Chrome, Chromium, Firefox (debian11) and from smartphone android.
Black pages for all browsers.

I ran the playbook with the original organization cloned from https://github.com/openwisp/openwisp-wifi-login-pages
Copied in files with the direcotories owlp_i18n and owlp_organizations.
The logs are ok, the console reports this error:

A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.
To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.
Note that for performance reasons, only the first access to one of the properties is shown.
1 fonte
onloadwff.js:1

Attached is the output diff between the original org and my org.

My playbook is:

- hosts: CaptivePortal
  become: "{{ become | default('yes') }}"
  roles:
    - geerlingguy.certbot
    - openwisp-wifi-login-pages
  vars:
    # Captive Portal
    wifi_login_pages_domains: ["wifi.nnxx.ninux.org"]
    wifi_login_pages_ssl_cert: "/etc/letsencrypt/live/{{ inventory_hostname }}/fullchain.pem"
    wifi_login_pages_ssl_key: "/etc/letsencrypt/live/{{ inventory_hostname }}/privkey.pem"
      
    # certbot configuration
    certbot_auto_renew_minute: "20"
    certbot_auto_renew_hour: "5"
    certbot_create_if_missing: true
    certbot_auto_renew_user: "root"
    certbot_certs:
      - email: "openwisp....@gmail.com"
        domains:
          - "{{ inventory_hostname }}"



Il 26/05/22 15:55, Federico Capoano ha scritto:
-- 
Informativa Privacy - Ai sensi del D. Lgs n. 196/2003 (Codice Privacy) si precisa che le informazioni contenute in questo messaggio sono riservate e ad uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.

Privacy Information - This message, for the D. Lgs n. 196/2003 (Privacy Code), may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
diff.txt

Federico Capoano

unread,
May 26, 2022, 4:40:09 PM5/26/22
to open...@googlegroups.com
Did you define an organization as explained in the README of the wifi login pages app?

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.

Michele Salerno

unread,
May 26, 2022, 7:42:07 PM5/26/22
to open...@googlegroups.com
This is my config for testing
https://github.com/mikysal78/wifi.nnxx.ninux.org/blob/main/files/owlp_organizations/default/default.yml


Il 26/05/22 22:39, Federico Capoano ha scritto:
> Did you define an organization as explained in the README of the wifi
> login pages app?

Reply all
Reply to author
Forward
0 new messages