Error when trying to set repeater identity via key file (docker install) #115

Closed
opened 2026-10-27 09:33:58 +01:00 by adam · 1 comment
Owner

I am struggling bigtime to set the repeater identity key based on the key file value. I'd like to keep the node identity consistent with what I've been using if at all possible!

I'm using docker with the following config:

services:
  openhop-repeater:
    image: openhop/openhop-repeater:main
    container_name: openhop-repeater
    restart: unless-stopped
    ports:
      - 8000:8000
    devices:
      - /dev/serial/by-id/usb-RAKwireless_WisCore_RAK4631_Board_DEC74977445A6206-if00:/dev/kiss-radio
    # USB DEVICE PERMISSIONS
    group_add:
      # Dialout group id for raspberry pi ACMO devices
      - 166
      - plugdev
    volumes:
      - ./openhop.config.yaml:/etc/openhop_repeater/config.yaml
      - ./repeater.key:/etc/openhop_repeater/identity.key
      - ./openhop_data:/var/lib/openhop_repeater

and my configuration for that section looks like this:

  # Path to identity file (public/private key)
  # If not specified, a new identity will be generated
  identity_file: /etc/openhop_repeater/identity.key

  # Identity key (alternative to identity_file)
  # Store the private key directly in config as binary (set by convert_firmware_key.sh)
  # If both identity_file and identity_key are set, identity_key takes precedence
  # identity_key: null

  # Owner information (shown to clients requesting owner info)
  owner_info: ""

The /repeater.key file contains only a 64 byte key value (128 characters). But I am getting the following error and cannot for the life of me figure out why!

openhop-repeater  | Failed to load identity key: Invalid key length: 96, expected 32 or 64

The key is obviously a private key so I don't want to share the value, but here's a printout of the file length to verify that I'm not crazy

megan@raspberrypi5:~/docker $ cat ./repeater.key | wc -c
128

(Edit: 96 makes me think it's appending 32 bytes to the end, which seems like it's maybe trying to generate more of the key? Might try running it with only the seed portion, but I'm not confident that's it, and if it is that's prob something that needs updating to make consistent with the documentation!)

(Edit 2: Nope that's not it! the key length it is getting definitely just isn't what's in the file. probably an encoding thing I'm missing)

I am struggling bigtime to set the repeater identity key based on the key file value. I'd like to keep the node identity consistent with what I've been using if at all possible! I'm using docker with the following config: ``` services: openhop-repeater: image: openhop/openhop-repeater:main container_name: openhop-repeater restart: unless-stopped ports: - 8000:8000 devices: - /dev/serial/by-id/usb-RAKwireless_WisCore_RAK4631_Board_DEC74977445A6206-if00:/dev/kiss-radio # USB DEVICE PERMISSIONS group_add: # Dialout group id for raspberry pi ACMO devices - 166 - plugdev volumes: - ./openhop.config.yaml:/etc/openhop_repeater/config.yaml - ./repeater.key:/etc/openhop_repeater/identity.key - ./openhop_data:/var/lib/openhop_repeater ``` and my configuration for that section looks like this: ``` # Path to identity file (public/private key) # If not specified, a new identity will be generated identity_file: /etc/openhop_repeater/identity.key # Identity key (alternative to identity_file) # Store the private key directly in config as binary (set by convert_firmware_key.sh) # If both identity_file and identity_key are set, identity_key takes precedence # identity_key: null # Owner information (shown to clients requesting owner info) owner_info: "" ``` The /repeater.key file contains only a 64 byte key value (128 characters). But I am getting the following error and cannot for the life of me figure out why! ``` openhop-repeater | Failed to load identity key: Invalid key length: 96, expected 32 or 64 ``` The key is obviously a private key so I don't want to share the value, but here's a printout of the file length to verify that I'm not crazy ``` megan@raspberrypi5:~/docker $ cat ./repeater.key | wc -c 128 ``` (Edit: 96 makes me think it's appending 32 bytes to the end, which seems like it's maybe trying to generate more of the key? Might try running it with only the seed portion, but I'm not confident that's it, and if it is that's prob something that needs updating to make consistent with the documentation!) (Edit 2: Nope that's not it! the key length it is getting definitely just isn't what's in the file. probably an encoding thing I'm missing) <!-- github-sync-id:4791228983 -->
adam closed this issue 2026-10-27 09:33:58 +01:00
Author
Owner

This was a user error/documentation misunderstanding, so going to close it out! Was able to resolve it.

The identity key file also expects the key to be in base64 format, so you can either convert it yourself or use the script to convert it!

In docker specifically, converting using the script involved:

  • commenting out the line that checks for sudo in the key conversion script (docker container can edit it's own files, typically, and running as root I ran into other issues)
  • copying the modified script file into the docker container alongside the configurations
  • executing the script by running a terminal within the docker container and grabbing the value of that to update the key file (though you could also just let it update the config files in the container for you and keep it running, I imagine!)

I don't think most people would need the above, but if you are a fellow (sad) windows user, there you go <3. Thanks for the awesome tool!

This was a user error/documentation misunderstanding, so going to close it out! Was able to resolve it. The identity key file also expects the key to be in base64 format, so you can either convert it yourself or use the script to convert it! In docker specifically, converting using the script involved: - commenting out the line that checks for sudo in the key conversion script (docker container can edit it's own files, typically, and running as root I ran into other issues) - copying the modified script file into the docker container alongside the configurations - executing the script by running a terminal within the docker container and grabbing the value of that to update the key file (though you could also just let it update the config files in the container for you and keep it running, I imagine!) I don't think most people would need the above, but if you are a fellow (sad) windows user, there you go <3. Thanks for the awesome tool! <!-- github-comment-id:4871723607 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/pyMC_Repeater#115