|
@@ -1,11 +1,11 @@
|
|
|
<form action="/_api/admin/security/passport-github" method="post" class="form-horizontal passportStrategy" id="githubSetting" role="form"
|
|
<form action="/_api/admin/security/passport-github" method="post" class="form-horizontal passportStrategy" id="githubSetting" role="form"
|
|
|
{% if isRestartingServerNeeded %}style="opacity: 0.4;"{% endif %}>
|
|
{% if isRestartingServerNeeded %}style="opacity: 0.4;"{% endif %}>
|
|
|
- <legend>GitHub OAuth {{ t("security_setting.configuration") }}</legend>
|
|
|
|
|
- <p class="well alert-anchor">{{ t("security_setting.connect_api_manager") }}</p>
|
|
|
|
|
|
|
+ <legend>{{ t("security_setting.OAuth.GitHub.name") }}{{ t("security_setting.configuration") }}</legend>
|
|
|
|
|
+ <p class="well alert-anchor">{{ t("security_setting.OAuth.connect_api_manager", "https://github.com/settings/developers", "GitHub Developer Settings") }}</p>
|
|
|
{% set nameForIsGitHubEnabled = "settingForm[security:passport-github:isEnabled]" %}
|
|
{% set nameForIsGitHubEnabled = "settingForm[security:passport-github:isEnabled]" %}
|
|
|
{% set isGitHubEnabled = settingForm['security:passport-github:isEnabled'] %}
|
|
{% set isGitHubEnabled = settingForm['security:passport-github:isEnabled'] %}
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
- <label for="{{nameForIsGitHubEnabled}}" class="col-xs-3 control-label">{{ t("security_setting.GitHub_OAuth.use_GitHub_OAuth") }}</label>
|
|
|
|
|
|
|
+ <label for="{{nameForIsGitHubEnabled}}" class="col-xs-3 control-label">{{ t("security_setting.OAuth.GitHub.name") }}</label>
|
|
|
<div class="col-xs-6">
|
|
<div class="col-xs-6">
|
|
|
<div class="btn-group btn-toggle" data-toggle="buttons">
|
|
<div class="btn-group btn-toggle" data-toggle="buttons">
|
|
|
<label class="btn btn-default btn-rounded btn-outline {% if isGitHubEnabled %}active{% endif %}" data-active-class="primary">
|
|
<label class="btn btn-default btn-rounded btn-outline {% if isGitHubEnabled %}active{% endif %}" data-active-class="primary">
|
|
@@ -22,16 +22,12 @@
|
|
|
<fieldset id="passport-github-hide-when-disabled" {%if !isGitHubEnabled %}style="display: none;"{% endif %}>
|
|
<fieldset id="passport-github-hide-when-disabled" {%if !isGitHubEnabled %}style="display: none;"{% endif %}>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
- <label for="settingForm[security:passport-github:clientId]" class="col-xs-3 control-label">{{ t("security_setting.github_setting") }}</label>
|
|
|
|
|
|
|
+ <label for="settingForm[security:passport-github:clientId]" class="col-xs-3 control-label">{{ t("security_setting.OAuth.register", t("security_setting.OAuth.GitHub.name") ) }}</label>
|
|
|
<div class="col-xs-6">
|
|
<div class="col-xs-6">
|
|
|
<ol class="help-block">
|
|
<ol class="help-block">
|
|
|
- <li>{{ t("security_setting.access_api_manager") }}</li>
|
|
|
|
|
- <li>{{ t("security_setting.create_project") }}</li>
|
|
|
|
|
- <li>{{ t("security_setting.create_auth_to_oauth") }}</li>
|
|
|
|
|
- <ol>
|
|
|
|
|
- <li>{{ t("security_setting.select_webapp") }}</li>
|
|
|
|
|
- <li>{{ t("security_setting.GitHub_OAuth.change_redirect_url", "https://${growi.host}/passport/github/callback", "${growi.host}") }}</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
|
|
+ <li>{{ t("security_setting.OAuth.GitHub.register_1", "https://github.com/settings/developers", "GitHub Developer Settings") }}</li>
|
|
|
|
|
+ <li>{{ t("security_setting.OAuth.GitHub.register_2", "https://${growi.host}/passport/github/callback", "${growi.host}") }}</li>
|
|
|
|
|
+ <li>{{ t("security_setting.OAuth.GitHub.register_3") }}</li>
|
|
|
</ol>
|
|
</ol>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -55,11 +51,11 @@
|
|
|
<input type="checkbox" id="bindByUserName-GitHub" name="settingForm[security:passport-github:isSameUsernameTreatedAsIdenticalUser]" value="1"
|
|
<input type="checkbox" id="bindByUserName-GitHub" name="settingForm[security:passport-github:isSameUsernameTreatedAsIdenticalUser]" value="1"
|
|
|
{% if settingForm['security:passport-github:isSameUsernameTreatedAsIdenticalUser'] %}checked{% endif %} />
|
|
{% if settingForm['security:passport-github:isSameUsernameTreatedAsIdenticalUser'] %}checked{% endif %} />
|
|
|
<label for="bindByUserName-GitHub">
|
|
<label for="bindByUserName-GitHub">
|
|
|
- {{ t("security_setting.ldap.Treat username matching as identical") }}
|
|
|
|
|
|
|
+ {{ t("security_setting.Treat username matching as identical", "username") }}
|
|
|
</label>
|
|
</label>
|
|
|
<p class="help-block">
|
|
<p class="help-block">
|
|
|
<small>
|
|
<small>
|
|
|
- {{ t("security_setting.ldap.Treat username matching as identical_warn") }}
|
|
|
|
|
|
|
+ {{ t("security_setting.Treat username matching as identical_warn", "username") }}
|
|
|
</small>
|
|
</small>
|
|
|
</p>
|
|
</p>
|
|
|
</div>
|
|
</div>
|
|
@@ -76,81 +72,6 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
</form>
|
|
|
-{% if false %}
|
|
|
|
|
-<hr>
|
|
|
|
|
-<h4>
|
|
|
|
|
- <i class="fa fa-question-circle" aria-hidden="true"></i>
|
|
|
|
|
- <a href="#collapseHelpForApp" data-toggle="collapse">How to configure Slack App?</a>
|
|
|
|
|
-</h4>
|
|
|
|
|
-
|
|
|
|
|
-<ol id="collapseHelpForApp" class="collapse">
|
|
|
|
|
- <li>
|
|
|
|
|
- Register Slack App
|
|
|
|
|
- <ol>
|
|
|
|
|
- <li>
|
|
|
|
|
- Create App from <a href="https://api.slack.com/applications/new">this link</a>, and fill the form out as below:
|
|
|
|
|
- <dl class="dl-horizontal">
|
|
|
|
|
- <dt>App Name</dt> <dd><code>growi</code> </dd>
|
|
|
|
|
- <dt>Development Slack Team</dt> <dd>Select the team you want to notify to.</dd>
|
|
|
|
|
- </dl>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li><strong>Save</strong> it.</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- Get App Credentials
|
|
|
|
|
- <ol>
|
|
|
|
|
- <li>Go To "Basic Information" page and make a note "Client ID" and "Client Secret".</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- Set Redirect URLs
|
|
|
|
|
- <ol>
|
|
|
|
|
- <li>Go to "OAuth & Permissions" page.</li>
|
|
|
|
|
- <li>Add <code><script>document.write(location.origin);</script>/admin/notification/slackAuth</code> .</li>
|
|
|
|
|
- <li>Don't forget to <strong>save</strong>.</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- Set Permission Scopes to the App
|
|
|
|
|
- <ol>
|
|
|
|
|
- <li>Go to "OAuth & Permissions" page.</li>
|
|
|
|
|
- <li>Add "Send messages as GROWI"(<code>chat:write:bot</code>).</li>
|
|
|
|
|
- <li>Don't forget to <strong>save</strong>.</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- Create a bot user
|
|
|
|
|
- <ol>
|
|
|
|
|
- <li>Go to "Bot Users" page and add.</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- Install the app
|
|
|
|
|
- <ol>
|
|
|
|
|
- <li>Go to "Install App to Your Team" page and install.</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- (At Team) Approve the app
|
|
|
|
|
- <ol>
|
|
|
|
|
- <li>Go to the management Apps page for the team you installed the app and approve "growi".</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- (At Team) Invite the bot to your team
|
|
|
|
|
- <ol>
|
|
|
|
|
- <li>Invite the user you created in <code>4. Add a bot user</code> to the channel you notify to.</li>
|
|
|
|
|
- </ol>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- (At GROWI admin page) Input "clientId" and "clientSecret" and submit on this page.
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- (At GROWI admin page) Click "Connect to Slack" button to start OAuth process.
|
|
|
|
|
- </li>
|
|
|
|
|
-</ol>
|
|
|
|
|
-{% endif %}
|
|
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
$('input[name="settingForm[security:passport-github:isEnabled]"]').change(function() {
|
|
$('input[name="settingForm[security:passport-github:isEnabled]"]').change(function() {
|