Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
Merge branch 'remote-main' into feature/params
Browse files Browse the repository at this point in the history
  • Loading branch information
panoti committed Aug 30, 2023
2 parents 44572fa + 19de2eb commit 634bcc9
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 11 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Docker publish

on:
release:
types:
- created
workflow_dispatch:

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...


build:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=tag
# Determine the release version
- name: Get release version
id: get-release-version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
if: startsWith(github.ref, 'refs/tags/')

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ steps.meta.outputs.tags }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.get-release-version.outputs.version }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
name: Go

on:
push:
branches: [ "main" ]
#push:
# branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand All @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: Build
run: go build -v ./...
Expand Down
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,30 @@ These features are not in the latest release but in the main branch. They might

## Setup

<details>

<summary>

### Manual building
</summary>

- `git clone https://github.com/acheong08/obsidian-sync`
- `cd obsidian-sync`
- `export HOST=<YOUR DOMAIN NAME>` - Not necessary when running on localhost
- `go run cmd/obsidian-sync/main.go`
- Use nginx or cloudflare to proxy & handle TLS/SSL

~~**HTTPS _should_ be required. I use `certbot` or Cloudflare**. By default, the sync uses `wss` unless you're operating on `localhost` or `127.0.0.1` which breaks if you don't have TLS/SSL~~
</details>

<details>

<summary>

### Docker
</summary>

https://github.com/acheong08/rev-obsidian-sync/pkgs/container/rev-obsidian-sync

</details>

HTTPS is not required.

Expand Down Expand Up @@ -79,6 +96,8 @@ server {
}
```

You can use `certbot` or cloudflare to handle HTTPS although it is not mandatory.

</details>

## Adding a new user
Expand All @@ -103,9 +122,3 @@ This plugin will not be part of the official community plugins list.
- Set API endpoint
- e.g. `https://obsidian.yourdomain.com`
- For development: `http://127.0.0.1:3000`

Known bugs:

- ~~Cannot restart plugin (for whatever reason you might want to do that...) - Restart the app if you want to reload this particular plugin~~

Report all bugs in this repository.

0 comments on commit 634bcc9

Please sign in to comment.