From e83d15076a9d7d3cad88aa46c703f66540e43708 Mon Sep 17 00:00:00 2001 From: Dennis van Zuijlekom Date: Tue, 14 Mar 2023 16:13:46 +0100 Subject: [PATCH 1/4] Correct typo and slight formatting issue --- doc/manual/installation.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/manual/installation.md b/doc/manual/installation.md index 9c2e2299c3..85b5545a4b 100644 --- a/doc/manual/installation.md +++ b/doc/manual/installation.md @@ -96,9 +96,11 @@ Install the database packages sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev For Debian Stretch, replace `libmysqlclient-dev` with `default-libmysqlclient-dev`. See the [additional notes section](#additional-notes) for more information. -For Debian BullEye: + +For Debian BullsEye: + sudo apt-get install -y default-mysql-server default-mysql-client default-libmysqlclient-dev - + Check the installed MySQL version (remember if its >= 5.5.3 for the `.env` configuration done later): mysql --version From 384a41166c6f2d7dc68ce2ca294d11a0639b82bb Mon Sep 17 00:00:00 2001 From: Dennis van Zuijlekom Date: Tue, 14 Mar 2023 16:15:23 +0100 Subject: [PATCH 2/4] Add hints for PostgreSQL setups on Debian --- doc/manual/installation.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/doc/manual/installation.md b/doc/manual/installation.md index 85b5545a4b..ac8f286387 100644 --- a/doc/manual/installation.md +++ b/doc/manual/installation.md @@ -91,6 +91,8 @@ Create a user for Huginn: ## 4. Database +### MySQL / MariaDB + Install the database packages sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev @@ -150,6 +152,27 @@ You should now see `ERROR 1049 (42000): Unknown database 'huginn_production'` wh You are done installing the database and can go back to the rest of the installation. +### PostgreSQL + +Install the database packages + + sudo apt-get install -y postgresql libpq-dev + +Create a user for Huginn and set its database connection password. If you want the user to be able to create the database, add `-d` + + sudo -u postgres -H createuser -P huginn + +Create a database + + sudo -u postgres -H createdb -O huginn -T template0 huginn_production + +Try connecting to the new database with the new user + + sudo -u huginn psql -h localhost -W huginn_production + + # Type the password you set earlier + +You should now be greeted by the `psql` interactive client and be connected to the `huginn_production` database. Quit the database session with `\q` or `CTRL-D` ## 5. Huginn @@ -205,6 +228,20 @@ If you are using a local MySQL server the database configuration should look lik # database can hold 4-byte UTF-8 characters like emoji. #DATABASE_ENCODING=utf8mb4 +If you are using a local PostgreSQL server the database configuration should look like this (use the password of the huginn PostgreSQL user you created earlier): + + DATABASE_ADAPTER=postgresql + DATABASE_RECONNECT=true + DATABASE_NAME=huginn_production + DATABASE_POOL=20 + DATABASE_USERNAME=huginn + DATABASE_PASSWORD='$password' + DATABASE_HOST=localhost + DATABASE_PORT=5432 + DATABASE_SOCKET=/var/run/postgresql/.s.PGSQL.5432 + + DATABASE_ENCODING=utf8 + **Important**: Uncomment the RAILS_ENV setting to run Huginn in the production rails environment RAILS_ENV=production From 65bb1a93be9751f0f9f1702f94c7139a4af083c0 Mon Sep 17 00:00:00 2001 From: Dennis van Zuijlekom Date: Tue, 14 Mar 2023 16:17:14 +0100 Subject: [PATCH 3/4] Add hints on non-standard app directories, e.g. /opt/huginn/ --- doc/manual/installation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/manual/installation.md b/doc/manual/installation.md index ac8f286387..b647f10171 100644 --- a/doc/manual/installation.md +++ b/doc/manual/installation.md @@ -305,6 +305,9 @@ Enable (remove the comment) [from these lines](https://github.com/huginn/huginn/ **Note:** Ensure you have no leading spaces before `web:` or `jobs:` in your `Procfile` file. +If you use a directory other than `/home/huginn/huginn/` for the app, change the location of the `runit` logfile in `lib/tasks/production.rake`, for example: + run('foreman export runit -a huginn -l /opt/huginn/log /etc/service') + Export the init scripts: sudo bundle exec rake production:export @@ -315,6 +318,7 @@ Export the init scripts: sudo cp deployment/logrotate/huginn /etc/logrotate.d/huginn +Change the location of the log directory if you have chosen to log to a different directory other than `/home/huginn/huginn/log/` ### Ensure Your Huginn Instance Is Running From 6fd50ccd8186ded72864584ea065dbcbf0b11fe6 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Mon, 24 Apr 2023 22:56:14 +0900 Subject: [PATCH 4/4] Update doc/manual/installation.md --- doc/manual/installation.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/manual/installation.md b/doc/manual/installation.md index b647f10171..a55fba05f8 100644 --- a/doc/manual/installation.md +++ b/doc/manual/installation.md @@ -238,7 +238,6 @@ If you are using a local PostgreSQL server the database configuration should loo DATABASE_PASSWORD='$password' DATABASE_HOST=localhost DATABASE_PORT=5432 - DATABASE_SOCKET=/var/run/postgresql/.s.PGSQL.5432 DATABASE_ENCODING=utf8