From 850f62191869b0e534e8871ab7dc9855182503f4 Mon Sep 17 00:00:00 2001 From: mark wu Date: Wed, 6 Dec 2023 17:50:31 +0800 Subject: [PATCH] Add more doc to setup development environment section --- docs/development/getting-started.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/development/getting-started.md b/docs/development/getting-started.md index 744ae78..0b74ff9 100644 --- a/docs/development/getting-started.md +++ b/docs/development/getting-started.md @@ -11,11 +11,14 @@ Only creating new database migrations requires installing the tool. ## Setup environment -Copy `.env.example` to `.env` and adjust as needed. -We used [`direnv`](direnv.net) to help setup required environment variables. +Copy `.env.example` to `.env` and adjust as needed. Then run it via docker-compose. + +To run it without `docker-compose`, we recommend to use [`direnv`](https://github.com/direnv/direnv) to help setup required environment variables. Otherwise, expose `.env` variables to your system environment. By default, the local data is stored in `data.local`. +And default domain is `http://*.localtest.me:8001` as value of PAGESHIP_HOST_PATTERN set in .env file + ## Running in single site mode ```sh @@ -38,4 +41,22 @@ Open the sites at `http://localtest.me:8000/` or `http://dev.localtest.me:8000/` go run ./cmd/controller start ``` -Setup pageship command to use `http://api.localtest.me:8001` as the API server. +Setup pageship command to use `http://api.localtest.me:8001` as the API server with your github account. + +(Note: Must enter absolute path for `SSH Key file`) + +```sh +go run ./cmd/pageship login + +GitHub user name: +API server: http://api.localtest.me:8001 +SSH key file: /Home/yourUsername/.ssh/id_rsa + +``` + +If you enter incorrect info and want to restore whole process please enter command: + +```sh +go run ./cmd/pageship config reset + +```