Skip to content
25 changes: 22 additions & 3 deletions conf/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,13 @@
[captcha]

; Whether or not to enable ReCaptcha
recaptcha = off
recaptcha = __RECAPTCHA__

; Public key for reCaptcha (see http://www.google.com/recaptcha)
recaptcha_public_key = your_public_key
recaptcha_public_key = __RECAPTCHA_PUBLIC__

; Private key for reCaptcha (see http://www.google.com/recaptcha)
recaptcha_private_key = your_private_key
recaptcha_private_key = __RECAPTCHA_PRIVATE__

; Whether or not to use Captcha on user registration
captcha_on_register = on
Expand All @@ -454,6 +454,25 @@
; Validate the hostname in the ReCaptcha response
recaptcha_enforce_hostname = Off

; Whether or not to enable ALTCHA
altcha = __ALTCHA__

; Private key for ALTCHA
altcha_hmackey = '__APP_KEY__'

; Whether or not to use ALTCHA on user registration
altcha_on_register = on

; Whether or not to use ALTCHA on user login
altcha_on_login = on

; Whether or not to use ALTCHA on user lost password
altcha_on_lost_password = on

; The quantity of encryption cycles performed by the ALTCHA system
altcha_encrypt_number = 10000


;;;;;;;;;;;;;;;;;;;;;
; External Commands ;
;;;;;;;;;;;;;;;;;;;;;
Expand Down
37 changes: 37 additions & 0 deletions config_panel.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version = "1.0"

[main]
name.en = "OJS configuration"
name.fr = "Configuration d'OJS"

[main.config]
name.en = "Configuration Options"
name.fr = "Options de configuration"

[main.config.altcha]
ask.en = "Enable / Disable Altcha"
ask.fr = "Activer / Désactiver Altcha"
type = "select"
choices = [ "on", "off" ]

[main.config.altcha_hmackey]
ask.en = "Hmackey for Altcha"
ask.fr = "Hmackey pour Altcha"
type = "string"

[main.config.recaptcha]
ask.en = "Enable / Disable recaptcha"
ask.fr = "Activer / Désactiver recaptcha"
type = "select"
choices = [ "on", "off" ]

[main.config.recaptcha_public]
ask.en = "Public key for recaptcha"
ask.fr = "Clé publique pour recaptcha"
type = "string"

[main.config.recaptcha_private]
ask.en = "Private key for recaptcha"
ask.fr = "Clé privée pour recaptcha"
type = "string"

3 changes: 3 additions & 0 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,6 @@ ram.runtime = "50M"

[resources.database]
type = "mysql"

[resources.composer]
version = "2.9.2"
19 changes: 19 additions & 0 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ ynh_app_setting_set --key=timezone --value=$timezone

timezone_formatted=$(format_timezone "$timezone")

altcha=off
ynh_app_setting_set --key=altcha --value=$altcha

altcha_hmackey=""
ynh_app_setting_set --key=altcha_hmackey --value=$altcha_hmackey

recaptcha=off
ynh_app_setting_set --key=recaptcha --value=$recaptcha

recaptcha_public=""
ynh_app_setting_set --key=recaptcha_public --value=$recaptcha_public

recaptcha_private=""
ynh_app_setting_set --key=recaptcha_private --value=$recaptcha_private

#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
Expand Down Expand Up @@ -77,6 +92,10 @@ ynh_hide_warnings ynh_exec_as_app OJS_LOCALE="$language" \
OJS_OAI_ID="$domain" \
php$php_version "$install_dir/tools/unattended_install.php"

pushd $install_dir
ynh_composer_exec require altcha-org/altcha
popd

ynh_store_file_checksum "$install_dir/config.inc.php"
ynh_hide_warnings ynh_config_add --template="config.inc.php" --destination="$install_dir/config.inc.php"
ynh_replace --match="installed = Off" --replace="installed = On" --file="$install_dir/config.inc.php"
Expand Down
7 changes: 7 additions & 0 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ if [[ "${mail_user:-}" != "noreply" && "${mail_user:-}" != "contact" ]]; then
ynh_app_setting_set --key=mail_user --value="noreply"
fi

ynh_app_setting_set_default --key=altcha --value="off"
ynh_app_setting_set_default --key=altcha_hmackey --value=""
ynh_app_setting_set_default --key=recaptcha --value="off"
ynh_app_setting_set_default --key=recaptcha_public --value=""
ynh_app_setting_set_default --key=recaptcha_private --value=""

salt=$(ynh_app_setting_get --app=$app --key=salt)
api_key_secret=$(ynh_app_setting_get --app=$app --key=api_key_secret)
app_key=$(ynh_app_setting_get --app=$app --key=app_key)
Expand Down Expand Up @@ -106,6 +112,7 @@ chown -R "$app:www-data" "$install_dir"
pushd $install_dir
php$php_version tools/upgrade.php check
php$php_version -d memory_limit=2048M tools/upgrade.php upgrade
ynh_composer_exec require altcha-org/altcha
popd

chown -R "$app:www-data" "$install_dir"
Expand Down
Loading