Skip to content

Commit

Permalink
Merge branch 'release/3.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
electerious committed Sep 18, 2021
2 parents 9a6e51d + 0fb590e commit 6c23dc2
Show file tree
Hide file tree
Showing 10 changed files with 1,248 additions and 1,073 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [3.2.0] - 2021-09-18

### Changed

- Switch to official Node.js Docker image
- Updated dependencies, including mongoose (thanks @suda, #291)

## [3.1.1] - 2021-06-27

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Start with first build stage

FROM mhart/alpine-node:14 AS build
FROM node:14-alpine AS build
WORKDIR /srv/app/

# Add dependencies first so that Docker can use the cache as long as the dependencies stay unchanged
Expand All @@ -16,7 +16,7 @@ COPY dist /srv/app/dist

# Start with second build stage

FROM mhart/alpine-node:14
FROM node:14-alpine
EXPOSE 3000
WORKDIR /srv/app/

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Get Ackee up and running…
- […with Qovery](docs/Get%20started.md#with-qovery)
- […with Render](docs/Get%20started.md#with-render)
- […with Railway](docs/Get%20started.md#with-railway)
- […with Koyeb](docs/Get%20started.md#with-koyeb)

And configure Ackee and your server correctly…

Expand Down Expand Up @@ -95,9 +96,9 @@ I am working hard on continuously developing and maintaining Ackee. Please consi
- [vuepress-plugin-ackee](https://github.com/spekulatius/vuepress-plugin-ackee) - VuePress plugin for Ackee
- [svelte-ackee](https://github.com/gaia-green-tech/svelte-ackee) - Svelte module for Ackee
- [ackee_dart](https://github.com/marchellodev/ackee_dart) - Ackee plugin for Dart/Flutter ([pub.dev](https://pub.dev/packages/ackee_dart))

- [ackee-tracker-consent](https://www.npmjs.com/package/ackee-tracker-consent) - A consent banner to activate detailed tracking on Ackee

### Links

- [Follow Ackee on Twitter](https://twitter.com/getackee)
- [Vote for Ackee on ProductHunt](https://www.producthunt.com/posts/ackee)
- [Vote for Ackee on ProductHunt](https://www.producthunt.com/posts/ackee)
222 changes: 97 additions & 125 deletions dist/index.js

Large diffs are not rendered by default.

45 changes: 44 additions & 1 deletion docs/Get started.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The node server shows you the UI and receives the request from all of your sites
- [With Qovery](#with-qovery)
- [With Render](#with-render)
- [With Railway](#with-railway)
- [With Koyeb](#with-koyeb)

## With Docker Compose

Expand Down Expand Up @@ -275,6 +276,48 @@ Once your deploy has finished, you are ready to start using Ackee! Visit the URL

You can use the [Railway](https://railway.app/) button for a one-click deployment and have Ackee running within minutes.

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new?template=https%3A%2F%2Fgithub.com%2Frailwayapp%2Fexamples%2Ftree%2Fmaster%2Fexamples%2Fackee&plugins=mongodb&envs=ACKEE_USERNAME%2CACKEE_PASSWORD)
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/starters/ackee)

Upon clicking the button, you will be asked to set the `ACKEE_USERNAME` and `ACKEE_PASSWORD` environment variables. Once you do that, everything should just work on it's own. Railway will automatically provision the MongoDB database for you and also link it to your Ackee deployment!

## With Koyeb

[Koyeb](https://www.koyeb.com) is a developer-friendly serverless platform to deploy apps globally. The platform lets you seamlessly run Docker containers, web apps, and APIs with git-based deployment, native autoscaling, free SSL, a global edge network, and built-in service mesh and discovery.

### 1. Configure Ackee

- You need to have a MongoDB instance running (e.g. [MongoDB Atlas](https://www.mongodb.com/cloud/atlas))
- Ensure that you're using the correct CORS headers by setting [`ACKEE_ALLOW_ORIGIN`](CORS%20headers.md#platforms-as-a-service-configuration)
- Have the [Koyeb CLI](https://www.koyeb.com/docs/cli/installation) installed which is the fastest way to deploy Ackee

### 2. Deploy Ackee

Before deploying Ackee on Koyeb, create three secrets to securely store your Ackee username, password, and your MongoDB URL.
In your terminal execute the following to create the secrets:

```sh
$ koyeb secret create mongodb-url
✔ Enter your secret: mongodb://<username>:<password>@<host>:<port>/<db>

$ koyeb secret create ackee-username
✔ Enter your secret: <ackee_username>

$ koyeb secret create ackee-password
✔ Enter your secret: <ackee_password>
```

Once you’ve created the secrets, you can deploy Ackee. In your terminal run the following command to create a new Koyeb App and deploy the Ackee service.

```sh
koyeb app init ackee --docker electerious/ackee --ports 3000:http --routes /:3000 --env ACKEE_USERNAME=@ackee-username --env ACKEE_PASSWORD=@ackee-password --env ACKEE_MONGODB=@mongodb-url --env ACKEE_ALLOW_ORIGIN="https://example.com"
```

Your Ackee service is being deployed. To retrieve the Ackee URL run:

```
$ koyeb app get ackee
ID NAME DOMAINS UPDATED AT
30de8301-05b1-4131-a842-28e608900000 ackee ackee-<YOUR_KOYEB_ORG>.koyeb.app 2021-07-06 11:58:01.143967 +0000 UTC
```

Open the URL to access Ackee.
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ackee",
"private": true,
"version": "3.1.1",
"version": "3.2.0",
"authors": [
"Tobias Reich <[email protected]>"
],
Expand Down Expand Up @@ -37,17 +37,17 @@
"apollo-server-lambda": "^2.25.1",
"apollo-server-micro": "^2.25.1",
"apollo-server-plugin-http-headers": "^0.1.4",
"date-fns": "^2.22.1",
"date-fns-tz": "^1.1.4",
"date-fns": "^2.24.0",
"date-fns-tz": "^1.1.6",
"debounce-promise": "^3.1.2",
"dotenv": "^10.0.0",
"graphql": "^15.5.0",
"graphql-scalars": "^1.10.0",
"graphql": "^15.5.3",
"graphql-scalars": "^1.10.1",
"graphql-tools": "^7.0.5",
"is-url": "^1.2.4",
"micro": "^9.3.4",
"microrouter": "^3.1.3",
"mongoose": "^5.12.14",
"mongoose": "^6.0.6",
"node-fetch": "^2.6.1",
"node-schedule": "^2.0.0",
"normalize-url": "^6.0.1",
Expand All @@ -57,32 +57,32 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@apollo/client": "^3.3.20",
"@electerious/eslint-config": "^2.0.3",
"@apollo/client": "^3.4.12",
"@electerious/eslint-config": "^2.0.5",
"ava": "3.15.0",
"classnames": "^2.3.1",
"coveralls": "^3.1.0",
"eslint": "^7.29.0",
"coveralls": "^3.1.1",
"eslint": "^7.32.0",
"eslint-plugin-ava": "^12.0.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-react": "^7.25.2",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-unicorn": "^33.0.1",
"eslint-plugin-unicorn": "^36.0.0",
"formbase": "^12.0.2",
"history": "^5.0.0",
"history": "^5.0.1",
"human-number": "^1.0.6",
"mocked-env": "^1.3.4",
"mongodb-memory-server": "^6.9.6",
"nodemon": "^2.0.7",
"mocked-env": "^1.3.5",
"mongodb-memory-server": "^7.4.0",
"nodemon": "^2.0.12",
"normalize.css": "^8.0.1",
"nyc": "^15.1.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-apollo-network-status": "^5.0.1",
"react-dom": "^17.0.2",
"react-fast-compare": "^3.2.0",
"react-hotkeys-hook": "^3.3.2",
"react-use": "^17.2.4",
"react-hotkeys-hook": "^3.4.0",
"react-use": "^17.3.1",
"rosid-handler-js-next": "^1.0.1",
"rosid-handler-sass": "^8.0.0",
"s-ago": "^2.2.0",
Expand Down Expand Up @@ -111,4 +111,4 @@
"engines": {
"node": ">= 14"
}
}
}
2 changes: 1 addition & 1 deletion src/resolvers/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
const { username, password } = input

if (config.username == null) throw new KnownError('Ackee username missing in environment')
if (config.password == null) throw new KnownError('Ackee username missing in environment')
if (config.password == null) throw new KnownError('Ackee password missing in environment')

if (username !== config.username) throw new KnownError('Username or password incorrect')
if (password !== config.password) throw new KnownError('Username or password incorrect')
Expand Down
4 changes: 0 additions & 4 deletions src/utils/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@
const mongoose = require('mongoose')

module.exports = (dbUrl) => mongoose.connect(dbUrl, {
useFindAndModify: false,
useNewUrlParser: true,
useCreateIndex: true,
useUnifiedTopology: true,
connectTimeoutMS: 60000,
})
8 changes: 4 additions & 4 deletions test/resolvers/_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const connect = require('../../src/utils/connect')
const createArray = require('../../src/utils/createArray')
const { day, minute } = require('../../src/utils/times')

const mongoDb = new MongoMemoryServer()
const mongoDb = MongoMemoryServer.create()

const connectToDatabase = async () => {
const dbUrl = await mongoDb.getUri()
const dbUrl = (await mongoDb).getUri()
return connect(dbUrl)
}

Expand Down Expand Up @@ -74,9 +74,9 @@ const cleanupDatabase = async (t) => {
})
}

const disconnectFromDatabase = () => {
const disconnectFromDatabase = async () => {
mongoose.disconnect()
mongoDb.stop()
;(await mongoDb).stop()
}

const api = async (base, body, token, headers = {}) => {
Expand Down
Loading

1 comment on commit 6c23dc2

@vercel
Copy link

@vercel vercel bot commented on 6c23dc2 Sep 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.