This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# sudo ./install-shadowsocks-local-service.sh | |
cp shadowsocks-local.default /etc/default/shadowsocks-local | |
cp shadowsocks-local.init /etc/init.d/shadowsocks-local | |
chmod +x /etc/init.d/shadowsocks-local | |
ln -s ../init.d/shadowsocks-local /etc/rc0.d/K01shadowsocks-local | |
ln -s ../init.d/shadowsocks-local /etc/rc1.d/K01shadowsocks-local | |
ln -s ../init.d/shadowsocks-local /etc/rc2.d/K01shadowsocks-local | |
ln -s ../init.d/shadowsocks-local /etc/rc3.d/K01shadowsocks-local |