Frontend configuration seemingly ignored

Hi,

I’m trying to install Twake on my server, but I encounter an issue.

Docker container is started, and I can access Twake via ip on port 8000. However, when I try to configure a domain name, it doesn’t work anymore. I created config files in configuration subfolders (with https urls), executed docker-compose restart, but when I requested my custom URL, page get stuck on “(1/4) Starting backend…”.

I watched my browser’s console, and saw that AJAX calls are performed using http url instead of https, throwing a mixed active content blockade.

Then, I tried to change js window variables using the console (window.api_root_url, window.front_root_url, window.websocket_url) to set https urls, which worked (partially of course). I’m also able to reach API urls (such as /ajax/core/version) with https.

I think my js configuration is ignored, but I don’t know why. I tried to perform a fresh install, but it dosn’t change anything. Any idea?

Thanks :hugs:

Hi, welcome to the Twake community!

We are moving our documentation to gitbook, here is the updated version:

  1. https://doc.twake.app/configuration
  2. https://doc.twake.app/configuration/custom-domain-and-https

I just wrote the second one, tell me if it works for you :slight_smile:

Romaric Mourgues

Hi,

Thanks for your answer ! :slight_smile:

I retried with a new fresh install, following instructions you gave to Valzul in another post (Here : Commands/Documentation for a reset?).

I also rewrote my apache2 directives, thoughting it could be a problem with the reverse proxy (I’m not using nginx), but I think they fit with those you defined for nginx in your documentation.

Issue is now slightly different : when I request my custom URL, page doesn’t get stuck on “(1/4) Starting backend…” anymore, I see the login form, but AJAX calls still trying to request http url, and then, still being blockaded :thinking:

Philippe

Hum, can you try this command to rebuild your frontend ?
docker-compose exec nginx yarn build

You can also run this to check what is your current loaded configuration:
docker-compose exec nginx cat src/app/environment/environment.ts

If your configuration doesn’t match, be sure your environment.ts in in [docker-compose-directory]/configuration/frontend/ and that you restarted docker-compose.

Romaric

Ok, tried your command and then executed a docker-compose restart, and things changed once again !

AJAX Calls now using https url, hosanna ! According to console, websocket connexion is established too. Thanks for that !

But… facing a new issue, wonderful ! I tried to create an account or login and nothing happend. Console giving me a “bad JSON” Error. When inspecting AJAX calls responses, I got a PHP warning and an error :

“Warning: require(/twake-core/cache/Doctrine/Proxies/__CG__TwakeUploadEntityFile.php): failed to open stream: No such file or directory in /twake-core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 206

" Fatal error: require(): Failed opening required ‘/twake-core/cache/Doctrine/Proxies/__CG__TwakeUploadEntityFile.php’ (include_path=’.:/usr/local/lib/php’) in /twake-core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 206"

Any idea ?

Sorry for that mess :sweat_smile:

Philippe

This one is harder, you shouldn’t have any “cache” folder in /twake-core/ … :thinking:
Can you give me your Parameters.php configuration (if you have a custom configuration file), especially the “db” object ?

Hmmm, interesting…

There it is :

"db" => [
    "driver" => "pdo_cassandra",
    "host" => "scylladb",
    "port" => 9042,
    "dbname" => "twake",
    "user" => "root",
    "password" => "root",
    "encryption_key" => "My custom key, 48 characters long",
    "dev" => false
],

Oooh well yes I know what it is, try with “dev” => true ? (and restart)

Great, worked like a charm ! Thanks for that :blush::ok_hand:

Last but not least : I can access workspace and use every feature without any problem, except for profile picture file upload. Document file (tested with PDF or image) upload work perfectly, but I can’t change my profile picture, nor workspace’s and company’s PP. It seems to work, but a second later, pictures are replaced by a grey square.

Watching console hinted me about a 404 error of image file (route structured as : /upload/prfl/2/a2968a0fce0d368ad6da24bbfca8245e.png). When accessing image directly, getting that kind of error :

{"error": "Route not found: "/upload/prfl/2/a2968a0fce0d368ad6da24bbfca8245e.png/""}

There’s no problem when saving any other option !

It’s getting good, where almost there, haha ! :joy:

Thanks for your time, you really help making our doc and containers better :slightly_smiling_face:

I’ll add an issue and see what’s happening, did you also try uploading files in the Drive ?

Romaric

With pleasure, thanks to you for helping me ! :wink:

Great ! Yep, works perfectly (previews are visible, file are readable and downloadable).

Oh, and thinking of it : if you want to enrich documentation, I can give you Apache2 directives for reverse proxying :thinking:

Philippe

Yes I will appreciate your configuration for Apache2!
Can you create an issue on gitlab with your proposition in it (to not put too many things in this thread) ?

https://github.com/TwakeApp/Twake/issues

Just fixed the upload folder issue, a missing line in our docker-compose.yml
Please update your docker-compose.yml with

https://github.com/RomaricMourgues/Twake/blob/8c9377c4bc1c4d8fc603857d54b05d24fdf41b8b/twake/docker-compose.yml.dist

(Added volumes for uploaded documents not in drive lines 28 and 65)

Then do a docker-compose stop && docker-compose up -d

Tell me if it works.

Ok, I did what you’ve told. I needed to execute docker-compose exec nginx yarn build once again after docker-compose up -d, haha !

Just tested to change my profile picture, and it works, thanks ! :slight_smile: (Also checked with workspace’s and company’s logo, worked fine too)

Amazing! :tada:
For the yarn build yes finally it’s needed, I’ll update the doc for this too.