Skip to content

Commit

Permalink
improve doc on backend run without docker
Browse files Browse the repository at this point in the history
  • Loading branch information
paskal authored and umputun committed Jan 31, 2022
1 parent 31af19e commit 3a9806a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ remark42
/backend/var/
/backend/app/var/
/backend/web/
/backend/*.html.tmpl
compose-private-backend.yml
compose-private-frontend.yml
compose-private.yml
Expand Down
14 changes: 7 additions & 7 deletions site/src/docs/configuration/parameters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ services:
| auth.email.from | AUTH_EMAIL_FROM | | email from |
| auth.email.subj | AUTH_EMAIL_SUBJ | `remark42 confirmation` | email subject |
| auth.email.content-type | AUTH_EMAIL_CONTENT_TYPE | `text/html` | email content type |
| auth.email.template | AUTH_EMAIL_TEMPLATE | none (predefined) | custom email message template file |
| notify.users | NOTIFY_USERS | none | type of user notifications (Telegram, email) |
| notify.admins | NOTIFY_ADMINS | none | type of admin notifications (Telegram, Slack, webhook and/or email) |
| notify.queue | NOTIFY_QUEUE | `100` | size of notification queue |
Expand Down Expand Up @@ -152,14 +151,15 @@ The following list of command-line options is deprecated and might be removed in
<details>
<summary>Deprecated options</summary>

| Command line | Replacement | Environment | Replacement | Default | Description | Deprecation version |
| ------------------ | ------------- | ------------------ | ------------- | ------- | -------------- | ------------------- |
| auth.email.host | smtp.host | AUTH_EMAIL_HOST | SMTP_HOST | | smtp host | 1.5.0 |
| auth.email.port | smtp.port | AUTH_EMAIL_PORT | SMTP_PORT | | smtp port | 1.5.0 |
| Command line | Replacement | Environment | Replacement | Default | Description | Deprecation version |
| ------------------ | ------------ | ------------------- | ------------- | ------- | -------------- | ------------------- |
| auth.email.template| none | AUTH_EMAIL_TEMPLATE | none | `email_confirmation_login.html.tmpl` | custom email message template file | 1.5.0 |
| auth.email.host | smtp.host | AUTH_EMAIL_HOST | SMTP_HOST | | smtp host | 1.5.0 |
| auth.email.port | smtp.port | AUTH_EMAIL_PORT | SMTP_PORT | | smtp port | 1.5.0 |
| auth.email.user | smtp.username | AUTH_EMAIL_USER | SMTP_USERNAME | | smtp user name | 1.5.0 |
| auth.email.passwd | smtp.password | AUTH_EMAIL_PASSWD | SMTP_PASSWORD | | smtp password | 1.5.0 |
| auth.email.tls | smtp.tls | AUTH_EMAIL_TLS | SMTP_TLS | `false` | enable TLS | 1.5.0 |
| auth.email.timeout | smtp.timeout | AUTH_EMAIL_TIMEOUT | SMTP_TIMEOUT | `10s` | smtp timeout | 1.5.0 |
| auth.email.tls | smtp.tls | AUTH_EMAIL_TLS | SMTP_TLS | `false` | enable TLS | 1.5.0 |
| auth.email.timeout | smtp.timeout | AUTH_EMAIL_TIMEOUT | SMTP_TIMEOUT | `10s` | smtp timeout | 1.5.0 |
| img-proxy | image-proxy.http2https | IMG_PROXY | IMAGE_PROXY_HTTP2HTTPS | `false` | enable HTTP->HTTPS proxy for images | 1.5.0 |
| notify.type | notify.admins, notify.users | NOTIFY_TYPE | NOTIFY_ADMINS, NOTIFY_USERS | | | 1.9.0 |
| notify.email.notify_admin | notify.admins=email | NOTIFY_EMAIL_ADMIN | NOTIFY_ADMINS=email | | | 1.9.0 |
Expand Down
12 changes: 10 additions & 2 deletions site/src/docs/contributing/development/backend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,25 @@ Backend Docker Compose config (`compose-dev-backend.yml`) by default skips runni

Run tests in your IDE, and re-run `make rundev` each time you want to see how your code changes behave to test them at <http://127.0.0.1:8080/web/>.

#### Without docker
#### Without Docker

You have to [install](https://golang.org/doc/install) the latest stable `go` toolchain to run the backend locally.

In order to have working Remark42 installation you need once to copy frontend static files to `./backend/web` directory from `master` docker image:
In order to have working Remark42 installation you need once to copy frontend static files to `./backend/web` directory from `master` docker image, and also copy files from `./templates` to the `./backend` as they are expected to be where application starts:

```shell
# frontend files
docker pull umputun/remark42:master
docker create -ti --name remark42files umputun/remark42:master sh
docker cp remark42files:/srv/web/ ./backend/
docker rm -f remark42files
# template files
cp ./backend/templates/* ./backend
# fix frontend files to point to the right URL
## Mac version
find -E ./backend/web -regex '.*\.(html|js|mjs)$' -print -exec sed -i '' "s|{% REMARK_URL %}|http://127.0.0.1:8080|g" {} \;
## Linux version
find ./backend/web -regex '.*\.\(html\|js\|mjs\)$' -print -exec sed -i "s|{% REMARK_URL %}|http://127.0.0.1:8080|g" {} \;
```

To run backend - `cd backend; go run app/main.go server --dbg --secret=12345 --url=http://127.0.0.1:8080 --admin-passwd=password --site=remark`. It stars backend service with embedded bolt store on port `8080` with basic auth, allowing to authenticate and run requests directly, like this:
Expand Down

0 comments on commit 3a9806a

Please sign in to comment.