Skip to content

Commit

Permalink
Merge main into stable/4.0.x. Update 20230906
Browse files Browse the repository at this point in the history
* commit '94b8a58b3373fc153c67bc16691c4b060d0a4c01':
  Bump actions/checkout from 3 to 4 (#115)
  Extend project automation (#112)
  Bump golang from 1.20.6-alpine to 1.20.7-alpine (#111)
  update deps (#110)
  New environment variables (#109)
  Fix message bus (#108)
  Update deps (#107)
  Update go.mod
  Remove template fields
  • Loading branch information
peb-adr committed Sep 6, 2023
2 parents 9d6bf81 + 94b8a58 commit ab4bced
Show file tree
Hide file tree
Showing 17 changed files with 230 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/icc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
go-version: '1.20'

- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: go fmt
run: test -z $(gofmt -l .)
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/project-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Project automation
on:
workflow_call:
inputs:
resource_node_id:
required: true
type: string
status_value:
required: true
type: string
secrets:
AUTOMATION_APP_ID:
required: true
AUTOMATION_APP_INSTALLATION_ID:
required: true
AUTOMATION_APP_PRIVATE_KEY:
required: true

jobs:
workflow_call:
name: Set status
runs-on: ubuntu-latest
steps:
- uses: leonsteinhaeuser/[email protected]
with:
gh_app_ID: ${{ secrets.AUTOMATION_APP_ID }}
gh_app_installation_ID: ${{ secrets.AUTOMATION_APP_INSTALLATION_ID }}
gh_app_secret_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}
organization: OpenSlides
project_id: 2
resource_node_id: ${{ inputs.resource_node_id }}
status_value: ${{ inputs.status_value }}
14 changes: 14 additions & 0 deletions .github/workflows/project-issue-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Project automation
on:
issues:
types:
- closed

jobs:
issue_closed:
name: Issue closed
uses: ./.github/workflows/project-automation.yml
secrets: inherit
with:
resource_node_id: ${{ github.event.issue.node_id }}
status_value: "Done"
15 changes: 15 additions & 0 deletions .github/workflows/project-issue-opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Project automation
on:
issues:
types:
- opened
- reopened

jobs:
issue_opened:
name: Issue opened
uses: ./.github/workflows/project-automation.yml
secrets: inherit
with:
resource_node_id: ${{ github.event.issue.node_id }}
status_value: "Backlog"
14 changes: 14 additions & 0 deletions .github/workflows/project-pull-request-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Project automation
on:
pull_request_target:
types:
- closed

jobs:
pull_request_closed:
name: Pull request closed
uses: ./.github/workflows/project-automation.yml
secrets: inherit
with:
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: "Done"
15 changes: 15 additions & 0 deletions .github/workflows/project-pull-request-opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Project automation
on:
pull_request_target:
types:
- opened
- reopened

jobs:
pull_request_opened:
name: Pull request opened
uses: ./.github/workflows/project-automation.yml
secrets: inherit
with:
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: "Work in progress"
14 changes: 14 additions & 0 deletions .github/workflows/project-pull-request-review-requested.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Project automation
on:
pull_request_target:
types:
- review_requested

jobs:
pull_request_review_requested:
name: Pull request review requested
uses: ./.github/workflows/project-automation.yml
secrets: inherit
with:
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: "Review in progress"
6 changes: 4 additions & 2 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: go

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: create secrets
run: |
Expand All @@ -30,7 +30,9 @@ jobs:
- name: Start With golang
run: |
export SECRETS_PATH=secrets
export DATABASE_PASSWORD_FILE=secrets/postgres_password
export AUTH_TOKEN_KEY_FILE=secrets/auth_token_key
export AUTH_COOKIE_KEY_FILE=secrets/auth_cookie_key
go build
timeout --preserve-status --signal=SIGINT 2s ./openslides-icc-service
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/set-project.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.6-alpine as base
FROM golang:1.20.7-alpine as base
WORKDIR /root/

RUN apk add git
Expand Down
28 changes: 10 additions & 18 deletions environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,17 @@ The Service uses the following environment variables:
* `ICC_PORT`: Port on which the service listen on. The default is `9007`.
* `MESSAGE_BUS_HOST`: Host of the redis server. The default is `localhost`.
* `MESSAGE_BUS_PORT`: Port of the redis server. The default is `6379`.
* `DATASTORE_DATABASE_USER`: Postgres User. The default is `openslides`.
* `OPENSLIDES_DEVELOPMENT`: If set, the service uses the default secrets. The default is `false`.
* `DATASTORE_DATABASE_HOST`: Postgres Host. The default is `localhost`.
* `DATASTORE_DATABASE_PORT`: Postgres Post. The default is `5432`.
* `DATASTORE_DATABASE_NAME`: Postgres Database. The default is `openslides`.
* `DATABASE_PASSWORD_FILE`: Postgres Password. The default is `/run/secrets/postgres_password`.
* `DATABASE_USER`: Postgres Database. The default is `openslides`.
* `DATABASE_HOST`: Postgres Host. The default is `localhost`.
* `DATABASE_PORT`: Postgres Post. The default is `5432`.
* `DATABASE_NAME`: Postgres User. The default is `openslides`.
* `AUTH_PROTOCOL`: Protocol of the auth service. The default is `http`.
* `AUTH_HOST`: Host of the auth service. The default is `localhost`.
* `AUTH_PORT`: Port of the auth service. The default is `9004`.
* `AUTH_Fake`: Use user id 1 for every request. Ignores all other auth environment variables. The default is `false`.
* `ICC_REDIS_HOST`: The host of the redis instance to save icc messages. The default is `localhost`.
* `ICC_REDIS_PORT`: The port of the redis instance to save icc messages. The default is `6379`.


## Secrets

Secrets are filenames in the directory `SECRETS_PATH` (default: `/run/secrets/`).
The service only starts if it can find each secret file and read its content.
The default values are only used, if the environment variable `OPENSLIDES_DEVELOPMENT` is set.

* `postgres_password`: Postgres Password. The default is `openslides`.
* `auth_token_key`: Key to sign the JWT auth tocken. The default is `auth-dev-token-key`.
* `auth_cookie_key`: Key to sign the JWT auth cookie. The default is `auth-dev-cookie-key`.
* `AUTH_FAKE`: Use user id 1 for every request. Ignores all other auth environment variables. The default is `false`.
* `AUTH_TOKEN_KEY_FILE`: Key to sign the JWT auth tocken. The default is `/run/secrets/auth_token_key`.
* `AUTH_COOKIE_KEY_FILE`: Key to sign the JWT auth cookie. The default is `/run/secrets/auth_cookie_key`.
* `CACHE_HOST`: The host of the redis instance to save icc messages. The default is `localhost`.
* `CACHE_PORT`: The port of the redis instance to save icc messages. The default is `6379`.
39 changes: 18 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,49 @@ module github.com/OpenSlides/openslides-icc-service
go 1.20

require (
github.com/OpenSlides/openslides-autoupdate-service v0.4.1-0.20230205113522-64e8a845d31c
github.com/OpenSlides/openslides-autoupdate-service v0.4.1-0.20230804053435-1a247b6a1f2b
github.com/alecthomas/kong v0.8.0
github.com/gomodule/redigo v1.8.9
github.com/google/go-cmp v0.5.9 // indirect
github.com/ory/dockertest/v3 v3.10.0
github.com/ostcar/topic v0.4.1
gopkg.in/yaml.v2 v2.4.0 // indirect
)

require (
github.com/alecthomas/kong v0.8.0
golang.org/x/sys v0.7.0 // indirect
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/docker/cli v23.0.0+incompatible // indirect
github.com/docker/docker v23.0.3+incompatible // indirect
github.com/docker/cli v23.0.4+incompatible // indirect
github.com/docker/docker v23.0.4+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.2.0 // indirect
github.com/jackc/puddle/v2 v2.1.2 // indirect
github.com/jackc/pgx/v5 v5.4.2 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/opencontainers/runc v1.1.6 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/tools v0.7.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit ab4bced

Please sign in to comment.