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

ham adapter insecure mode #14

Closed
fighterzg6 opened this issue Nov 29, 2018 · 41 comments
Closed

ham adapter insecure mode #14

fighterzg6 opened this issue Nov 29, 2018 · 41 comments
Labels
enhancement New feature or request

Comments

@fighterzg6
Copy link

hi it is possible thats iobroker.ham starts in insecure mode??
i need this for alexa

@Apollon77
Copy link
Collaborator

Do you have more Details in „insecure mode“? What exactly is the issue with Alexa?

@fighterzg6
Copy link
Author

The plugin allows you to view and control some types of Homebridge accessories from your web browser.

To enable accessory control you must be running Homebridge in insecure mode:

homebridge -I
Insecure mode, as it's name suggests, is not secure. Anyone with network access to your Homebridge server port and pin will be able to control your accessories. Unless exposing the Homebridge port to the internet, this will generally not be a problem as access will be limited to people already on your local network. Remote access via a home hub (Apple TV, iPad, HomePod etc.) will still be secure. Enable at your own risk.

my plugin for home bridge need this,
my global homebridge starts with the command homebridge -I, then all plugins can access the data.

How can I adjust this in the adapter that he calls the homebridge with this option

@Apollon77
Copy link
Collaborator

Ok, need to check this. It is not about „starting with the parameter“ but setting that flag internally correctly.

@fighterzg6
Copy link
Author

OK thanks! if that works, that would be absolutely the bang

@fighterzg6
Copy link
Author

In deutsch würde das auch funktionieren

@fighterzg6
Copy link
Author

hallo, gibt es schon etwas neues??

@Apollon77
Copy link
Collaborator

Ja das ich viele Themen habe und schauen muss wann was kommt. Bitte abwarten

@Apollon77
Copy link
Collaborator

Bitte 1.0.0 vom Github testen. Github install, am besten noch ein "iobroker upload ham" hinterher und dann neu starten. Instanzkonfig sollte eine neue Einstellung für Aktivieren des Insecure Mode haben.

Bitte Testfeedback geben

@fighterzg6
Copy link
Author

wede ich morgen gleich teste. mir ist heute die sd karte im raspberry zerbrochen. morgen hab ich das system am laufen. vielen dank im voraus

@fighterzg6
Copy link
Author

2018-12-05 17:57:47.933 - info: ham.0 terminating
2018-12-05 17:57:47.953 - error: Caught by controller[0]: Error: The module '/usr/local/lib/node_modules/homebridge/node_modules/ed25519-hap/build/Release/ed25519.node'
2018-12-05 17:57:47.954 - error: Caught by controller[0]: was compiled against a different Node.js version using
2018-12-05 17:57:47.954 - error: Caught by controller[0]: NODE_MODULE_VERSION 67. This version of Node.js requires
2018-12-05 17:57:47.954 - error: Caught by controller[0]: NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
2018-12-05 17:57:47.954 - error: Caught by controller[0]: the module (for instance, using npm rebuild or npm install).
2018-12-05 17:57:47.954 - error: Caught by controller[0]: at Object.Module._extensions..node (module.js:681:18)
2018-12-05 17:57:47.954 - error: Caught by controller[0]: at Module.load (module.js:565:32)
2018-12-05 17:57:47.954 - error: Caught by controller[0]: at tryModuleLoad (module.js:505:12)
2018-12-05 17:57:47.955 - error: Caught by controller[0]: at Function.Module._load (module.js:497:3)
2018-12-05 17:57:47.955 - error: Caught by controller[0]: at Function.Module._load (/opt/iobroker/node_modules/mock-require/index.js:29:22)
2018-12-05 17:57:47.955 - error: Caught by controller[0]: at Module.require (module.js:596:17)
2018-12-05 17:57:47.955 - error: Caught by controller[0]: at require (internal/module.js:11:18)
2018-12-05 17:57:47.955 - error: Caught by controller[0]: at bindings (/usr/local/lib/node_modules/homebridge/node_modules/bindings/bindings.js:84:48)
2018-12-05 17:57:47.955 - error: Caught by controller[0]: at Object. (/usr/local/lib/node_modules/homebridge/node_modules/ed25519-hap/index.js:1:99)
2018-12-05 17:57:47.956 - error: Caught by controller[0]: at Module._compile (module.js:652:30)
2018-12-05 17:57:47.956 - error: host.raspberrypi instance system.adapter.ham.0 terminated with code 0 (OK)
2018-12-05 17:57:47.956 - info: host.raspberrypi Restart adapter system.adapter.ham.0 because enabled

so das kommt jetzt raus. bin am ende! mit meinem dau wissen komm ich nicht weiter

@Apollon77
Copy link
Collaborator

Hast du deine nodejs Version geändert? Führe mal "npm rebuild" in deinem globalen homebridge ordner aus bzw installiere neu. Hat mit dem Adapter an sich nichts zu tun! (sollte zumindestens nicht)

@fighterzg6
Copy link
Author

Na ich habe das ganze System neu aufgesetzt.
Erst Homebridge mit dieser Anleitung
https://smartapfel.de/homebridge/homebridge-installieren/
Dabei wurde Node 11.3.0 installiert.

Und dann hab ich den iobroker installiert.
Wie ich jetzt die Node Version wechsle müsstest du mir kurz erklären

Mit freundlichen Grüßen

@Apollon77
Copy link
Collaborator

Node so zu installieren ist in meinen Augen eine schlimme Idee ... sorry. Du hast es manuell installiert also musst Du es manuell wieder wegwerfen. Sorry.
Node besser installieren so: https://github.com/nodesource/distributions#debinstall

@fighterzg6
Copy link
Author

fighterzg6 commented Dec 11, 2018

Hab jetzt alles probiert, bekomme es einfach nicht hin , so startet der Adapter, aber sobald ich das Verzeichnis der Homebridge eingebe /usr/local/lib/node_modules/homebridge� geht nix mehr

@Apollon77
Copy link
Collaborator

Ja? Fehlt da Text?

@fighterzg6
Copy link
Author

wo?

@Apollon77
Copy link
Collaborator

Im letzten Post von Dir.

@Apollon77
Copy link
Collaborator

Aahhh mein Handy client hat bei dem komischen Zeichen oben abgeschnitten.

Was heisst "geht nichts mehr"? Mal bitte mit Debug starten bzew am besten an der Kommandozeile mit

DEBUG=* node /opt/iobroker/node_modules/iobroker-ham/main.js --force --logs

@Apollon77
Copy link
Collaborator

Any infos?

@Apollon77 Apollon77 added the enhancement New feature or request label Dec 17, 2018
@Apollon77
Copy link
Collaborator

Released in 1.0.0

@Apollon77
Copy link
Collaborator

Fuck ... ne blödsinn weil das DEBUG=* jetzt zuviel macht :-(

lass mal das "DEBUG=* am Anfang weg bitte.

Ansonsten hab ich nur das gefunden:

{ Error: EACCES: permission denied, open '/opt/iobroker/log/iobroker.2018-12-18.log'
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/opt/iobroker/log/iobroker.2018-12-18.log' }

Schau mal das Du den Befehl als der User startest unter dem auch iobroker läuft. Der kann nicht ins Log schreiben bei dem manuellen aufruf scheinbar

@fighterzg6
Copy link
Author

so jetzt aber

@fighterzg6
Copy link
Author

iobroker.2018-12-18.log

@fighterzg6
Copy link
Author

Und hast du etwas gefunden!?!

@Apollon77
Copy link
Collaborator

Es ist wieder ein node versions Unterschied. Als ob du global eine andere node Version nutzt als über iobroker.

Was sagt

node -v
nodejs -v
npm -v

Das globale homebridge hast du auch frisch kompiliert und gebaut? Ggf geh mal in das angegebene Verzeichnis wo das Problem ist und mach da ein

npm rebuild

@Apollon77
Copy link
Collaborator

Ps: sorry die Mail was wohl untergegangen das du was geschrieben hattest.

@fighterzg6
Copy link
Author

hallo, und gesundes neues!

also hab es jetzt soweit das der adapter startet und die plugins laufen, aber der ham adapter startet die homebridge nicht. ???

@Apollon77
Copy link
Collaborator

log? Screenshot vom Adapter Konfig?

@fighterzg6
Copy link
Author

Globaler Homebridge-Pfad /usr/local/lib/node_modules/homebridge/
Globaler Homebridge-Konfigurationsverzeichnispfad /var/homebridge/

er findet alle Geräte, startet auch die plugins, aber die homebridge selber nicht

@Apollon77
Copy link
Collaborator

Dann bitte Debug Log davon. Insecure steht auf was? Mal getestet ob das eine Auswirkung hat?

@fighterzg6
Copy link
Author

iobroker.2019-01-08.log

@Apollon77
Copy link
Collaborator

Hm ... Das Log zeigt

2019-01-08 12:12:54.310  - �[31merror�[39m: Caught by controller[3]: { Error: EACCES: permission denied, open '/var/homebridge/accessories/cachedAccessories'
2019-01-08 12:12:54.310  - �[31merror�[39m: Caught by controller[3]:     at Object.fs.openSync (fs.js:660:18)
2019-01-08 12:12:54.311  - �[31merror�[39m: Caught by controller[3]:     at Object.fs.writeFileSync (fs.js:1319:33)
2019-01-08 12:12:54.311  - �[31merror�[39m: Caught by controller[3]:     at LocalStorage.persistKeySync (/usr/local/lib/node_modules/homebridge/node_modules/node-persist/local-storage.js:457:12)
2019-01-08 12:12:54.311  - �[31merror�[39m: Caught by controller[3]:     at LocalStorage.setItemSync (/usr/local/lib/node_modules/homebridge/node_modules/node-persist/local-storage.js:275:14)
2019-01-08 12:12:54.311  - �[31merror�[39m: Caught by controller[3]:     at Server._updateCachedAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:544:20)
2019-01-08 12:12:54.311  - �[31merror�[39m: Caught by controller[3]:     at Server._teardown (/usr/local/lib/node_modules/homebridge/lib/server.js:549:8)
2019-01-08 12:12:54.311  - �[31merror�[39m: Caught by controller[3]:     at Object.end (/opt/iobroker/node_modules/iobroker.ham/lib/global-handler.js:265:16)
2019-01-08 12:12:54.312  - �[31merror�[39m: Caught by controller[3]:     at process.on (/opt/iobroker/node_modules/iobroker.ham/main.js:38:51)
2019-01-08 12:12:54.312  - �[31merror�[39m: Caught by controller[3]:     at process.emit (events.js:185:15)
2019-01-08 12:12:54.312  - �[31merror�[39m: Caught by controller[3]:   errno: -13,
2019-01-08 12:12:54.312  - �[31merror�[39m: Caught by controller[3]:   code: 'EACCES',
2019-01-08 12:12:54.312  - �[31merror�[39m: Caught by controller[3]:   syscall: 'open',
2019-01-08 12:12:54.312  - �[31merror�[39m: Caught by controller[3]:   path: '/var/homebridge/accessories/cachedAccessories' }
2019-01-08 12:12:54.312  - �[31merror�[39m: Caught by controller[4]: fs.js:660
2019-01-08 12:12:54.313  - �[31merror�[39m: Caught by controller[4]:   return binding.open(pathModule.toNamespacedPath(path),

Ist das schon behoben weil tritt beim zweiten Versuch nicht mehr auf?

Generell ist es aber kein Debug Log :-)
Unter Instanzen -> Expertenmodus -> Spalte Logstufe das Loglevel auf debug setzen.

Dann das Log bitte nochmal :-)

@fighterzg6
Copy link
Author

@Apollon77
Copy link
Collaborator

Can you please try is setting insecure mode or not makes any difference?

@fighterzg6
Copy link
Author

es ändert sich nichts

@fighterzg6
Copy link
Author

sagt immer noch dienst nicht gestartet

@Apollon77
Copy link
Collaborator

Und der Haken im Admin bei "Global mode" ist wirkloich gesetzt??

Bzw mach mal folgendes:
Im Admin unter "Objekte" den Expertenmodus an, alle filter weg (vor allem der wo an sich "state "steht. Dann nach system.adapter.ham.0 suchen und bei diesem "Ordner" rechts auf den Stuft Klicken. Dann gibts in dem Fenster was aufgeht ein "Raw (Experts only)" und da ist ein json. das würde ich gern mal sehen :-)

@fighterzg6
Copy link
Author

raw.pdf

@fighterzg6
Copy link
Author

bitteschön

@fighterzg6
Copy link
Author

Grüße, und was gefunden?

@Apollon77
Copy link
Collaborator

Noch keine Zeit gehabt. Im automatischen test tut alles ... ich kapiere es nicht. Einzige Idee die ich hätte: mach Du mal testweise nur einen deiner Platforms und schau ob es dann tut und finde ggf raus ob es damit was zu tun hat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants