Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Twilio SMS #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG DISTRO="alpine"
FROM docker.io/tiredofit/nginx-php-fpm:${PHP_VERSION}-${DISTRO}
LABEL maintainer="Dave Conroy (github.com/tiredofit)"

ENV SSP_VERSION=1.3 \
ENV SSP_VERSION=1.5.3 \
PHP_ENABLE_LDAP=TRUE \
PHP_ENABLE_CREATE_SAMPLE_PHP=FALSE \
NGINX_SITE_ENABLED=ssp \
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,15 @@ Be sure to view the following repositories to understand all the customizable op
| `SMS_TOKEN_LENGTH` | How many digits for a SMS Code | `6` |
| `SMS_TRUNCATE_NUMBER_LENGTH` | How many characters for above | `10` |
| `SMS_TRUNCATE_NUMBER` | Truncate Characters of number | `false` |
| `TWILIO_SID` | Twilio SID for API access | None |
| `TWILIO_AUTH_TOKEN` | Twilio auth token for API access | None |
| `TWILIO_OUTGOING_NUMBER` | Number to send SMS from | None |

Twilio setup:

Set `SMS_API_LIB` to `lib/smsapi-twilio.inc.php`.

You can get the TWILIO_SID and TWILIO_AUTH_TOKEN from [the Twilio console](https://www.twilio.com/console), and the TWILIO_OUTGOING_NUMBER from [the Twilio phone number database](https://www.twilio.com/console/phone-numbers/search).

#### SSH Settings

Expand Down
11 changes: 10 additions & 1 deletion install/assets/functions/30-self-service-password
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@ update_config() {
update_config_noquote() {
print_debug "Updating \$${1} with value '${2}"
sed -i -e "s#${1} = .*#${1} = ${2};#g" ${NGINX_WEBROOT}/conf/config.inc.php
}
}

add_to_config() {
if [[ -z "${2}" ]] ; then
print_debug "Not adding '\$${1}', no value provided"
else
print_debug "Adding '\$${1}' with value '${2}"
echo "${1} = \"${2}\"" >> ${NGINX_WEBROOT}/conf/config.inc.php
fi
}
5 changes: 5 additions & 0 deletions install/etc/cont-init.d/30-self-service-password
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ if [ "${SETUP_TYPE,,}" = "auto" ]; then
update_config recaptcha_size "${RECAPTCHA_SIZE}"
update_config_noquote recaptcha_request_method "${RECAPTCHA_REQUEST_METHOD}"

## Twilio
add_to_config twilio_sid "${TWILIO_SID}"
add_to_config twilio_auth_token "${TWILIO_AUTH_TOKEN}"
add_to_config twilio_outgoing_number "${TWILIO_OUTGOING_NUMBER}"

## Default action
update_config default_action "${DEFAULT_ACTION}"

Expand Down