diff --git a/CHANGELOG.md b/CHANGELOG.md index ab6d0351..2e0c8fad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,14 @@ The following log documents the history of the server project. None -### 2.0.0 2021-05-09 +### 2.1.0 2023-03-04 + +#### Changed + +- `OnPremise` environment variable is deprecated and is replaced with `OnPremises` +- Upgrade Go from 1.17 to 1.20. + +### 2.0.0 2022-05-09 #### Removed diff --git a/host/smoketest/README.md b/host/smoketest/README.md index 9025f533..a428896a 100644 --- a/host/smoketest/README.md +++ b/host/smoketest/README.md @@ -1 +1,9 @@ This directory contains a smoke test for running a self-hosted instance using a virtual machine. + +## Instruction + +The following script will set up a test environment in Vagrant and run the test. + +``` +./run_test.sh +``` diff --git a/host/smoketest/Vagrantfile b/host/smoketest/Vagrantfile index 54b28fcf..2eaee5dd 100644 --- a/host/smoketest/Vagrantfile +++ b/host/smoketest/Vagrantfile @@ -1,7 +1,7 @@ # -*- mode: ruby -*- Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/bionic64" + config.vm.box = "ubuntu/jammy64" config.vm.synced_folder './volume', '/vagrant' config.vm.network "forwarded_port", guest: 2300, host: 2300 diff --git a/host/smoketest/setup.sh b/host/smoketest/setup.sh index 589524ee..575b7fd8 100755 --- a/host/smoketest/setup.sh +++ b/host/smoketest/setup.sh @@ -9,7 +9,11 @@ sudo apt-get update sudo apt-get install -y postgresql-14 # set up database +sudo usermod -a -G sudo postgres +cd /var/lib/postgresql sudo -u postgres createdb dnote +sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" + # allow connection from host and allow to connect without password sudo sed -i "/port*/a listen_addresses = '*'" /etc/postgresql/14/main/postgresql.conf sudo sed -i 's/host.*all.*.all.*md5/# &/' /etc/postgresql/14/main/pg_hba.conf diff --git a/host/smoketest/testsuite.sh b/host/smoketest/testsuite.sh index 83b5e4b0..4fa05af3 100755 --- a/host/smoketest/testsuite.sh +++ b/host/smoketest/testsuite.sh @@ -2,10 +2,11 @@ # testsuite.sh runs the smoke tests for a self-hosted instance. # It is meant to be run inside a virtual machine which has been # set up by an entry script. -set -eu +set -eux echo 'Running a smoke test' +cd /var/lib/postgresql sudo -u postgres dropdb dnote sudo -u postgres createdb dnote @@ -18,7 +19,7 @@ GO_ENV=PRODUCTION \ DBPort=5432 \ DBName=dnote \ DBUser=postgres \ - DBPassword="" \ + DBPassword=postgres \ WebURL=localhost:3000 \ ./dnote-server -port 2300 start & sleep 3