chore: merge with main
This commit is contained in:
commit
ff9a2191dd
|
|
@ -0,0 +1,66 @@
|
|||
# This file is a template for docker compose deployment
|
||||
# Copy this file to .env and change the values as needed
|
||||
|
||||
# authentication key, change this and keep the key safe and secret
|
||||
# self defined key, you can use any string
|
||||
GOTRUE_JWT_SECRET=hello456
|
||||
|
||||
# User sign up will automatically be confirmed if this is set to true.
|
||||
# If you have OAuth2 set up or smtp configured, you can set this to false
|
||||
# to enforce email confirmation or OAuth2 login instead.
|
||||
# If you set this to false, you need to either set up SMTP
|
||||
GOTRUE_MAILER_AUTOCONFIRM=true
|
||||
|
||||
# if you enable mail confirmation, you need to set the SMTP configuration below
|
||||
GOTRUE_SMTP_HOST=smtp.gmail.com
|
||||
GOTRUE_SMTP_PORT=465
|
||||
GOTRUE_SMTP_USER=email_sender@some_company.com
|
||||
GOTRUE_SMTP_PASS=email_sender_password
|
||||
GOTRUE_SMTP_ADMIN_EMAIL=comp_admin@some_company.com
|
||||
|
||||
# gotrue admin
|
||||
GOTRUE_ADMIN_EMAIL=admin@example.com
|
||||
GOTRUE_ADMIN_PASSWORD=password
|
||||
|
||||
# clicking on email verification link will redirect to this host
|
||||
# change this to your own domain where you host the docker-compose or gotrue
|
||||
API_EXTERNAL_URL=http://your-host
|
||||
|
||||
# Google OAuth2
|
||||
GOTRUE_EXTERNAL_GOOGLE_ENABLED=true
|
||||
GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID=
|
||||
GOTRUE_EXTERNAL_GOOGLE_SECRET=
|
||||
GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI=http://your-host/callback
|
||||
# GitHub OAuth2
|
||||
GOTRUE_EXTERNAL_GITHUB_ENABLED=false
|
||||
GOTRUE_EXTERNAL_GITHUB_CLIENT_ID=
|
||||
GOTRUE_EXTERNAL_GITHUB_SECRET=
|
||||
GOTRUE_EXTERNAL_GITHUB_REDIRECT_URI=http://your-host/callback
|
||||
# Discord OAuth2
|
||||
GOTRUE_EXTERNAL_DISCORD_ENABLED=false
|
||||
GOTRUE_EXTERNAL_DISCORD_CLIENT_ID=
|
||||
GOTRUE_EXTERNAL_DISCORD_SECRET=
|
||||
GOTRUE_EXTERNAL_DISCORD_REDIRECT_URI=http://your-host/callback
|
||||
# File Storage
|
||||
USE_MINIO=true
|
||||
# MINIO_URL=http://localhost:9000 # change this if you are using a different address for minio
|
||||
AWS_ACCESS_KEY_ID=minioadmin
|
||||
AWS_SECRET_ACCESS_KEY=minioadmin
|
||||
AWS_S3_BUCKET=appflowy
|
||||
AWS_REGION=us-east-1
|
||||
|
||||
RUST_LOG=info
|
||||
|
||||
# PgAdmin
|
||||
PGADMIN_DEFAULT_EMAIL=admin@example.com
|
||||
PGADMIN_DEFAULT_PASSWORD=password
|
||||
|
||||
# Portainer (username: admin)
|
||||
PORTAINER_PASSWORD=password1234
|
||||
|
||||
# Grafana Dashboard
|
||||
GF_SECURITY_ADMIN_USER=admin
|
||||
GF_SECURITY_ADMIN_PASSWORD=password
|
||||
|
||||
# Cloudflare tunnel token
|
||||
CLOUDFLARE_TUNNEL_TOKEN=
|
||||
|
|
@ -25,7 +25,7 @@ For example, I create a project that used for localhost development. After creat
|
|||
|
||||

|
||||
|
||||
The redirect URI should be `<your host server public ip/hostname>/callback`. For example, my host server is `localhost`, so the redirect URI is `http://localhost:9998/callback`.
|
||||
The redirect URI should be `<your host server public ip/hostname>/gotrue/callback`. For example, my host server is `localhost`, so the redirect URI is `http://localhost/gotrue/callback`.
|
||||
|
||||

|
||||
|
||||
|
|
@ -53,8 +53,8 @@ Begin by accessing your [GitHub Developer Settings](https://github.com/settings/
|
|||
1. In the 'OAuth Apps' section, click 'New OAuth App'.
|
||||
2. Fill in the 'Application name' with your app's name.
|
||||
3. For 'Homepage URL', provide the full URL to your app's homepage.
|
||||
4. Specify your app's 'Authorization callback URL' where users will be redirected post-authorization. The redirect URI should be
|
||||
`<your host server public ip/hostname>/callback`. For example, my host server is `localhost`, so the redirect URI is `http://localhost:9998/callback`..
|
||||
4. Specify your app's 'Authorization callback URL' where users will be redirected post-authorization. The redirect URI should be
|
||||
`<your host server public ip/hostname>/gotrue/callback`. For example, my host server is `localhost`, so the redirect URI is `http://localhost/gotrue/callback`..
|
||||
5. Click 'Register Application' at the bottom.
|
||||
6. Once registered, securely store the generated OAuth credentials.
|
||||
7. Copy and save your Client ID.
|
||||
|
|
@ -73,8 +73,8 @@ Update the `.env` file with the Client ID and Client Secret.
|
|||
2. Click 'New Application' in the top right.
|
||||
3. Name your application and select 'Create'.
|
||||
4. In the settings menu, choose 'OAuth2'.
|
||||
5. Under 'Redirects', select 'Add Redirect' and input your callback URL. The redirect URI should be `<your host server public ip/hostname>/callback`.
|
||||
For example, my host server is `localhost`, so the redirect URI is `http://localhost:9998/callback`.
|
||||
5. Under 'Redirects', select 'Add Redirect' and input your callback URL. The redirect URI should be `<your host server public ip/hostname>/gotrue/callback`.
|
||||
For example, my host server is `localhost`, so the redirect URI is `http://localhost/gotrue/callback`.
|
||||
6. Remember to 'Save Changes' at the bottom.
|
||||
7. Under 'Client Information', note down your 'Client ID' and 'Client Secret' for later use.
|
||||
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ cd AppFlowy-Cloud
|
|||
### 2. Preparing the configuration
|
||||
- This is perhaps the most important part of the deployment process, please read carefully.
|
||||
- It is required that that is a `.env` file in the root directory of the repository.
|
||||
- To get started, copy the template `dev.env` as `.env` using the following shell commands:
|
||||
- To get started, copy the template `deploy.env` as `.env` using the following shell commands:
|
||||
```bash
|
||||
cp dev.env .env
|
||||
cp deploy.env .env
|
||||
```
|
||||
- There will be values in the `.env` that needs to be change according to your needs
|
||||
- Kindly read the following comments for each set of settings
|
||||
|
|
@ -77,16 +77,12 @@ GOTRUE_ADMIN_PASSWORD=password
|
|||
# which is the same as the public IP/hostname of your host server
|
||||
# when an email confirmation link is click, this is the host that user's devices
|
||||
# will try to connect to
|
||||
API_EXTERNAL_URL=http://localhost:9998
|
||||
|
||||
# 2 fields below are only relevant for development, can ignore
|
||||
DATABASE_URL=postgres://postgres:password@localhost:5433/postgres
|
||||
SQLX_OFFLINE=false
|
||||
API_EXTERNAL_URL=http://your-host
|
||||
|
||||
# File Storage
|
||||
# This affects where the files will be uploaded.
|
||||
# By default, Minio will be deployed as file storage server # and it will use the host server's disk storage.
|
||||
# You can also AWS S3 by setting USE_MINIO as false
|
||||
# By default, Minio will be deployed as file storage server which will use the host's disk storage.
|
||||
# You can also AWS S3 by setting USE_MINIO as false and configure the AWS related fields.
|
||||
USE_MINIO=true # determine if minio-server is used
|
||||
# MINIO_URL=http://localhost:9000 # change this to use minio from a different host (e.g. maybe you self host Minio somewhere)
|
||||
AWS_ACCESS_KEY_ID=minioadmin
|
||||
|
|
@ -103,25 +99,25 @@ If using localhost, then just keep the default value.
|
|||
GOTRUE_EXTERNAL_GOOGLE_ENABLED=true
|
||||
GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID=
|
||||
GOTRUE_EXTERNAL_GOOGLE_SECRET=
|
||||
GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI=http://localhost:9998/callback
|
||||
GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI=http://your-host/gotrue/callback
|
||||
|
||||
# GitHub OAuth2
|
||||
GOTRUE_EXTERNAL_GITHUB_ENABLED=true
|
||||
GOTRUE_EXTERNAL_GITHUB_CLIENT_ID=your-github-client-id
|
||||
GOTRUE_EXTERNAL_GITHUB_SECRET=your-github-secret
|
||||
GOTRUE_EXTERNAL_GITHUB_REDIRECT_URI=http://localhost:9998/callback
|
||||
GOTRUE_EXTERNAL_GITHUB_REDIRECT_URI=http://your-host/gotrue/callback
|
||||
|
||||
# Discord OAuth2
|
||||
GOTRUE_EXTERNAL_DISCORD_ENABLED=true
|
||||
GOTRUE_EXTERNAL_DISCORD_CLIENT_ID=your-discord-client-id
|
||||
GOTRUE_EXTERNAL_DISCORD_SECRET=your-discord-secret
|
||||
GOTRUE_EXTERNAL_DISCORD_REDIRECT_URI=http://localhost:9998/callback
|
||||
GOTRUE_EXTERNAL_DISCORD_REDIRECT_URI=http://your-host/gotrue/callback
|
||||
```
|
||||
|
||||
### 3. Running the services
|
||||
|
||||
### Start and run AppFlowy-Cloud
|
||||
- The following command will build and start the AppFlowy-Cloud.
|
||||
- The following command will build and start the AppFlowy-Cloud.
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
|
|
@ -133,10 +129,11 @@ docker ps -a
|
|||
|
||||
> When using the `docker compose up -d` command without specifying a tag, Docker Compose will pull the `latest`
|
||||
tag for the `appflowy_cloud` and `admin_frontend` images from Docker Hub by default. If you've set the `BACKEND_VERSION`
|
||||
environment variable, it will pull the specified version instead. If `BACKEND_VERSION` is not set, Docker Compose
|
||||
environment variable, it will pull the specified version instead. If `BACKEND_VERSION` is not set, Docker Compose
|
||||
defaults to using the `latest` tag.
|
||||
|
||||
- The metrics endpoint can also be used to verify that the AppFlowy-Cloud server is running. It should return a status of 200 OK.
|
||||
- This command should only be run in the host machine as port 8000 should not be exposed
|
||||
```bash
|
||||
curl -v localhost:8000/metrics
|
||||
```
|
||||
|
|
|
|||
|
|
@ -71,29 +71,24 @@ If you have any questions, please feel free to reach out to us on [Discord](http
|
|||
Create a `.env` file from the template. There will be values in the `.env` that needs to be change according to
|
||||
your needs Kindly read the comments in `.env` file.
|
||||
```bash
|
||||
cp dev.env .env
|
||||
cp deploy.env .env
|
||||
```
|
||||
|
||||
3. **Mailer Configuration**:
|
||||
Set up auto-confirmation for the Gotrue mailer in the `.env` file:
|
||||
```bash
|
||||
echo "GOTRUE_MAILER_AUTOCONFIRM=true" >> .env
|
||||
```
|
||||
|
||||
4. **Authentication Setup**:
|
||||
Open your .env file and update the OAuth redirect URIs with the Public IPv4 DNS of your EC2 instance. It should look something like this: http://ec2-13-228-28-244.ap-southeast-1.compute.amazonaws.com/gotrue/callback.
|
||||
3. **Authentication Setup**:
|
||||
Open your .env file and update the OAuth redirect URIs with the Public IPv4 DNS of your EC2 instance. It should look something like this: http://ec2-13-228-28-244.ap-southeast-1.compute.amazonaws.com/gotrue/callback.
|
||||
As an example, when configuring OAuth credentials in Google, it should resemble the image shown below:
|
||||

|
||||
|
||||
For detailed setup instructions, refer to the Authentication documentation.
|
||||
|
||||
|
||||
5. **Start AppFlowy Services**:
|
||||
4. **Start AppFlowy Services**:
|
||||
Launch the services using Docker Compose:
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
6. **Verify Service Status**:
|
||||
5. **Verify Service Status**:
|
||||
Check that all services are running:
|
||||
```bash
|
||||
docker ps -a
|
||||
|
|
@ -214,10 +209,3 @@ Alternatively, you can selectively reduce Docker's disk usage:
|
|||
Additionally, ensure that dependencies on the `admin_frontend` service are also commented out as needed.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue