From 661b24a24ae10e55e60d578a65c22ab4d8a422fc Mon Sep 17 00:00:00 2001 From: SeanChangX Date: Thu, 9 Jan 2025 13:55:09 +0800 Subject: [PATCH 1/4] Add udev rules change request template --- .../udev-rules-change-request.yaml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/udev-rules-change-request.yaml diff --git a/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml b/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml new file mode 100644 index 0000000..5456699 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml @@ -0,0 +1,78 @@ +name: "Udev Rules Change Request" +description: "Template for requesting changes or updates to udev rules." +title: "[Udev Rules Change] " +labels: + - udev + - change-request + - needs-review +assignees: [] + +body: + - type: markdown + attributes: + value: | + ## Instructions + Please fill out the sections below to provide all necessary details for your udev rules change request. Ensure you have provided sufficient information for reviewers to understand and evaluate your request. + + ### Example Udev Rules + ``` + ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="1835fcde3dd3ec11931b5383a1ca919a", SYMLINK+="stm_00", MODE="0666" + ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", ATTRS{serial}=="066DFF343047463043161846", SYMLINK+="stm_01", MODE="0666" + ACTION=="add", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="0001", SYMLINK+="lidar", MODE="0666" + SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", SYMLINK+="esp32", MODE="0666" + ``` + + ### Explanation of Parameters + - **ACTION**: Specifies the action to trigger the rule, e.g., "add" for adding a device. + - **SUBSYSTEM**: Filters the type of device subsystem, e.g., "tty" for serial devices. + - **ATTRS{idVendor}**: Vendor ID of the device. + - **ATTRS{idProduct}**: Product ID of the device. + - **ATTRS{serial}**: Serial number of the device to uniquely identify it. + - **SYMLINK**: Creates a symbolic link to the device with the specified name. + - **MODE**: Sets the permissions of the device node, e.g., "0666" for read/write access for all users. + + - type: input + id: requestor + attributes: + label: "Requesting Software Group" + description: "Your group requesting the change." + placeholder: "e.g., Localization" + validations: + required: true + + - type: textarea + id: change_description + attributes: + label: "Change Description" + description: "Describe the purpose and context of the proposed udev rules change." + placeholder: "e.g., Update rules for new LIDAR device" + validations: + required: true + + - type: dropdown + id: tested + attributes: + label: "Has this been tested?" + description: "Confirm whether the change has been tested for functionality." + options: + - Yes + - No + validations: + required: true + + - type: input + id: priority + attributes: + label: "Startup Priority" + description: "Specify if this needs to start before or after certain processes." + placeholder: "e.g., Not specified" + validations: + required: true + + - type: textarea + id: additional_notes + attributes: + label: "Additional Notes" + description: "Provide any additional context or information." + placeholder: "Optional" + render: false From cfdf6c6210111f002b444be38bed4a617c80fd8f Mon Sep 17 00:00:00 2001 From: SeanChangX Date: Thu, 9 Jan 2025 13:58:33 +0800 Subject: [PATCH 2/4] Fix formatting in udev rules change request template --- .github/ISSUE_TEMPLATE/udev-rules-change-request.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml b/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml index 5456699..3052ebf 100644 --- a/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml +++ b/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml @@ -55,8 +55,8 @@ body: label: "Has this been tested?" description: "Confirm whether the change has been tested for functionality." options: - - Yes - - No + - "Yes" + - "No" validations: required: true @@ -66,7 +66,7 @@ body: label: "Startup Priority" description: "Specify if this needs to start before or after certain processes." placeholder: "e.g., Not specified" - validations: + validations: required: true - type: textarea From 4368a1870e760b0bb092ba0ea4375cffc42ffbb7 Mon Sep 17 00:00:00 2001 From: SeanChangX Date: Thu, 9 Jan 2025 14:06:11 +0800 Subject: [PATCH 3/4] Add change type selection and new udev rule input to issue template --- .../udev-rules-change-request.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml b/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml index 3052ebf..0212cef 100644 --- a/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml +++ b/.github/ISSUE_TEMPLATE/udev-rules-change-request.yaml @@ -49,6 +49,27 @@ body: validations: required: true + - type: dropdown + id: change_type + attributes: + label: "Change Type" + description: "Select the type of change you are requesting." + options: + - "Addition" + - "Modification" + - "Removal" + validations: + required: true + + - type: textarea + id: new_udev_rule + attributes: + label: "New Udev Rule" + description: "Provide the new udev rule to be added or changed." + placeholder: "e.g., ACTION==\"add\", SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"10c4\", ATTRS{idProduct}==\"ea60\", SYMLINK+=\"device_name\", MODE=\"0666\"" + validations: + required: true + - type: dropdown id: tested attributes: From ba82443921853704db9a0ccf8b39c4773a096366 Mon Sep 17 00:00:00 2001 From: SeanChangX Date: Thu, 9 Jan 2025 23:02:03 +0800 Subject: [PATCH 4/4] Update README with hostname convention and SSH setup instructions --- README.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 82e14fa..2b5b795 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,37 @@ To install the DIT-Scripts, clone the repository to your local machine and run t ## Issues -If you want to add new dependencies or other system changes, please open an issue. \ No newline at end of file +If you want to add new dependencies or other system changes, please open an issue. + +## Other Notes + +### A. How is the hostname of our robot's host named? +>The naming convention follows **DIT-[Year]-[Fixed IP Location]**. +> +>For example: If the hostname is **DIT-2025-10**, it indicates that this host belongs to **Eurobot 2025** and its IP is fixed at `192.168.X.10` (by default). Therefore, you can also address it directly using **mDNS** as `dit-2025-10.local`. + +### B. How to ssh without password? (optional) +```bash +# Generate a dedicated ssh_key on your local machine +ssh-keygen -t ed25519 -C "DIT-2025" +# After saving the local key pair, upload the public key to remote (robot) +# [ Friendly Reminder ] It is recommended to switch the files under the keys folder to read-only mode for the user using chmod 400 to ensure security +cat ~/.ssh/keys/DIT-2025_ed25519.pub | ssh username@remote_host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys" +``` +Refer to the [DigitalOcean Tutorial](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-on-ubuntu-20-04) for more information. + +### C. How to setup ssh_config? (recommended) +Edit the `~/.ssh/config` file on your local machine and add the following content: +```bash +Host DIT-2025-10 +Hostname dit-2025-10.local +User main +ForwardAgent yes +IdentityFile ~/.ssh/keys/DIT-2025_ed25519 +``` + +### D. How ssh forwarding works? (**Highly Recommended**) +Forwarding your personal ssh key to the remote host can help you access GitHub repos without leaking your personal ssh key to the robot. (**DO NOT SHARE YOUR PERSONAL SSH KEY!!!**) +```bash +ssh-add ~/.ssh/keys/[Your Personal SSH Key for GitHub] +```