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

Commit

Permalink
Update list of required environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed May 24, 2022
1 parent d8f1508 commit bff33af
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
3 changes: 0 additions & 3 deletions .env_sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<img alt="Gitea" src="https://user-images.githubusercontent.com/194400/168781665-a52d2c00-8b69-44ae-a10a-7bd1c3932020.svg" width="240"/>

**`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)
Expand All @@ -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, <br />
> however we quickly realized
> that having it **_separate_** was better
> for **_testability/maintainability_**.
> for **_testability/maintainability_**. <br />
> 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". <br />
> 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. <br />

Hopefully this diagram explains
Expand Down Expand Up @@ -120,42 +120,39 @@ 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.

### _Required_ Environment Variables

> 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`

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, <br />
create a `GIT_TEMP_DIR_PATH` environment variable.
e.g:

```sh
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**.<br />
> If it doesn't already exist, create it. <br />
> e.g:
> `mkdir tmp` followed by `cp -r test-repo tmp`
<br />
Expand Down Expand Up @@ -255,6 +252,8 @@ Gitea.push(org_name, repo_name)
"Your README.md text"
```

<br />

## Full Function Reference / Docs? 📖

Rather than duplicate all the docs here,
Expand Down
2 changes: 1 addition & 1 deletion tmp/test-repo/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
text test-repo8417785248937389
text test-repo6670551262744575

0 comments on commit bff33af

Please sign in to comment.