GithubHelp home page GithubHelp logo

thomasgassmann / mycloud-cli Goto Github PK

View Code? Open in Web Editor NEW
7.0 5.0 0.0 1.05 MB

Swisscom myCloud CLI

License: MIT License

Python 98.02% JavaScript 1.50% Dockerfile 0.49%
swisscom swisscom-developer cloud python swisscom-mycloud cli mycloud

mycloud-cli's Introduction

Swisscom myCloud CLI

THIS PROJECT IS NO LONGER ACTIVELY MAINTAINED

Swisscom myCloud CLI is a command line utility to manage all your data stored on Swisscom myCloud. To achieve this, it uses the public Swisscom myCloud API.

Requirements

Any Keyring Backend comptatible with the keyring package is required in order to store the credentials for myCloud.

Usage

Docker

docker run -it mycloud-cli

Manual Installation

First, make sure chromium and chromedriver are installed and in your $PATH.

To install or upgrade myCloud CLI via pip, run:

python3 -m pip install --user --upgrade mycloud-cli

After installing myCloud CLI make sure to add the certificates for mitmproxy to your CA in your OS / Chromium. Run:

mycloud auth cert

to download the required certificate.

Authenticate

To use myCloud CLI, run mycloud [command]. Then authenticate yourself with your username and password using:

mycloud auth login

To get a list of all available commands, run:

mycloud -h

WebDAV

myCloud CLI includes a basic WebDAV Proxy out of the box.

To run it, first configure the credentials for the WebDAV server using:

mycloud config webdav

Then start the server using:

mycloud webdav --host ip --port port

Setup local environment

First, clone the repository:

git clone https://github.com/thomasgassmann/mycloud-cli

Then install all dependencies via pipenv:

cd mycloud-cli
export PIPENV_VENV_IN_PROJECT="enabled"
pipenv install --python 3.7
pipenv shell

Then run python -m mycloud auth cert to install the certificates as described in the Installation section.

mycloud-cli's People

Contributors

dependabot[bot] avatar thomasgassmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mycloud-cli's Issues

Use asyncio for requests

The asyncio library should be used instead of threading when making requests to myCloud or doing other IO operations.

Check possibility to use LFS

Check possibility to use the LFS endpoint to upload bigger files.
Notes on API:

POST https://storage.prod.mdl.swisscom.ch/lfs
POST https://storage.prod.mdl.swisscom.ch/lfs/[id]/[partIndex]

Add CI/CD

Add continuous integration / continuous delivery

Linting

Add pylint and solve all linting errors.

Simplify settings

  • Store all settings including constants in one file
  • Make settings easily editable for user
  • Use only one configuration file

Add support for ZIP download

Add support to download files / directories in a zipped format using the API provided at:
POST https://storage.prod.mdl.swisscom.ch/jobs/zip

Don't force user to use custom versioning

The user should not be forced to use the custom versioning style with the mycloud_metadata.json file. The module for handling these things should either be removed or made optional via a flag or a subcommand.

Support trash

Support putting files into trash by using:
PUT https://storage.prod.mdl.swisscom.ch/trash/items

Add WebDAV proxy

Add a command to run the myCloud CLI in a WebDAV proxy mode. The myCloud CLI could for example start a daemon that would provide a WebDAV endpoint to other applications. The myCloud CLI would then "translate" all incoming WebDAV requests to myCloud.
This would also allow mounting your myCloud Drive via davfs2.

Add unit tests

Add unit tests for features in myCloud CLI and mock all corresponding endpoints.

Investigate moving files

Check the possibility to the move API to move files, instead of using the rename API:
https://storage.prod.mdl.swisscom.ch/commands/move

Add command to display sessions

Add a command to the myCloud CLI, which will allow displaying sessions via the following API:
GET https://identity.prod.mdl.swisscom.ch/sessions?nocache=time

Allow for easier authentication

Instead of having to specify the username each time, allow the username to be written into a file and defaulted. Whenever running the myCloud CLI, prompt the user to enter his/her password without displaying it.

Remove token config file

Remove the token config file, since it stores the myCloud token and any other program could potentially access it.

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.