Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

  • Update argument parsing to accept IP addresses in addition to domain names
  • Add IP address detection logic (check if relay1/relay2 are IP addresses)
  • Generate 12-character alphanumeric lowercase username for IP addresses
  • Update AccountMaker.get_relay_account() to handle both domain names and IP addresses
  • For IP addresses, use dclogin scheme with proper parameters (p, v, ip, sp, ic, ss)
  • Pass linting checks
  • Address code review feedback: improve account reuse for IP addresses
  • Extract hardcoded port numbers and parameters to constants
  • Refactor: Move _is_ip_address to standalone function
  • Refactor: Extract common account lookup logic into _find_existing_account helper
  • Refactor: Merge username and password generation into single _generate_credentials function
  • Remove unnecessary URL encoding for password (only contains alphanumeric characters)
  • Test the changes with both domain names and IP addresses
Original prompt

look at the definition of dclogin in https://github.com/deltachat/interface


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI requested a review from hpk42 January 24, 2026 01:48
Copilot stopped work on behalf of hpk42 due to an error January 24, 2026 01:48
@hpk42
Copy link
Contributor

hpk42 commented Jan 24, 2026

@copilot look at the definition of dclogin in https://github.com/deltachat/interface and modify cmping.py to accept an IP address instead of a relay domain name. When an IP address is specified, use a 12 character long local name consisting of "a-z" and "0-9" characters. call the set_config_from_qr code with a "dclogin:" scheme like in this example: dclogin:lbcwz3c54s9n@172.238.97.168/?p=77d8rr624dkkxjedvv4g91i3&v=1&ip=993&sp=465&ic=3&ss=default

Copilot AI and others added 2 commits January 24, 2026 01:55
Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot look at the definition of dclogin in https://github.com/deltachat/interface and modify cmping.py to accept an IP address instead of a relay domain name. When an IP address is specified, use ...

Done! I've updated cmping.py to accept IP addresses and use the dclogin scheme as specified.

Key changes in commit a041f8b:

  • Added IP address detection using Python's ipaddress module
  • Generated 12-character alphanumeric lowercase usernames for IP addresses
  • Implemented dclogin scheme with the parameters from your example: dclogin:username@ip/?p=password&v=1&ip=993&sp=465&ic=3&ss=default
  • Account reuse logic checks the host part of configured addresses to reuse existing accounts for the same IP

The implementation follows the dclogin specification from deltachat/interface and maintains backward compatibility with domain-based configuration.

Copilot AI changed the title [WIP] Update definition of dclogin in codebase Add IP address support with dclogin scheme to cmping Jan 24, 2026
@hpk42
Copy link
Contributor

hpk42 commented Jan 24, 2026

@copilot move _is_ip_address out of the class into a single function

Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot move _is_ip_address out of the class into a single function

Done in commit 291c399. Moved _is_ip_address out of the AccountMaker class to a standalone function.

@hpk42
Copy link
Contributor

hpk42 commented Jan 24, 2026

@copilot simplify get_relay_account. refactor the common code like "for account in self.get_all_accounts" loop into a function and call it from both the "is ip_address" and "is not ip_address" branches

Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot simplify get_relay_account. refactor the common code like "for account in self.get_all_accounts" loop into a function and call it from both the "is ip_address" and "is not ip_address" branche...

Done in commit 18ba56a. Simplified get_relay_account by extracting the common account lookup loop into _find_existing_account helper method. The refactored code first checks for existing accounts (for both IP and domain cases), then only creates a new account if one isn't found.

@hpk42
Copy link
Contributor

hpk42 commented Jan 24, 2026

@copilot merge _generate_username and _generate_password into a single _generate_credentials function

Copilot AI and others added 2 commits January 24, 2026 11:22
Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
@hpk42 hpk42 closed this Jan 24, 2026
@hpk42 hpk42 deleted the copilot/update-dclogin-definition branch January 24, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants