Search backend for OpenFitnessPal.
Note: all commands here are done as root.
To build this project, you'll need a libc implementation (only tested with glibc), optionally a separate libcrypt implementation, and Git. Most Linux distributions should have all of these by default, but in case yours doesn't:
pacman -S glibc libxcrypt git
emerge --ask sys-libs/glibc dev-vcs/git
apt install glibc git
- Clone this repository:
git clone https://git.swurl.xyz/swirl/OFPSearch && cd OFPSearch
- Now, you need to compile.
make
- Install python-myfitnesspal through pip. This may change depending on your distribution, but generally,
pip install --break-system-packages
may be the only real way.
Alternatively, modify doc/runSearch.sh
to use a virtualenv.
Furthermore, you will need to be logged in on a browser to MyFitnessPal.
- Now, you need to install. NGINX and systemd files are provided in this project; you may choose not to install them.
For all install commands, you may optionally provide prefix
and DESTDIR
options. This is useful for packagers; i.e. for a PKGBUILD: make prefix=/usr DESTDIR=${pkgdir} install
.
Available install commands are as follows:
make install
installs the executable, NGINX, and systemd files.make install-bin
installs the executable file.make install-systemd
installs the systemd file, as well as its environment file.make install-nginx
installs the NGINX file.
For example, on a non-systemd system using NGINX, you would run make install-bin install-nginx
.
- If using systemd, change the environment file to reflect your desired options:
vim /etc/search.conf
- You can now enable and start the service:
systemctl enable --now search
The server should now be running on localhost at port 8888.
An NGINX file is provided with this project.
For this, you'll need NGINX (obviously), certbot, and its NGINX plugin. Most Linux distributions should have these in their repositories, i.e.:
pacman -S nginx certbot-nginx
emerge --ask www-servers/nginx app-crypt/certbot-nginx
apt install nginx python-certbot-nginx
This section assumes you've already followed the last.
- Change the domain in the NGINX file:
sed -i 's/your.doma.in/[DOMAIN HERE]' /etc/nginx/sites-available/search
- Enable the site:
ln -s /etc/nginx/sites-{available,enabled}/search
- Enable HTTPS for the site:
certbot --nginx -d [DOMAIN HERE]
- Enable and start NGINX:
systemctl enable --now nginx
If it's already running, reload:
systemctl reload nginx
Your site should be running at https://your.doma.in.
Contributions are always welcome.