Tandoor Recipes was installed on a Windows 10 Pro PC because the author's wife is writing a plant based cookbook and has several years worth of recipe materials, photographs, and other applications on her Windows 10 Pro laptop.
For a new project where Windows 10 Pro is not needed, the Docker installation on a Linux Ubuntu computer (https://docs.tandoor.dev/install/docker/) is recommended.
This procedure assumes familiarity with Windows PowerShell and Linux shell commands and may take several hours to complete.
This procedure is provided as a courtesy and functioned on the author's Windows 10 Pro computer on April 15, 2022. Your results may be different due to variations in Windows 10 Pro software configurations and computer hardware.
The Windows 10 Pro software revision used was:
Edition Windows 10 Pro
Version 21H2
OS build 19044.1645
Experience Windows Feature Experience Pack 120.2212.4170.0
1F. After enabling virtualization in BIOS, PC will reboot.
1G. Click on Windows Start button and then start Ubuntu 20.04.4 LTS.
1H. Make sure to install Ubuntu with user 'recipes', or create a new user 'recipes' if required.
Verify:
PS C:\WINDOWS\system32> wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
1I. From this point on, it is recommended to use the Windows Terminal Preview ('WTP') except when performing a Windows administrative function with PSadmin such as 'wsl --shutdown'. See:
2D. Use WTP to verify systemd with a systemctl command:
PS C:\Users\YourUserName> wsl genie -s
recipes@YourComputerName-wsl:~$ sudo systemctl status time-sync.target
[sudo] password for recipes: xxxxxxxx
● time-sync.target - System Time Synchronized
Loaded: loaded (/lib/systemd/system/time-sync.target; static; vendor preset: disabled)
Active: active since Thu 2022-04-14 09:41:00 PDT; 4min 53s ago
Docs: man:systemd.special(7)
Apr 14 09:41:00 YourComputerName-wsl systemd[1]: Reached target System Time Synchronized.
recipes@YourComputerName-wsl:~$
2E. WSL2 can be shutdown with PSadmin with the 'wsl --shutdown' command.
2F. In a new PSadmin window, the wsl help information is available with the command 'wsl --help'.
2G. From this point forward, Ubuntu 20.04 should operate normally as long as WSL2 is started by PSadmin with the 'wsl genie -s' command, followed by WTP also with the 'wsl genie -s' command.
Step 3. NGINX Installation
3A. The Tandoor Recipes installation steps below provide the required content for NGINX configuration. NGINX can be installed with:
3B. If there is another web server running on your Windows 10 Pro computer (e.g. IIS), there may be a conflict with http port 80 (e.g. http://127.0.0.1/ or http://localhost/). This was true for the author, so IIS was disabled as a Windows Service during Tandoor Recipes installation until the Tandoor Recipes port 8002 was functional with NGINX.
3C. Verify with http://127.0.0.1, browser should display "Welcome to nginx!".
cd ~
# should be /home/recipes
git clone https://github.com/TandoorRecipes/recipes.git
# on 04-15-2022 this was the 'develop' branch
sudo mv recipes /var/www
cd /var/www/recipes
ls -alh # verify clone
sudo chown -R recipes:www-data /var/www/recipes
8A. If you already have PostgreSQL installed on your Windows 10 Pro computer, you may need to change the Tandoor Recipes PostgreSQL port from 5432 to something else (e.g. 5433). The author did this by editing the two files:
sudo nano /etc/postgresql/12/main/postgresql.conf
#
# Tandoor Recipes
# change to avoid conflist with Odoo PostgreSQL database
#
#port = 5432 # (change requires restart)
port = 5433
restart postgresql:
sudo systemctl restart postgresql
sudo systemctl status postgresql
and:
nano /var/www/recipes/.env
#
# change POSTGRES_PORT to avoind conflict with Odoo
#
#POSTGRES_PORT=5432
POSTGRES_PORT=5433
sudo systemctl start gunicorn_recipes
sudo systemctl status gunicorn_recipes
8B. If you already have PostgreSQL installed on your Windows 10 Pro computer (e.g. Odoo uses PostgreSQL), it may be possible to use the already installed PostgreSQL server. This has not been verified, however.
8C. If you wish to inspect the database, pgAdmin 4 is an excellent PostgreSQL utility that runs on Windows and Linux (https://www.pgadmin.org/download/). When installed under Windows, pgAdmin 4 can access the Tandoor Recipes PostgreSQL server running under WSL2.
8D. Install PostgreSQL on your WSL2 Ubuntu instance:
sudo apt install libpq-dev postgresql
8E. Verify:
sudo systemctl status postgresql
# look for loaded and active
sudo service postgresql status
# if down then
sudo service postgresql start
10B. Open psql console
note: replace 'password' with yoursecurepassword
sudo -u postgres psql
# postgres=# is expected console response
# In the psql console:
CREATE DATABASE djangodb;
CREATE USER djangouser WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE djangodb TO djangouser;
ALTER DATABASE djangodb OWNER TO djangouser;
#--Maybe not necessary, but should be faster:
ALTER ROLE djangouser SET client_encoding TO 'utf8';
ALTER ROLE djangouser SET default_transaction_isolation TO 'read committed';
ALTER ROLE djangouser SET timezone TO 'UTC';
#--Grant superuser right to your new user, it will be removed later
ALTER USER djangouser WITH SUPERUSER;
exit
Step 11. Download the .env configuration file and edit it accordingly
11A. Download:
cd /var/www/recipes
wget https://raw.githubusercontent.com/vabene1111/recipes/develop/.env.template -O /var/www/recipes/.env
sudo nano /etc/nginx/conf.d/recipes.conf
# insert:
upstream recipes {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
server unix:/var/www/recipes/recipes.sock fail_timeout=0;
}
server {
listen 8002;
#access_log /var/log/nginx/access.log;
#error_log /var/log/nginx/error.log;
location /static {
#alias /var/www/recipes/staticfiles;
alias /var/www/recipes/static;
}
location /media {
#alias /var/www/recipes/mediafiles;
alias /var/www/recipes/media;
}
location / {
proxy_set_header Host $http_host;
proxy_pass http://unix:/var/www/recipes/recipes.sock;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
note: WPT allows multiple concurrent console windows, which is useful for tail.
15B. If NGINX is showing errors, try the simple web server on port 8000:
cd /var/www/recipes
./manage.py runserver 0.0.0.0:8000
# console should show all accesses and errors
# http://127.0.0.1:8000/ should display Tandoor Recipes setup page
Step 17. Start Tandoor Recipes on Windows Boot
17A. Open Task Scheduler.
17B. Create Task:
General - Name - Tandoor Recipes WSL2 Ubuntu-20.04.4 Start on Boot
General - select 'Run whether user is logged on or now'
General - click on 'Run with highest privileges'
New Trigger - At startup
New Action - Program/Script - wsl, Add arguments - genie -a
Conditions - uncheck Start the task only if the computer is on AC power
Step 16. Verify Import Recipe
16A. The import recipe function worked perfectly for:
We provide also a portable archive file (tar.xz), just decompress the content somewhere convenient, then double-click on the digiKam icon in the folder.
The .tar.xz file can be extracted with the Ubuntu 20.04 Tandoor Recipes instance:
sudo tar -xvf /mnt/c/Users/YOURUSERNAME/Downloads/digiKam-7.6.0-Win64.tar.xz -C /mnt/c/Users/YOURUSERNAME/Downloads
You can move the newly created \Users\YOURUSERNAME\Downloads\digiKam folder to a better location, such as your Desktop.
The author's recommendation is to create a folder to contain exported digiKam photos for import into Tandoor Recipes. After the photos have been imported by Tandoor Recipes, the exported digiKam photos may be deleted.
this is far more comprehensive than most other tutorials so i am, for now, going to leave this as an issue and link it in the docs so everyone can easily find it.
Documentation link
https://docs.tandoor.dev/install/manual/
Affected section
Installation
Other
No response
Issue description
Install TANDOOR RECIPES on Windows 10 Pro, WSL 2, Ubuntu 20.04
Author: https://AudioClassify.com/, https://OTTStreamingVideo.net
April 15, 2022
Tandoor Recipes was installed on a Windows 10 Pro PC because the author's wife is writing a plant based cookbook and has several years worth of recipe materials, photographs, and other applications on her Windows 10 Pro laptop.
For a new project where Windows 10 Pro is not needed, the Docker installation on a Linux Ubuntu computer (https://docs.tandoor.dev/install/docker/) is recommended.
This procedure assumes familiarity with Windows PowerShell and Linux shell commands and may take several hours to complete.
This procedure is provided as a courtesy and functioned on the author's Windows 10 Pro computer on April 15, 2022. Your results may be different due to variations in Windows 10 Pro software configurations and computer hardware.
The Windows 10 Pro software revision used was:
Recommended Resources to Read First
https://github.com/TandoorRecipes/recipes
https://docs.tandoor.dev/install/manual/
https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#1-overview
https://docs.microsoft.com/en-us/windows/wsl/install
https://www.windowscentral.com/how-install-ubuntu-2110-wsl-windows-10-and-11
https://askubuntu.com/questions/1379425/system-has-not-been-booted-with-systemd-as-init-system-pid-1-cant-operate
https://gist.github.com/djfdyuruiry/6720faa3f9fc59bfdf6284ee1f41f950
https://ubuntu.com/tutorials/install-and-configure-nginx#1-overview
https://linuxize.com/post/how-to-install-python-3-9-on-ubuntu-20-04/
https://stackoverflow.com/questions/65644782/how-to-install-pip-for-python-3-9-on-ubuntu-20-04
https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#6-customising-your-terminal-with-windows-terminal-preview
https://askubuntu.com/questions/1379425/system-has-not-been-booted-with-systemd-as-init-system-pid-1-cant-operate
https://gist.github.com/djfdyuruiry/6720faa3f9fc59bfdf6284ee1f41f950
https://stackoverflow.com/questions/28379947/what-is-gunicorn-sock
https://www.windowscentral.com/how-create-automated-task-using-task-scheduler-windows-10
Step 1. WSL2 and Ubuntu 20.04
1A. Verfiy WSL2 is installed using Windows Powershell as Administrator ('PSadmin'):
PSadmin Desired output:
1B. If the output differs, follow the Ubuntu tutorial at:
https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#1-overview
1C. After reboot, go to the Microsoft App Store and download Ubuntu 20.04.4 LTS (494.5 MB download).
Microsoft Store description:
1D. Control Panel - Programs and Features - Turn Windows features on or off
check
1E. Verify virtualization is enabled in your PC BIOS. For example:
https://support.hp.com/us-en/document/ish_5637142-5637191-16
1F. After enabling virtualization in BIOS, PC will reboot.
1G. Click on Windows Start button and then start Ubuntu 20.04.4 LTS.
1H. Make sure to install Ubuntu with user 'recipes', or create a new user 'recipes' if required.
Verify:
1I. From this point on, it is recommended to use the Windows Terminal Preview ('WTP') except when performing a Windows administrative function with PSadmin such as 'wsl --shutdown'. See:
https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#6-customising-your-terminal-with-windows-terminal-preview
Windows Terminal Preview can be installed from the Microsoft Store.
1J. Verify:
WTP Desired output:
Step 2. Enable systemd in WSL 2
2A. Please read this link:
https://askubuntu.com/questions/1379425/system-has-not-been-booted-with-systemd-as-init-system-pid-1-cant-operate
2B. The solution is found in this link:
https://gist.github.com/djfdyuruiry/6720faa3f9fc59bfdf6284ee1f41f950
WTP:
PSadmin:
2C. Start WSL2 with PSadmin:
PSadmin expected output:
2D. Use WTP to verify systemd with a systemctl command:
2E. WSL2 can be shutdown with PSadmin with the 'wsl --shutdown' command.
2F. In a new PSadmin window, the wsl help information is available with the command 'wsl --help'.
2G. From this point forward, Ubuntu 20.04 should operate normally as long as WSL2 is started by PSadmin with the 'wsl genie -s' command, followed by WTP also with the 'wsl genie -s' command.
Step 3. NGINX Installation
3A. The Tandoor Recipes installation steps below provide the required content for NGINX configuration. NGINX can be installed with:
3B. If there is another web server running on your Windows 10 Pro computer (e.g. IIS), there may be a conflict with http port 80 (e.g. http://127.0.0.1/ or http://localhost/). This was true for the author, so IIS was disabled as a Windows Service during Tandoor Recipes installation until the Tandoor Recipes port 8002 was functional with NGINX.
3C. Verify with http://127.0.0.1, browser should display "Welcome to nginx!".
Step 4. Install Python3.9
4A. Please see https://linuxize.com/post/how-to-install-python-3-9-on-ubuntu-20-04/:
4B. Verify with:
Expected output:
Step 5. Clone Latest Tandoor Recipies
5A. Clone latest reposititory from GitHub:
Step 6. Set-up PIP and ENV
6A. Install pip for python3.9:
6B. Verify:
Expected output:
6C. Install python3.9-venv:
6D. Create virtual environment:
Verify:
note: the pyvenv.cfg file, bin folder, and lib folder, are related to the newly created virtual environment.
6E. Activate venv:
6F. Load env values:
Step 7. Install Javascript Tools (nodejs >= 12 required)
7A. Install nodejs:
7B. Install npm:
Step 8. Install PostgreSQL
8A. If you already have PostgreSQL installed on your Windows 10 Pro computer, you may need to change the Tandoor Recipes PostgreSQL port from 5432 to something else (e.g. 5433). The author did this by editing the two files:
restart postgresql:
and:
reload /var/www/recipes/.env :
restart gunicorn_recipes:
8B. If you already have PostgreSQL installed on your Windows 10 Pro computer (e.g. Odoo uses PostgreSQL), it may be possible to use the already installed PostgreSQL server. This has not been verified, however.
8C. If you wish to inspect the database, pgAdmin 4 is an excellent PostgreSQL utility that runs on Windows and Linux (https://www.pgadmin.org/download/). When installed under Windows, pgAdmin 4 can access the Tandoor Recipes PostgreSQL server running under WSL2.
8D. Install PostgreSQL on your WSL2 Ubuntu instance:
8E. Verify:
Step 9. Install requirements.txt
9A. Install requirements.txt:
Step 10. Configure PostgreSQL
10A. Start postgresql if not running:
10B. Open psql console
note: replace 'password' with yoursecurepassword
Step 11. Download the .env configuration file and edit it accordingly
11A. Download:
11B. Edit with nano.
note: replace 'secretkey' with yoursecretkey
note: TIMEZONE is from https://timezonedb.com/time-zones
note: replace 'password' with yoursecurepassword
11B. Load env values
Step 12. Continue Installation
12A. Migrate:
12B. Revert superuser from postgres:
12C. Generate static files:
Step 13. Setup Web Services
13A. Create gunicorn_recipes.service:
13B. Enable and Start:
13C. Verify:
Step 14. NGINX recipes.conf
14A. This differs from https://docs.tandoor.dev/install/manual/:
14B. Check NGINX and restart:
14C. Verify at http://127.0.0.1:8002. If the installation is correct, the Tandoor Recipes setup page should display (redirect to http://127.0.0.1:8002/setup/).
Step 15. Debug Tools (if necessary)
15A. Useful commands:
note: WPT allows multiple concurrent console windows, which is useful for tail.
15B. If NGINX is showing errors, try the simple web server on port 8000:
Step 17. Start Tandoor Recipes on Windows Boot
17A. Open Task Scheduler.
17B. Create Task:
General - Name - Tandoor Recipes WSL2 Ubuntu-20.04.4 Start on Boot
General - select 'Run whether user is logged on or now'
General - click on 'Run with highest privileges'
New Trigger - At startup
New Action - Program/Script - wsl, Add arguments - genie -a
Conditions - uncheck Start the task only if the computer is on AC power
Step 16. Verify Import Recipe
16A. The import recipe function worked perfectly for:
https://www.loveandlemons.com/vegan-pasta/
Windows and Linux Open Source Photo Management System
The author also installed digiKam (https://www.digikam.org), which is a high quality open source photo management system.
The Windows 10 installation of digiKam uses an portable archive folder and takes only a few minutes:
https://www.digikam.org/download/binary/
download link:
https://download.kde.org/stable/digikam/7.6.0/digiKam-7.6.0-Win64.tar.xz
The .tar.xz file can be extracted with the Ubuntu 20.04 Tandoor Recipes instance:
sudo tar -xvf /mnt/c/Users/YOURUSERNAME/Downloads/digiKam-7.6.0-Win64.tar.xz -C /mnt/c/Users/YOURUSERNAME/Downloads
You can move the newly created \Users\YOURUSERNAME\Downloads\digiKam folder to a better location, such as your Desktop.
The author's recommendation is to create a folder to contain exported digiKam photos for import into Tandoor Recipes. After the photos have been imported by Tandoor Recipes, the exported digiKam photos may be deleted.