- based on small Digital Ocean VPS (1CPU / 1GB RAM) with Ubuntu 16.04
- SSH keys are recommended, but not described here
- (sub) domain name necessary for SSL certificate
Login as "root"
| import crypto from 'crypto' | |
| import parseSignedRequest from './parseSignedRequest.mjs' | |
| import { instance as fileStorage } from '../ConfirmingFileStorage.mjs' | |
| import { getLogger } from '../logger.mjs' | |
| import { toAbsoluteUrl } from '../util.mjs' | |
| const logger = getLogger('deletionEndpoint') | |
| export function registerHandles (app) { |
| setTimeout(function() { | |
| function getAllModules() { | |
| return new Promise((resolve) => { | |
| const id = _.uniqueId("fakeModule_"); | |
| window["webpackJsonp"]( | |
| [], | |
| { | |
| [id]: function(module, exports, __webpack_require__) { | |
| resolve(__webpack_require__.c); | |
| } |
By the Google's update at June 19, 2018, finally, Utilities.computeDigest(), Utilities.computeHmacSha256Signature() and Utilities.computeHmacSignature() got to be able to use the byte arrays. By this, using only native Google Apps Script, the result can be retrieved without using jsSHA. When I used the updated them, the response speed is much faster than that of jsSHA. It is considered that this may be optimized for Google Apps Script. As a sample, it shows 2 samples as follows. The both results are the same.
var obj = new jsSHA("SHA-512", "TEXT");
obj.setHMACKey(key, "B64");
obj.update(value);
var res = obj.getHMAC("B64");| /** | |
| * Pretends to take a long time to return two rows of data | |
| * | |
| * @param {string} endpoint | |
| * @return {ResponseObject} | |
| */ | |
| function doSomething (endpoint) { | |
| Utilities.sleep(5 * 1000); // sleep for 5 seconds | |
| return { | |
| numberOfRows: 2, |
| function isChatMessage(message) { | |
| if (message.__x_isSentByMe) { | |
| return false; | |
| } | |
| if (message.__x_isNotification) { | |
| return false; | |
| } | |
| if (!message.__x_isUserCreatedType) { | |
| return false; | |
| } |
sudo apt-get install build-essential curl file git python-setuptools
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
test -d ~/.linuxbrew && PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
test -d /home/linuxbrew/.linuxbrew && PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
| *-*-*-*-*-*-*-*-*-* Updated January 04, 2022 *-*-*-*-*-*-*-*-*-* | |
| ### Update and install some utilities | |
| sudo apt update && sudo apt-get upgrade | |
| sudo apt install -y curl apt-transport-https gnupg nano | |
| curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1 | |
| source /etc/os-release |
| [ | |
| { | |
| "name": "Afghanistan", | |
| "dial_code": "+93", | |
| "code": "AF" | |
| }, | |
| { | |
| "name": "Aland Islands", | |
| "dial_code": "+358", | |
| "code": "AX" |
| function doGet(e) { | |
| var toNum = e.parameter.PhoneNumber; | |
| var fromNum = e.parameter.CallerId; | |
| var action = e.parameter.Direction; | |
| var record = e.parameter.Record; | |
| Logger.log(e); | |
| var output = ContentService.createTextOutput(); | |
| var xml = createDialTWIML(fromNum, toNum, action); |