Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Add github app config information #424

Merged
merged 17 commits into from
Aug 31, 2023
4 changes: 2 additions & 2 deletions app/views/docs/authentication-management.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ let prefs = try await account.getPrefs()</code></pre>

<h2><a href="#labels" id="labels">Labels</a></h2>
<p>
Labels are a good way to flag a user to grant them access to resources.
Labels are a good way to categorize a user to grant them access to resources.
For example, a <code>subscriber</code> label can be added to a user once they've purchased a subscription.
</p>

Expand Down Expand Up @@ -414,7 +414,7 @@ var response = await users.UpdateLabels(
</p>

<p>
For example, in a todo app, a user can <a href="docs/client/teams#teamsCreate">create a team</a> for one of their todo lists and <a href="/docs/client/teams#teamsCreateMembership">invite another user</a> to the team to grant the other user access.
For example, in a todo app, a user can <a href="/docs/client/teams#teamsCreate">create a team</a> for one of their todo lists and <a href="/docs/client/teams#teamsCreateMembership">invite another user</a> to the team to grant the other user access.
The invited user can <a href="/docs/client/teams#teamsUpdateMembershipStatus">accept the invitation</a> to gain access.
If the user's ever removed from the team, they'll lose access again.
</p>
157 changes: 149 additions & 8 deletions app/views/docs/configuration.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,143 @@
<h2><a href="#git" id="git">Configure GitHub App</a></h2>
<p>
Appwrite supports automatic deployments through Git integration.
In order for Appwrite to access your repos, you must configure a GitHub app to enable this integration.
In order for Appwrite to access your repos, you must <a href="https://docs.github.com/en/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps" target="_blank" rel="noopener">create a GitHub app</a> to enable this integration.
The GitHub app requires the following configurations.
</p>

<p>You'll have to configure the following environment variables.</p>
<p>
For automatic Git deployment to work, Appwrite needs to receive communication from GitHub, this means your Appwrite project must be accessible on the internet.
If you're running on <code>localhost</code>, you need to run a proxy like <b>ngrok</b>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a hyperlink to the ngrok website

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linked

</p>

<h3><a href="#callback" id="callback">Callback URL</a></h3>
<p>
GitHub will use <b>callback URLs</b> to redirect users back to Appwrite.
Set these callback URLs under <b>Identifying and authorizing users</b>.
</p>
<table class="full">
<thead>
<tr>
<td>URLs</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>http://[HOSTNAME_OR_IP]/v1/vcs/github/callback</code></td>
</tr>
<tr>
<td><code>http://[HOSTNAME_OR_IP]/v1/account/sessions/oauth2/callback/github/console</code></td>
</tr>
</tbody>
</table>

<h3><a href="#post-install" id="post-install">Post Installation</a></h3>
<p>
Check the <b>Redirect on update</b> box under the <b>Post installation</b> section.
</p>


<h3><a href="#github-webhooks" id="github-webhooks">Webhook</a></h3>
<p>
GitHub will notify Appwrite about events like new commits using webhooks.
Under <b>Webhook</b>, you need to check the <b>Active</b> checkbox.
You also need to set the <b>Webhook URL</b> as <code>https://[HOSTNAME_OR_IP]/v1/vcs/github/events</code>.
</p>

<p>
If you're running Appwrite on <code>localhost</code>, GitHub can't send requests to Appwrite through webhooks and automatic deployments won't work.
You'll need host Appwrite on a server or use a proxy like <a href="https://ngrok.com/">ngrok</a> to make Appwrite accessible to GitHub.
</p>

<h3><a href="#repository-permission" id="repository-permission">Repository Permissions</a></h3>
<p>
Configure these permissions under the <b>Repository permission</b> dropdown.
</p>
<table class="full">
<thead>
<tr>
<td>Permission</td>
<td>Access</td>
</tr>
</thead>
<tbody>
<tr>
<td>Administration</td>
<td>Read and write</td>
</tr>
<tr>
<td>Checks</td>
<td>Read and write.</td>
</tr>
<tr>
<td>Commit Statuses</td>
<td>Read and write</td>
</tr>
<tr>
<td>Contents</td>
<td>Read and write</td>
</tr>
<tr>
<td>Issues</td>
<td>Read and write</td>
</tr>
<tr>
<td>Metadata</td>
<td>Read-only</td>
</tr>
<tr>
<td>Pull requests</td>
<td>Read and write</td>
</tr>
<tr>
<td>Webhooks</td>
<td>Read and write</td>
</tr>
</tbody>
</table>

<h3><a href="#account-permission" id="account-permission">Account Permissions</a></h3>
<p>
Configure these permissions under the <b>Account Permission</b> dropdown.
</p>
<table class="full">
<thead>
<tr>
<td>Permission</td>
<td>Access</td>
</tr>
</thead>
<tbody>
<tr>
<td>Email address</td>
<td>Read-only</td>
</tr>
</tbody>
</table>

<h3><a href="#subscribe-events" id="subscribe-events">Subscribe to Events</a></h3>
<p>
Select these under the <b>Subscribe to events</b> dropdown.
</p>
<table class="full">
<thead>
<tr>
<td>Event</td>
<td></td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td>Pull request</td>
<td>Push</td>
<td></td>
</tr>
</tbody>
</table>

<h3><a href="#github-variables" id="github-variables">Environment Variables</a></h3>
<p>After creating your app, you'll have to configure the following environment variables.</p>

<table class="full">
<thead>
Expand All @@ -37,7 +170,7 @@
<tbody>
<tr>
<td>_APP_VCS_GITHUB_APP_NAME</td>
<td>Name of your GitHub app. This value should be set to your GitHub application's URL.</td>
<td>Name of your GitHub app. This is the display name you'll see on GitHub and it will be visible in your GitHub app's URL.</td>
</tr>
<tr>
<td>_APP_VCS_GITHUB_PRIVATE_KEY</td>
Expand All @@ -64,6 +197,14 @@

<p><a href="/docs/environment-variables"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> Learn more about environment variables</a></p>

<h3><a href="#existing-apps" id="existing-apps">Update Existing GitHub Apps</a></h3>
<p>
If you're editing existing GitHub apps, there are additional steps.
Every time you update your GitHub app's permissions, GitHub will prompt you to review the changes.
You will receive an email and you'll find a prompt under <b>Settings</b> > <b>Integrations</b> > <b>Applications</b> > <b>Installed GitHub Apps</b> > find your GitHub app > <b>Configure</b>.
You need accept the change so they're applied to your app.
</p>

<h2><a href="#functions" id="functions">Configure Function Runtimes</a></h2>
<p>
Not all function runtimes are enabled by default. Enable the runtimes that you need and disable unused runtimes to save disk space on your server.
Expand All @@ -80,18 +221,18 @@

<p>You can find a full list of supported runtimes on the <a href="/docs/environment-variables#functions">environment variables</a> page.</p>

<p>You can also configure the maximum timeout that can be set on individual Appwrite functions. The maximum configurable timeout can be increased by changing the <code>_APP_FUNCTIONS_TIMEOUT</code> environment variable. This environment variable changes the configurable maximum but does not alter existing individual configurations.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _APP_FUNCTIONS_RUNTIMES above shouldn't have spaces

<p>You can also configure the maximum timeout that can be set on individual Appwrite functions. The maximum configurable timeout can be increased by changing the <code>_APP_FUNCTIONS_TIMEOUT</code> environment variable. This environment variable changes the configurable maximum but does not alter existing configurations of individual functions.</p>

<h2><a href="#storage" id="storage">Storage Adaptors</a></h2>
<h2><a href="#storage" id="storage">Storage Adapters</a></h2>
<p>Appwrite's Storage Service can be configured to store files locally, or with self-hosted and cloud storage services. By default, Appwrite's Storage Service <b>stores files on your server's local storage</b>. If you expect large volumes of data or the need to have scalable data storage, you may choose to use a separate storage service.</p>

<p>Appwrite supports AWS S3, Digital Ocean Spaces, Backblaze, Akamai Object Storage, and Wasabi as storage adaptors. Some of these services can be self-hosted, just like Appwrite.</p>
<p>Appwrite supports AWS S3, Digital Ocean Spaces, Backblaze, Akamai Object Storage, and Wasabi as storage adapters. Some of these services can be self-hosted, just like Appwrite.</p>

<p>You can select which storage adaptor to use by setting the <code>_APP_STORAGE_DEVICE</code> environment variable. Valid values are <code>local</code>, <code>s3</code>, <code>dospaces</code>, <code>backblaze</code>, <code>linode</code> and <code>wasabi</code>. Each storage adaptor requires its own set of additional environment variables to configure.</p>
<p>You can select which storage adaptor to use by setting the <code>_APP_STORAGE_DEVICE</code> environment variable. Valid values are <code>local</code>, <code>s3</code>, <code>dospaces</code>, <code>backblaze</code>, <code>linode</code>, and <code>wasabi</code>. Each storage adaptor requires its own set of additional environment variables to configure.</p>

<p>The maximum size for individual file uploads is controlled by the <code>_APP_STORAGE_LIMIT</code> environment variable, which defaults to 30 MB. See <a href="/docs/environment-variables#storage">Environment Variables</a> for more information.</p>

<p><a href="/docs/environment-variables#storage"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> Configure storage adaptors</a></p>
<p><a href="/docs/environment-variables#storage"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> Configure storage adapters</a></p>

<h2><a href="#apply-changes" id="apply-changes">Applying Changes</a></h2>
<p>After editing your <code>docker-compose.yml</code> or <code>.env</code> files, you will need to recreate your Appwrite stack by running the following compose command in your terminal.</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/docs/email-and-sms-templates.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
depending on the configured locale.
</p>

<h2><a href="#smtp" id="#smtp">Custom SMTP server</a></h2>
<h2><a href="#smtp" id="smtp">Custom SMTP server</a></h2>
<p>
Appwrite Cloud has a default SMTP server to get you started.
This SMTP server sends generic emails and doesn't allow customizing SMTP templates.
Expand Down
2 changes: 1 addition & 1 deletion app/views/docs/functions-deploy.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<h2><a href="#cli" id="cli">CLI</a></h2>
<div class="notice margin-bottom-small">
<h2>CLI Setup</h2>
<p>Before you can deploy with the Appwrite CLI, make sure you've <a href="docs/command-line">installed and initialized</a> the CLI.</p>
<p>Before you can deploy with the Appwrite CLI, make sure you've <a href="/docs/command-line">installed and initialized</a> the CLI.</p>
</div>
<p>
To deploy with the Appwrite CLI, your function must be added to <code>appwrite.json</code> that tells the CLI where each function is stored.
Expand Down
12 changes: 6 additions & 6 deletions app/views/docs/functions-develop.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2637,32 +2637,32 @@ public class Main {
<li>
The parameter passed into functions has changed.
<code>req</code> and <code>res</code> has been replaced by <code>context</code>, which contains new logger methods.
<a href="docs/functions-develop#context">Learn about context.</a>
<a href="/docs/functions-develop#context">Learn about context.</a>
</li>
<li>
To improve privacy and logging reliability, we provide new <code>context.log()</code> and <code>context.error()</code> functions.
You can no longer use native logging methods.
<a href="docs/functions-develop#logging">Learn about logging.</a>
<a href="/docs/functions-develop#logging">Learn about logging.</a>
</li>
<li>
The old way of <code>req.variables</code> has been deprecated.
You can now access variables passed into each function as environment variables.
<a href="docs/functions-develop#environment-variables">Learn about environment variables.</a>
<a href="/docs/functions-develop#environment-variables">Learn about environment variables.</a>
</li>
<li>
The <code>req</code> object has been updated to use terminology consistent with typical HTTP concepts.
You'll now find familiar concepts like headers, body, HTTP methods, and others.
<a href="docs/functions-develop#request">Learn about request.</a>
<a href="/docs/functions-develop#request">Learn about request.</a>
</li>
<li>
The response object has been updated.
You can now specify headers, as well as use new methods like return redirects or empty responses.
<a href="docs/functions-develop#response">Learn about response.</a>
<a href="/docs/functions-develop#response">Learn about response.</a>
</li>
<li>
Now, you <b>must return a response</b> such as <code>return context.res.send("")</code>.
This prevents confusing errors when functions are terminated prematurely before a response is sent.
<a href="docs/functions-develop#response">Learn about response.</a>
<a href="#response">Learn about response.</a>
</li>
<li>
Some variables about how a function was triggered are now found in the <code>context.req</code> object as <a href="/docs/functions-develop#request">headers</a>.
Expand Down
7 changes: 4 additions & 3 deletions app/views/docs/migrations-firebase.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,13 @@
Click <b>Add Key</b> and select <b>Create new key</b>. Select <b>JSON</b> as the key type and click <b>Create</b>. This will download a JSON file to your computer.
</li>
<li>
Upload the JSON file to Appwrite and follow the migration wizard.
Upload the JSON file to Appwrite and follow the migration wizard to select which resource you need to migrate.
</li>
<li>
After completing the migration wizard, migration will begin. Return to step 4 of <a href="#migration-process">the migration steps</a>.
After completing the migration wizard, migration will begin. This will run in the background, you can close the browser.</a>.
</li>
<li>
Finally, add the platforms for your <a href="/docs/getting-started-for-web">Web</a>, <a href="getting-started-for-flutter/docs/getting-started-for-flutter">Flutter</a>, <a href="/docs/getting-started-for-android">Android</a>, and <a href="/docs/getting-started-for-apple">iOS</a> apps.
Finally, add the platforms for your <a href="/docs/getting-started-for-web">Web</a>, <a href="getting-started-for-flutter/docs/getting-started-for-flutter">Flutter</a>, <a href="/docs/getting-started-for-android">Android</a>, and <a href="/docs/getting-started-for-apple">iOS</a> apps.
Also remember to <a href="/docs/permissions">add appropriate permissions</a></b> to the migrated resources to protect user data and privacy.
</li>
</ol>
2 changes: 1 addition & 1 deletion app/views/docs/self-hosting.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
</table>

<h2><a href="#next-steps" id="next-steps">Next Steps</a></h2>
<p>Self-hosting Appwrite gives you more configurable options. You can customize Appwrite with your choice of S3 compatible storage adaptors, email and SMS providers, functions runtimes, and more.</p>
<p>Self-hosting Appwrite gives you more configurable options. You can customize Appwrite with your choice of S3 compatible storage adapters, email and SMS providers, functions runtimes, and more.</p>

<p><a href="/docs/configuration"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> Learn about configuring Appwrite</a></p>

Expand Down