GithubHelp home page GithubHelp logo

atom-community / sync-settings Goto Github PK

View Code? Open in Web Editor NEW
1.1K 16.0 105.0 2.13 MB

Synchronize all your settings and packages across atom instances

Home Page: https://atom.io/packages/sync-settings

License: MIT License

JavaScript 89.64% CoffeeScript 10.01% Less 0.35%

sync-settings's Introduction

Sync Settings for Atom

CI

Synchronize settings, keymaps, user styles, init script, snippets and installed packages across Atom instances.

Features

  • Sync Atom's and package settings
  • Sync installed packages
  • Sync user keymaps
  • Sync user styles
  • Sync user init script
  • Sync snippets
  • Sync user defined text files

Installation

$ apm install sync-settings or using the Install button from Atom.io.

Backup locations

By default your backup will be stored in a gist, but you may also install other location packages.

Some other locations:

Gist Setup

  1. Open Sync Settings configuration in Atom Settings.
  2. Create a new personal access token which has the gist scope and be sure to activate permissions: Gist -> create gists.
  3. Copy the access token to Sync Settings configuration or set it as an environmental variable GITHUB_TOKEN.
  4. Create a new gist:
  • The description can be left empty. It will be set when invoking the backup command the first time.
  • Use packages.json as the filename.
  • Put some arbitrary non-empty content into the file. It will be overwritten by the first invocation of the backup command
  • Save the gist.
  1. Copy the gist id (last part of url after the username) to Sync Settings configuration or set it as an environmental variable GIST_ID.

Disclaimer: GitHub Gists are by default public. If you don't want other people to easily find your gist (i.e. if you use certain packages, storing auth-tokens, a malicious party could abuse them), you should make sure to create a secret gist.

Alternative Sync Settings configuration using Atom's config.cson

  1. Click on Menu "Open Your Config" to edit Atom's config.cson
  2. Use these keys:
  "sync-settings":
    gistId: "b3025...88c41c"
    personalAccessToken: "6a10cc207b....7a67e871"

Cloning a backup to a fresh Atom install

  1. Install the package from the command line: apm install sync-settings
  2. Launch Atom passing in GITHUB_TOKEN and GIST_ID. For example:
GITHUB_TOKEN=6a10cc207b....7a67e871 GIST_ID=b3025...88c41c atom
  1. You will still need to make sure you add your gist id and github token to the Sync Settings configuration in Atom Settings OR set them as environment variables in your shell configuration.

Usage

Open the Atom Command Palette where you can search for the following list of commands.

Backup or restore all settings from the Packages menu or use one of the following commands:

  • sync-settings:backup
  • sync-settings:restore

View your online backup using the following command:

  • sync-settings:view-backup

Check the latest backup is applied:

  • sync-settings:check-backup

You can also fork existing settings from a different GitHub user using the following command:

  • sync-settings:fork
  • In the following input field enter the Gist ID to fork

Create a new backup:

  • sync-settings:create-backup

Delete the current backup:

  • sync-settings:delete-backup

Running the tests

  1. Create a new personal access token which has the gist scope and will be used for testing purposes.
  2. Export it with export GITHUB_TOKEN=YOUR_TOKEN
  3. Run apm test

Contributing

If you're going to submit a pull request, please try to follow the official contribution guidelines of Atom.

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Ensure tests are passing. See running-the-tests.
  4. Commit your changes (git commit -am 'Add some feature').
  5. Push to the branch (git push origin my-new-feature).
  6. Create new Pull Request.

See all contributors.

Location Service

Packages can provide a location service using Atom's Service's API

Example:

Add the keywords sync-settings and location and add the providedServices property to your package.json file.

// package.json
  ...
  "main": "./main.js",
  ...
  "keywords": [
    ...
    "sync-settings",
    "location"
  ],
  ...
  "providedServices": {
    "sync-settings-location": {
      "versions": {
        "1.0.0": "provideLocationService"
      }
    }
  },
  ...

Then add the provideLocationService function to your main.js file (where your activate function is for Atom to activate your package)

// main.js
  ...
  activate () {
    ...
  },

  provideLocationService () {
    return require('./locationService.js')
  },
  ...

Return an object that provides the functions for your service.

// locationService.js

module.exports = {
  /**
   * Get URL for the backup
   * @return {string} Backup URL. Return null if no URL exists
   */
  async getUrl () {
    ...
  },

  /**
   * Create new backup location
   * @return {Object} Returns empty object on success. Falsey value on silent error
   */
  async create () {
    ...
  },

  /**
   * Get backup files and time
   * @return {Object} Returns object with `files` and `time` on success. Falsey value on silent error
   */
  async get () {
    ...
    return {
      files: {
        'filename.txt': {
          content: '...'
        }
      },
      time: new Date().toISOString(), // ISO string, (e.g. 2020-01-01T00:00:00.000Z)
    }
  },

  /**
   * Delete backup
   * @return {Object} Returns empty object on success. Falsey value on silent error
   */
  async delete () {
    ...
  },

  /**
   * Update backup and get time
   * @param  {Object} files Files to update
   * @return {Object} Returns object with `time` on success. Falsey value on silent error
   */
  async update (files) {
    ...
    return {
      time: new Date().toISOString(),
    }
  },

  /**
   * Fork backup
   * @return {Object} Returns empty object on success. Falsey value on silent error
   */
  async fork () {
    ...
  },
}

sync-settings's People

Contributors

aminya avatar chibicode avatar dein0s avatar dependabot[bot] avatar dhq avatar dirk-thomas avatar dsnipe avatar github-actions[bot] avatar gitter-badger avatar groupsky avatar iampbernardo avatar ikngtty avatar jerone avatar jrop avatar kalkov avatar kusma avatar mehcode avatar olmokramer avatar renovate-bot avatar renovate[bot] avatar rigor789 avatar savagecore avatar semantic-release-bot avatar sirlancelot avatar solsend2l avatar tdolsen avatar timsims avatar uzitech avatar vaskort avatar ykpythemind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sync-settings's Issues

Uncaught SyntaxError: Unexpected token E

Actually not sure what's going on here... can I get some help on how to resolve this?

I put in my Gist Key and it doesn't seem to be complaining about that

[Enter steps to reproduce below:]

  1. Throws the error on upload

Atom Version: 0.208.0
System: Mac OS X 10.10.3
Thrown From: sync-settings package, v0.4.0

Stack Trace

Uncaught SyntaxError: Unexpected token E

At file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.html#%7B%22locationsToOpen%22%3A%5B%7B%7D%5D%2C%22bootstrapScript%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%2Fsrc%2Fwindow-bootstrap.js%22%2C%22resourcePath%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22includeDeprecatedAPIs%22%3Afalse%2C%22profileStartup%22%3Afalse%2C%22appVersion%22%3A%220.208.0%22%2C%22shellLoadTime%22%3A723%2C%22initialPaths%22%3A%5B%22atom%3A%2F%2Fconfig%22%5D%7D:1

SyntaxError: Unexpected token E
  at Object.parse (native)
  at ~/.atom/packages/sync-settings/lib/sync-settings.coffee:70:26
  at Object.proto.sendError (~/.atom/packages/sync-settings/node_modules/github/api/v3.0.0/index.js:32:13)
  at Object.self.(anonymous function).(anonymous function) [as edit] (~/.atom/packages/sync-settings/node_modules/github/index.js:359:33)
  at Object.module.exports.upload (~/.atom/packages/sync-settings/lib/sync-settings.coffee:63:27)
  at atom-workspace.<anonymous> (~/.atom/packages/sync-settings/lib/sync-settings.coffee:31:69)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:520:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:355:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:177:20)

Commands

  2x -0:19.4.0 sync-settings:upload (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "metrics",
      "background-tips"
    ],
    "themes": [
      "atom-dark-ui",
      "one-dark-syntax"
    ]
  },
  "sync-settings": {
    "personalAccessToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  }
}

Installed Packages

# User
sync-settings, v0.4.0
zentabs, v0.8.4

# Dev
No dev packages

Check for updated backup

If we store the last restored/created backup, we can then check on start if there is a newer backup and either restore it automatically or notify user about that. The git commit id should be enough to verify the backup.

Track usage

Some form of analytics (like google analytics provides for websites) to track usage and version distributions would be helpful. Not sure how the privacy should be approached - maybe a opt-on/opt-out setting.

Custom keybinding settings for packages didn't sync

I just set up Atom on my work machine, and noticed that I had to re-setup custom keybindings for certain packages because they did not carry over from my personal machine in the backup. Is this a bug? Is it a possibility?

Add "init.coffee", "atom.less"?

How about adding init.coffee and atom.less to the contents being synced? If there are reason why someone might not want that, maybe make it selectable?

Synchronize custom files too

Hi, right now it is only possible to synchronize predefined list of files. How about to let user to synchronize other files too? For example I use Project Manager which stores settings for project in project.cson and I would like to synchronize it too.

I am happy to add this, just want to know if you would be interested.

Uncaught SyntaxError: Unexpected token g

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.0
System: Mac OS X 10.10.3
Thrown From: sync-settings package, v0.5.0

Stack Trace

Uncaught SyntaxError: Unexpected token g

At file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.html#%7B%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22%2FUsers%2FAli%2FGithub%2FPersonal%2FSyntro%2Fsyntro%22%7D%5D%2C%22bootstrapScript%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%2Fsrc%2Fwindow-bootstrap.js%22%2C%22resourcePath%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22appVersion%22%3A%221.0.0%22%2C%22initialPaths%22%3A%5B%22%2FUsers%2FAli%2FGithub%2FPersonal%2FSyntro%2Fsyntro%22%5D%7D:1

SyntaxError: Unexpected token g
  at Object.parse (native)
  at /Users/Ali/.atom/packages/sync-settings/lib/sync-settings.coffee:99:24
  at Object.proto.sendError (/Users/Ali/.atom/packages/sync-settings/node_modules/github/api/v3.0.0/index.js:32:13)
  at /Users/Ali/.atom/packages/sync-settings/node_modules/github/api/v3.0.0/gists.js:180:29
  at callCallback (/Users/Ali/.atom/packages/sync-settings/node_modules/github/index.js:743:17)
  at ClientRequest.<anonymous> (/Users/Ali/.atom/packages/sync-settings/node_modules/github/index.js:809:17)
  at emitOne (events.js:77:13)
  at ClientRequest.emit (events.js:166:7)
  at TLSSocket.socketErrorListener (_http_client.js:254:9)
  at emitOne (events.js:77:13)
  at TLSSocket.emit (events.js:166:7)
  at net.js:933:16
  at process._tickCallback (node.js:357:13)

Commands

     -0:11.5.0 project-manager:toggle (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:02.9.0 sync-settings:backup (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "monokai"
    ],
    "disabledPackages": [
      "minimap",
      "pigments",
      "seti-icons",
      "close-on-left"
    ]
  },
  "sync-settings": {
    "personalAccessToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "gistId": "30a3d994410d8546da0a"
  }
}

Installed Packages

# User
Remote-FTP, v0.7.1
aligner-css, v1.2.0
aligner-php, v1.0.0
aligner-ruby, v1.4.0
aligner-scss, v1.0.1
angularjs, v0.3.0
autocomplete-php, v0.3.6
autocomplete-ruby, v0.1.0
color-picker, v2.0.7
file-icons, v1.5.8
hashrocket, v0.4.8
language-gherkin, v1.0.2
linter, v1.1.0
linter-clang, v2.26.1
linter-jshint, v0.1.7
linter-php, v0.0.15
linter-rubocop, v0.2.7
monokai, v0.14.0
project-manager, v1.15.10
remote-edit, v1.8.4
ruby-block, v0.3.4
sync-settings, v0.5.0
tree-view-breadcrumb, v0.6.0

# Dev
No dev packages

Extra files contents undefined

Today I tried uploading my settings with extra files defined. Aldo the files were created, the contents was undefined.

Support synchronizing binary files

On my settings, I have the setting "Extra Files" set to "bgs/command.jpg". The file exists, but when I try to backup my settings it fails with the following message:

error backing up data: {"message":"Validation Failed","errors": [{"resource":"Gist","code":"invalid","field":"files"}],"documentation_url":"https://developer.github.com/v3/gists/#edit-a-gist"} exports.HttpError {message: "{"message":"Validation Failed","errors":[{"resourc…ps://developer.github.com/v3/gists/#edit-a-gist"}", code: 422, toString: function, toJSON: function}

Atom 1.0.0
Sync Settings 0.5.0

Uncaught TypeError: Cannot read property 'getUserKeymapPath' of undefined

[Enter steps to reproduce below:]

  1. Installed plugin on a second machine
  2. Added access token and gist ID
  3. ran sync-download

Atom Version: 0.194.0 ⚠️ in 1.0 API Preview Mode ⚠️
System: Mac OS X 10.10.3
Thrown From: sync-settings package, v0.2.2

Stack Trace

Uncaught TypeError: Cannot read property 'getUserKeymapPath' of undefined

At /Users/matthias/.atom/packages/sync-settings/lib/sync-settings.coffee:96

TypeError: Cannot read property 'getUserKeymapPath' of undefined
  at /Users/matthias/.atom/packages/sync-settings/lib/sync-settings.coffee:96:41
  at /Users/matthias/.atom/packages/sync-settings/node_modules/github/api/v3.0.0/gists.js:342:17
  at callCallback (/Users/matthias/.atom/packages/sync-settings/node_modules/github/index.js:743:17)
  at IncomingMessage.<anonymous> (/Users/matthias/.atom/packages/sync-settings/node_modules/github/index.js:796:25)
  at emitNone (events.js:72:20)
  at IncomingMessage.emit (events.js:163:7)
  at _stream_readable.js:891:16
  at process._tickCallback (node.js:357:13)

Commands

  2x -0:51.3.0 sync-settings:download (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  },
  "sync-settings": {
    "personalAccessToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "gistId": "577155c3ef97b89b810d"
  }
}

Installed Packages

# User
sync-settings, v0.2.2

# Dev
No dev packages

Code refactor

Refactor the core logic for backing and restoring to remove the duplicated code and logic. A possible solution would be something like:

# define the configuration files
fileConfig = 
  'settings.json': {reader: => JSON.stringify(atom.config.settings, @filterSettings, '\t'), writer: (content) => @applySettings '', JSON.parse(content)}

# backup
files = for file, config of fileConfig
  config.reader() if atom.config.get("sync-settings.sync#{_.capitalize file}")

# restore
for own filename, file of res.files
  if filename of fileConfig
    fileConfig[filename].writer(file.content) if atom.config.get("sync-settings.sync#{_.capitalize file}")

warning: haven't tested the code, so it may need some tuning

Automatic updating to remote gist would be lovely.

I would adore the ability to be added to have this automagically be done. I have two workstations my portable one (laptop) and my home one (desktop) I'd love to be able to have both workspaces have these things synced.

Clean up after #36

I want to discuss if we need to clean up after #66 was merged to fix long standing bug #36. The leftover part is a file called snippets.coffee which was added when running version 0.4.0 and earlier. The file is completely useless.

We can do a few things:

  1. Ignore the issue, the file isn't harmless and people can remove it whenever they want.
  2. Do nothing, only mention it in the readme and give instructions how to remove it.
  3. Build some logic to remove the file in (only) the next version.

The last solution seems the more friendly solution, solving the problem without any user action. Problem is that there's no API to know when the package is updated from a older version. I propose the following (untested) draft:

activate: ->
  currentVersion = atom.packages.getLoadedPackage('sync-settings').metadata.version
  if atom.config.get('sync-settings.version') isnt currentVersion 
    fs.unlink(path.join(atom.getConfigDirPath(), 'snippets.coffee'))
    atom.config.set('sync-settings.version', currentVersion)

/cc @groupsky

Feature request: See diff of local settings and those in gist

Before the request I'd like to say I really like this package as is, it's really handy and allowed me to sync my work and home atom settings so thanks for making it 👍 😄

As the title suggests, I'd like to be able to see a diff of my local settings and the remote settings so that I can decide which action (upload vs download) I'd like to perform when I've made a change.

First-time use

Let's create a window where the user can add the gist token, gist id and choose what to backup/restore. While filling in a check could be done if everything is ok. From there the user can backup or restore. If no gist is already created, we should create one and backup immediately.

This will probably lower the barrier for novice users.

Settings.json created

I have my configuration in config.cson, but due to an old install I had, the first sync I did included a settings.json file as well. I've since removed settings.json from both my machines and from the gist, but for some reason it re-appears every time I save my settings to the gist. Is this intentional for some reason?

Uncaught SyntaxError: Unexpected token s

[Enter steps to reproduce below:]

  1. Synchronize Settings => Backup

Atom Version: 1.0.0
System: Windows 7 64-bit Professional
Thrown From: sync-settings package, v0.5.0

Stack Trace

Uncaught SyntaxError: Unexpected token s

At file:///C:/Users/ted.chen/AppData/Local/atom/app-1.0.0/resources/app.asar/static/index.html#%7B%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22D%3A%5C%5Cworkspace%5C%5Clab%5C%5Cfreeswitch-practice%5C%5Cmplus-fs-node%22%7D%5D%2C%22bootstrapScript%22%3A%22C%3A%5C%5CUsers%5C%5Cted.chen%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-1.0.0%5C%5Cresources%5C%5Capp.asar%5C%5Csrc%5C%5Cwindow-bootstrap.js%22%2C%22resourcePath%22%3A%22C%3A%5C%5CUsers%5C%5Cted.chen%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-1.0.0%5C%5Cresources%5C%5Capp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22appVersion%22%3A%221.0.0%22%2C%22shellLoadTime%22%3A351%2C%22initialPaths%22%3A%5B%22D%3A%5C%5Cworkspace%5C%5Clab%5C%5Cfreeswitch-practice%5C%5Cmplus-fs-node%22%5D%7D:1

SyntaxError: Unexpected token s
  at Object.parse (native)
  at C:\Users\ted.chen\.atom\packages\sync-settings\lib\sync-settings.coffee:99:24
  at Object.proto.sendError (C:\Users\ted.chen\.atom\packages\sync-settings\node_modules\github\api\v3.0.0\index.js:32:13)
  at C:\Users\ted.chen\.atom\packages\sync-settings\node_modules\github\api\v3.0.0\gists.js:180:29
  at callCallback (C:\Users\ted.chen\.atom\packages\sync-settings\node_modules\github\index.js:743:17)
  at ClientRequest.<anonymous> (C:\Users\ted.chen\.atom\packages\sync-settings\node_modules\github\index.js:809:17)
  at emitOne (events.js:77:13)
  at ClientRequest.emit (events.js:166:7)
  at TLSSocket.socketErrorListener (_http_client.js:254:9)
  at emitOne (events.js:77:13)
  at TLSSocket.emit (events.js:166:7)
  at TLSSocket.<anonymous> (_tls_wrap.js:931:16)
  at emitNone (events.js:67:13)
  at TLSSocket.emit (events.js:163:7)
  at TLSSocket._finishInit (_tls_wrap.js:506:8)

Commands

     -7:12.8.0 sync-settings:backup (atom-text-editor.editor.mini.is-focused)
  2x -6:33.7.0 core:paste (atom-text-editor#sync-settings.personalAccessToken.editor.mini.is-focused)
  6x -6:21.8.0 sync-settings:backup (atom-text-editor#sync-settings.gistId.editor.mini.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "atom-beautifier",
      "language-babel",
      "autoclose-html",
      "atom-html-preview",
      "react",
      "jsonlint",
      "project-manager",
      "linter-jshint",
      "jshint"
    ],
    "themes": [
      "one-dark-ui",
      "base16-tomorrow-dark-theme"
    ]
  },
  "sync-settings": {
    "personalAccessToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "gistId": "bd6321d11507ca6d2998"
  }
}

Installed Packages

# User
angularjs, v0.3.0
emmet, v2.3.12
js-refactor, v0.4.2
language-javascript-jsx, v0.3.6
language-lua, v0.9.4
linter, v1.1.0
linter-eslint, v1.0.17
linter-htmlhint, v0.0.17
linter-jsonlint, v0.1.4
linter-lua, v0.1.6
markdown-format, v2.5.1
open-recent, v2.2.4
refactor, v0.5.1
sync-settings, v0.5.0
text-manipulation, v0.6.0

# Dev
No dev packages

No feedback about errors

I just installed the plugin, I generated a key, created a secret gist, then I press "upload settings" in menu and nothing happens. I press Ctrl+alt+u and nothing happens. Even the console is empty.

And when I go to the gist page, it's empty as I left it.

I suppose that some error happened on the way, but I would certainly appreciate some message about this in the UI.

Remove keymaps

Remove both keymaps (Ctrl+Alt+U and Ctrl+Alt+D) so people don't trigger by accident and the keymaps clutter Atom with commands that are triggered once in a while.

As alternative, people can:

  • use the Sync Settings menuitems in the Package menu.
  • the commands:
    • sync-settings:backup
    • sync-settings:restore
  • make their own keymaps:
    
    'atom-workspace':
      'ctrl-alt-u': 'sync-settings:backup'
      'ctrl-alt-d': 'sync-settings:restore'
    

Uncaught TypeError: Cannot read property 'name' of undefined

[Enter steps to reproduce below:]

  1. Install atom-sync-settings from settings/packages
  2. launch Settings upload from Menu > Packages > Synchronize settings > Upload

(i remove my token from the trace, but it was set)

Atom Version: 0.176.0
System: Mac OS X 10.10.1
Thrown From: sync-settings package, v0.2.1

Stack Trace

Uncaught TypeError: Cannot read property 'name' of undefined

At /Users/fruardum/.atom/packages/sync-settings/lib/sync-settings.coffee:57

TypeError: Cannot read property 'name' of undefined
  at Object.module.exports.getPackages (/Users/fruardum/.atom/packages/sync-settings/lib/sync-settings.coffee:57:8)
  at Object.module.exports.upload (/Users/fruardum/.atom/packages/sync-settings/lib/sync-settings.coffee:31:34)
  at atom-text-editor.<anonymous> (/Users/fruardum/.atom/packages/sync-settings/lib/sync-settings.coffee:19:71)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:156:19)
  at Ipc.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:65:30)
  at Ipc.emit (events.js:107:17)
  at process.<anonymous> (/Applications/Atom.app/Contents/Resources/atom/renderer/api/lib/ipc.js:22:29)
  at process.emit (events.js:110:17)

Commands

  2x -2:28.7 core:paste (atom-text-editor#sync-settings.gistId.editor.mini)
     -0:01.5 sync-settings:upload (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "followSymlinks": true,
    "disabledPackages": [
      "composer",
      "behat-atom"
    ]
  },
  "sync-settings": {
    "gistId": "atom-sync",
    "personalAccessToken": "..."
  }
}

Installed Packages

# User
atom-lint, v0.20.1
autocomplete-plus, v2.0.6
coffee-lint, v0.7.3
git-log, v0.2.0
git-tab-status, v1.5.3
jsonlint, v1.0.0
language-twig, v1.5.2
linter, v0.11.0
linter-csslint, v0.0.11
linter-flow, v0.1.3
linter-haml, v0.1.0
linter-php, v0.0.11
linter-rubocop, v0.2.1
linter-ruby, v0.1.4
linter-scss-lint, v0.0.11
php-twig, v3.0.0
phpunit, v1.0.9
phpunit-snippets, v0.1.0
project-manager, v1.15.5
rsense, v0.6.0
ruby-block-converter, v3.1.0
save-session, v0.11.3
script, v2.16.0
slash-closer, v0.7.1
symbols-tree-view, v0.4.0
symfony-snippets, v0.3.0
sync-settings, v0.2.1

# Dev
No dev packages

/cc @atom/core

Sync package removals

Maybe it's just me but it seems that package removals are not synced.
This should at least be an option. Others might like the current behavior.

Not working on 0.181.0

First of all, the selectors are deprecated, so I had to add my own with atom-workspace selector.

Secondly, nothing happens when I trigger the download event? The keybinding resolver says it resolves to sync-settings:download properly, but nothing happens after that?

atom 0.181.0 sync-settings 0.2.1

uploading from a Mac and download to Linux

The idea is awesome but it should have some settings, like what do we want to upload (just package settings, just keymap or just package configuration) because I did an upload from a mac to download in linux and it got messy.

Package ordering issue

Backing up from dev mode creates a different package.json list then in normal mode. The dev packages (apm links) are prepended. This results in unneeded revisions.

Uncaught SyntaxError: Unexpected token s

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.201.0
System: Microsoft Windows 7 旗舰版
Thrown From: sync-settings package, v0.2.2

Stack Trace

Uncaught SyntaxError: Unexpected token s

At file:///C:/Users/fcn0590/AppData/Local/atom/app-0.201.0/resources/app.asar/static/index.html#%7B%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22C%3A%5C%5CPython27%5C%5CLib%5C%5Csite-packages%5C%5Cpylint-1.4.3-py2.7.egg%5C%5Cpylint%22%7D%5D%2C%22bootstrapScript%22%3A%22C%3A%5C%5CUsers%5C%5Cfcn0590%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-0.201.0%5C%5Cresources%5C%5Capp.asar%5C%5Csrc%5C%5Cwindow-bootstrap.js%22%2C%22resourcePath%22%3A%22C%3A%5C%5CUsers%5C%5Cfcn0590%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-0.201.0%5C%5Cresources%5C%5Capp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22apiPreviewMode%22%3Afalse%2C%22appVersion%22%3A%220.201.0%22%2C%22initialPaths%22%3A%5B%22C%3A%5C%5CPython27%5C%5CLib%5C%5Csite-packages%5C%5Cpylint-1.4.3-py2.7.egg%5C%5Cpylint%22%5D%7D:1

SyntaxError: Unexpected token s
  at Object.parse (native)
  at C:\Users\fcn0590\.atom\packages\sync-settings\lib\sync-settings.coffee:64:26
  at Object.proto.sendError (C:\Users\fcn0590\.atom\packages\sync-settings\node_modules\github\api\v3.0.0\index.js:32:13)
  at C:\Users\fcn0590\.atom\packages\sync-settings\node_modules\github\api\v3.0.0\gists.js:180:29
  at callCallback (C:\Users\fcn0590\.atom\packages\sync-settings\node_modules\github\index.js:743:17)
  at ClientRequest.<anonymous> (C:\Users\fcn0590\.atom\packages\sync-settings\node_modules\github\index.js:809:17)
  at emitOne (events.js:77:13)
  at ClientRequest.emit (events.js:166:7)
  at TLSSocket.socketOnEnd (_http_client.js:283:9)
  at emitNone (events.js:72:20)
  at TLSSocket.emit (events.js:163:7)
  at _stream_readable.js:891:16
  at process._tickCallback (node.js:357:13)

Commands

     -1:32 sync-settings:upload (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-light-ui",
      "github-2014"
    ],
    "ignoredNames": [
      "*.pyc"
    ]
  },
  "sync-settings": {
    "personalAccessToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "gistId": "AtomSettings"
  }
}

Installed Packages

# User
github-2014, v3.5.0
highlight-selected, v0.9.3
language-glsl, v2.0.0
language-lua, v0.9.3
linter, v0.12.6
linter-lua, v0.1.5
linter-pylint, v0.2.2
project-manager, v1.15.7
sync-settings, v0.2.2
terminal-status, v1.6.7

# Dev
No dev packages

Support for proxy

This plugin is doing nothing, and I'm thinking it's because I'm behind a proxy.

Any ideas for supporting proxies?

e.g.

export HTTP_PROXY=proxy
export HTTPS_PROXY=proxy

Suggest changing Upload/Download to Backup/Restore

Aldo I've used this package a few times, every time I have to wait and think what upload and download mean. Choosing the wrong action overrides everything, without confirmation (feature?).

I want to propose to change the actions to other words:

  • UploadBackup
  • DownloadRestore

Proxy problemen: Uncaught SyntaxError: Unexpected token c

[Enter steps to reproduce below:]

  1. ... Behind corporate proxy
  2. ... Try to download settings

Atom Version: 0.199.0
System: Microsoft Windows 8 Enterprise
Thrown From: sync-settings package, v0.2.2

Stack Trace

Uncaught SyntaxError: Unexpected token c

At file:///C:/Users/cgeorge/AppData/Local/atom/app-0.199.0/resources/app.asar/static/index.html#%7B%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22C%3A%5C%5CUsers%5C%5Ccgeorge%5C%5C.atom%22%7D%5D%2C%22bootstrapScript%22%3A%22C%3A%5C%5CUsers%5C%5Ccgeorge%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-0.199.0%5C%5Cresources%5C%5Capp.asar%5C%5Csrc%5C%5Cwindow-bootstrap.js%22%2C%22resourcePath%22%3A%22C%3A%5C%5CUsers%5C%5Ccgeorge%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-0.199.0%5C%5Cresources%5C%5Capp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22apiPreviewMode%22%3Afalse%2C%22appVersion%22%3A%220.199.0%22%2C%22shellLoadTime%22%3A324%2C%22initialPaths%22%3A%5B%22C%3A%5C%5CUsers%5C%5Ccgeorge%5C%5C.atom%22%5D%7D:1

SyntaxError: Unexpected token c
  at Object.parse (native)
  at C:\Users\cgeorge\.atom\packages\sync-settings\lib\sync-settings.coffee:82:24
  at Object.proto.sendError (C:\Users\cgeorge\.atom\packages\sync-settings\node_modules\github\api\v3.0.0\index.js:32:13)
  at C:\Users\cgeorge\.atom\packages\sync-settings\node_modules\github\api\v3.0.0\gists.js:315:29
  at callCallback (C:\Users\cgeorge\.atom\packages\sync-settings\node_modules\github\index.js:743:17)
  at ClientRequest.<anonymous> (C:\Users\cgeorge\.atom\packages\sync-settings\node_modules\github\index.js:809:17)
  at emitOne (events.js:77:13)
  at ClientRequest.emit (events.js:166:7)
  at TLSSocket.socketErrorListener (_http_client.js:254:9)
  at emitOne (events.js:77:13)
  at TLSSocket.emit (events.js:166:7)
  at net.js:438:14
  at process._tickCallback (node.js:357:13)

Commands

     -0:24.4.0 sync-settings:download (atom-text-editor.editor.is-focused)
  9x -0:22.3.0 core:close (ul.list-inline.tab-bar.inset-panel)
     -0:05.5.0 settings-view:open (atom-pane.pane.active)

Config

{
  "core": {},
  "sync-settings": {
    "gistId": "e627f2123fd3cd041ba6",
    "personalAccessToken": "[removedfornow]"
  }
}

Installed Packages

# User
sync-settings, v0.2.2

# Dev
No dev packages

Secure token value

Currently bug reports generated from atom contain the token and gist repo. There should be some form of protection of the token so bug reports don't expose it. Additionally it would be preferable if other plugins don't have access to the token.

One way is to generate a random key and encrypt the token with that, the key itself could be stored as a plugin state - which I haven't investigated how secure is.

Another way is to store it in another location like custom config file in atom's config directory.

So far both approaches require building a custom UI to manage the token.

Atom 0.206.0 - Uncaught TypeError: Cannot read property 'getUserKeymapPath' of undefined

After upgrade Atom for version 0.206.0, the Atom Sync Settings v0.2.2 crashed.

Error:
TypeError: Cannot read property 'getUserKeymapPath' of undefined
at /home/user/.atom/packages/sync-settings/lib/sync-settings.coffee:153:45
at /home/user/.atom/packages/sync-settings/node_modules/github/api/v3.0.0/gists.js:342:17
at callCallback (/home/user/.atom/packages/sync-settings/node_modules/github/index.js:743:17)
at IncomingMessage. (/home/user/.atom/packages/sync-settings/node_modules/github/index.js:796:25)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:163:7)
at _stream_readable.js:891:16
at process._tickCallback (node.js:357:13)

Optimize package startup time

Minimize the main coffee file to speedup parsing and load all dependencies async during activation. This is especially relevant after PR #88 because it activates the package on atom startup.

Snippets not getting applied

I've created a new snippet in my snippets.cson file and then did an sync-upload. I can see the file in my gist and it has my snippet. I move to my other machine, do a sync-download and my snippets.cson file remains unchanged.

Uncaught TypeError: object is not a function

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.0
System: Mac OS X 10.9.5
Thrown From: sync-settings package, v0.5.0

Stack Trace

Uncaught TypeError: object is not a function

At /Users/moriitakayuki/.atom/packages/sync-settings/lib/sync-settings.coffee:150

TypeError: object is not a function
  at /Users/moriitakayuki/.atom/packages/sync-settings/lib/sync-settings.coffee:150:7
  at /Users/moriitakayuki/.atom/packages/sync-settings/node_modules/github/api/v3.0.0/gists.js:342:17
  at callCallback (/Users/moriitakayuki/.atom/packages/sync-settings/node_modules/github/index.js:743:17)
  at IncomingMessage.<anonymous> (/Users/moriitakayuki/.atom/packages/sync-settings/node_modules/github/index.js:796:25)
  at emitNone (events.js:72:20)
  at IncomingMessage.emit (events.js:163:7)
  at _stream_readable.js:891:16
  at process._tickCallback (node.js:357:13)

Commands

     -0:01.5.0 sync-settings:restore (ul.list-inline.tab-bar.inset-panel)

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "seti-syntax"
    ]
  },
  "sync-settings": {
    "personalAccessToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "gistId": "d9090d0e06171c640911"
  }
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.3.0
autoclose-html, v0.18.0
autocomplete-paths, v1.0.2
color-picker, v2.0.7
css-snippets, v0.8.0
docblockr, v0.7.2
emmet, v2.3.12
file-icons, v1.5.8
highlight-line, v0.11.0
highlight-selected, v0.10.1
japanese-menu, v0.7.0
japanese-wrap, v0.2.7
minimap, v4.10.2
minimap-color-highlight, v4.1.4
minimap-highlight-selected, v4.3.0
pigments, v0.8.2
save-session, v0.15.6
seti-syntax, v0.4.0
seti-ui, v0.7.1
sync-settings, v0.5.0
tabs-to-spaces, v0.11.0
trailing-spaces, v0.3.2

# Dev
No dev packages

Atom.Object.defineProperty.get is deprecated.

Bug report from Atom:

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (c:\Users\jerone\AppData\Local\atom\app-0.174.0\resources\app\src\atom.js:55:11)
Object.activate (c:\Users\jerone\.atom\packages\sync-settings\lib\sync-settings.coffee:20:9)

Doing nothing on Ubuntu?

Not sure what I'm doing wrong here. I have two ubuntu 14.04 setups. I installed and went through the steps on one machine, uploaded my settings just fine. I did the same thing on another, practically identical machine, and I was unable to download or upload. I even tried completely removing atom and my .atom folder and trying again. Nothing is printed in the debug log, no error messages appear anywhere. Any idea how I can troubleshoot this?

Security risk?

In the settings.json file, it saves the personal access token that this plugin uses. I would assume the worst an attacker could do is modify a user's gists, but is that even too much of a concern? Is obfuscation possible and/or needed?

"sync-settings": {
    "personalAccessToken": "**************",
    "gistId": "*********"
}

Fix travis build of pull request

The problem is with the oauth token for github. GitHub doesn't allow the token to be commited in the repo, but it is specified as a secure var in travis config. But unfortunately when travis builds it doesn't get the actual token, but an old one.

When building normal commits, the token is correct.

Hight startup time

Compared to other package sync settings is taking (according to timecop) by far the most time 440ms for package loading. Don't have time right not to check the code for what might be the problem, but I am happy to help with 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.