Skip to content

Commit e6fb352

Browse files
Merge remote-tracking branch 'upstream/master'
2 parents f29dbe3 + 86536a9 commit e6fb352

92 files changed

Lines changed: 16318 additions & 9169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bugs.md

100755100644
File mode changed.

.github/ISSUE_TEMPLATE/config.yml

100755100644
File mode changed.

.github/ISSUE_TEMPLATE/feature_request.md

100755100644
File mode changed.

.github/pull_request_template.md

100755100644
File mode changed.

.github/workflows/build-publish-docker.yml

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
name: Build and Publish Version Tags
44
on:
55
push:
6+
branches:
7+
- '**'
68
tags:
79
- "v*"
810
jobs:
@@ -11,17 +13,23 @@ jobs:
1113
name: Build Docker image and push to repositories
1214
# run only when code is compiling and tests are passing
1315
runs-on: ubuntu-latest
16+
env:
17+
IMAGE: ${{ secrets.DOCKER_IMAGE || 'openstad/api' }}
1418
# steps to perform in job
1519
steps:
1620
- name: Checkout code
1721
uses: actions/checkout@v2
1822

19-
- name: Get the version
20-
id: get_version
21-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
22-
23-
# - name: tag number
24-
# run : echo ${{ github.event.release.tag_name }}
23+
- name: Docker meta
24+
id: meta
25+
uses: docker/metadata-action@v4
26+
with:
27+
images: ${{ env.IMAGE }}
28+
tags: |
29+
# branch event
30+
type=ref,event=branch,suffix=-{{sha}}
31+
# tag event
32+
type=ref,event=tag
2533
2634
# setup Docker buld action
2735
- name: Set up Docker Buildx
@@ -35,16 +43,27 @@ jobs:
3543
password: ${{ secrets.DOCKERHUB_TOKEN }}
3644

3745
- name: Build image and push to Docker Hub and GitHub Container Registry
46+
id: docker_build
3847
uses: docker/build-push-action@v2
3948
with:
4049
context: .
4150
push: true
42-
# Note: tags has to be all lower-case
43-
tags: |
44-
openstad/api:${{ steps.get_version.outputs.VERSION }}
45-
# build on feature branches, push only on main branch
46-
##push: ${{ github.ref == 'refs/heads/main' }}
47-
- name: Image digest
48-
run: echo ${{ steps.docker_build.outputs.digest }}
51+
tags: ${{ steps.meta.outputs.tags }}
52+
53+
# Comment build info in commit
54+
- uses: actions/github-script@0.9.0
55+
env:
56+
STDOUT: "Published new image: `${{ fromJson(steps.docker_build.outputs.metadata)['image.name'] }}`"
57+
with:
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
script: |
60+
github.repos.createCommitComment({
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
commit_sha: context.sha,
64+
body: process.env.STDOUT
65+
})
4966
67+
- name: Image digest
68+
run: echo "${{ steps.docker_build.outputs.metadata }}"
5069

.github/workflows/gitops.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,33 @@
33
## UNRELEASED
44
* Change mongoDB S3 backup to read the database dump in chunks and upload it to the S3 bucket using a MultiPart upload setup.
55
* Allow s3 backups to be disabled from the cronjobs, but instead be run through a different entrypoint (backup.js) to allow kubernetes cronjobs to be used.
6+
* Add input, textarea and multiple-choice question types to the choices guide
7+
8+
## 1.0.0
9+
* Anonymize site users
10+
* Save idea as concept
11+
* Bugfix: no-sentiment in arguments-block
12+
* Bugfix: edit idea after first like or argument
13+
* Add env MYSQL_CA_CERT for MySQL SSL connection
14+
* Update/cleanup access rights for moderators and editors
15+
* Bugfix: add constraint to users table, to prevent double users
16+
* Remove all remaining code related to sessions; the API is stateless
17+
* Remove old image code
18+
* Bugfix: users in vote export
19+
* Bugfix: site.config.ideas.automaticallyUpdateStatus
20+
* Upgrade to node 16
21+
* Add virtual end date to idea
622

723
## v0.40.0
824
Update version number
9-
10-
## v0.21.0
25+
* Remove sessions and cookies - the API is stateless
1126
* Update Action cron to once every minute
1227
* Add linter/prettier
1328
* Unknown fixed-auth-token is no longer an error but is now a not-logged-in
1429
* Better handling of database connections
1530
* New template distribution system
1631
* Do not wait for cms when updating site config
1732
* Move docker builds from travis to github actions
18-
1933
## v0.20.0 (2021-12-20)
2034
* Fix responding to not existing routes with to much information
2135
* Make submissions listable & viewable, and allow them to be filtered by formId

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Nodejs 8.0.0 alpine 3.6.0
2-
FROM node:13.14.0-alpine
2+
FROM node:16.16.0-alpine
33

44
# Label for tracking
55
LABEL nl.openstad.container="api_container" nl.openstad.version="0.0.1-beta" nl.openstad.release-date="2020-05-07"
@@ -19,15 +19,13 @@ ENV API_MAIL_TRANSPORT_SMTP_REQUIRESSL=""
1919
ENV API_MAIL_TRANSPORT_SMTP_AUTH_USER=""
2020
ENV API_MAIL_TRANSPORT_SMTP_AUTH_PASS=""
2121
ENV API_NOTIFICATIONS_ADMIN_EMAILADDRESS=""
22-
ENV API_SECURITY_SESSIONS_COOKIENAME=""
23-
ENV API_SECURITY_SESSIONS_ONLYSECURE=""
2422
ENV API_AUTHORIZATION_JWTSECRET=""
2523
ENV API_AUTHORIZATION_FIXEDAUTHTOKENS=""
2624
ENV AUTH_API_URL=""
2725

2826

2927
# Install all base dependencies.# add perl for shell scripts
30-
RUN apk add --no-cache --update g++ make python musl-dev bash perl perl-dbd-mysql perl-posix-strftime-compiler
28+
RUN apk add --no-cache --update g++ make python3 musl-dev bash perl perl-dbd-mysql perl-posix-strftime-compiler
3129

3230
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/main' >> /etc/apk/repositories
3331
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/community' >> /etc/apk/repositories
@@ -47,7 +45,7 @@ RUN npm install
4745
RUN npm install -g nodemon
4846

4947
# Remove unused packages only used for building.
50-
RUN apk del g++ make python && rm -rf /var/cache/apk/*
48+
RUN apk del g++ make python3 && rm -rf /var/cache/apk/*
5149

5250
# Set node ownership to /home/app
5351
RUN chown -R node:node /home/app

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ module.exports = {
4444
},
4545
4646
"security": {
47-
"sessions": {
48-
"secret": "COOKIE_SECRET",
49-
"onlySecure": true
50-
}
5147
},
5248
5349
"authorization": {
@@ -93,7 +89,10 @@ Then run following command:
9389
```
9490
env ... node reset.js
9591
```
96-
92+
If you are using an existing database and only want to migrate run the following command:
93+
```
94+
node -r dotenv/config migrate.js
95+
```
9796

9897
### 4. Start de server
9998
```
@@ -128,7 +127,10 @@ If you want to enable gitops flow in the ci pipeline of travis you need to confi
128127
- GITOPS_ACC_VALUES_FILE=k8s/openstad/environments/acc.values.yaml
129128
- GITOPS_PROD_VALUES_FILE=k8s/openstad/environments/prod.values.yaml
130129

130+
## MySQL with SSL
131+
132+
When you want to connect to a MySQL server using SSL, a Certificate Authority certificate is required. The contents of this CA certificate can be passed into the `MYSQL_CA_CERT` environment variable.
133+
131134
## Documentatie
132135

133136
Meer informatie staat in de [docs directory](doc/index.md).
134-

config/default.js

Lines changed: 24 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)