{"id":13340698,"url":"https://github.com/sepehrsohrabii/SSR-Auto-VPN","last_synced_at":"2025-03-11T18:31:37.679Z","repository":{"id":151876095,"uuid":"595796548","full_name":"sepehrsohrabii/SSR-Auto-VPN","owner":"sepehrsohrabii","description":"This repo will be the most full automated script with python that will create Hetzner server, create users, and send them by email.","archived":false,"fork":false,"pushed_at":"2023-02-28T07:50:57.000Z","size":27,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T06:29:02.324Z","etag":null,"topics":["auto-script","auto-vpn","full-automated","hetzner","hetzner-cloud","sendmail","server-tunnel","shadowsocksr","vpn","vpn-server","vpn-tunnel"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sepehrsohrabii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-31T20:36:27.000Z","updated_at":"2023-07-18T20:08:08.000Z","dependencies_parsed_at":"2023-05-13T04:45:36.427Z","dependency_job_id":null,"html_url":"https://github.com/sepehrsohrabii/SSR-Auto-VPN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepehrsohrabii%2FSSR-Auto-VPN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepehrsohrabii%2FSSR-Auto-VPN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepehrsohrabii%2FSSR-Auto-VPN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepehrsohrabii%2FSSR-Auto-VPN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sepehrsohrabii","download_url":"https://codeload.github.com/sepehrsohrabii/SSR-Auto-VPN/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243090425,"owners_count":20234802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-script","auto-vpn","full-automated","hetzner","hetzner-cloud","sendmail","server-tunnel","shadowsocksr","vpn","vpn-server","vpn-tunnel"],"created_at":"2024-07-29T19:23:54.899Z","updated_at":"2025-03-11T18:31:37.666Z","avatar_url":"https://github.com/sepehrsohrabii.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Full Automate VPN\n\nThis repository aims to simplify the process of installing ShadowsockR for individuals or organizations with multiple users. The solution is specifically designed to work with Hetzner cloud virtual private servers (VPSs) and automates the entire process from start to finish. The system retrieves user names and email addresses from a pre-prepared Google Sheet, creates a Hetzner Cloud VPS in the location of your choice, connects to the server via SSH, installs ShadowsockR, and creates the users specified in the Google Sheet. Finally, the system sends each user their credentials via email through Gmail.\n\n-----\n## Requirements\n1. Google Account\n2. Hetzner Verified Account\n\n## Prerequisites\n\n1. Build a Google Sheet of your users in the following format:\n   https://docs.google.com/spreadsheets/d/1yKTZpSU0ds_N7HdYz8X0kkj4W4LFEWa9s3GqGxExvXw/edit?usp=sharing\n\n   (Make sure the sheet is accessible to all with the link.)\n\n2. Create an SSH key from this website and download the key files (file.key.pub and file.key).\n\n3. Go to Hetzner panel, add the SSH key, and make it the default.\n\n4. Create a new Hetzner API token.\n\n5. Get the Google credentials by following this link:\n   https://medium.com/@a.marenkov/how-to-get-credentials-for-google-sheets-456b7e88c430\n\n6. Download the Google credentials as a JSON file and name it `client_secret.json`.\n\n7. Configure your Google account and create an APP key.\n\n8. Create a `SECRET.py` file and paste the following code, replacing the parameters with your own:\n\n```python\nEMAIL_SENDER = \"your gmail address\"\nEMAIL_PASSWORD = \"your app key password\"\nHETZNER_API_KEY = \"hetzner API key\"\nHETZNER_SSH_KEY_NAME = \"Hetzner SSH key name\"\nSHADOWSOCKSR_PASSWORD = \"desired password\"\nMY_GOOGLE_SHEET_URL = \"google sheet share link\"\nSSH_PRIVATE_KEY_PASS = \"SSH private key password\"\n```\n-----\n## Running the Project\n\n1. Create a Python virtual environment by running the following command in the project directory:\n```bash\n  python -m venv .venv\n```\n\n2. Activate the environment with the following command:\n```bash\n  source .venv/bin/activate\n```\n3. Install the packages from `requirements.txt`:\n```bash\n  pip install -r requirements. txt\n```\n4. Run the project with the following command:\n```bash\n  python run.py\n```\n* Input the IP address of either the tunnel server or the main server, as needed. (The script will want it in the running process.)\n\n-----\n## Create a Tunnel Server if needed\nJust replate `TUNNEl_SERVER_IP` and `MAIN_SERVER_IP` with Your servers. and then run it in your tunnel server.\n```bash\nsysctl net.ipv4.ip_forward=1\niptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to-destination TUNNEl_SERVER_IP\niptables -t nat -A PREROUTING -j DNAT --to-destination MAIN_SERVER_IP\niptables -t nat -A POSTROUTING -j MASQUERADE\n```\n\n\n-----\n## Updates\n* Now you can configure the server which you had.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepehrsohrabii%2FSSR-Auto-VPN","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsepehrsohrabii%2FSSR-Auto-VPN","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepehrsohrabii%2FSSR-Auto-VPN/lists"}