├── .editorconfig ├── .github ├── FUNDING.yml ├── stale.yml └── workflows │ └── stale.yml ├── .gitignore ├── MANIFEST.in ├── README.md ├── babel.cfg ├── docs ├── Gemfile ├── _includes │ ├── footer.html │ └── navbar.html ├── _layouts │ └── base.html ├── googlec910c5c71f0ef021.html ├── index.html └── static │ ├── js │ └── helpers.js │ └── lib │ ├── bootstrap │ ├── css │ │ └── bootstrap.min.css │ └── js │ │ ├── bootstrap.bundle.min.js │ │ └── bootstrap.bundle.min.js.map │ ├── fontawesome │ ├── css │ │ ├── fontawesome.min.css │ │ └── solid.min.css │ └── webfonts │ │ ├── fa-brands-400.ttf │ │ ├── fa-brands-400.woff2 │ │ ├── fa-regular-400.ttf │ │ ├── fa-regular-400.woff2 │ │ ├── fa-solid-900.ttf │ │ ├── fa-solid-900.woff2 │ │ ├── fa-v4compatibility.ttf │ │ └── fa-v4compatibility.woff2 │ └── jquery │ └── js │ └── jquery-3.6.0.min.js ├── extras ├── README.txt └── googledrivefiles.md ├── octoprint_googledrivefiles ├── __init__.py ├── static │ └── js │ │ └── googledrivefiles.js └── templates │ └── googledrivefiles_settings.jinja2 ├── requirements.txt ├── screenshots ├── configuration_step1.png ├── configuration_step2.png ├── configuration_step3.png ├── configuration_step4.png ├── configuration_step5.png ├── configuration_step5a.png ├── configuration_step6.png ├── configuration_step7.png ├── patreon-with-text-new.png ├── paypal-with-text.png ├── screenshot_filelist.png ├── settings_download.png ├── settings_menu.png ├── settings_step1.png ├── settings_step10.png ├── settings_step11.png ├── settings_step12.png ├── settings_step13.png ├── settings_step2.png ├── settings_step3.png ├── settings_step4.png ├── settings_step5.png ├── settings_step6.png ├── settings_step7.png ├── settings_step8.png ├── settings_step8b.png └── settings_step9.png ├── setup.cfg ├── setup.py └── translations └── README.txt /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | end_of_line = lf 8 | charset = utf-8 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [**.py] 13 | indent_style = space 14 | indent_size = 4 15 | 16 | [**.js] 17 | indent_style = space 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [jneilliii] 2 | patreon: jneilliii 3 | custom: ['https://www.paypal.me/jneilliii'] 4 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 14 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - enhancement 8 | - bug 9 | # Label to use when marking an issue as stale 10 | staleLabel: stale 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | activity in 14 days. It will be closed if no further activity occurs in 7 days. 15 | # Comment to post when closing a stale issue. Set to `false` to disable 16 | closeComment: false 17 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: Mark Stale Issues 2 | on: 3 | workflow_dispatch: 4 | schedule: 5 | - cron: "0 0 * * *" 6 | # permissions: 7 | # actions: write 8 | jobs: 9 | stale: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/stale@v9 13 | with: 14 | repo-token: ${{ secrets.GITHUB_TOKEN }} 15 | stale-issue-message: 'This issue has been automatically marked as stale because it has not had activity in 14 days. It will be closed if no further activity occurs in 7 days' 16 | days-before-stale: 14 17 | days-before-close: 7 18 | stale-issue-label: 'stale' 19 | days-before-issue-stale: 14 20 | days-before-pr-stale: -1 21 | days-before-issue-close: 7 22 | days-before-pr-close: -1 23 | exempt-issue-labels: 'bug,enhancement' 24 | # - uses: actions/checkout@v4 25 | # - uses: gautamkrishnar/keepalive-workflow@v2 26 | # with: 27 | # use_api: true 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.swp 3 | .idea 4 | *.iml 5 | build 6 | dist 7 | *.egg* 8 | .DS_Store 9 | *.zip 10 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | recursive-include octoprint_googledrivefiles/templates * 3 | recursive-include octoprint_googledrivefiles/translations * 4 | recursive-include octoprint_googledrivefiles/static * 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Google Drive Files 2 | 3 | This plugin will sync a configured folder in your Google Drive locally to your OctoPrint instance. 4 | 5 | ![screenshot](screenshots/screenshot_filelist.png) 6 | 7 | ## Prerequisites 8 | 9 | ### Dependencies 10 | Due to upstream dependencies this plugin has been updated to only work in Python 3. You can either flash OctoPi 0.18 which ships with Python 3 standard or use the upgrade instructions [here](https://github.com/cp2004/Octoprint-Upgrade-To-Py3) to upgrade your instance. 11 | 12 | You may also need to install some system dependencies, specifically if you manually installed OctoPrint and didn't use the OctoPi image. Known dependencies that have been reported are `Rust` and `libssl-dev`. Use the commands to below to install them. 13 | 14 | ``` 15 | sudo apt install rustc 16 | sudo apt install libssl-dev 17 | ``` 18 | 19 | ### Create a Google OAuth App 20 | 1. Login to the [Google Developers Console](https://cloud.google.com/console)
21 | ![screenshot](screenshots/settings_step1.png) 22 | 2. Create a new project giving it a name of your choice.
23 | ![screenshot](screenshots/settings_step2.png) 24 | 3. In the sidebar on the left (via ![screenshot](screenshots/settings_menu.png)), select **APIs and Services** > **Dashboard** then at the top of the page click the button to `Enable APIS and Services`.
25 | ![screenshot](screenshots/settings_step3.png) 26 | 4. Enter drive in the search box at the top of the page and click `Google Drive API`.
27 | ![screenshot](screenshots/settings_step4.png) 28 | 5. Click the `Enable` button to allow our app to use the Google Drive API.
29 | ![screenshot](screenshots/settings_step5.png) 30 | 6. In the sidebar on the left, select **APIS and Services** > **Credentials**
31 | ![screenshot](screenshots/settings_step6.png) 32 | 7. Click `CONFIGURE CONSENT SCREEN` button at the top of the page.
33 | ![screenshot](screenshots/settings_step7.png) 34 | 8. Select the `External` user type if you do not use Google G Suite, otherwise you can select `Internal` and click `Create`.
35 | ![screenshot](screenshots/settings_step8.png) 36 | 9. If you don't publish your app you need to add the user email that you will be using to access Google Drive as a Test User.
37 | ![screenshot](screenshots/settings_step8b.png) 38 | 10. Click `Save and Continue` on the remaining pages for your consent screen, and then click `Back to Dashboard`.
39 | ![screenshot](screenshots/settings_step9.png) 40 | 11. In the sidebar on the left (via ![screenshot](screenshots/settings_menu.png)), select **APIs and Services** > **Credentials** again.
41 | ![screenshot](screenshots/settings_step10.png) 42 | 12. Click on `Create credentials` and select `OAuth client ID`.
43 | ![screenshot](screenshots/settings_step11.png) 44 | 13. Select `Web application` for application type and then enter a name (can be anything and does not really matter). Fill in the Authorized redirect URIs as `https://jneilliii.github.io/OctoPrint-GoogleDriveFiles/` and then click `Create`.
45 | ![screenshot](screenshots/settings_step12.png) 46 | 14. Click `OK` to the confirmation page and then use the download button ![screenshot](screenshots/settings_download.png) to save your client_secrets#####.json file.
47 | ![screenshot](screenshots/settings_step13.png) 48 | 15. Use the downloaded client_secrets#####.json file to upload into the plugin’s settings to authorize its access to your Google Drive as described in the Configuration section below. 49 | 50 | ## Setup 51 | 52 | Install via the bundled [Plugin Manager](https://docs.octoprint.org/en/master/bundledplugins/pluginmanager.html) 53 | or manually using this URL: 54 | 55 | https://github.com/jneilliii/OctoPrint-GoogleDriveFiles/archive/master.zip 56 | 57 | ## Configuration 58 | Once the Prerequisite steps above have been completed and you have downloaded your client_secrets.json file follow these steps to authorize the plugin to your newly created app. 59 | 60 | 1. Open OctoPrint's settings from the System menu at the top of the page and select `Google Drive Files` in the left-hand navigation menu.
61 | ![screenshot](screenshots/configuration_step1.png) 62 | 2. Fill in the name of the folder you'd like to sync with in your Google Drive (will be added if it doesn't exist), use the `Browse` button to select your downloaded client_secrets#####.json file and press the `Upload` button.
63 | ![screenshot](screenshots/configuration_step2.png) 64 | 3. An authentication URL will be generated, click the `Get Auth Code` button to open a new window and authorize your custom Google app.
65 | ![screenshot](screenshots/configuration_step3.png) 66 | 4. Log in to your Google account you want to give Drive access to. You will get a warning that the App isn't verified. This is normal as you have not submitted your custom app for verification by Google. You can choose to do that if you want but is not necessary for the operation of the plugin. Click the `Continue` button.
67 | ![screenshot](screenshots/configuration_step4.png) 68 | 5. Click the `Continue` button to retrieve your authentication code.
69 | ![screenshot](screenshots/configuration_step5.png) 70 | 6. Click the copy button to copy the authentication code to the clipboard.
71 | ![screenshot](screenshots/configuration_step5a.png) 72 | 7. Paste the code copied in the previous step into the **Auth Code** field and click `Authorize`.
73 | ![screenshot](screenshots/configuration_step6.png) 74 | 8. If everything went well then you will be presented with a successful message.
75 | ![screenshot](screenshots/configuration_step7.png) 76 | 77 | ## Get Help 78 | 79 | If you experience issues with this plugin or need assistance please use the issue tracker by clicking issues above. 80 | 81 | ## Additional Plugins 82 | 83 | Check out my other plugins [here](https://plugins.octoprint.org/by_author/#jneilliii) 84 | 85 | ## Sponsors 86 | - Andreas Lindermayr 87 | - [@TheTuxKeeper](https://github.com/thetuxkeeper) 88 | - [@tideline3d](https://github.com/tideline3d/) 89 | - [SimplyPrint](https://simplyprint.io/) 90 | - [Andrew Beeman](https://github.com/Kiendeleo) 91 | - [Calanish](https://github.com/calanish) 92 | - [Lachlan Bell](https://lachy.io/) 93 | - [Jonny Bergdahl](https://github.com/bergdahl) 94 | ## Support My Efforts 95 | I, jneilliii, programmed this plugin for fun and do my best effort to support those that have issues with it, please return the favor and leave me a tip or become a Patron if you find this plugin helpful and want me to continue future development. 96 | 97 | [![Patreon](screenshots/patreon-with-text-new.png)](https://www.patreon.com/jneilliii) [![paypal](screenshots/paypal-with-text.png)](https://paypal.me/jneilliii) 98 | 99 | No paypal.me? Send funds via PayPal to jneilliii@gmail.com 100 | 101 | You can use [this](https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=jneilliii@gmail.com) link too. But the normal PayPal fee will be deducted. 102 | 103 | -------------------------------------------------------------------------------- /babel.cfg: -------------------------------------------------------------------------------- 1 | [python: */**.py] 2 | 3 | [jinja2: */**.jinja2] 4 | silent=false 5 | extensions=jinja2.ext.autoescape, jinja2.ext.with_, jinja2.ext.do, octoprint.util.jinja.trycatch 6 | 7 | [javascript: */**.js] 8 | extract_messages = gettext, ngettext 9 | -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } 6 | 7 | # gem "rails" 8 | 9 | gem 'github-pages', ">=206", group: :jekyll_plugins -------------------------------------------------------------------------------- /docs/_includes/footer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jneilliii/OctoPrint-GoogleDriveFiles/226b303a3f2470bf710e377d788d18662d71d049/docs/_includes/footer.html -------------------------------------------------------------------------------- /docs/_includes/navbar.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_layouts/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {{ page.title }} 21 | 22 | 23 | {% include navbar.html %} 24 | 25 |
26 | {{ content }} 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/googlec910c5c71f0ef021.html: -------------------------------------------------------------------------------- 1 | google-site-verification: googlec910c5c71f0ef021.html -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Google Drive Files oAuth 3 | layout: base 4 | --- 5 |
6 |
7 |
8 |

Google Drive Files

9 | 10 |
11 | 12 | 13 |
14 | 17 |
18 |
19 |
20 | 34 | -------------------------------------------------------------------------------- /docs/static/js/helpers.js: -------------------------------------------------------------------------------- 1 | var copyToClipboard = function (text) { 2 | var temp = $("