SamR1/FitTrackee

Sharing experiences regarding hosting

githubtilemaker opened this issue ยท 16 comments

I use a shared hosting contract with hosting.com for a cms. If I see it correctly, I need a separate server for

Python >= 3.8.1
PostgreSQL 11+

I would be happy to hear how others host their fittrackee instance.

escuco commented

My FitTrackee instance is running on a uberspace: https://uberspace.de/en/
Works like a charm.

I did this this afternoon following the installation instructions
https://samr1.github.io/FitTrackee/en/installation.html#id5
and tried it out locally.
I failed miserably.

Are there more detailed instructions for a local installation on ubuntu 22.04?

SamR1 commented

Hi,

What kind of error did you encounter?

I cloned the repo like explained here: https://samr1.github.io/FitTrackee/en/installation.html#dev-environment

$ make install-dev

is fine. But

$ make install-db
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  Peer authentication failed for user "postgres"
make: *** [Makefile:164: install-db] Fehler 2

Then I managed to come a line futher. I changed in pg_hba.conf

local all postgres peer

to

local all postgres md5

but then I get

$ make install-db
DROP DATABASE
DROP DATABASE
DROP DATABASE
DROP DATABASE
DROP DATABASE
DROP DATABASE
DROP SCHEMA
DROP ROLE
CREATE ROLE
CREATE SCHEMA
CREATE DATABASE
CREATE DATABASE
CREATE DATABASE
CREATE DATABASE
CREATE DATABASE
CREATE DATABASE
make: /home/fittrackee/FitTrackee/.venv/bin/ftcli: Datei oder Verzeichnis nicht gefunden
make: *** [Makefile:165: install-db] Fehler 127

SamR1 commented

Hi,

It seems FitTrackee is not installed.
Can you check whether the virtualenv is correcty initialized?

Thank you for asking and helping me.
I have recreated virtualenv. Now I get this error message.

Installing the current project: fittrackee (0.7.22)
(.venv) myuser@myuser-virtual-machine:~/fittrackee/FitTrackee$ make install-db
DROP DATABASE
DROP DATABASE
DROP DATABASE
DROP DATABASE
DROP DATABASE
DROP DATABASE
DROP SCHEMA
DROP ROLE
CREATE ROLE
CREATE SCHEMA
CREATE DATABASE
CREATE DATABASE
CREATE DATABASE
CREATE DATABASE
CREATE DATABASE
CREATE DATABASE
Traceback (most recent call last):
  File "/home/myuser/fittrackee/FitTrackee/.venv/bin/ftcli", line 3, in <module>
    from fittrackee.cli import cli
  File "/home/myuser/fittrackee/FitTrackee/fittrackee/cli/__init__.py", line 3, in <module>
    from fittrackee.migrations.commands import db_cli
  File "/home/myuser/fittrackee/FitTrackee/fittrackee/migrations/commands.py", line 8, in <module>
    from fittrackee.cli.app import app
  File "/home/myuser/fittrackee/FitTrackee/fittrackee/cli/app.py", line 3, in <module>
    app = create_app(init_email=False)
  File "/home/myuser/fittrackee/FitTrackee/fittrackee/__init__.py", line 87, in create_app
    db.init_app(app)
  File "/home/myuser/fittrackee/FitTrackee/.venv/lib/python3.10/site-packages/flask_sqlalchemy/extension.py", line 310, in init_app
    raise RuntimeError(
RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set.
make: *** [Makefile:165: install-db] Fehler 1

SamR1 commented

OK thanks for your answer.
It seems the database URL is not set in .env.

Thank you for your answer. I really appreciate it. I realise that you don't have to explain things to me that are not part of your software. And here I obviously have gaps. I would like to close this gap.

You are right. I have treated the .env file stepmotherly. I understood that I only have to enter special features here and the standard is set. I have now added values here.
Now I'm getting one other step further. I can register. Not at port 3000. But at Port 5000. But I can not login.

I
1

I think there is a problem with the ports? Because the message after make server told me, that port 3000 ist the correct one.

2

can register users. But they are not saved. At least I can't log in with them.

If I use Port 3000 I only see this view:

3

I have now found the solution. I was able to activate the account via

make user-set-admin USERNAME=<username>.

I have now found the solution. I was able to activate the account via x.

Yesterday I was confused by the fact that port 3000 did not work. That's why I didn't even try that further.

Port 5000 works for me.

Now I'm closing the ticket because it's basically running for me now and I first have to familiarise myself theoretically with the environment with Python, which is new to me.

SamR1 commented

Glad it works :).

If the port 3000 (used for front-end development) doesn't work, an environment variable may be missing.

Edit: I found the solution myself. It was my failt again.
I incorrectly set the variable PORT to 5432 instead of leaving it at 5000.

Would you please give me a hint again?
I am trying the recommended installation from pypi https://samr1.github.io/FitTrackee/en/installation.html#from-pypi

\conninfo tells me this:

fittrackee=# \conninfo
You are connected to database "fittrackee" as user "fittrackee" via socket in "/var/run/postgresql" at port "5432".

But if I run fittrackee it did not get connection:

(venv) myuser@machine:~/FitTrackee$ fittrackee
[2023-09-13 10:01:15 +0200] [6703] [INFO] Starting gunicorn 21.2.0
[2023-09-13 10:01:15 +0200] [6703] [ERROR] Connection in use: ('127.0.0.1', 5432)
[2023-09-13 10:01:15 +0200] [6703] [ERROR] Retrying in 1 second.
[2023-09-13 10:01:16 +0200] [6703] [ERROR] Connection in use: ('127.0.0.1', 5432)
[2023-09-13 10:01:16 +0200] [6703] [ERROR] Retrying in 1 second.
[2023-09-13 10:01:17 +0200] [6703] [ERROR] Connection in use: ('127.0.0.1', 5432)
[2023-09-13 10:01:17 +0200] [6703] [ERROR] Retrying in 1 second.
[2023-09-13 10:01:18 +0200] [6703] [ERROR] Connection in use: ('127.0.0.1', 5432)
[2023-09-13 10:01:18 +0200] [6703] [ERROR] Retrying in 1 second.
[2023-09-13 10:01:19 +0200] [6703] [ERROR] Connection in use: ('127.0.0.1', 5432)
[2023-09-13 10:01:19 +0200] [6703] [ERROR] Retrying in 1 second.
[2023-09-13 10:01:20 +0200] [6703] [ERROR] Can't connect to ('127.0.0.1', 5432)

I have managed to put a test instance online.
Fittrackee supports ActivityPub. Is it possible that I can follow my Fittrackee user from my Mastodon account?

I thought that I could follow the user runner on the fittrackee.example.com instance by searching @runner@fittrackee.example.org. But that doesn't work.

SamR1 commented

Hi,

It's not possible, FitTrackee does not support ActivityPub for now.

Thank you for your reply.
I misunderstood #16
I have now looked more closely. So ActivityPub is planned but not yet realised.

Is it possible to share an activity without a user having to register or log in to my instance?
Specifically, I mean: I upload a GPX file and publish a link to this activity on Mastodon.
At the moment, another user cannot see this activity if he click on the link. He only sees a login. I have not yet found the possibility to make an activity public.

SamR1 commented

Hi,

For now, activities cannot be shared, developments are in progress to add this functionality.

xmgz commented

as this issue is for sharing experiences... mine is using YunoHost on a local device and install FitTrackee package.

YNH package mantainer (Tho) tries to help people with issues on our system and updates the package just few days after is released here. Very helpful.

I have using FitTrackee since January, adding every garmin activity and it works nicely for my purpose. Yes, it will be nice when later in development some "sharing" features are added.

I've been checking used space by this app (about 110 Mb since Jan, single user) with the gpx files. I initially thought it would be much more, so nice :D (I'm doing some kind of activity almost every day). So disk usage is not an issue, that's what I wanted to share here.

Thank you.