Compare commits

..

No commits in common. "d5062ef5eaaee4bee3863f0193ecdef870eea7ef" and "21694c5e991ee879d57ff5e54dbe2d015cc06938" have entirely different histories.

12 changed files with 81 additions and 97 deletions

View File

@ -16,7 +16,7 @@ RUN apt-get dist-upgrade -y
# Install freedombox package so that plint:plinth user/group are created etc. # Install freedombox package so that plint:plinth user/group are created etc.
RUN apt-get install -y freedombox/trixie-backports RUN apt-get install -y freedombox/trixie-backports
RUN systemctl disable plinth.service RUN systemctl mask plinth.service
# Don't ask for the secret in first wizard # Don't ask for the secret in first wizard
RUN rm -f /var/lib/plinth/firstboot-wizard-secret RUN rm -f /var/lib/plinth/firstboot-wizard-secret

View File

@ -16,7 +16,8 @@
- apt-get update - apt-get update
- apt-get -y install make - apt-get -y install make
- make provision-dev - make provision-dev
- make wait-while-first-setup - sudo -u plinth ./run --develop > plinth.log 2>&1 &
- while ! grep -q "Setup finished" plinth.log; do sleep 1; echo -n .; done
script: script:
- FREDOMBOX_URL=https://localhost FREEDOMBOX_SSH_PORT=22 FREEDOMBOX_SAMBA_PORT=445 pytest -v --durations=10 --include-functional --splinter-headless --instafail --template=html1/index.html --report=functional-tests.html - FREDOMBOX_URL=https://localhost FREEDOMBOX_SSH_PORT=22 FREEDOMBOX_SAMBA_PORT=445 pytest -v --durations=10 --include-functional --splinter-headless --instafail --template=html1/index.html --report=functional-tests.html
artifacts: artifacts:

View File

@ -143,12 +143,12 @@ directory:
guest$ cd /freedombox guest$ cd /freedombox
``` ```
FreedomBox Service runs as plinth.service in the container. This service Run the development version of FreedomBox Service in the container using the
restarts when it detects a change to the source code file. This provides a quick following command. This command continuously deploys your code changes into the
feedback cycle during development. To watch service logs run: container providing a quick feedback cycle during development.
```bash ```bash
guest$ sudo freedombox-logs guest$ freedombox-develop
``` ```
If you have changed any system configuration files during your development, If you have changed any system configuration files during your development,
@ -156,8 +156,7 @@ you will need to run the following to install those files properly on to the
system and their changes to reflect properly. system and their changes to reflect properly.
```bash ```bash
guest$ sudo make build install ; guest$ sudo make build install
guest$ sudo systemctl restart plinth.service
``` ```
Note: This development container has automatic upgrades disabled by default. Note: This development container has automatic upgrades disabled by default.
@ -374,12 +373,13 @@ After logging into the virtual machine (VM), the source code is available in
vm$ cd /freedombox vm$ cd /freedombox
``` ```
FreedomBox Service runs as plinth.service in the virtual machine. This service Run the development version of FreedomBox Service (Plinth) from your source
restarts when it detects a change to the source code file. This provides a quick directory in the virtual machine using the following command. This command
feedback cycle during development. To watch service logs run: continuously deploys your code changes into the virtual machine providing a
quick feedback cycle during development.
```bash ```bash
vm$ sudo freedombox-logs vm$ freedombox-develop
``` ```
If you have changed any system configuration files during your development, If you have changed any system configuration files during your development,

View File

@ -161,16 +161,6 @@ Environment=PYTHONPATH=/freedombox/
endef endef
export DEVELOP_SERVICE_CONF export DEVELOP_SERVICE_CONF
define DEVELOP_LOGS_SCRIPT
#!/usr/bin/bash
set -e
set -x
journalctl --follow --unit=plinth.service --unit=freedombox-privileged.service
endef
export DEVELOP_LOGS_SCRIPT
# Run basic setup for a developer environment (VM or container) # Run basic setup for a developer environment (VM or container)
provision-dev: provision-dev:
# Install newer build dependencies if any # Install newer build dependencies if any
@ -180,15 +170,9 @@ provision-dev:
# Install latest code over .deb # Install latest code over .deb
$(MAKE) build install $(MAKE) build install
# Configure privileged and web daemon for development setup # Configure privileged daemon for development setup
mkdir -p /etc/systemd/system/freedombox-privileged.service.d/ mkdir -p /etc/systemd/system/freedombox-privileged.service.d/
echo "$$DEVELOP_SERVICE_CONF" > /etc/systemd/system/freedombox-privileged.service.d/develop.conf echo "$$DEVELOP_SERVICE_CONF" > /etc/systemd/system/freedombox-privileged.service.d/develop.conf
mkdir -p /etc/systemd/system/plinth.service.d/
echo "$$DEVELOP_SERVICE_CONF" > /etc/systemd/system/plinth.service.d/develop.conf
# Create a command to easily watch service logs
echo "$$DEVELOP_LOGS_SCRIPT" > /usr/bin/freedombox-logs
chmod 755 /usr/bin/freedombox-logs
# Reload newer systemd units, ignore failure # Reload newer systemd units, ignore failure
-systemctl daemon-reload -systemctl daemon-reload
@ -199,10 +183,6 @@ provision-dev:
-test -d /run/systemd/system && \ -test -d /run/systemd/system && \
systemctl enable --now freedombox-privileged.socket systemctl enable --now freedombox-privileged.socket
# Enable and restart plinth service if it is running
-systemctl enable plinth.service
-systemctl restart plinth.service
# Stop any ongoing upgrade, ignore failure # Stop any ongoing upgrade, ignore failure
-killall -9 unattended-upgr -killall -9 unattended-upgr
@ -227,12 +207,6 @@ provision-dev:
DEBIAN_FRONTEND=noninteractive apt-get install --yes ncurses-term \ DEBIAN_FRONTEND=noninteractive apt-get install --yes ncurses-term \
sshpass bash-completion sshpass bash-completion
wait-while-first-setup:
while [ x$$(curl -k https://localhost/plinth/status/ 2> /dev/null | \
json_pp 2> /dev/null | grep 'is_first_setup_running' | \
tr -d '[:space:]' | cut -d':' -f2 ) != 'xfalse' ] ; do \
sleep 1; echo -n .; done
.PHONY: \ .PHONY: \
build \ build \
check \ check \
@ -245,5 +219,4 @@ wait-while-first-setup:
configure \ configure \
install \ install \
provision \ provision \
update-translations \ update-translations
wait-while-first-setup

View File

@ -62,7 +62,7 @@ See the [HACKING.md](https://salsa.debian.org/freedombox-team/freedombox/blob/ma
# Localization # Localization
[![Translation status](https://hosted.weblate.org/widget/freedombox/horizontal-auto.svg)](https://hosted.weblate.org/engage/freedombox/) [![Translation status](https://hosted.weblate.org/widgets/freedombox/-/287x66-white.png)](https://hosted.weblate.org/engage/freedombox/?utm_source=widget)
# License # License

10
Vagrantfile vendored
View File

@ -24,13 +24,17 @@ Vagrant.configure(2) do |config|
config.vm.provision "shell", inline: <<-SHELL config.vm.provision "shell", inline: <<-SHELL
cd /freedombox/ cd /freedombox/
make provision-dev make provision-dev
echo 'alias freedombox-develop="cd /freedombox; sudo -u plinth /freedombox/run --develop"' >> /home/vagrant/.bashrc
SHELL SHELL
config.vm.provision "tests", run: "never", type: "shell", path: "plinth/tests/functional/install.sh" config.vm.provision "tests", run: "never", type: "shell", path: "plinth/tests/functional/install.sh"
config.vm.post_up_message = "FreedomBox virtual machine is ready config.vm.post_up_message = "FreedomBox virtual machine is ready
for development. Plinth will be available at https://localhost:4430/plinth for development. You can run the development version of Plinth using
(with an invalid SSL certificate). To watch logs: the following command.
$ vagrant ssh $ vagrant ssh
$ sudo freedombox-logs $ freedombox-develop
Plinth will be available at https://localhost:4430/plinth (with
an invalid SSL certificate).
" "
config.trigger.after [:up, :resume, :reload] do |trigger| config.trigger.after [:up, :resume, :reload] do |trigger|

View File

@ -196,6 +196,9 @@ cd /freedombox/
sudo apt-get -y install make sudo apt-get -y install make
sudo make provision-dev sudo make provision-dev
echo 'alias freedombox-develop="cd /freedombox; sudo -u plinth /freedombox/run --develop"' \
>> /home/fbx/.bashrc
# Make some pytest related files and directories writable to the fbx user # Make some pytest related files and directories writable to the fbx user
sudo touch geckodriver.log sudo touch geckodriver.log
sudo chmod a+rw geckodriver.log sudo chmod a+rw geckodriver.log
@ -238,7 +241,25 @@ fi
# Run the plinth server if functional tests are requested # Run the plinth server if functional tests are requested
if [[ "{pytest_command}" =~ "--include-functional" ]] if [[ "{pytest_command}" =~ "--include-functional" ]]
then then
make -C /freedombox wait-while-first-setup is_plinth_running=0
ps -ax -o cmd | grep -q "^sudo -u plinth /freedombox/run" && \
is_plinth_running=1
ps -ax -o cmd | grep -q "^/usr/bin/python3 /usr/bin/plinth" && \
is_plinth_running=1
if [[ $is_plinth_running -eq 1 ]]
then
echo "> In machine: Plinth is already running"
else
echo -n "> In machine: Starting plinth ... "
sudo -u plinth /freedombox/run --develop > plinth.log 2>&1 &
while ! grep -q "Setup finished" plinth.log
do
sleep 1
echo -n .
done
echo
fi
if [[ "{pytest_command}" != *"--splinter-headless"* ]] if [[ "{pytest_command}" != *"--splinter-headless"* ]]
then then
@ -1053,7 +1074,7 @@ Folder overlay : (host, read-only){project_folder}
SSH easily : {script} ssh {options} SSH easily : {script} ssh {options}
Run tests : {script} run-tests {options} [ --pytest-args ... ] Run tests : {script} run-tests {options} [ --pytest-args ... ]
Watch FreedomBox logs : sudo freedombox-logs Run FreedomBox inside : freedombox-develop
Web access : https://{ip_address}/ Web access : https://{ip_address}/
Ports access : Any port on {ip_address} Ports access : Any port on {ip_address}

View File

@ -3,7 +3,6 @@
import argparse import argparse
import logging import logging
import os
import sys import sys
import threading import threading
@ -122,8 +121,7 @@ def main():
arguments = parse_arguments() arguments = parse_arguments()
cfg.read() cfg.read()
if arguments.develop or os.getenv('FREEDOMBOX_DEVELOP', '') == '1': if arguments.develop:
cfg.develop = True
# Use the config in the current working directory # Use the config in the current working directory
cfg.read_file(cfg.get_develop_config_path()) cfg.read_file(cfg.get_develop_config_path())

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: FreedomBox UI\n" "Project-Id-Version: FreedomBox UI\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-07 00:04+0000\n" "POT-Creation-Date: 2025-10-07 00:04+0000\n"
"PO-Revision-Date: 2025-10-30 04:24+0000\n" "PO-Revision-Date: 2025-10-27 16:02+0000\n"
"Last-Translator: Coucouf <coucouf@coucouf.fr>\n" "Last-Translator: Coucouf <coucouf@coucouf.fr>\n"
"Language-Team: French <https://hosted.weblate.org/projects/freedombox/" "Language-Team: French <https://hosted.weblate.org/projects/freedombox/"
"freedombox/fr/>\n" "freedombox/fr/>\n"
@ -4784,14 +4784,13 @@ msgid ""
"gaming systems (such as PS3 and Xbox 360) or applications such as totem and " "gaming systems (such as PS3 and Xbox 360) or applications such as totem and "
"Kodi." "Kodi."
msgstr "" msgstr ""
"MiniDLNA est un serveur de médias simplifié qui vise une compatibilité " "MiniDLNA est un serveur de médias simple ayant pour but dêtre entièrement "
"complète avec les clients DLNA et UPnP-AV. Le démon MiniDLNA est capable de " "compatible avec les clients DLNA et UPnP-AV. Le démon MiniDLNA est capable "
"servir des fichiers de médias (musique, photos et vidéos) à des clients " "de servir des fichiers de médias (musique, photos et vidéos) à des clients "
"réseau. DLNA/UPnP est un protocole sans configuration et est compatible avec " "sur un réseau. DLNA/UPnP est un protocole sans configuration et est "
"tout appareil ayant la certification DLNA comme les lecteurs portables, les " "compatible avec tout appareil ayant la certification DLNA comme les lecteurs "
"smartphones, les télévisions et les consoles de jeu " "portables, les smartphones, les télévisions et les systèmes de jeu (comme la "
"(comme la PS3 ou la Xbox 360) ainsi que les applications telles que Totem ou " "PS3 ou la Xbox 360) ainsi que les applications telles que Totem ou Kodi."
"Kodi."
#: plinth/modules/minidlna/__init__.py:45 #: plinth/modules/minidlna/__init__.py:45
msgid "MiniDLNA" msgid "MiniDLNA"
@ -10079,8 +10078,8 @@ msgid ""
"route all outgoing traffic from {box_name} through the VPN." "route all outgoing traffic from {box_name} through the VPN."
msgstr "" msgstr ""
"Il peut être utilisé pour se connecter à un fournisseur de réseau privé " "Il peut être utilisé pour se connecter à un fournisseur de réseau privé "
"virtuel VPN proposant un service WireGuard et router tout le trafic sortant " "virtuel VPN proposant un service WireGuard, pour router tout le trafic "
"de la {box_name} à travers ce VPN." "sortant de la {box_name} à travers ce VPN."
#: plinth/modules/wireguard/__init__.py:26 #: plinth/modules/wireguard/__init__.py:26
#, python-brace-format #, python-brace-format
@ -10089,10 +10088,10 @@ msgid ""
"travelling. While connected to a public Wi-Fi network, all traffic can be " "travelling. While connected to a public Wi-Fi network, all traffic can be "
"securely relayed through {box_name}." "securely relayed through {box_name}."
msgstr "" msgstr ""
"Une autre usage possible est de connecter un appareil mobile à votre " "Une autre utilisation possible est de connecter un appareil mobile à votre "
"{box_name} pendant un déplacement. Même si votre appareil est connecté à un " "{box_name} pendant un déplacement. Même si celui-ci est connecté à un réseau "
"réseau Wi-Fi public, tout votre trafic sera alors relayé via votre {box_name}" "Wi-Fi public, tout votre trafic sera alors relayé via votre {box_name} de "
" de manière sécurisée." "manière sécurisée."
#: plinth/modules/wireguard/forms.py:32 #: plinth/modules/wireguard/forms.py:32
msgid "Invalid key." msgid "Invalid key."
@ -10110,12 +10109,12 @@ msgid ""
"Public key of the peer. Example: " "Public key of the peer. Example: "
"MConEJFIg6+DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= ." "MConEJFIg6+DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= ."
msgstr "" msgstr ""
"Clé publique du pair. Exemple : MConEJFIg6+DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= " "Clé publique du serveur. Exemple : "
"." "MConEJFIg6+DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= ."
#: plinth/modules/wireguard/forms.py:70 #: plinth/modules/wireguard/forms.py:70
msgid "Endpoint of the server" msgid "Endpoint of the server"
msgstr "Point de terminaison du serveur" msgstr "Point dentrée du serveur"
#: plinth/modules/wireguard/forms.py:71 #: plinth/modules/wireguard/forms.py:71
msgid "" msgid ""
@ -10134,12 +10133,12 @@ msgid ""
"Provided by the server operator, a long string of characters. Example: " "Provided by the server operator, a long string of characters. Example: "
"MConEJFIg6+DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= ." "MConEJFIg6+DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= ."
msgstr "" msgstr ""
"Il sagit dune longue chaîne de caractères fournie par lopérateur du " "Fourni par le gestionnaire du serveur, il sagit dune longue chaîne de "
"serveur. Par exemple : MConEJFIg6+DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= ." "caractères. Par exemple : MConEJFIg6+DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= ."
#: plinth/modules/wireguard/forms.py:82 #: plinth/modules/wireguard/forms.py:82
msgid "Client IP address provided by server" msgid "Client IP address provided by server"
msgstr "Adresse IP du client fournie par le serveur" msgstr "Adresse IP client fournie par le serveur"
#: plinth/modules/wireguard/forms.py:83 #: plinth/modules/wireguard/forms.py:83
msgid "" msgid ""
@ -10148,8 +10147,8 @@ msgid ""
"192.168.0.10." "192.168.0.10."
msgstr "" msgstr ""
"Adresse IP attribuée à cette machine sur le réseau privé virtuel VPN une " "Adresse IP attribuée à cette machine sur le réseau privé virtuel VPN une "
"fois connectée au serveur distant. Cette valeur est généralement fournie par " "fois connecté au serveur distant. Cette valeur est généralement fournie par "
"lopérateur du serveur. Par exemple : 192.18.0.10." "le gestionnaire du serveur. Par exemple : 192.18.0.10."
#: plinth/modules/wireguard/forms.py:89 #: plinth/modules/wireguard/forms.py:89
msgid "Private key of this machine" msgid "Private key of this machine"
@ -10164,9 +10163,9 @@ msgid ""
msgstr "" msgstr ""
"Paramètre optionnel. De nouvelles clés privée/publique seront générées si ce " "Paramètre optionnel. De nouvelles clés privée/publique seront générées si ce "
"champ est laissé vide. La clé publique pourra ensuite être communiquée au " "champ est laissé vide. La clé publique pourra ensuite être communiquée au "
"serveur. Il sagit de la méthode recommandée, même si certains opérateurs de " "serveur. Il sagit de la méthode recommandée, même si certains gestionnaires "
"serveur insistent pour fournir eux même cette clé. Exemple : MConEJFIg6+" "de serveur insistent pour fournir eux même cette clé. Exemple : "
"DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= ." "MConEJFIg6+DFHg2J1nn9SNLOSE9KR0ysdPgmPjibEs= ."
#: plinth/modules/wireguard/forms.py:98 #: plinth/modules/wireguard/forms.py:98
msgid "Pre-shared key" msgid "Pre-shared key"
@ -10190,8 +10189,8 @@ msgstr "Utiliser cette connexion pour y envoyer tout le trafic sortant"
#: plinth/modules/wireguard/forms.py:107 #: plinth/modules/wireguard/forms.py:107
msgid "Typically checked for a VPN service through which all traffic is sent." msgid "Typically checked for a VPN service through which all traffic is sent."
msgstr "" msgstr ""
"À activer lorsque le service de réseau privé virtuel VPN doit être utilisé " "À activer en général pour un service de réseau privé virtuel VPN à travers "
"pour envoyer tout le trafic." "lequel tout le trafic est envoyé."
#: plinth/modules/wireguard/manifest.py:45 #: plinth/modules/wireguard/manifest.py:45
msgid "VPN client" msgid "VPN client"
@ -10212,7 +10211,7 @@ msgstr "IP autorisées"
#: plinth/modules/wireguard/templates/wireguard.html:19 #: plinth/modules/wireguard/templates/wireguard.html:19
#: plinth/modules/wireguard/templates/wireguard.html:78 #: plinth/modules/wireguard/templates/wireguard.html:78
msgid "Last Connected Time" msgid "Last Connected Time"
msgstr "Dernière connexion" msgstr "Date de dernière connexion"
#: plinth/modules/wireguard/templates/wireguard.html:38 #: plinth/modules/wireguard/templates/wireguard.html:38
#, python-format #, python-format
@ -10246,7 +10245,7 @@ msgstr "En tant que client"
#: plinth/modules/wireguard/templates/wireguard.html:69 #: plinth/modules/wireguard/templates/wireguard.html:69
#, python-format #, python-format
msgid "Servers that %(box_name)s will connect to:" msgid "Servers that %(box_name)s will connect to:"
msgstr "Serveurs auxquels la %(box_name)s se connecte :" msgstr "Serveurs auxquels la %(box_name)s va se connecter :"
#: plinth/modules/wireguard/templates/wireguard.html:76 #: plinth/modules/wireguard/templates/wireguard.html:76
#: plinth/modules/wireguard/templates/wireguard_delete_server.html:20 #: plinth/modules/wireguard/templates/wireguard_delete_server.html:20
@ -10301,7 +10300,7 @@ msgstr "Clé publique du client :"
#: plinth/modules/wireguard/templates/wireguard_show_client.html:25 #: plinth/modules/wireguard/templates/wireguard_show_client.html:25
msgid "IP address to use for client:" msgid "IP address to use for client:"
msgstr "Adresse IP à utiliser par le client :" msgstr "Adresse IP à utiliser pour le client :"
#: plinth/modules/wireguard/templates/wireguard_show_client.html:29 #: plinth/modules/wireguard/templates/wireguard_show_client.html:29
#: plinth/modules/wireguard/templates/wireguard_show_server.html:32 #: plinth/modules/wireguard/templates/wireguard_show_server.html:32
@ -10310,7 +10309,7 @@ msgstr "Clé pré-partagée :"
#: plinth/modules/wireguard/templates/wireguard_show_client.html:33 #: plinth/modules/wireguard/templates/wireguard_show_client.html:33
msgid "Server endpoints:" msgid "Server endpoints:"
msgstr "Points de terminaisons du serveur :" msgstr "Serveurs distants :"
#: plinth/modules/wireguard/templates/wireguard_show_client.html:41 #: plinth/modules/wireguard/templates/wireguard_show_client.html:41
#: plinth/modules/wireguard/templates/wireguard_show_server.html:28 #: plinth/modules/wireguard/templates/wireguard_show_server.html:28
@ -10330,7 +10329,7 @@ msgstr "Données reçues :"
#: plinth/modules/wireguard/templates/wireguard_show_client.html:61 #: plinth/modules/wireguard/templates/wireguard_show_client.html:61
#: plinth/modules/wireguard/templates/wireguard_show_server.html:60 #: plinth/modules/wireguard/templates/wireguard_show_server.html:60
msgid "Latest handshake:" msgid "Latest handshake:"
msgstr "Dernier établissement dune liaison (« handshake ») :" msgstr "Dernier « handshake » :"
#: plinth/modules/wireguard/templates/wireguard_show_server.html:14 #: plinth/modules/wireguard/templates/wireguard_show_server.html:14
#, python-format #, python-format

View File

@ -30,10 +30,9 @@ class FirstBootMiddleware(MiddlewareMixin):
if user_requests_login: if user_requests_login:
return return
# Don't interfere with help or status pages # Don't interfere with help pages
user_requests_help = request.path.startswith(reverse('help:index')) user_requests_help = request.path.startswith(reverse('help:index'))
user_requests_status = request.path.startswith(reverse('status')) if user_requests_help:
if user_requests_help or user_requests_status:
return return
# Don't interfere with first setup progress page. When first setup is # Don't interfere with first setup progress page. When first setup is

View File

@ -18,7 +18,6 @@ system_urlpatterns = [
urlpatterns = [ urlpatterns = [
re_path(r'^$', views.index, name='index'), re_path(r'^$', views.index, name='index'),
re_path(r'^status/$', views.status, name='status'),
re_path(r'^language-selection/$', re_path(r'^language-selection/$',
public(views.LanguageSelectionView.as_view()), public(views.LanguageSelectionView.as_view()),
name='language-selection'), name='language-selection'),

View File

@ -178,16 +178,6 @@ def index(request):
}) })
@public
def status(request):
"""Return the status of service in JSON format."""
status = {
'is_available': True,
'is_first_setup_running': setup.is_first_setup_running
}
return JsonResponse(status)
def _pick_menu_items(menu_items, selected_tags): def _pick_menu_items(menu_items, selected_tags):
"""Return a sorted list of menu items filtered by tags.""" """Return a sorted list of menu items filtered by tags."""