From f9f603bc9380834c88b60f8c3b418d62505aac5e Mon Sep 17 00:00:00 2001 From: aguestuser <aguestuser@riseup.net> Date: Wed, 10 Jun 2020 00:41:02 -0400 Subject: [PATCH 1/4] [218] rename signupChannel -> supportChannel, remove special casing --- .env.dev.example | 2 +- .env.example | 2 +- README.md | 2 +- app/config/signal.js | 6 +- app/services/dispatcher/commands/execute.js | 61 ++++++++----------- app/services/dispatcher/messenger.js | 4 +- app/services/dispatcher/run.js | 6 +- app/services/registrar/phoneNumber/common.js | 4 +- app/services/registrar/phoneNumber/recycle.js | 2 +- .../dispatcher/commands/execute.spec.js | 25 -------- .../services/dispatcher/messenger.spec.js | 46 +------------- test/unit/services/dispatcher/run.spec.js | 18 +++--- 12 files changed, 48 insertions(+), 130 deletions(-) diff --git a/.env.dev.example b/.env.dev.example index e7b85b46d..4ccec9ddb 100644 --- a/.env.dev.example +++ b/.env.dev.example @@ -13,7 +13,7 @@ SIGNALBOOST_API_TOKEN=%HEX STRING% TWILIO_ACCOUNT_SID=%HEX STRING% TWILIO_AUTH_TOKEN=%HEX STRING% -# Signup channel number // Optional Phone number used by Signalboost for the special "signup channel" +# Support channel number // Optional Phone number used by Signalboost for the special "support channel" # Use Boost cli to create these, you only need the one specific to the mode you are running in # Format must be e164 (https://www.twilio.com/docs/glossary/what-e164), with the + and with no special characters diff --git a/.env.example b/.env.example index ad5c9f4b4..4685cae2e 100644 --- a/.env.example +++ b/.env.example @@ -11,7 +11,7 @@ SIGNALBOOST_HOST_URL=%FULL DOMAIN NAME FOR PROD SERVER% SIGNALBOOST_API_TOKEN=%HEX STRING% -# Signup channel number // Optional Phone number used by Signalboost for the special "signup channel" +# Support channel number // Optional Phone number used by Signalboost for the special "support channel" # Use Boost cli to create these, you only need the one specific to the mode you are running in # Format must be e164 (https://www.twilio.com/docs/glossary/what-e164), with the + and with no special characters diff --git a/README.md b/README.md index 0e0dc870f..a63b63e8a 100644 --- a/README.md +++ b/README.md @@ -472,7 +472,7 @@ LETSENCRYPT_EMAIL=%EMAIL ADDRESS FOR TEAM SYSADMIN% For now we'll comment out this optional item because we need the Boost CLI to creat this channel on twillio: ``` -# Signup channel number // Optional Phone number used by Signalboost for the special "signup channel" +# Support channel number // Optional Phone number used by Signalboost for the special "support channel" # Use Boost cli to create these, you only need the one specific to the mode you are running in # Format must be e164 (https://www.twilio.com/docs/glossary/what-e164), with the + and with no special characters diff --git a/app/config/signal.js b/app/config/signal.js index 4ac5f5933..6839a4ae9 100644 --- a/app/config/signal.js +++ b/app/config/signal.js @@ -12,7 +12,7 @@ const defaults = { intervalBetweenRegistrations: 2000, // 2 seconds signaldStartupTime: 1000 * 60 * 5, // 5 minutes welcomeDelay: 3000, // 3 sec - signupPhoneNumber: process.env.SIGNUP_CHANNEL_NUMBER, + supportPhoneNumber: process.env.SIGNUP_CHANNEL_NUMBER, defaultMessageExpiryTime: 60 * 60 * 24 * 7, // 1 week expiryUpdateDelay: 200, // 200 millis setExpiryInterval: 2000, // 2 sec @@ -34,7 +34,7 @@ const test = { intervalBetweenRegistrations: 5, // 10 millis, signaldStartupTime: 1, // 1 milli welcomeDelay: 0.0001, // .0001 millis - signupPhoneNumber: '+15555555555', + supportPhoneNumber: '+15555555555', expiryUpdateDelay: 1, // 1 milli setExpiryInterval: 1, // 1 milli minResendInterval: 2, // 20 millis @@ -46,7 +46,7 @@ const test = { const development = { ...defaults, - signupPhoneNumber: process.env.SIGNUP_CHANNEL_NUMBER_DEV, + supportPhoneNumber: process.env.SIGNUP_CHANNEL_NUMBER_DEV, } module.exports = { diff --git a/app/services/dispatcher/commands/execute.js b/app/services/dispatcher/commands/execute.js index 01d1633a1..7386404bd 100644 --- a/app/services/dispatcher/commands/execute.js +++ b/app/services/dispatcher/commands/execute.js @@ -14,9 +14,6 @@ const { getAllAdminsExcept, getAdminMemberships } = require('../../../db/reposit const { messagesIn } = require('../strings/messages') const { memberTypes } = require('../../../db/repositories/membership') const { ADMIN, NONE } = memberTypes -const { - signal: { signupPhoneNumber }, -} = require('../../../config') /** * @@ -36,9 +33,6 @@ const execute = async (executable, dispatchable) => { const { command, payload, language } = executable const { db, sock, channel, sender, sdMessage } = dispatchable - // don't allow ANY command execution on the signup channel for non-admins - if (channel.phoneNumber === signupPhoneNumber && sender.type !== ADMIN) return noop() - // if payload parse error occured return early and notify sender if (executable.error) { // sorry for this gross special casing! working fast during a mass mobilization! -aguestuser @@ -56,32 +50,30 @@ const execute = async (executable, dispatchable) => { } // otherwise, dispatch on the command issued, and process it! - const result = await ( - { - [commands.ACCEPT]: () => maybeAccept(db, channel, sender, language), - [commands.ADD]: () => maybeAddAdmin(db, sock, channel, sender, payload), - [commands.DECLINE]: () => decline(db, channel, sender, language), - [commands.DESTROY]: () => maybeConfirmDestroy(db, sock, channel, sender), - [commands.DESTROY_CONFIRM]: () => maybeDestroy(db, sock, channel, sender), - [commands.HELP]: () => showHelp(db, channel, sender), - [commands.HOTLINE_ON]: () => maybeToggleSettingOn(db, channel, sender, toggles.HOTLINE), - [commands.HOTLINE_OFF]: () => maybeToggleSettingOff(db, channel, sender, toggles.HOTLINE), - [commands.INFO]: () => showInfo(db, channel, sender), - [commands.INVITE]: () => maybeInvite(db, channel, sender, payload, language), - [commands.JOIN]: () => maybeAddSubscriber(db, channel, sender, language), - [commands.LEAVE]: () => maybeRemoveSender(db, channel, sender), - [commands.PRIVATE]: () => - maybePrivateMessageAdmins(db, sock, channel, sender, payload, sdMessage), - [commands.RENAME]: () => maybeRenameChannel(db, channel, sender, payload), - [commands.REMOVE]: () => maybeRemoveMember(db, channel, sender, payload), - [commands.REPLY]: () => maybeReplyToHotlineMessage(db, channel, sender, payload), - [commands.VOUCHING_ON]: () => maybeToggleSettingOn(db, channel, sender, toggles.VOUCHING), - [commands.VOUCHING_OFF]: () => maybeToggleSettingOff(db, channel, sender, toggles.VOUCHING), - [commands.VOUCH_LEVEL]: () => maybeSetVouchLevel(db, channel, sender, payload), - [commands.SET_LANGUAGE]: () => setLanguage(db, sender, language), - [commands.SET_DESCRIPTION]: () => maybeSetDescription(db, channel, sender, payload), - }[command] || (() => noop()) - )() + const result = await ({ + [commands.ACCEPT]: () => maybeAccept(db, channel, sender, language), + [commands.ADD]: () => maybeAddAdmin(db, sock, channel, sender, payload), + [commands.DECLINE]: () => decline(db, channel, sender, language), + [commands.DESTROY]: () => maybeConfirmDestroy(db, sock, channel, sender), + [commands.DESTROY_CONFIRM]: () => maybeDestroy(db, sock, channel, sender), + [commands.HELP]: () => showHelp(db, channel, sender), + [commands.HOTLINE_ON]: () => maybeToggleSettingOn(db, channel, sender, toggles.HOTLINE), + [commands.HOTLINE_OFF]: () => maybeToggleSettingOff(db, channel, sender, toggles.HOTLINE), + [commands.INFO]: () => showInfo(db, channel, sender), + [commands.INVITE]: () => maybeInvite(db, channel, sender, payload, language), + [commands.JOIN]: () => maybeAddSubscriber(db, channel, sender, language), + [commands.LEAVE]: () => maybeRemoveSender(db, channel, sender), + [commands.PRIVATE]: () => + maybePrivateMessageAdmins(db, sock, channel, sender, payload, sdMessage), + [commands.RENAME]: () => maybeRenameChannel(db, channel, sender, payload), + [commands.REMOVE]: () => maybeRemoveMember(db, channel, sender, payload), + [commands.REPLY]: () => maybeReplyToHotlineMessage(db, channel, sender, payload), + [commands.VOUCHING_ON]: () => maybeToggleSettingOn(db, channel, sender, toggles.VOUCHING), + [commands.VOUCHING_OFF]: () => maybeToggleSettingOff(db, channel, sender, toggles.VOUCHING), + [commands.VOUCH_LEVEL]: () => maybeSetVouchLevel(db, channel, sender, payload), + [commands.SET_LANGUAGE]: () => setLanguage(db, sender, language), + [commands.SET_DESCRIPTION]: () => maybeSetDescription(db, channel, sender, payload), + }[command] || (() => noop()))() result.notifications = result.notifications || [] return { command, payload, ...result } @@ -284,10 +276,7 @@ const maybeInvite = async (db, channel, sender, inviteePhoneNumbers, language) = if (!isEmpty(errors)) { return { status: statuses.ERROR, - message: cr.dbErrors( - errors.map(e => e.inviteePhoneNumber), - inviteResults.length, - ), + message: cr.dbErrors(errors.map(e => e.inviteePhoneNumber), inviteResults.length), notifications, } } diff --git a/app/services/dispatcher/messenger.js b/app/services/dispatcher/messenger.js index ca8875605..68eba7dea 100644 --- a/app/services/dispatcher/messenger.js +++ b/app/services/dispatcher/messenger.js @@ -14,7 +14,6 @@ const logger = loggerOf('messenger') const { defaultLanguage, signal: { - signupPhoneNumber, defaultMessageExpiryTime, setExpiryInterval, broadcastBatchSize, @@ -66,10 +65,9 @@ const dispatch = async ({ commandResult, dispatchable }) => { } // (CommandResult, Dispatchable) -> MessageType -const parseMessageType = (commandResult, { sender, channel }) => { +const parseMessageType = (commandResult, { sender }) => { if (commandResult.status === statuses.NOOP) { if (sender.type === ADMIN) return BROADCAST_MESSAGE - if (channel.phoneNumber === signupPhoneNumber) return SIGNUP_MESSAGE return HOTLINE_MESSAGE } return COMMAND_RESULT diff --git a/app/services/dispatcher/run.js b/app/services/dispatcher/run.js index 364fe0ed3..035df75b1 100644 --- a/app/services/dispatcher/run.js +++ b/app/services/dispatcher/run.js @@ -11,7 +11,7 @@ const safetyNumberService = require('../registrar/safetyNumbers') const { messagesIn } = require('./strings/messages') const { get, isEmpty, isNumber } = require('lodash') const { - signal: { signupPhoneNumber }, + signal: { supportPhoneNumber }, } = require('../../config') /** @@ -127,7 +127,7 @@ const relay = async (db, sock, channel, sender, inboundMsg) => { // (Database, Socket, SdMessage, number) -> Promise<void> const notifyRateLimitedMessage = async (db, sock, sdMessage, resendInterval) => { - const channel = await channelRepository.findDeep(db, signupPhoneNumber) + const channel = await channelRepository.findDeep(db, supportPhoneNumber) if (!channel) return Promise.resolve() const recipients = channelRepository.getAdminMemberships(channel) @@ -137,7 +137,7 @@ const notifyRateLimitedMessage = async (db, sock, sdMessage, resendInterval) => sock, memberPhoneNumber, sdMessageOf( - { phoneNumber: signupPhoneNumber }, + { phoneNumber: supportPhoneNumber }, messagesIn(language).notifications.rateLimitOccurred(sdMessage.username, resendInterval), ), ), diff --git a/app/services/registrar/phoneNumber/common.js b/app/services/registrar/phoneNumber/common.js index bbd3aa4cc..f1cf3446b 100644 --- a/app/services/registrar/phoneNumber/common.js +++ b/app/services/registrar/phoneNumber/common.js @@ -5,7 +5,7 @@ const signal = require('../../signal') const { twilio: { accountSid, authToken, smsEndpoint }, registrar: { host }, - signal: { signupPhoneNumber }, + signal: { supportPhoneNumber }, } = require('../../../config') // STRINGS @@ -38,7 +38,7 @@ const notifyMembersExcept = async (db, sock, channel, message, sender) => { // (DB, Socket, String) -> Promise<void> const notifyMaintainers = async (db, sock, message) => { - const adminChannel = await channelRepository.findDeep(db, signupPhoneNumber) + const adminChannel = await channelRepository.findDeep(db, supportPhoneNumber) const adminPhoneNumbers = channelRepository.getAdminPhoneNumbers(adminChannel) await signal.broadcastMessage(sock, adminPhoneNumbers, signal.sdMessageOf(adminChannel, message)) } diff --git a/app/services/registrar/phoneNumber/recycle.js b/app/services/registrar/phoneNumber/recycle.js index 7f1fbbbfa..032a907e2 100644 --- a/app/services/registrar/phoneNumber/recycle.js +++ b/app/services/registrar/phoneNumber/recycle.js @@ -57,7 +57,7 @@ const recycleChannelFailureNotification = channel => // Channel -> Promise<void> const notifyMaintainersOfDestructionFailure = async (db, sock, channel) => { - const adminChannel = await channelRepository.findDeep(db, signalConfig.signupPhoneNumber) + const adminChannel = await channelRepository.findDeep(db, signalConfig.supportPhoneNumber) const adminPhoneNumbers = channelRepository.getAdminPhoneNumbers(adminChannel) await signal.broadcastMessage( diff --git a/test/unit/services/dispatcher/commands/execute.spec.js b/test/unit/services/dispatcher/commands/execute.spec.js index c8516dbe5..4bf2bc674 100644 --- a/test/unit/services/dispatcher/commands/execute.spec.js +++ b/test/unit/services/dispatcher/commands/execute.spec.js @@ -26,9 +26,6 @@ import { } from '../../../../support/factories/membership' import { messagesIn } from '../../../../../app/services/dispatcher/strings/messages' import { deauthorizationFactory } from '../../../../support/factories/deauthorization' -const { - signal: { signupPhoneNumber }, -} = require('../../../../../app/config') describe('executing commands', () => { const db = {} @@ -44,11 +41,6 @@ describe('executing commands', () => { messageCount: { broadcastIn: 42 }, } const bystanderAdminMemberships = channel.memberships.slice(1, 3) - const signupChannel = { - name: 'SB_SIGNUP', - phoneNumber: signupPhoneNumber, - publications: channel.publications, - } const admin = { ...channel.memberships[0], phoneNumber: channel.memberships[0].memberPhoneNumber, @@ -2110,23 +2102,6 @@ describe('executing commands', () => { }) }) - describe('new user attempting to JOIN the signup channel', () => { - it('returns NOOP', async () => { - const dispatchable = { - db, - channel: signupChannel, - sender: randomPerson, - sdMessage: sdMessageOf(signupChannel, 'HELLO'), - } - expect(await processCommand(dispatchable)).to.eql({ - command: commands.NOOP, - status: statuses.NOOP, - message: '', - notifications: [], - }) - }) - }) - describe('invalid command', () => { it('returns NOOP status/message', async () => { const dispatchable = { diff --git a/test/unit/services/dispatcher/messenger.spec.js b/test/unit/services/dispatcher/messenger.spec.js index 036db37cd..82b9de11c 100644 --- a/test/unit/services/dispatcher/messenger.spec.js +++ b/test/unit/services/dispatcher/messenger.spec.js @@ -13,15 +13,13 @@ import { statuses } from '../../../../app/services/util' import { genPhoneNumber } from '../../../support/factories/phoneNumber' import { sdMessageOf } from '../../../../app/services/signal' import { messagesIn } from '../../../../app/services/dispatcher/strings/messages' -import { defaultLanguage } from '../../../../app/config' import channelRepository from '../../../../app/db/repositories/channel' import hotlineMessageRepository from '../../../../app/db/repositories/hotlineMessage' const { - signal: { signupPhoneNumber, broadcastBatchSize }, + signal: { broadcastBatchSize }, } = require('../../../../app/config') describe('messenger service', () => { - const notifications = messagesIn(defaultLanguage).notifications const [db, sock] = [{}, { write: () => {} }] const channelPhoneNumber = genPhoneNumber() const subscriberPhoneNumbers = times(2, genPhoneNumber) @@ -55,11 +53,6 @@ describe('messenger service', () => { messageCount: { broadcastIn: 42 }, } const hotlineEnabledChannel = { ...channel, hotlineOn: true } - const signupChannel = { - name: 'SB_SIGNUP', - phoneNumber: signupPhoneNumber, - memberships: channel.memberships, - } const attachments = [{ filename: 'some/path', width: 42, height: 42 }] const sdMessage = { @@ -354,43 +347,6 @@ describe('messenger service', () => { }) }) - describe('when message is a signup request', () => { - const adminPhoneNumbers = channelRepository.getAdminPhoneNumbers(channel) - - beforeEach(async () => { - const dispatchable = { - db, - sock, - channel: signupChannel, - sender: randomSender, - sdMessage: sdMessageOf(signupChannel, 'gimme a channel'), - } - const commandResult = { status: commands.NOOP, message: '', notifications: [] } - await messenger.dispatch({ dispatchable, commandResult }) - }) - - it('responds to requester', () => { - expect(sendMessageStub.getCall(0).args).to.eql([ - sock, - randomSender.phoneNumber, - sdMessageOf(signupChannel, notifications.signupRequestResponse), - ]) - }) - - it('forwards request to channel admins and appends phone number', () => { - adminPhoneNumbers.forEach((adminPhoneNumber, idx) => { - expect(sendMessageStub.getCall(idx + 1).args).to.eql([ - sock, - adminPhoneNumber, - sdMessageOf( - signupChannel, - notifications.signupRequestReceived(randomSender.phoneNumber, 'gimme a channel'), - ), - ]) - }) - }) - }) - describe('when message is a command response', () => { beforeEach(async () => { await messenger.dispatch({ diff --git a/test/unit/services/dispatcher/run.spec.js b/test/unit/services/dispatcher/run.spec.js index 888efeb4d..9955845fd 100644 --- a/test/unit/services/dispatcher/run.spec.js +++ b/test/unit/services/dispatcher/run.spec.js @@ -21,7 +21,7 @@ import { messagesIn } from '../../../../app/services/dispatcher/strings/messages import { adminMembershipFactory } from '../../../support/factories/membership' import { inboundAttachmentFactory } from '../../../support/factories/sdMessage' const { - signal: { defaultMessageExpiryTime, signupPhoneNumber, minResendInterval }, + signal: { defaultMessageExpiryTime, supportPhoneNumber, minResendInterval }, } = require('../../../../app/config') describe('dispatcher service', () => { @@ -284,10 +284,10 @@ describe('dispatcher service', () => { }) describe('when message is a rate limit error notification', () => { - const signupChannel = deepChannelFactory({ - phoneNumber: signupPhoneNumber, + const supportChannel = deepChannelFactory({ + phoneNumber: supportPhoneNumber, memberships: ['EN', 'ES', 'FR'].map(language => - adminMembershipFactory({ channelPhoneNumber: signupPhoneNumber, language }), + adminMembershipFactory({ channelPhoneNumber: supportPhoneNumber, language }), ), }) const recipientNumber = genPhoneNumber() @@ -313,9 +313,9 @@ describe('dispatcher service', () => { beforeEach(() => enqueueResendStub.returns(minResendInterval)) - describe('and there is a signup channel', () => { + describe('and there is a support channel', () => { beforeEach(async () => { - findDeepStub.returns(Promise.resolve(signupChannel)) + findDeepStub.returns(Promise.resolve(supportChannel)) sock.emit('data', JSON.stringify(sdErrorMessage)) await wait(2 * socketDelay) }) @@ -325,12 +325,12 @@ describe('dispatcher service', () => { }) it('notifies admins of the support channel', () => { - signupChannel.memberships.forEach(({ memberPhoneNumber, language }, idx) => + supportChannel.memberships.forEach(({ memberPhoneNumber, language }, idx) => expect(sendMessageStub.getCall(idx).args).to.eql([ sock, memberPhoneNumber, sdMessageOf( - { phoneNumber: signupPhoneNumber }, + { phoneNumber: supportPhoneNumber }, messagesIn(language).notifications.rateLimitOccurred( channel.phoneNumber, minResendInterval, @@ -341,7 +341,7 @@ describe('dispatcher service', () => { }) }) - describe('and there is not a signup channel', () => { + describe('and there is not a support channel', () => { beforeEach(async () => { findDeepStub.returns(Promise.resolve(null)) sock.emit('data', JSON.stringify(sdErrorMessage)) -- GitLab From 0a91966caf3395fbdbabf63fea2edd13e29bc909 Mon Sep 17 00:00:00 2001 From: aguestuser <aguestuser@riseup.net> Date: Wed, 10 Jun 2020 00:45:15 -0400 Subject: [PATCH 2/4] [218] rename SIGNUP_CHANNEL_NUMBER, update value to 8005717 --- .env.dev.example | 2 +- .env.example | 2 +- .env.gpg | Bin 3444 -> 3446 bytes README.md | 2 +- app/config/signal.js | 4 ++-- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.env.dev.example b/.env.dev.example index 4ccec9ddb..5e37f3216 100644 --- a/.env.dev.example +++ b/.env.dev.example @@ -17,4 +17,4 @@ TWILIO_AUTH_TOKEN=%HEX STRING% # Use Boost cli to create these, you only need the one specific to the mode you are running in # Format must be e164 (https://www.twilio.com/docs/glossary/what-e164), with the + and with no special characters -SIGNUP_CHANNEL_NUMBER=%+15554445555% +SUPPORT_CHANNEL_NUMBER=%+15554445555% diff --git a/.env.example b/.env.example index 4685cae2e..6671f882d 100644 --- a/.env.example +++ b/.env.example @@ -15,7 +15,7 @@ SIGNALBOOST_API_TOKEN=%HEX STRING% # Use Boost cli to create these, you only need the one specific to the mode you are running in # Format must be e164 (https://www.twilio.com/docs/glossary/what-e164), with the + and with no special characters -SIGNUP_CHANNEL_NUMBER=%+15554445555% +SUPPORT_CHANNEL_NUMBER=%+15554445555% # Twilio // Required in all modes to create channel numbers. Signup at https://www.twilio.com/ # Free accounts work but are limited to one phone number which will limit your ability to create channels diff --git a/.env.gpg b/.env.gpg index e5a820ba310eac96b892ae81d44c1d106a919024..f4a64607fd050bea855904691185813571ee2584 100644 GIT binary patch literal 3446 zcmZo=>|uVD5G<7x$L`9={XgV(lwry5*u4u^dd)X-TKn$v368oF&quSF^t|5}ou0Y7 zi+!up$q@DfTrZ}xEz3L<Ha(#1+o_n1{PFw4dM_SdoN-uX(NzB_Z°Q#=vtb;+je zlS{`v0n_7ubWh~+PqYerKKEC2|Hl*B^+~EvWd64t<<Vu1NHyIXaNo>;g<X;F(etzG z11G+_&yaHVac3*{g#+JCZT=PzHY?ETS53byhxqHuyQkJWCug4W)KmT!9rj24?(|}_ zinFZSHlE(|?6OhOJg0XKr&cI@@#Xlr=A=~O#=He@&)@7i=p0<oy;Q_?iusz_gwz=( zu2L>{U;5;|k6Cl~@pEVQlS^+bZM#^u)cktKp3Cb$-=3EsKBbGZ$N%lw<?|+9KK5SX zInx<|tMVexJR(n7ZBH(He8Ta>t*!gN<@|fXyhY^dE3xYzcSqDr{x|1E7_X~H*~FiX zLYp4CzinRr`r*TG75NRSuj_A|D>wCBe^%(l;cauLeQUjOn0Z&aRoBC*5>`B`xxH>a zx|n}IVd>4i|NgWx@i3ofe9!ZEP3bpA0fw1dCmxJEJ8gID-5nctF4%VH@b<o!m)B{O z%}QS*zO3PUY*1XYwYrwVCEZG?KNogyWX%7&v?)pQ*WF6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I#KYO2<_D0xo%!3nu);ew_Q(hL8v9yQ8%T<tg2_wq*7<dXIEg=^HjRPG&a zj#&J2W%{Ow-iHw;Z|4S`(%|!TVqHD;f9cJgjC!Yi-E%g}eKNSPq@-k8@iO1e_Szt! zTf643uFX9A#zfKEW}kqL#%cW>i56~)1mnD3Mz|*UtPwktq3id_{exfaP5ZxBm=CQz zvWu&C(#h{kVh?8RoHR{)CQqRFmPUcNMHV-9mreFoH-3NeyYbU%8N-xY6N8?|Y&_Pj z*zz~<?5>N>KQ5<<z9>(N5^r#qZ4X=;vhoH~lRf)#XAPm%yNZ5KXZ%rFWjl@EbYYmm p3x?v`yA3BiIlSsg&U@alFrVhxLXp`%O|Dz2l?#PlN!<ww1ONpKlwkk> diff --git a/README.md b/README.md index a63b63e8a..2428b45f2 100644 --- a/README.md +++ b/README.md @@ -476,7 +476,7 @@ For now we'll comment out this optional item because we need the Boost CLI to cr # Use Boost cli to create these, you only need the one specific to the mode you are running in # Format must be e164 (https://www.twilio.com/docs/glossary/what-e164), with the + and with no special characters -#SIGNUP_CHANNEL_NUMBER=%+15554445555% +#SUPPORT_CHANNEL_NUMBER=%+15554445555% ``` #### Configure ansible/inventory diff --git a/app/config/signal.js b/app/config/signal.js index 6839a4ae9..b20760cf7 100644 --- a/app/config/signal.js +++ b/app/config/signal.js @@ -12,7 +12,7 @@ const defaults = { intervalBetweenRegistrations: 2000, // 2 seconds signaldStartupTime: 1000 * 60 * 5, // 5 minutes welcomeDelay: 3000, // 3 sec - supportPhoneNumber: process.env.SIGNUP_CHANNEL_NUMBER, + supportPhoneNumber: process.env.SUPPORT_CHANNEL_NUMBER, defaultMessageExpiryTime: 60 * 60 * 24 * 7, // 1 week expiryUpdateDelay: 200, // 200 millis setExpiryInterval: 2000, // 2 sec @@ -46,7 +46,7 @@ const test = { const development = { ...defaults, - supportPhoneNumber: process.env.SIGNUP_CHANNEL_NUMBER_DEV, + supportPhoneNumber: process.env.SUPPORT_CHANNEL_NUMBER_DEV, } module.exports = { -- GitLab From 5ba4ea9e5df02c4b9926d3c37ce7a0a7d6485f5d Mon Sep 17 00:00:00 2001 From: aguestuser <aguestuser@riseup.net> Date: Wed, 10 Jun 2020 00:47:39 -0400 Subject: [PATCH 3/4] [218] add lint step to gitlab CI --- .gitlab-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 29d3f46a0..1a04fbea4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,5 +19,12 @@ test_unit: - npm install - npx sequelize db:migrate --env test - NODE_ENV=test npx mocha ./test/unit -name '*.spec.js' --recursive -r babel-register --reporter dot --exit + only: + - merge_requests + +test_lint: + script: + - npm install + - npx eslint app && npx eslint test only: - merge_requests \ No newline at end of file -- GitLab From e83b6fd1c4f2b8bc5363a8a6c9e2b316107f1f7b Mon Sep 17 00:00:00 2001 From: aguestuser <aguestuser@riseup.net> Date: Wed, 10 Jun 2020 01:01:21 -0400 Subject: [PATCH 4/4] [218] prefer yarn to npm install --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a04fbea4..1b4b6ec91 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ test_unit: - name: postgres:latest alias: db script: - - npm install + - yarn install - npx sequelize db:migrate --env test - NODE_ENV=test npx mocha ./test/unit -name '*.spec.js' --recursive -r babel-register --reporter dot --exit only: @@ -24,7 +24,7 @@ test_unit: test_lint: script: - - npm install + - yarn install - npx eslint app && npx eslint test only: - merge_requests \ No newline at end of file -- GitLab