Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 14:26
    mmzeeman synchronize #2743
  • 14:26

    mmzeeman on fix-2742

    Use maybe_set also for set conn… (compare)

  • 13:58
    mmzeeman synchronize #2743
  • 13:58

    mmzeeman on fix-2742

    Check if mod_translate is runni… (compare)

  • 08:00
    mmzeeman review_requested #2743
  • 07:59
    mmzeeman opened #2743
  • 07:59

    mmzeeman on fix-2742

    Add language, tz and peer_ip to… (compare)

  • 07:52
    mworrell milestoned #2742
  • 07:16
    mmzeeman labeled #2742
  • 07:16
    mmzeeman labeled #2742
  • 07:16
    mmzeeman opened #2742
  • Sep 26 10:49
    mworrell synchronize #2723
  • Sep 26 10:49

    mworrell on resource-pubsub

    Resolve review marks by @mmzeem… (compare)

  • Sep 26 10:48
    mworrell synchronize #2723
  • Sep 26 10:48

    mworrell on resource-pubsub

    Handle review notes by @robvand… (compare)

  • Sep 26 10:42
    mworrell synchronize #2723
  • Sep 26 10:42

    mworrell on resource-pubsub

    Resolve review marks by @mmzeem… (compare)

  • Sep 26 10:34
    mworrell edited #2723
  • Sep 26 10:34
    mworrell synchronize #2723
  • Sep 26 10:34

    mworrell on resource-pubsub

    Fix + test for authoritative im… (compare)

Marc Worrell
@mworrell
And then you make your local user with the same ids?
heiheshang
@heiheshang
yes
heiheshang
@heiheshang
or use in docker-compose file user: "${UID}:${GID}"
UID=${UID} GID=${GID} docker-compose up
Marc Worrell
@mworrell
Ah, then the docker container is running as that user?
heiheshang
@heiheshang
container - yes, no zotonic. Scripts force user switch
absareng
@absareng
Morning Guys, I am new to zotonics and for doc I come to the point that "mastering" templating is key asset to get benefit from the framework. I read templating is based on erlytdl but I see not deps on this apps ?
absareng
@absareng
I got it . you have done your own module "The basis of the Zotonic template compiler is forked version of ErlyDTL."
I guess it is z_template.erl
absareng
@absareng
got it https://github.com/zotonic/template_compiler . please confirm . thanks
Marc Worrell
@mworrell
Indeed that is the one :-)
See also out test-version of the docs (and more site) https://test.zotonic.com/
absareng
@absareng
thanks I will have a deep look
Jonathan
@steele232

@mworrell @heiheshang sorry I never got back to y'all, I got busy and never came back to this until now. I would really like to get it installed and running in the next couple of days because I have a new project in mind and a limited window to work on it. I think I mostly just need the basic capabilities of Zotonic/CMS in order to get started with the project so if I can get it running then it's basically a success haha.

I didn't really understand the explanation of users and groups. I'm a little familiar with those things but not an expert. I'm currently on macOS, but I might run this in Linux later and that's part of why Docker appeals but I'm willing to not use Docker and just dig into the details a little more.

Jonathan
@steele232
I tried docker-compose up on the same version I mentioned before and I got some errors again. I'm also willing to upgrade but I am just trying to get something running so I figured I would start from where I was.
Here are the errors I got, a slightly abbreviated log:
$ UID=${UID} GID=${GID} docker-compose up
-bash: UID: readonly variable
Starting zotonic-05802_postgres_1 ... done
Starting zotonic-05802_zotonic_1  ... done
Attaching to zotonic-05802_postgres_1, zotonic-05802_zotonic_1
postgres_1  | Error: Database is uninitialized and superuser password is not specified.
postgres_1  |        You must specify POSTGRES_PASSWORD to a non-empty value for the
postgres_1  |        superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
postgres_1  | 
postgres_1  |        You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
postgres_1  |        connections without a password. This is *not* recommended.
postgres_1  | 
postgres_1  |        See PostgreSQL documentation about "trust":
postgres_1  |        https://www.postgresql.org/docs/current/auth-trust.html
zotonic_1   | + HOME=/opt/zotonic
zotonic_1   | + ZOTONIC_PIDFILE=/run/zotonic.pid
zotonic_1   | + ZOTONIC_CONFIG_DIR=/etc/zotonic
zotonic_1   | + SHELL=/bin/sh
zotonic_1   | + export HOME ZOTONIC_PIDFILE ZOTONIC_CONFIG_DIR SHELL
zotonic_1   | + touch /run/zotonic.pid
zotonic_1   | + chown zotonic /run/zotonic.pid
zotonic_1   | + mkdir -p /etc/zotonic/security
zotonic_1   | + chown -R zotonic /etc/zotonic/security
zotonic_1   | + mkdir -p /etc/zotonic/config.d
zotonic_1   | + chown -R zotonic /etc/zotonic/config.d
zotonic_1   | + '[' '!' -f /etc/zotonic/config.d/docker.config ']'
zotonic_1   | + cp ./docker/zotonic-docker.config /etc/zotonic/config.d/docker.config
zotonic_1   | cp: can't stat './docker/zotonic-docker.config': No such file or directory
zotonic_1   | + '[' '!' -f /etc/zotonic/erlang.config ']'
zotonic_1   | + cp ./docker/erlang.config /etc/zotonic/erlang.config
zotonic_1   | cp: can't stat './docker/erlang.config': No such file or directory
zotonic_1   | + '[' '!' -f /opt/zotonic/_build/default/lib/zotonic_core/ebin/zotonic_core.app ']'
zotonic_1   | + /usr/bin/gosu zotonic make
zotonic-05802_postgres_1 exited with code 1
....
....
....
zotonic_1   | {"could not start kernel pid",application_controller,"error in config file \"/etc/zotonic/erlang.config\" (none): configuration file not found"}
zotonic_1   | could not start kernel pid (application_controller) (error in config file "/etc/zotonic/erlang.config" (none): configuration file not found)
zotonic_1   | 
zotonic_1   | Crash dump is being written to: erl_crash.dump...done
zotonic_1   | make: *** [GNUmakefile:57: compile] Error 1
zotonic_1   | + '[' -e /opt/zotonic/apps/zotonic_launcher/src/command/zotonic_cmd_/bin/bash.erl ']'
zotonic_1   | 
zotonic_1   | 
zotonic_1   | ####
zotonic_1   | #### Usage: bin/zotonic [options] [command]
zotonic_1   | ####
zotonic_1   | #### To rebuild zotonic run make
zotonic_1   | ####
zotonic_1   | 
zotonic_1   | + '[' -n '' ']'
zotonic_1   | + printf '\n\n####\n#### Usage: bin/zotonic [options] [command]\n####\n#### To rebuild zotonic run make\n####\n\n'
zotonic_1   | + exec /usr/bin/gosu zotonic /bin/bash
zotonic-05802_zotonic_1 exited with code 0
Marc Worrell
@mworrell
Hi Jonathan, I never got Docker reliable (and performing) working on macOS. On macOS it is easy to work with kerl for installing Erlang (OTP23.something recommended for master, till we have tested OTP24). I use brew for ffmpeg, imagemagick etc. And recently also used the PostgreSQL App, which I really liked as it doesn't add extra services to macOS.
I assume you use the master branch of Zotonic - it doesn't have an official release, but we do use it in production.
For installing a VPS I use the the cloud-init scripts. Makes it really easy to have fully installed Ubuntu 18 machine (need to change some firewall scripts for Ubuntu 20).
Jonathan
@steele232
Okay, yeah I'll try getting it working on macOS and then try getting it working on VPS after that;
For macOS, I haven't used kerl but I've heard it mentioned and I do have Erlang OTP23 installed; I do use brew and I do have Postgres installed so I guess I shouldn't have too much troubIe with dependencies on macOS. I will try cloning down master and giving that a shot.
Jonathan
@steele232
Hey, I was able to get it started on macOS by cloning master, and following the documentation. I have more configuration to do but I successfully see the Status page so I'm happy for now. I'll have to come back to this tonight but I'm off to a good start.
Jonathan
@steele232
Good news and a Hiccup: I was able to add a site via the command line and then see it in the status site's admin page. I was trying to get into the new site's admin page and I can't seem to get the right user/password combination. I know the status app's default user is wwwadmin and the password is findable in a config file. For the new app, I can find the password in a config file (I think) but I don't know if I have the right username and I can't find any more documentation on it. Can you help me?
Jonathan
@steele232
More good news: when I created the new site through the status admin page button, I was able to log in to the admin portal and edit the site and it all seems to be working well!
Jonathan
@steele232
Small question: Is there a way to cleanly delete a site? My first idea is to delete the zotonic/apps_user/<mysite> directory and delete the schema associated with the site in postgres. I think there were a few other configs that go with the site.. can you think of anything else I need to remove? I don't see a way to do it with the admin gui or the zotonic shell command
Jonathan
@steele232
Actually I just made my way onto the original site's admin page so I guess I don't need to delete it.
Marc Worrell
@mworrell
Just a heads up that the master branch now supports OTP-24.
Arthur Clemens
@ArthurClemens

I am struggling with 0.x code for a website hit by stringent Chrome rules:

Mixed Content: The site at 'https://X/' was loaded over a secure connection, but the file at 'https://X/media/attachment/2021/6/21/17523_background_png.png' was redirected through an insecure connection. This file should be served over HTTPS. This download has been blocked.

I’ve tried to add “absolute” to the image:

{% url media_attachment id=background_cover_media_id use_absolute_url %}

But the generated URL uses “http” instead of “https”. How can I change this?

Marc Worrell
@mworrell
@ArthurClemens I assume you are terminating ssl using a proxy, and not in Zotonic itself?
In that case you need to set the site.protocol config to https
Arthur Clemens
@ArthurClemens
Works! Thanks
Marc Worrell
@mworrell
Perfect :)
Jonathan
@steele232
I'm trying to edit templates because I want to add some things to the default Person page. I tried to create a file named page.person.tpl based on the documentation. I enabled debug and found that the mod_base_site was being used for the dispatch and the template being used was {cat,"page.tpl"} so I went about trying to edit the apps/zotonic_mod_base_site/priv/templates/page.tplfile -- I know I should probably edit my own dispatch and templates instead of the base one but I was having trouble with that -- I can't even really tell if my edits are getting factored in because my confidence with the template language is weak and I'm not sure if inserting text directly works. From the docs and the console, I thought z:m(). or z:flush(). or even z:restart(mysite). might update the resources so I've been trying that but I don't feel like I'm seeing the results I'm expecting.
@mworrell or @heiheshang , Can you help me with making simple changes to the Person page template? I've spent several hours on this so far.
heiheshang
@heiheshang
you can make changes to the template in the priv of your site.
heiheshang
@heiheshang
which release are you using?
Jonathan
@steele232
@heiheshang , I am using release based off master branch commit eaaa6f35a55c0e38e83d5eab259287d05e48697a which is from June 13 of this year. VERSION file says pre-transport-3192-geaaa6f35a
I will try again to edit templates in the priv of my site and I will let you know how it goes
Marc Worrell
@mworrell
If it is for a person category then you can name your template page.person.tpl
That is what the {cat, “page.tpl”} uses for “person” pages.
Jonathan
@steele232
Debug
...
template     {cat,"page.tpl"}
zotonic_dispatch_file     <<"dispatch">>
zotonic_dispatch_module     mod_base_site

I made a page.person.tpl file

{% extends "page.tpl" %}

This is a Person

I ran this to restart: z:restart(places). (places is the name of the site)
And I also ran init:restart(). to restart

@mworrell , is my template file ok there? Am I using the right command to refresh the templates?
Marc Worrell
@mworrell
The latest master versions are very stable. So update if you can, BUT beware that with the newest master we have moved mod_base_site to a separate repository.
Jonathan
@steele232
OK. I can try to do that as well
Marc Worrell
@mworrell
If a template extends another template then you can only use blocks. Which replace parts in the extended template.
Jonathan
@steele232
Oh ok
Marc Worrell
@mworrell
In the development tools you can also check which templates are selected, also for dispatch rules.
Jonathan
@steele232
Ok, I'll check that out.
Here is my new template file. I'll try refreshing it
{% extends "page.tpl" %}

{% block below_summary %}
<div>
  This is a Person
</div>
{% endblock %}
It showed up now!
Ok, so my problem is basically solved now because I confirmed that I can change the template file and I will start learning the template language better now.
I will look at the development tools you mentioned as well.
Jonathan
@steele232
Thank you so much @mworrell I really appreciate it