myProxy
                                
                                 myProxy copied to clipboard
                                
                                    myProxy copied to clipboard
                            
                            
                            
                        MyProxy is an application that proxies requests to other servers
MyProxy ยท 
MyProxy is an alternative to Nginx that allows automatic domain provider integration, ssl support for all domains, dynamic port proxy and automatic git deployment.
MyProxy helps you quickly and easily:
- Connect to your Domain provider
- Set up A and CNAME records for your selected domains
- Create and serve SSL certificates for your selected domains
- Run an unlimited number of applications on your subdomains
Watch the following videos to understand how MyProxy works:
Setting up MyProxy on your server
Try it out?
Try it out on one of our open source partners providing a heroku alternative: https://freedomains.dev/
Why?
Setting up a server is hard - especially setting up DNS records, managing certificates, and deployment. So we setup to build a simple and easy-to-use app that helps us build applications quickly.
We are new to software engineering so if you find areas where this app could be improved, please let us know by creating an issue. We are excited to learn!
Also, we are currently seeking jobs. If your team needs software engineers, please reach out:
- Alberto Lopez - Available immediately
- David De Wulf - Open to new opportunities
- Rahul Kalra - Available immediately
- Sahil Kalra - UC San Diego senior, graduating June 2020
- Herman Wong - Open to new opportunities
Prerequisites
To use MyProxy, you need 3 things:
- A domain name. MyProxy uses acme.sh, so you would have to buy the domains from any of the DNS APIs listed there (includes all of the major providers like namecheap, goDaddy, etc.)
- A server's IP address that you have root access to. You can use your home server or get one from AWS EC2, DigitalOcean, GoogleCloud, etc.
- Docker needs to be installed on the server. MyProxy uses Docker to run deployed apps inside containers.
Installation and Usage
Server setup
We tested MyProxy on the AWS and Google Cloud platforms. If you use them, please follow the configurations and setup below to make sure MyProxy works well for you.
AWS Setup
You will need to configure the VM's firewall per table below during security group setup on AWS EC2 instance.
| Type | Protocol | Port Range | Source | 
|---|---|---|---|
| HTTP | TCP | 80 | 0.0.0.0/0 | 
| HTTPS | TCP | 443 | 0.0.0.0/0 | 
| SSH | TCP | 22 | 0.0.0.0/0 | 
| Custom TCP Rule | TCP | 3000 | 0.0.0.0/0 | 
| Custom TCP Rule | TCP | 9418 | 0.0.0.0/0 | 
Google Cloud Setup
- Target: specify target tags
- Target Tags: myproxy
- Source Filter: IP ranges
- Source IP: 0.0.0.0/0
- Specify Protocol and Ports: tcp: 3000
Update Google VMs to specify myproxy http-server https-server in network tags
Installation
- Connect to your server: ssh root@your-server-ip-address
- AWS Users Only  Change to root user sudo su rootand change to home foldercd ~
- Install Docker on your server, follow the instructions for your OS at the Docker docs.
- Clone the app: git clone https://github.com/garageScript/myProxy.git
- Go to the MyProxy folder: cd myProxy
- Run the setup script ./scripts/setup.sh
- Installs nodeJSandnpmif system does not have them.
- Enables firewall port 3000(for the admin page UI),80and443.
- Installs application dependencies
- For a complete list of commands the script runs, look here
- Run the App: ADMIN=YOUR_ADMIN_PASSWORD npm run server
- You can also run the app under your own defined port by setting a PORTenvironment variable
- Exit from server exit
Usage
- Go to your server url: http://your-server-ip-address:3000. You will be prompted to enter your admin password and your domain provider's API Key and Secret, find out how here
- All your domain names in that provider will show up. Click the setup button next to the domain you wish to setup (could take up to 5 minutes)
- After your domain is setup, you will be able to generate as many subdomain repositories as you want! To do that:
- Go to your server URL:  http://your-server-ip-address:3000
- Create a subdomain. IP and port are optional. You should see a git link that was created for you.
- git clonethe app, then build the app locally. Find out how in the Building Your Local App section below.
- When you are done, git push origin masterand watch your app run in production!
 
- Go to your server URL:  
Building-Your-Local-App
- In the terminal, run git clone <your fullDomain repo>to clone your app folder.
- Enter your repo cd <your fullDomain folder>
- Run npm init -y
- Run npm i express --save
- Run touch app.js
- Copy the following code into app.js.
const express = require('express');
const app = express();
app.use(express.static('public'));
app.get('/', (req, res) => {
  res.send('hello');
});
app.listen(process.env.PORT || 8123);
- Update the scriptssection inpackage.jsonwith your app entry point command, understart:"start": "node app.js"
- Run git add .
- Run git commit -m "Initial Commit"
- Run git push origin master
API Reference
Users can use Access Tokens to manage their domain mappings from a 3rd party server. See available endpoints
Development & Contribution
The following steps will guide you through how to setup your development environment to send pull requests or build your own custom features.
You need to install node and typescript
- Fork and clone the repository.
- Install dependencies: npm installoryarn
- Run the app: yarn startornpm run start
- You can also run the app under your own defined port by setting a PORTenvironment variable
Adding a new provider
If your company sells domain names and you want your service to be supported on MyProxy, make sure you integrate with acme.sh first.
Sample integration for Name.com that you can follow along.
- All implemented providers are listed in src/providers/index.ts. Add your service toproviderList, following the youracme.shintegration's naming convention.
- pathshould be the location of the file you create in the next step.
- Create a file that exports the following functions: getDomainsandsetRecord.
- Depending on your API in the previous step, you may need to create types. Types should be added to src/types/general.ts
You are done! Get a beer ๐บ
Before sending a Pull Request:
- Run npm run autofix: make sure there are no errors / warnings
License
MyProxy is MIT licensed
Contributors โจ
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!