From bff33aff99165f4a94af881c80ac8f6206b3a436 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Tue, 24 May 2022 16:17:17 +0100 Subject: [PATCH] Update list of required environment variables --- .env_sample | 3 --- README.md | 33 ++++++++++++++++----------------- tmp/test-repo/README.md | 2 +- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/.env_sample b/.env_sample index 6120fcd..4f4e04b 100644 --- a/.env_sample +++ b/.env_sample @@ -4,8 +4,5 @@ export GITEA_URL=gitea-server.fly.dev # Get yours from: $GITEA_URL/user/settings/applications export GITEA_ACCESS_TOKEN=d6fca75c63daa014c187 -# The absolute path to the SSH *Private* Key -export GITEA_SSH_PRIVATE_KEY_PATH=~/.ssh/id_rsa - # Optionally set the path where you want to clone git repos: export GIT_TEMP_DIR_PATH=tmp diff --git a/README.md b/README.md index 197afc2..cd3ca96 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Gitea -**`Elixir`** interface with a **`Gitea`** instance from . +**`Elixir`** interface with a **`Gitea`** instance. [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/dwyl/gitea/Elixir%20CI?label=build&style=flat-square)](https://github.com/dwyl/gitea/actions/workflows/ci.yml) [![codecov.io](https://img.shields.io/codecov/c/github/dwyl/gitea/main.svg?style=flat-square)](http://codecov.io/github/dwyl/gitea?branch=main) @@ -21,29 +21,29 @@ # _Why?_ 💡 We needed an _easy_ way to interact -with our **`Gitea`** (GitHub Backup) **Server** +with a **`Gitea`** (GitHub Backup) **Server** from our **`Elixir/Phoenix`** App. > **Note**: We were _briefly_ tempted > to write this code _inside_ the Phoenix App -> that uses it, +> that uses it,
> however we quickly realized > that having it **_separate_** was better -> for **_testability/maintainability_**. +> for **_testability/maintainability_**.
> Having a _separate_ module enforces a > [separation of concerns](https://en.wikipedia.org/wiki/Separation_of_concerns) -> with a strong "API contract". +> with a strong "API contract".
> This way we know this package is well-tested, > documented and maintained. > And can be used and _extended independently_ > of any `Elixir/Phoenix` app. -> The `Elixir/Phoenix` app can treat `gitea` +> The `Elixir/Phoenix` app can treat **`gitea`** > as a logically separate/independent entity > with a clear interface. # _What_? 📦 -A library for interacting with `gitea` (`git`) +A library for interacting with **`gitea`** (`git`) from `Elixir` apps.
Hopefully this diagram explains @@ -120,8 +120,8 @@ in your `Elixir/Phoenix` App, you will need to have a few environment variables defined. -There are **3 _required_** -and **2 _optional_** variables. +There are **2 _required_** +and **1 _optional_** variables. Make sure you read through the next section to determine if you _need_ the _optional_ ones. @@ -129,7 +129,7 @@ to determine if you _need_ the _optional_ ones. > See: [`.env_sample`](https://github.com/dwyl/gitea/blob/main/.env_sample) -There are **3 _required_** environment variables: +There are **2 _required_** environment variables: 1. `GITEA_URL` - the domain where your Gitea Server is deployed, without the protocol, e.g: `gitea-server.fly.dev` @@ -137,15 +137,12 @@ There are **3 _required_** environment variables: 2. `GITEA_ACCESS_TOKEN` - the REST API Access Token See: https://github.com/dwyl/gitea-server#connect-via-rest-api-https -3. `GITEA_SSH_PRIVATE_KEY_PATH` - absolute path to the `id_rsa` file - on your `localhost` or `Phoenix` server instance. - ### _Optional_ Environment Variables #### `GIT_TEMP_DIR_PATH` If you want to specify a directory where -you want to clone `git` repos to, +you want to clone `git` repos to,
create a `GIT_TEMP_DIR_PATH` environment variable. e.g: @@ -153,9 +150,9 @@ e.g: export GIT_TEMP_DIR_PATH=tmp ``` -> **Note**: the directory **must _already_ exist**. -> (it won't be created if it's not there ...) -> Create it if you don't already have it: +> **Note**: the directory **must _already_ exist**.
+> If it doesn't already exist, create it.
+> e.g: > `mkdir tmp` followed by `cp -r test-repo tmp`
@@ -255,6 +252,8 @@ Gitea.push(org_name, repo_name) "Your README.md text" ``` +
+ ## Full Function Reference / Docs? 📖 Rather than duplicate all the docs here, diff --git a/tmp/test-repo/README.md b/tmp/test-repo/README.md index 7639ed2..0b5eda9 100644 --- a/tmp/test-repo/README.md +++ b/tmp/test-repo/README.md @@ -1 +1 @@ -text test-repo8417785248937389 \ No newline at end of file +text test-repo6670551262744575 \ No newline at end of file