diff --git a/README.md b/README.md index c941630d..4b83927e 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ To secure your webpage, you only have to set the `ITC_TOKEN` environment variabl - `ITC_CLOSED_TEXT` Set this text to temporary disable enrollment of new beta testers - `RESTRICTED_DOMAIN` Set this domain (in the format `domain.com`) to restrict users with emails in another domain from signing up. This list supports multiple domains by setting it to a comma delimited list (`domain1.com,domain2.com`) - `FASTLANE_ITC_TEAM_NAME` If you're in multiple teams, enter the name of your iTC team here. Make sure it matches. +- `MAX_NUMBER_OF_TESTERS` Set a limit on the number of tester that are allowed to sign up (`500`). ## Custom Domain diff --git a/app/controllers/invite_controller.rb b/app/controllers/invite_controller.rb index 48970ac0..084cf313 100644 --- a/app/controllers/invite_controller.rb +++ b/app/controllers/invite_controller.rb @@ -72,6 +72,16 @@ def submit begin login + if ENV['MAX_NUMBER_OF_TESTERS'] + if ENV['MAX_NUMBER_OF_TESTERS'].to_i <= Spaceship::Tunes::Tester::External.all.count + @message = t(:message_max_testers) + @type = 'warning' + render :index + #ENV['ITC_CLOSED_TEXT'] = t(:message_max_testers) + return + end + end + tester = Spaceship::Tunes::Tester::External.find_by_app(apple_id, email) logger.info "Found tester #{tester}" @@ -101,7 +111,7 @@ def submit end @type = "success" end - + rescue => ex Rails.logger.fatal ex.inspect Rails.logger.fatal ex.backtrace.join("\n") diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 6f50145f..c5ad576d 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -30,6 +30,7 @@ cs: password_placeholder: "Heslo" get_beta_access: "Získat přístup k beta verzi" message_invalid_password: "Neplatné heslo, kontaktujte prosím provozovatele aplikace" + message_max_testers: "Maximum number of testers has been reached, please check back later" message_demo_page: "Toto je demo stránka. Tady by byla potvrzující zpráva s informacemi o TestFlight emailu" message_success_live: "Byl jste úspěšně přidán jako tester. Zkontrolujte svou emailovou schránku kvůli pozvánce" message_success_pending: "Byl jste úspěšně přidán jako tester. Budeme Vás informovat, jakmile bude k dispozici další testovací verze" diff --git a/config/locales/da.yml b/config/locales/da.yml index b912691b..3e5f861e 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -30,6 +30,7 @@ da: password_placeholder: "Kodeord" get_beta_access: "Få Beta Adgang" message_invalid_password: "Forkert kodeord, kontakt venligst app ejeren" + message_max_testers: "Maximum number of testers has been reached, please check back later" message_demo_page: "Dette er en test side. Her kommer success beskeden med information om TestFlight e-mailen" message_success_live: "Du er blevet tilføjet som tester. Tjek din e-mail for invitationen" message_success_pending: "Du er blevet tilføjet som tester. Du får besked når næste version er tilgængelig" diff --git a/config/locales/de.yml b/config/locales/de.yml index 942c3c75..6a16330c 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -30,6 +30,7 @@ de: password_placeholder: "Passwort" get_beta_access: "Beta-Zugang anfordern" message_invalid_password: "Ungültiges Passwort, bitte kontaktieren Sie den Hersteller der Applikation" + message_max_testers: "Maximum number of testers has been reached, please check back later" message_demo_page: "Dies ist eine Demoseite. Hier würde die Bestätigung mit Informationen über die TestFlight E-Mail stehen" message_success_live: "Sie wurden erfolgreich als Tester hinzugefügt. Überprüfen Sie Ihren Posteingang für eine Einladung" message_success_pending: "Sie wurden erfolgreich als Tester hinzugefügt. Sie werden benachrichtigt sobald eine neue Version verfügbar ist" diff --git a/config/locales/en.yml b/config/locales/en.yml index b310ecf6..2828b93a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,6 +30,7 @@ en: password_placeholder: "Password" get_beta_access: "Get Beta Access" message_invalid_password: "Invalid password given, please contact the application owner" + message_max_testers: "Maximum number of testers has been reached, please check back later" message_demo_page: "This is a demo page. Here would be the success message with information about the TestFlight email" message_success_live: "Successfully added you as a tester. Check your email inbox for an invite" message_success_pending: "Successfully added you as a tester. You'll be notified once the next build is available" diff --git a/config/locales/es.yml b/config/locales/es.yml index 37d2b058..b567cc68 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -30,8 +30,9 @@ es: password_placeholder: "Contraseña" get_beta_access: "Acceder a la beta" message_invalid_password: "Contraseña incorrecta, por favor contacta con el propietario de la aplicación" + message_max_testers: "Maximum number of testers has been reached, please check back later" message_demo_page: "Esto es una página de prueba. Aquí tendrías el mensaje de éxito con la información sobre el correo electrónico de TestFlight" message_success_live: "Has sido añadido como tester. Revisa tu correo para ver la invitación" message_success_pending: "Has sido añadido como tester. Se te avisará una vez que la próxima versión esté disponible" message_email_exists: "La dirección de correo electrónico introducida, ya estaba registrada" - message_error: "Algo fue mal, contacta con el propietario de la aplicación" \ No newline at end of file + message_error: "Algo fue mal, contacta con el propietario de la aplicación" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e878c0ee..a86037bb 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -30,6 +30,7 @@ fr: password_placeholder: "Mot de passe" get_beta_access: "Accéder à la beta" message_invalid_password: "Le mot de passe est invalide. Veuillez contacter le développeur de l'application." + message_max_testers: "Maximum number of testers has been reached, please check back later" message_demo_page: "Ceci est une page de démonstration. Voici à quoi ressemblerait le message à propos de l'e-mail TestFlight." message_success_live: "Vous avez bien été enregistré en tant que testeur. Une invitation vous a été envoyée, veuillez relever votre boîte e-mail." message_success_pending: "Vous avez bien été enregistré en tant que testeur. Vous serez averti par e-mail lorsque l'application sera disponible." diff --git a/config/locales/it.yml b/config/locales/it.yml index 8f05055e..718775de 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -30,6 +30,7 @@ it: password_placeholder: "Password" get_beta_access: "Ottieni l'accesso beta" message_invalid_password: "Password invalida, per favore contatta il proprietario dell'applicazione" + message_max_testers: "Maximum number of testers has been reached, please check back later" message_demo_page: "Questa è una pagina di esempio. Qui ci sarebbe il messaggio di conferma con le informazioni riguardo l'email di TestFlight" message_success_live: "Sei stato aggiunto come tester. Controlla la tua mail per l'invito" message_success_pending: "Sei stato aggiunto come tester. Sarai avvisato quando la prossima build sarà disponibile" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 165eeae4..ceb9eb34 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -30,6 +30,7 @@ ru: password_placeholder: "Пароль" get_beta_access: "Получить доступ к beta-версии." message_invalid_password: "Неверный пароль. Пожалуйста, свяжитесь с разработчиком приложения." + message_max_testers: "Maximum number of testers has been reached, please check back later" message_demo_page: "Это демо-страница. Здесь будет сообщение с информацией о письме от TestFlight." message_success_live: "Вы успешно добавлены в программу beta-тестирования. Вам на почту придет приглашение." message_success_pending: "Вы успешно добавлены в программу beta-тестирования. Вам придет уведомление, как только следующая beta-версия приложения станет доступна." diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 12459ef5..282364e3 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -31,6 +31,7 @@ zh-TW: get_beta_access: "取得測試邀請" message_invalid_password: "錯誤的密碼,請聯繫程式作者" message_demo_page: "這是一個測試頁面,這邊將會有成功訊息與關於 TestFlight 邀請信的相關資訊。" + message_max_testers: "Maximum number of testers has been reached, please check back later" message_success_live: "已經成功將你加為測試者,請確認信箱中的邀請函。" message_success_pending: "已經成功將你加為測試者,你將在下次新版釋出時收到通知。" message_email_exists: "Email 已經被註冊"