<commit_before># Juke
A Node.js script to reprovision a Streisand Instance to a new IP for GFW circumvention on Digital Ocean

## Prerequisites:
#### Remote:
  - A running [Streisand](https://github.com/jlund/streisand) droplet deployed on Digital Ocean
    - The initial droplet created by streisand should have a snapshot taken after creation. All new droplets created with Juke first check for a snapshot, and if that is not found then it uses the Droplet's `image_id`.
    - *Droplet name should contain the string `streisand-`. I use the convention `streisand-month-day-hour.minute` i.e. `streisand-01-20-14.46` which is what Juke will use when recreating the droplet.*
  - A Digital Ocean [API token](https://cloud.digitalocean.com/settings/api/tokens) with read/write access
  - *(optional)* A [domain configured](https://cloud.digitalocean.com/networking/domains/) on Digital Ocean with an `A` record pointing at your Streisand droplet's IP
  
#### Local:
- NPM, Node installed at `node@>=6.0.0`

## Installation and Use:
- Checkout this repository and cd to dir: `git checkout <EMAIL>:nickolasclarke/juke.git && cd juke`
- Install node dependencies: `npm install`
- Run with `node juke.js`
- If using an IP in your Shadowsocks client configuration, update it to reflect the new server's IP

## Current Limitations:
- Currently only reconfigures the Shadowsocks service for use
- The https:// and tor:// gateways are also unavailble upon redeployment, which contains the client configuration details, mirrors, etc.

## TODO:
- Testing suite
- Refactor to use async/await
- Handle network failures gracefully
- Add automatic reconfiguration for other services besides Shadowsocks
- Make domain optional<commit_msg>updated TODO<commit_after># Juke
A Node.js script to reprovision a Streisand Instance to a new IP for GFW circumvention on Digital Ocean

## Prerequisites:
#### Remote:
  - A running [Streisand](https://github.com/jlund/streisand) droplet deployed on Digital Ocean
    - The initial droplet created by streisand should have a snapshot taken after creation. All new droplets created with Juke first check for a snapshot, and if that is not found then it uses the Droplet's `image_id`.
    - *Droplet name should contain the string `streisand-`. I use the convention `streisand-month-day-hour.minute` i.e. `streisand-01-20-14.46` which is what Juke will use when recreating the droplet.*
  - A Digital Ocean [API token](https://cloud.digitalocean.com/settings/api/tokens) with read/write access
  - *(optional)* A [domain configured](https://cloud.digitalocean.com/networking/domains/) on Digital Ocean with an `A` record pointing at your Streisand droplet's IP
  
#### Local:
- NPM, Node installed at `node@>=6.0.0`

## Installation and Use:
- Checkout this repository and cd to dir: `git checkout git@github.com:nickolasclarke/juke.git && cd juke`
- Install node dependencies: `npm install`
- Run with `node juke.js`
- If using an IP in your Shadowsocks client configuration, update it to reflect the new server's IP

## Current Limitations:
- Currently only reconfigures the Shadowsocks service for use
- The https:// and tor:// gateways are also unavailble upon redeployment, which contains the client configuration details, mirrors, etc.

## TODO:
- Testing suite
- Refactor to use async/await
- Handle network failures gracefully
- Add automatic reconfiguration for other services besides Shadowsocks
- ~~make domain optional~~
- add generic error handler for fatal and non fatal reporting

{'fraction_non_alphanumeric': 0.08677098150782361, 'fraction_numerical': 0.006258890469416785, 'mean_word_length': 4.359756097560975, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7259198', 'n_tokens_mistral': 1013, 'n_tokens_neox': 967, 'n_words': 434}