Code Monkey home page Code Monkey logo

asdev's Introduction

asdev

asdev is a tool to ease with the development of ASUSTOR apps.

Currently asdev is experimental and only supports uploading APKs to update existing apps (i.e. submitting updates to App Central). It has not been tested for the creation of new applications.

asdev uses Google Chrome (or Chromium) to log on to the ASUSTOR Developer Corner and perform the necessary actions to update apps.

Features

  • List all apps (information and status)
  • Submit an updated APK to App Central
    • Reads changelog and description from APK and makes sure the fields are up-to-date
    • Re-applies all current app categories

Requirements

Installation

$ go get -u github.com/mafredri/asdev

Usage

The asdev update command is used to deploy one or more .apk's to the ASUSTOR Developer Corner. For authentication, the username and password must be provided via environment variables or command line flags.

$ export ASDEV_USERNAME="my-user"
$ export ASDEV_PASSWORD="my-password"
$ asdev update ./path/to/my.apk ./path/to/my-other.apk

OR:

$ asdev --username my-user --password my-password update ./path/to/my.apk ./path/to/my-other.apk

By default Chrome is run in headless mode, if you wish to see what asdev is doing, you can disable headless mode with the --no-headless command line flag.

NOTE: If you're not using macOS or using Chromium or Chrome Canary, you should provide the path to the browsers executable via the --browser cli flag (the environment variable ASDEV_BROWSER can also be used).

For more information, see --help:

$ asdev --help-long
usage: asdev [<flags>] <command> [<args> ...]

Flags:
  -h, --help               Show context-sensitive help (also try --help-long and
                           --help-man).
  -u, --username=USERNAME  Username (for login)
  -p, --password=PASSWORD  Password (for login)
      --browser="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
                           Path to Chrome or Chromium executable
      --no-headless        Disable (Chrome) headless mode
      --timeout=10m        Command timeout
  -v, --verbose            Verbose mode

Commands:
  help [<command>...]
    Show help.


  show categories
    Show all available categories


  list
    List and show status of all apps and app updates


  update [<flags>] <APKs>...
    Update apps by uploading one or more APK(s)

    -c, --category=CATEGORY ...  (NOT IMPLEMENTED) Change categorie(s)
    -t, --tag=TAG ...            (NOT IMPLEMENTED) Change tag(s)
    -b, --beta                   (NOT IMPLEMENTED) Beta app
    -i, --icon=ICON              (NOT IMPLEMENTED) Change icon (256x256)

  create --category=CATEGORY --tag=TAG [<flags>] <APKs>...
    (NOT IMPLEMENTED) Submit a new application by uploading one or more APK(s)

    -c, --category=CATEGORY ...  Set categorie(s)
    -t, --tag=TAG ...            Set tag(s)
    -b, --beta                   Set app to beta status
    -i, --icon=ICON              Set icon (256x256)

Preview

$ asdev list
+-------------+-------------+--------+------------+----------------------+---------------------+----------------+
| PACKAGE     | NAME        | ARCH   | VERSION    | CATEGORIES           | LAST UPDATE         | STATUS         |
+-------------+-------------+--------+------------+----------------------+---------------------+----------------+
| deluge      | Deluge      | x86-64 | 1.3.15-r1  | Download             | 2017-08-11 07:18:26 | Ready for sale |
| deluge      | Deluge      | arm    | 1.3.15-r1  | Download             | 2017-08-11 07:18:06 | Ready for sale |
| deluge      | Deluge      | i386   | 1.3.15-r1  | Download             | 2017-08-11 07:18:15 | Ready for sale |
| go          | Go          | x86-64 | 1.8.3      | Utility, Framework & | 2017-08-06 16:10:11 | In Review      |
|             |             |        |            | Library              |                     |                |
| go          | Go          | arm    | 1.8.3      | Utility, Framework & | 2017-08-06 16:27:53 | In Review      |
|             |             |        |            | Library              |                     |                |
| go          | Go          | i386   | 1.8.3      | Utility, Framework & | 2017-08-06 16:14:23 | In Review      |
|             |             |        |            | Library              |                     |                |
| jackett     | Jackett     | any    | 0.7.411    | Download             | 2016-10-08 12:11:33 | Ready for sale |
|             | Jackett     | any    | 0.7.1609   | Download             | 2017-08-06 13:54:49 | In Review      |
| qbittorrent | qBittorrent | x86-64 | 3.3.14     | Download             | 2017-08-11 07:18:36 | Ready for sale |
| qbittorrent | qBittorrent | arm    | 3.3.14     | Download             | 2017-08-11 07:18:54 | Ready for sale |
| qbittorrent | qBittorrent | i386   | 3.3.14     | Download             | 2017-08-11 07:19:12 | Ready for sale |
| radarr      | Radarr      | x86-64 | 0.2.0.453  | Download, Multimedia | 2017-03-13 21:02:51 | Ready for sale |
|             | Radarr      | x86-64 | 0.2.0.778  | Download, Multimedia | 2017-08-06 13:01:45 | In Review      |
| radarr      | Radarr      | i386   | 0.2.0.453  | Download, Multimedia | 2017-03-13 21:02:20 | Ready for sale |
|             | Radarr      | i386   | 0.2.0.778  | Download, Multimedia | 2017-08-06 13:01:41 | In Review      |
| radarr      | Radarr      | arm    | 0.2.0.453  | Download, Multimedia | 2017-03-13 17:59:53 | Ready for sale |
|             | Radarr      | arm    | 0.2.0.778  | Download, Multimedia | 2017-08-06 12:45:39 | In Review      |
| sonarr      | Sonarr      | arm    | 2.0.0.4645 | Download             | 2017-03-13 21:11:54 | Ready for sale |
|             | Sonarr      | arm    | 2.0.0.4855 | Download, Multimedia | 2017-08-06 13:51:06 | In Review      |
| sonarr      | Sonarr      | x86-64 | 2.0.0.4855 | Download, Multimedia | 2017-08-18 08:44:44 | Ready for sale |
| sonarr      | Sonarr      | i386   | 2.0.0.4855 | Download, Multimedia | 2017-08-18 08:44:23 | Ready for sale |
| tmux        | tmux        | arm    | 2.5.0      | Utility              | 2017-08-07 01:03:32 | In Review      |
| tmux        | tmux        | x86-64 | 2.5.0      | Utility              | 2017-08-07 01:03:59 | In Review      |
| tmux        | tmux        | i386   | 2.5.0      | Utility              | 2017-08-07 01:03:48 | In Review      |
+-------------+-------------+--------+------------+----------------------+---------------------+----------------+

asdev's People

Contributors

mafredri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

thaspius

asdev's Issues

Support creating new apps

Arguably, the savings in automating app creation is not much, but it's still a multi-step process. It would be nice to support it.

I've documented the steps:

Step 1: Upload APK

  1. Open: http://developer.asustor.com/app/upload
  2. Add apk: #appFile (input)
  3. Set beta status?: Check #is_beta (checkbox)
  4. Submit: #mainform (form)

Step 2: Submit APK

  1. Fill out mandatory info:
    • Tags are required: #tags_en_US (input)
  2. Fill out optional info:
    • Add categories?: Select options for #category_id
  3. Submit: #mainform (form)
  4. Check new app ID (APP_ID)

Step 3: Update icon

  1. Load: http://developer.asustor.com/app/updateLargeIcon?id=APP_ID
  2. Add icon to #large_icon (input)
  3. Submit form (name): FileForm
    • Or via button: .form-submit

Step 4: Edit info

  1. Load: http://developer.asustor.com/app/editMultilang?id=APP_ID
  2. Fill textarea: #license_en_US (if license is present)

Step 5: Add screenshot

  1. Load: http://developer.asustor.com/app/editScreenshot?id=APP_ID
  2. Add screenshot to input (name): app_screenshot
  3. Submit form, button has value "Upload"

Step 6: Final (submit for review)

  1. Load: http://developer.asustor.com/app/submitReview?id=APP_ID
  2. Done

Detect apps that are in review (or bypass)

We cannot submit an app update when a previous version of the app is in review.

Currently asdev just exists with the following (unhelpful) message:

2017/08/06 18:07:44 cdp.DOM: SetFileInputFiles: rpc error: Could not find node with given id (code = -32000)

It's not working because the dev corner redirects us away from the update page (via JavaScript).

Instead we should avoid trying to update an app that is already in review.

It would also be possible to prevent the JavaScript redirect, but I'm not sure of the repercussions for ASUSTOR, I will need to check with them if this is OK, in which case we could override an update ourselves.

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.