foxmask / django-th

:snake: Trigger Happy - The bus :bus: for your internet services
https://foxmask.org/tag/triggerhappy.html
BSD 3-Clause "New" or "Revised" License
1.35k stars 127 forks source link

Struggling with the docker support of this project. #300

Closed Leopere closed 4 years ago

Leopere commented 4 years ago

Creating a new issue for a bug report

:bug: If you think you've spotted a bug, give as many details as possible by starting with that informations:

 Feature Request

Just want to get a kick the tires instance up and running and Docker is usually the route but it seems this project may have abandoned the docker stuff. Either that or the documentation has drifted significantly.

foxmask commented 4 years ago

I should try. but as nobody care about that project, I didn't take care of the docker file.

Leopere commented 4 years ago

Oh man, I'll use the heck out of this project if it works!

The fact that you can run hooks based on RSS feeds alone is hugely useful for me, I've literally been looking for something that will do this for years!

The biggest flaws I have found in the Docker stuff are as follows:

foxmask commented 4 years ago

I followed this page https://trigger-happy.readthedocs.io/en/latest/docker_guide/index.html and all went well

after docker-compose up you can see

web_1    | System check identified no issues (0 silenced).
web_1    | February 13, 2020 - 17:38:21
web_1    | Django version 2.2.10, using settings 'django_th.settings_docker'
web_1    | Starting development server at http://0.0.0.0:8000/
web_1    | Quit the server with CONTROL-C.

so follow the steps

You can meet problem but that could be because of some systemp lib not installed, like libtidy, or the redis server package not installed

Leopere commented 4 years ago

I will provide a asciinema recording to show my results shortly.

Leopere commented 4 years ago

It's also very strange that there is more than one FROM line in the default Dockerfile

Leopere commented 4 years ago

image Console recording of me following the steps directly as written only adding the undocumented assumed git clone at the beginning. https://asciinema.org/a/7s4kmYu9SqmBkZr7Jp7alTg4X

Leopere commented 4 years ago

This here is the broken appliance that is deployed via following the instructions to the letter. http://s.nixc.us:8000/

foxmask commented 4 years ago

yes ; it's "normal" , As I've written this occurs because you did the step "Run" before the step "Database" 1) "Build"

Leopere commented 4 years ago

Oh, I see! Can we possibly rewrite the instructions to reflect the better order?

foxmask commented 4 years ago

yes :)

Leopere commented 4 years ago

Okay still no joy https://asciinema.org/a/vFKWRztD4ofsFAQuXmS6oTm2m is my latest recording and I'll leave the site running on http://s.nixc.us:8000 for now so you can see.

foxmask commented 4 years ago

set the var

ALLOWED_HOSTS = ['your.doamin.tld'] 

in the settings_docker.py

Leopere commented 4 years ago

Could it be set in the docker-compose.yml as an environment variable?

foxmask commented 4 years ago

i don't know I don't thing so.

Leopere commented 4 years ago

Okay so I'm struggling to locate settings_docker.py inside this repository is there a more precise path to see it in?

foxmask commented 4 years ago

you entered the path of that file 3 times :) it's in django_th folder

django_th/settings_docker.py

Leopere commented 4 years ago

In here? image

foxmask commented 4 years ago

nano django_th/settings_docker.py from where you are

Leopere commented 4 years ago

Ah I'm not sure why using the github search function wasn't showing me that file.

Okay, I'll add that is there any other commands that I should be re-running prior to re-launching?

foxmask commented 4 years ago

just the "up"

Leopere commented 4 years ago
  File "/app/django_th/settings_docker.py", line 11
    'ALLOWED_HOSTS = ['s.nixc.us']',
                       ^
SyntaxError: invalid syntax
root@s:/tmp/django-th|master⚡ ⇒  cat django_th/settings_docker.py
from .th_settings import *

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'postgres',
        'USER': 'postgres',
        # 'PASSWORD': 'th_pass',
        'HOST': 'db',
        'PORT': 5432,
        'ALLOWED_HOSTS = ['s.nixc.us']',
    }
}
foxmask commented 4 years ago
from .th_settings import *

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'postgres',
        'USER': 'postgres',
        # 'PASSWORD': 'th_pass',
        'HOST': 'db',
        'PORT': 5432,

    }
}
ALLOWED_HOSTS = ['s.nixc.us']
Leopere commented 4 years ago

HA I guess I should learn to read Python that makes way more sense. Sorry for the total rookie mistake. I know docker not python :P

Leopere commented 4 years ago

Okay, awesome! Is there a way that we can have that setting either documented or added to that install script that is run in the setup?

The thing is successfully running however sadly it doesn't auto redirect from http://my.tld:8000/ to http://my.tld:8000/th/ so you immediately get a 404 of a sort image However, as shown here image it's up and running!

foxmask commented 4 years ago

yes yes

now the login user is the superuser you created earlier

Leopere commented 4 years ago

Yes, that worked perfectly!

Leopere commented 4 years ago

304 would be the continuation of this.