diff --git a/docs/Platforms/FOSS/FerretDB2-PostgreSQL.md b/docs/Platforms/FOSS/FerretDB2-PostgreSQL.md index 2158a601e..ec6fa65a4 100644 --- a/docs/Platforms/FOSS/FerretDB2-PostgreSQL.md +++ b/docs/Platforms/FOSS/FerretDB2-PostgreSQL.md @@ -7,13 +7,13 @@ git clone --branch main --depth 1 https://github.com/wekan/wekan.git cd wekan sudo apt update sudo apt install -y build-essential gcc g++ make git curl wget \ -p7zip-full zip unzip unp npm p7zip-full +p7zip-full zip unzip unp npm sudo npm install -g n export N_NODE_MIRROR=https://github.com/wekan/node-v14-esm/releases/download sudo -E n 14.21.4 sudo npm -g install @mapbox/node-pre-gyp sudo npm -g install meteor@2.14 --unsafe-perm -export PATH=$PATH:/home/demo/.meteor +export PATH=$PATH:$HOME/.meteor meteor npm install production meteor build .build --directory --platforms=web.browser ``` @@ -22,7 +22,7 @@ meteor build .build --directory --platforms=web.browser ``` sudo bash -c 'curl -fsSL https://repo.pigsty.io/pig | bash' -pig repo add all -u +pig repo add pgsql -u pig ext install pg17 pig ext install documentdb ``` @@ -31,7 +31,7 @@ Edit `/etc/postgresql/17/main/postgresql.conf`, there set shared_preload_libraries = 'pg_cron, pg_documentdb, pg_documentdb_core' ``` edit `/etc/postgresql/17/main/pg_hba.conf` , -replace **scram-sha-256` with trust on the host lines for `127.0.0.1/32` and `::1/128` +replace `scram-sha-256` with trust on the host lines for `127.0.0.1/32` and `::1/128` Restart PostgreSQL: ``` @@ -65,6 +65,7 @@ sudo service ferretdb start ``` su - su - postgres +psql CREATE ROLE ferret WITH PASSWORD 'DB_PASSWORD_GOES_HERE'; CREATE DATABASE ferretdb; GRANT ALL PRIVILEGES ON DATABASE ferretdb TO ferret; @@ -79,6 +80,9 @@ GRANT ALL ON SCHEMA documentdb_data to ferret; GRANT documentdb_admin_role to ferret; ``` ## Launching WeKan + +a) At screen: + ``` export PATH=$HOME/.meteor cd ~/wekan @@ -90,6 +94,74 @@ ROOT_URL=https://wekan.example.com meteor run \ --port 8080 2>&1 | tee ../wekan-log.`date +%s`.txt ``` +b) SystemD Service: + +/etc/default/wekan: +``` +NODE_ENV=production +MAIL_FROM="WeKan kanban " +MAIL_URL=smtp://username:password@email-smtp.eu-west-1.amazonaws.com:587?tls={ciphers:"SSLv3"}&secureConnection=false +OAUTH2_AUTH_ENDPOINT=https://accounts.google.com/o/oauth2/v2/auth +OAUTH2_CLIENT_ID=example.apps.googleusercontent.com +OAUTH2_EMAIL_MAP=email +OAUTH2_ENABLED=true +OAUTH2_FULLNAME_MAP=name +OAUTH2_ID_MAP=sub +OAUTH2_REQUEST_PERMISSIONS="openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email" +OAUTH2_SECRET=topsecret +OAUTH2_TOKEN_ENDPOINT=https://oauth2.googleapis.com/token +OAUTH2_USERINFO_ENDPOINT=https://openidconnect.googleapis.com/v1/userinfo +OAUTH2_USERNAME_MAP=nickname +MONGO_LOG_DESTINATION=mongodb-log.txt +MONGODB_PORT=27017 +ROOT_URL=https://boards.example.com +WRITABLE_PATH=../files +MONGO_URL=mongodb://ferret:DB_PASSWORD_GOES_HERE@127.0.0.1:27017/wekan +WITH_API=true +RICHER_CARD_COMMENT_EDITOR=false +CARD_OPENED_WEBHOOK_ENABLED=false +BIGEVENTS_PATTERN=NONE +BROWSER_POLICY_ENABLED=true +TRUSTED_URL='' +WEBHOOKS_ATTRIBUTES='' +LDAP_BACKGROUND_SYNC_INTERVAL='' +``` +`/etc/systemd/system/wekan.service` running as user boards, +`sudo adduser boards` and copy files and update permissions +with `sudo chown boards:boards /home/boards -R` +``` +[Unit] +Description=The Wekan Service +After=syslog.target network.target + +[Service] +EnvironmentFile=/etc/default/wekan +User=boards +Group=boards +WorkingDirectory=/home/boards/repos/bundle +ExecStart=/usr/local/bin/node main.js +Restart=on-failure +SuccessExitStatus=143 +StandardOutput=file:/home/boards/repos/wekan-output-log.txt +StandardError=file:/home/boards/repos/wekan-error-log.txt + +[Install] +WantedBy=multi-user.target +``` +Then enable service: +``` +sudo systemctl enable wekan +sudo systemctl start wekan +``` +For SSL/TLS, I run Caddy at front of Node.js: +https://github.com/wekan/wekan/blob/main/docs/Webserver/Caddy.md + +Related is docs about Raspberry Pi: +https://github.com/wekan/wekan/blob/main/docs/Platforms/FOSS/RaspberryPi/Raspberry-Pi.md + +And also about Windows bundle: +https://github.com/wekan/wekan/blob/main/docs/Platforms/Propietary/Windows/Offline.md + ## Notes - Machine must have at least 3 gigs of ram. Crashes at npm installing meteor, with 384 megs.