Giter Site home page Giter Site logo

azure-mount-ftp-webapps-as-curlftpfs's Introduction

azure-mount-ftp-webapps-as-curlftpfs

This code will use the Azure API to mount all your webapps as mounts in /mnt/

What it does?

For Example, if you have 3 webapps on Azure.

www-web1-com www-web2-com www-web3-com

running this python script, with the correct credentials will mount automaticly for you.

/mnt/www-web1-com /mnt/www-web2-com /mnt/www-web3-com

We wrote this script alongside our Wordpress WP-CLI Python script so you can use a single server to run WP-CLI against multiple instances of wordpress running on webapps.

Using it

1)

Use the following repos to install the Python SDK for Azure

https://github.com/Azure-Samples/app-service-web-python-manage https://github.com/Azure/azure-sdk-for-python

2)

Clone this repo to somewhere

sudo git clone https://github.com/landscapeinstitute-bot/azure-mount-ftp-webapps-as-curlftpfs.git

3)

Install curlftpfs sudo apt-get install curlftpfs

4)

Create a new app in Azure Directory Use the following for details https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal

5)

now edit the azure-mount-all-webapps.py file and enter the following information

resource_group_name = Your Resource Group Name subscription_id = Your Subscription ID, found under azure portal / subscriptions client_id = In Azure Portal, enter your client/app id secret = Your App Secret tenant = Your Tenant ID (https://docs.microsoft.com/en-us/onedrive/find-your-office-365-tenant-id) ftp_username = Your master FTP username set in webapps for ALL your webapps (this comes before the individual username for each app) ftp_password = Your password for your FTP

6) Run sudo python azure-mount-all-webapps.py

Finishing up + Protection

You should now have all your sites mounted in /mnt/ only accessable by root. to protect this script, make it readable only by root

This script contains clear text copies of important details. You should protect it.

sudo chown root:root /path/to/script sudo chmod 700 /path/to/script

Do not recomend running anything like this as non-root. Use this to then run scripts against your sites.

If correct, non-root users should have no access to the scripts, or the sites.

azure-mount-ftp-webapps-as-curlftpfs's People

Contributors

landscapeinstitute-bot avatar li-louisvarley avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.