Skip to content

Instantly share code, notes, and snippets.

@siddMahen
Last active June 8, 2020 13:36
Show Gist options
  • Select an option

  • Save siddMahen/cf8689fe19e239536a7e946825b07f7f to your computer and use it in GitHub Desktop.

Select an option

Save siddMahen/cf8689fe19e239536a7e946825b07f7f to your computer and use it in GitHub Desktop.

Revisions

  1. siddMahen revised this gist Jun 8, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions instr.md
    Original file line number Diff line number Diff line change
    @@ -166,3 +166,5 @@ Started TaskList: Start Meteor
    [ravivakil.org] - Verifying Deployment
    [ravivakil.org] - Verifying Deployment: SUCCESS
    ```

    The `MAIL_URL` is set to a dummy value; a working Postfix server is also running on this machine (it is connected to Amazon's mail service), but I'd like to use Amazon's SMTP server directly.
  2. siddMahen revised this gist Jun 8, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion instr.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ Setup: Ubuntu 14.04 Lightsail instance with static IP address, DNS type A record
    5. Download Coauthor via git by running `$ cd ~ && git clone https://github.com/edemaine/coauthor.git`. Also create a build directory for later: `$ cd ~ && mkdir coauthor-build`
    6. Setup SSL certificates by following the instructions here: https://certbot.eff.org/lets-encrypt/ubuntuxenial-other
    7. Enter the deploy directory by running `$ cd ~/coauthor/.deploy`
    8. Modify the `mup.js` file so it is identical to the following:
    8. Modify the `mup.js` file so it looks like:
    ```
    module.exports = {
    servers: {
    @@ -78,6 +78,7 @@ module.exports = {
    };
    ```
    9. Run `sudo mup setup`

    Output:
    ```
    Started TaskList: Setup Docker
    @@ -126,6 +127,7 @@ Next, you should run:
    mup deploy
    ```
    10. Run `mup deploy`

    Output (edited for brevity)
    ```
    > Running hook default.deploy "npm install"
  3. siddMahen revised this gist Jun 8, 2020. 1 changed file with 92 additions and 8 deletions.
    100 changes: 92 additions & 8 deletions instr.md
    Original file line number Diff line number Diff line change
    @@ -3,12 +3,13 @@
    Setup: Ubuntu 14.04 Lightsail instance with static IP address, DNS type A record linking the static IP to domain name (ravivakil.org)

    1. SSH into the server by running `$ ssh -i /path/to/private/key [email protected]`
    2. Install node.js, version 12.x.x (see https://github.com/nodesource/distributions/blob/master/README.md) by running `$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -` followed by `$ sudo apt-get install -y nodejs`
    3. Download meteor by running `$ curl https://install.meteor.com/ | sh`
    4. Download Coauthor via git by running `$ cd ~ && git clone https://github.com/edemaine/coauthor.git`. Also create a build directory for later: `$ cd ~ && mkdir coauthor-build`
    5. Setup SSL certificates by following the instructions here: https://certbot.eff.org/lets-encrypt/ubuntuxenial-other
    6. Enter the deploy directory by running `$ cd ~/coauthor/.deploy`
    7. Modify the `mup.js` file so it is identical to the following:
    2. Securely move the private key onto the server (is this safe?) `$ scp -i /path/to/private/key /path/to/private/key [email protected]:home/ubuntu/`
    3. Install node.js, version 12.x.x (see https://github.com/nodesource/distributions/blob/master/README.md) by running `$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -` followed by `$ sudo apt-get install -y nodejs`
    4. Download meteor by running `$ curl https://install.meteor.com/ | sh`
    5. Download Coauthor via git by running `$ cd ~ && git clone https://github.com/edemaine/coauthor.git`. Also create a build directory for later: `$ cd ~ && mkdir coauthor-build`
    6. Setup SSL certificates by following the instructions here: https://certbot.eff.org/lets-encrypt/ubuntuxenial-other
    7. Enter the deploy directory by running `$ cd ~/coauthor/.deploy`
    8. Modify the `mup.js` file so it is identical to the following:
    ```
    module.exports = {
    servers: {
    @@ -76,7 +77,90 @@ module.exports = {
    },
    };
    ```
    8. Run `sudo mup setup`
    9. Run `mup deploy`
    9. Run `sudo mup setup`
    Output:
    ```
    Started TaskList: Setup Docker
    [ravivakil.org] - Setup Docker
    [ravivakil.org] - Setup Docker: SUCCESS
    Started TaskList: Setup Meteor
    [ravivakil.org] - Setup Environment
    [ravivakil.org] - Setup Environment: SUCCESS
    Started TaskList: Setup Mongo
    [ravivakil.org] - Setup Environment
    [ravivakil.org] - Setup Environment: SUCCESS
    [ravivakil.org] - Copying Mongo Config
    [ravivakil.org] - Copying Mongo Config: SUCCESS
    Started TaskList: Start Mongo
    [ravivakil.org] - Start Mongo
    [ravivakil.org] - Start Mongo: SUCCESS
    Started TaskList: Setup proxy
    [ravivakil.org] - Setup Environment
    [ravivakil.org] - Setup Environment: SUCCESS
    [ravivakil.org] - Pushing the Startup Script
    [ravivakil.org] - Pushing the Startup Script: SUCCESS
    [ravivakil.org] - Pushing Nginx Config Template
    [ravivakil.org] - Pushing Nginx Config Template: SUCCESS
    [ravivakil.org] - Pushing Nginx Config
    [ravivakil.org] - Pushing Nginx Config: SUCCESS
    [ravivakil.org] - Cleaning Up SSL Certificates
    [ravivakil.org] - Cleaning Up SSL Certificates: SUCCESS
    [ravivakil.org] - Copying SSL Certificate Bundle
    [ravivakil.org] - Copying SSL Certificate Bundle: SUCCESS
    [ravivakil.org] - Copying SSL Private Key
    [ravivakil.org] - Copying SSL Private Key: SUCCESS
    [ravivakil.org] - Setup SSL Certificates for Domains
    [ravivakil.org] - Setup SSL Certificates for Domains: SUCCESS
    [ravivakil.org] - Configure Nginx Upstream
    [ravivakil.org] - Configure Nginx Upstream: SUCCESS
    Started TaskList: Start proxy
    [ravivakil.org] - Start proxy
    [ravivakil.org] - Start proxy: SUCCESS
    Next, you should run:
    mup deploy
    ```
    10. Run `mup deploy`
    Output (edited for brevity)
    ```
    > Running hook default.deploy "npm install"
    > [email protected] postinstall /home/ubuntu/coauthor
    > node node_modules/grunt/bin/grunt --gruntfile .Gruntfile.coffee
    ...
    Done.
    audited 357 packages in 6.768s
    4 packages are looking for funding
    run `npm fund` for details
    found 0 vulnerabilities
    Building App Bundle Locally
    Browserslist: caniuse-lite is outdated. Please run next command `npm update`
    Started TaskList: Pushing Meteor App
    [ravivakil.org] - Pushing Meteor App Bundle to the Server
    [ravivakil.org] - Pushing Meteor App Bundle to the Server: SUCCESS
    [ravivakil.org] - Prepare Bundle
    [ravivakil.org] - Prepare Bundle: SUCCESS
    Started TaskList: Configuring App
    [ravivakil.org] - Pushing the Startup Script
    [ravivakil.org] - Pushing the Startup Script: SUCCESS
    [ravivakil.org] - Sending Environment Variables
    [ravivakil.org] - Sending Environment Variables: SUCCESS
    Started TaskList: Start Meteor
    [ravivakil.org] - Start Meteor
    [ravivakil.org] - Start Meteor: SUCCESS
    [ravivakil.org] - Verifying Deployment
    [ravivakil.org] - Verifying Deployment: SUCCESS
    ```
  4. siddMahen revised this gist Jun 8, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instr.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ Setup: Ubuntu 14.04 Lightsail instance with static IP address, DNS type A record
    1. SSH into the server by running `$ ssh -i /path/to/private/key [email protected]`
    2. Install node.js, version 12.x.x (see https://github.com/nodesource/distributions/blob/master/README.md) by running `$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -` followed by `$ sudo apt-get install -y nodejs`
    3. Download meteor by running `$ curl https://install.meteor.com/ | sh`
    4. Download Coauthor via git by running `$ cd ~ && git clone https://github.com/edemaine/coauthor.git`. Also create a build directory for later: `$cd ~ && mkdir coauthor-build`
    4. Download Coauthor via git by running `$ cd ~ && git clone https://github.com/edemaine/coauthor.git`. Also create a build directory for later: `$ cd ~ && mkdir coauthor-build`
    5. Setup SSL certificates by following the instructions here: https://certbot.eff.org/lets-encrypt/ubuntuxenial-other
    6. Enter the deploy directory by running `$ cd ~/coauthor/.deploy`
    7. Modify the `mup.js` file so it is identical to the following:
  5. siddMahen revised this gist Jun 8, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instr.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ Setup: Ubuntu 14.04 Lightsail instance with static IP address, DNS type A record
    1. SSH into the server by running `$ ssh -i /path/to/private/key [email protected]`
    2. Install node.js, version 12.x.x (see https://github.com/nodesource/distributions/blob/master/README.md) by running `$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -` followed by `$ sudo apt-get install -y nodejs`
    3. Download meteor by running `$ curl https://install.meteor.com/ | sh`
    4. Download Coauthor via git by running `$ cd ~ && git clone https://github.com/edemaine/coauthor.git`
    4. Download Coauthor via git by running `$ cd ~ && git clone https://github.com/edemaine/coauthor.git`. Also create a build directory for later: `$cd ~ && mkdir coauthor-build`
    5. Setup SSL certificates by following the instructions here: https://certbot.eff.org/lets-encrypt/ubuntuxenial-other
    6. Enter the deploy directory by running `$ cd ~/coauthor/.deploy`
    7. Modify the `mup.js` file so it is identical to the following:
  6. siddMahen revised this gist Jun 8, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions instr.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    Setting up Coauthor on a new Lighsail instance
    # Setting up Coauthor on a new Lighsail instance

    Setup: Ubuntu 14.04 Lightsail instance with static IP address, DNS A record linking the static IP to
    Setup: Ubuntu 14.04 Lightsail instance with static IP address, DNS type A record linking the static IP to domain name (ravivakil.org)

    1. SSH into the server by running `$ ssh -i /path/to/private/key [email protected]`
    2. Install node.js, version 12.x.x (see https://github.com/nodesource/distributions/blob/master/README.md) by running `$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -` followed by `$ sudo apt-get install -y nodejs`
  7. siddMahen renamed this gist Jun 8, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. siddMahen created this gist Jun 8, 2020.
    82 changes: 82 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,82 @@
    Setting up Coauthor on a new Lighsail instance

    Setup: Ubuntu 14.04 Lightsail instance with static IP address, DNS A record linking the static IP to

    1. SSH into the server by running `$ ssh -i /path/to/private/key [email protected]`
    2. Install node.js, version 12.x.x (see https://github.com/nodesource/distributions/blob/master/README.md) by running `$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -` followed by `$ sudo apt-get install -y nodejs`
    3. Download meteor by running `$ curl https://install.meteor.com/ | sh`
    4. Download Coauthor via git by running `$ cd ~ && git clone https://github.com/edemaine/coauthor.git`
    5. Setup SSL certificates by following the instructions here: https://certbot.eff.org/lets-encrypt/ubuntuxenial-other
    6. Enter the deploy directory by running `$ cd ~/coauthor/.deploy`
    7. Modify the `mup.js` file so it is identical to the following:
    ```
    module.exports = {
    servers: {
    one: {
    host: 'ravivakil.org',
    username: 'ubuntu',
    pem: "/home/ubuntu/privatekey.pem"
    }
    },
    // Meteor server
    meteor: {
    name: 'coauthor',
    //path: '/home/ubuntu/coauthor',
    path: '../',
    servers: {
    one: {}
    },
    docker: {
    image: 'abernix/meteord:node-12-base',
    stopAppDuringPrepareBundle: false,
    },
    buildOptions: {
    serverOnly: true,
    buildLocation: '/home/ubuntu/coauthor-build'
    },
    env: {
    ROOT_URL: 'https://ravivakil.org',
    MAIL_URL: 'smtp://email-smtp.us-west-2.amazonaws.com:587',
    //MAIL_FROM: '[email protected]',
    MONGO_URL: 'mongodb://mongodb/meteor',
    MONGO_OPLOG_URL: 'mongodb://mongodb/local',
    NODE_OPTIONS: '--trace-warnings'
    },
    deployCheckWaitTime: 200,
    deployCheckPort: 80,
    enableUploadProgressBar: true
    },

    // Mongo server
    mongo: {
    oplog: true,
    port: 27017,
    servers: {
    one: {},
    },
    },

    // Reverse proxy for SSL
    proxy: {
    domains: 'ravivakil.org',
    ssl: {
    crt: '/etc/letsencrypt/live/ravivakil.org/fullchain.pem',
    key: '/etc/letsencrypt/live/ravivakil.org/privkey.pem',
    forceSSL: true,
    },
    clientUploadLimit: '0', // disable upload limit
    nginxServerConfig: '../.proxy.config',
    },

    // Run 'npm install' before deploying, to ensure packages are up-to-date
    hooks: {
    'pre.deploy': {
    localCommand: 'npm install'
    }
    },
    };
    ```
    8. Run `sudo mup setup`
    9. Run `mup deploy`