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 an optional cap for the number of testers #108

Open
wants to merge 2 commits into
base: master
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 11 additions & 1 deletion app/controllers/invite_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -101,7 +111,7 @@ def submit
end
@type = "success"
end

rescue => ex
Rails.logger.fatal ex.inspect
Rails.logger.fatal ex.backtrace.join("\n")
Expand Down
1 change: 1 addition & 0 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
message_error: "Algo fue mal, contacta con el propietario de la aplicación"
1 change: 1 addition & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
1 change: 1 addition & 0 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-версия приложения станет доступна."
Expand Down
1 change: 1 addition & 0 deletions config/locales/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 已經被註冊"
Expand Down