hywax / mafl

Minimalistic flexible homepage
https://mafl.hywax.space
MIT License
348 stars 21 forks source link

[FEATURE_REQUEST] Reloading config.yml #66

Closed abby606 closed 6 months ago

abby606 commented 7 months ago

Question

I love the look and simplicity of mafl, thank you for your work!

Stupid question perhaps but changing the config.yml does not have instant results and in order to see my changes, I need to restart the mafl service - is this expected or am I doing something wrong?

thank you

Category

App Usage

hywax-assistant commented 7 months ago

👋 @abby606 Thanks for opening your first issue here! To help make it easier for us to investigate your issue, please follow the contributing guidelines.

If you like this project, please ⭐ star our repo.

hywax commented 7 months ago

Hi! Thanks!

This is the correct behavior at the moment. Now I'm working on not having to restart the service.

I will leave the issue open until this functionality is available.

abby606 commented 7 months ago

Thank you very much!

snickerweb commented 6 months ago

Hi. How I can restart the service?

andrewbeaton commented 6 months ago

As a work around, I've setup a oneshot and path unit service to monitor changes to the mafl config and restart the main mafl service.

Here's a quick shell script to set it up.

mafl-restart-service.sh

#!/usr/bin/env bash

echo -e "Creating oneshot service"
cat <<EOF >/etc/systemd/system/mafl-restart.service
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart mafl
EOF
echo -e "Created oneshot service"

echo -e "Creating path unit"
cat <<EOF >/etc/systemd/system/mafl-restart.path
[Path]
PathChanged=/opt/mafl/data/config.yml

[Install]
WantedBy=multi-user.target
EOF
echo -e "Created path unit"

systemctl enable --now mafl-restart.path 
snickerweb commented 6 months ago

Can you explain in step by step? Im a noob ;)

nano mafl-restart.path

copy/paste this: #!/usr/bin...........Created path unit"

systemctl enable --now mafl-restart.path

and now?

edit: oh cool, i see it. Every time I save the file, i can only refresh the homepage.

Thanks a lot !!!

hywax commented 6 months ago

I didn't realize this was such a hot topic. I'll try to do a hot reboot as soon as possible when changing config

snickerweb commented 6 months ago

andrewbeatons script work fine. I think a good thing is a reload button on the webpage bottom right. Can be switched off if the webpage is publicly accessible.

And it would be perfect if the yaml could be edited directly via the frontend. But that could be more complicated again.

hywax commented 6 months ago

@abby606 @snickerweb @andrewbeaton

The next update will add a feature to automatically update when the config is changed. The functionality has already been made, now it is being tested.

Thank you for your contribution!