Skip to content

harukizaemon/github-mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

For Synology NAS

Install Git

  1. Open Package Center.
  2. Search for "Git Server".
  3. Click Install.

Alternatively, use the Git package from SynoCommunity.

Enable SSH (required for Git)

  1. Go to Control Panel > Terminal & SNMP.
  2. Check Enable SSH service and set a port (default is 22).
  3. Click Apply.

Verify installation

  1. SSH to the NAS.
  2. Test the commands:
curl --version
ssh -V
git --version

Create a GitHub Personal Access Token

  1. Navigate to [https://github.com/settings/personal-access-tokens]
  2. Select Generate new token
  3. Give your token a descriptive name (e.g., "NAS Mirror")
  4. Set an expiration date
  5. Select the level of access
  6. Add a Contents permission set to Read-only
  7. Click Generate token
  8. Copy the token immediately and store it securely (e.g., in a password manager)

Update your .env file

cat > "$HOME/.env" << 'EOF'
GITHUB_USER=your_username
GITHUB_PAT=your_personal_access_token
EOF
chmod 600 "$HOME/.env"

Save the script to some location and make it executable

chmod 755 "mirror-github.sh"

Schedule with Task Scheduler in DSM

  1. Go to Control Panel > Task Scheduler > Create > Scheduled Task > User-defined script
  2. Give your task a descriptive name (e.g., "GitHub Mirror")
  3. Select an owner (the task will run as that user)
  4. Set the Run-command to /bin/sh "$HOME/bin/mirror-github.sh"
  5. Set schedule (e.g., daily)
  6. Decide if you want to receive emails when the script fails

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages