jahwag / ClaudeSync

ClaudeSync is a Python tool that automates the synchronization of local files with Claude.ai Projects
MIT License
321 stars 35 forks source link

Custom ssh keyfile name is not saved #82

Open Dakes opened 1 month ago

Dakes commented 1 month ago

Operating System

Linux, Arch

Python Version

3.12

ClaudeSync Version

0.6.1

Installation Type

New

Configuration

{
  "claude_api_url": "https://api.claude.ai/api",
  "compression_algorithm": "none",
  "file_categories": {
    "all_files": {
      "description": "All files not ignored",
      "patterns": [
        "*"
      ]
    },
    "all_source_code": {
      "description": "All source code files",
      "patterns": [
        "*.java",
        "*.py",
        "*.js",
        "*.ts",
        "*.c",
        "*.cpp",
        "*.h",
        "*.hpp",
        "*.go",
        "*.rs"
      ]
    },
    "build_config": {
      "description": "Build configuration files",
      "patterns": [
        "**/pom.xml",
        "**/build.gradle",
        "**/package.json",
        "**/setup.py",
        "**/Cargo.toml",
        "**/go.mod",
        "**/pyproject.toml",
        "**/requirements.txt",
        "**/*.tf",
        "**/*.yaml",
        "**/*.yml",
        "**/*.properties"
      ]
    },
    "production_code": {
      "description": "Production source code",
      "patterns": [
        "**/src/**/*.java",
        "**/*.py",
        "**/*.js",
        "**/*.ts",
        "**/*.vue"
      ]
    },
    "test_code": {
      "description": "Test source code",
      "patterns": [
        "**/test/**/*.java",
        "**/tests/**/*.py",
        "**/test_*.py",
        "**/*Test.java"
      ]
    },
    "uberproject_java": {
      "description": "Uberproject Java + Javascript",
      "patterns": [
        "**/src/**/*.java",
        "**/*.py",
        "**/*.js",
        "**/*.ts",
        "**/*.vue",
        "**/pom.xml",
        "**/build.gradle",
        "**/package.json",
        "**/setup.py",
        "**/Cargo.toml",
        "**/go.mod",
        "**/pyproject.toml",
        "**/requirements.txt",
        "**/*.tf",
        "**/*.yaml",
        "**/*.yml",
        "**/*.properties"
      ]
    }
  },
  "log_level": "INFO",
  "max_file_size": 32768,
  "prune_remote_files": true,
  "submodule_detect_filenames": [
    "pom.xml",
    "build.gradle",
    "package.json",
    "setup.py",
    "Cargo.toml",
    "go.mod"
  ],
  "two_way_sync": false,
  "upload_delay": 0.5
}

Steps to Reproduce

  1. delete old config in ~/.claudesync/
  2. Generate a new ed25519 private key (ssh-keygen -t ed25519 -C "my@email.com") in ~/.claudesync/
  3. run claudesync auth login and enter the path to your keyfile and watch it fail.

Description

This was my output. On both tries the login worked on the third attempt

Choose provider (claude.ai) [claude.ai]: 
A session key is required to call: https://api.claude.ai/api
To obtain your session key, please follow these steps:
1. Open your web browser and go to https://claude.ai
2. Log in to your Claude account if you haven't already
3. Once logged in, open your browser's developer tools:
   - Chrome/Edge: Press F12 or Ctrl+Shift+I (Cmd+Option+I on Mac)
   - Firefox: Press F12 or Ctrl+Shift+I (Cmd+Option+I on Mac)
   - Safari: Enable developer tools in Preferences > Advanced, then press Cmd+Option+I
4. In the developer tools, go to the 'Application' tab (Chrome/Edge) or 'Storage' tab (Firefox)
5. In the left sidebar, expand 'Cookies' and select 'https://claude.ai'
6. Locate the cookie named 'sessionKey' and copy its value. Ensure that the value is not URL-encoded.
Please enter your sessionKey: 
Please enter the expires time for the sessionKey (optional) [Tue, 19 Nov 2024 15:37:21 UTC]: 
* No supported SSH key found. RSA keys are no longer supported.
* Please generate an Ed25519 key using the following command:
ssh-keygen -t ed25519 -C "your_email@example.com"
Enter the full path to your new Ed25519 private key: /home/dakes/.claudesync/id_ed25519
* No supported SSH key found. RSA keys are no longer supported.
* Please generate an Ed25519 key using the following command:
ssh-keygen -t ed25519 -C "your_email@example.com"
Enter the full path to your new Ed25519 private key: /home/dakes/.claudesync/id_ed25519
* No supported SSH key found. RSA keys are no longer supported.
* Please generate an Ed25519 key using the following command:
ssh-keygen -t ed25519 -C "your_email@example.com"
Enter the full path to your new Ed25519 private key: /home/dakes/.ssh/claudesync
Successfully authenticated with claude.ai. Session key stored globally.

On a second attempt using the working key from the beginning it also worked on the third attempt.

Choose provider (claude.ai) [claude.ai]: 
A session key is required to call: https://api.claude.ai/api
To obtain your session key, please follow these steps:
1. Open your web browser and go to https://claude.ai
2. Log in to your Claude account if you haven't already
3. Once logged in, open your browser's developer tools:
   - Chrome/Edge: Press F12 or Ctrl+Shift+I (Cmd+Option+I on Mac)
   - Firefox: Press F12 or Ctrl+Shift+I (Cmd+Option+I on Mac)
   - Safari: Enable developer tools in Preferences > Advanced, then press Cmd+Option+I
4. In the developer tools, go to the 'Application' tab (Chrome/Edge) or 'Storage' tab (Firefox)
5. In the left sidebar, expand 'Cookies' and select 'https://claude.ai'
6. Locate the cookie named 'sessionKey' and copy its value. Ensure that the value is not URL-encoded.
Please enter your sessionKey: 
Please enter the expires time for the sessionKey (optional) [Tue, 19 Nov 2024 15:42:15 UTC]: 
* No supported SSH key found. RSA keys are no longer supported.
* Please generate an Ed25519 key using the following command:
ssh-keygen -t ed25519 -C "your_email@example.com"
Enter the full path to your new Ed25519 private key: /home/dakes/.ssh/claudesync
* No supported SSH key found. RSA keys are no longer supported.
* Please generate an Ed25519 key using the following command:
ssh-keygen -t ed25519 -C "your_email@example.com"
Enter the full path to your new Ed25519 private key: /home/dakes/.ssh/claudesync
* No supported SSH key found. RSA keys are no longer supported.
* Please generate an Ed25519 key using the following command:
ssh-keygen -t ed25519 -C "your_email@example.com"
Enter the full path to your new Ed25519 private key: /home/dakes/.ssh/claudesync
Successfully authenticated with claude.ai. Session key stored globally.

After collecting the output for this issue it seems apparent that it just isn't saving the file path. I thought it would just not accept my key after entering it, so I assumed the version is broken and continued to use 0.5.7, until opening this issue. But it just seems to ask for the key multiple times. Even when doing a claudesync push it asks for the key file twice. So maybe it should just save the used filename in the config directory. But the output asking for the key could probably be made a little bit more intuitive as well.

Logs

No response

github-actions[bot] commented 3 weeks ago

This issue has been marked as stale due to 14 days of inactivity. Please remove the stale label or comment to keep it open, otherwise, it will be closed in 3 days.

Dakes commented 3 weeks ago

bump

github-actions[bot] commented 1 week ago

This issue has been marked as stale due to 14 days of inactivity. Please remove the stale label or comment to keep it open, otherwise, it will be closed in 3 days.

Dakes commented 1 week ago

bump