Skip to content

Commit

Permalink
Feat: Add instructions on how to create a Mastodon app (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage authored Sep 13, 2023
1 parent e600ba5 commit f804875
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,33 @@ <h3 class="card-title">Setup OAuth</h3>
</div>
<div class="card-body">
<p>
Before you can synchronize your settings, you must create an OAuth app and put its credentials here.
Any settings you put here are only stored in your browser.
Before you can synchronize your settings, you must create an
<a target="_blank" href="https://{{currentInstance}}/settings/applications">OAuth app</a> and put its
credentials here. Any settings you put here are only stored in your browser.
</p>

<p>Your OAuth app settings should include this redirect uri: <code>{{redirectUrl}}</code></p>
<p>Your OAuth app needs these settings:</p>
<ul>
<li><strong>Redirect URI</strong> - <code>{{redirectUrl}}</code></li>
<li>
<strong>Scopes</strong> -
<ul>
<li><code>admin:read:domain_allows</code></li>
<li><code>admin:read:domain_blocks</code></li>
<li><code>admin:write:domain_allows</code></li>
<li><code>admin:write:domain_blocks</code></li>
</ul>
</li>
</ul>

<form [formGroup]="oauthForm" (submit)="saveOauthAndRedirect()">
<div class="form-group">
<label for="inputClientId">Client ID</label>
<input id="inputClientId" class="form-control" formControlName="clientId" />
<label for="inputClientId">Client key</label>
<input id="inputClientId" class="form-control" formControlName="clientId"/>
</div>
<div class="form-group">
<label for="inputClientSecret">Client secret</label>
<input id="inputClientSecret" class="form-control" formControlName="secret" />
<input id="inputClientSecret" class="form-control" formControlName="secret"/>
</div>
<button type="submit" class="btn btn-primary" [disabled]="!oauthForm.valid">Save</button>
</form>
Expand All @@ -46,11 +59,13 @@ <h3 class="card-title">Synchronization</h3>
<div [formGroup]="form">
<div class="form-group">
<div class="custom-control custom-switch custom-switch-on-danger">
<input class="custom-control-input" type="checkbox" id="inputMakeReasonsPublic" formControlName="reasonsPublic" aria-describedby="inputMakeReasonsPublicDescription" />
<input class="custom-control-input" type="checkbox" id="inputMakeReasonsPublic"
formControlName="reasonsPublic" aria-describedby="inputMakeReasonsPublicDescription"/>
<label for="inputMakeReasonsPublic" class="custom-control-label">Make reasons public</label>
</div>
<small id="inputMakeReasonsPublicDescription">
If enabled, the censure reasons will be displayed publicly in your Mastodon blocklist, otherwise they'll be visible as a private note.
If enabled, the censure reasons will be displayed publicly in your Mastodon blocklist, otherwise they'll
be visible as a private note.
</small>
</div>
</div>
Expand All @@ -60,7 +75,7 @@ <h3 class="card-title">Synchronization</h3>
<h3>Preview</h3>

<div class="position-relative">
<app-loader *ngIf="loadingPreview else previewTable" />
<app-loader *ngIf="loadingPreview else previewTable"/>
</div>

<ng-template #previewTable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {NormalizedInstanceDetailResponse} from "../../../response/normalized-ins
styleUrls: ['./synchronize-mastodon.component.scss']
})
export class SynchronizeMastodonComponent implements OnInit {
protected readonly currentInstance = this.authManager.currentInstanceSnapshot.name;

private syncSettings: MastodonSynchronizationSettings = this.database.mastodonSynchronizationSettings;

public oauthForm = new FormGroup({
Expand Down

0 comments on commit f804875

Please sign in to comment.