Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
d45dc3a
Suppression des inline/dataURI de certains boutons.
echarp Sep 15, 2023
332ae3b
Migration de state_machine à state_machines-activerecord, qui est
echarp Sep 15, 2023
4b65ca7
Mise à jour vers redis 4.8, nouvelle méthode #exists? à la place de e…
echarp Sep 16, 2023
6b0ba70
belongs_to est par défaut "not nullable" (depuis rails 5)
echarp Sep 16, 2023
b85a8d3
Complétion de clauses "group by" SQL pour fonctionner sur mysql standard
echarp Sep 17, 2023
a846c84
image_tag a besoin d'un chemin plus complet
echarp Sep 17, 2023
4db304a
Mécanisme de résolution standard pour templates rédaction/modération
echarp Sep 18, 2023
8658ad7
Deux nouveaux templates pour gérer les téléchargements markdown depuis
echarp Sep 18, 2023
eec0659
Migration à rails 6.1
echarp Sep 18, 2023
096dd5d
Migration initiale vers rails 7, avec gemmes locales et quelques page…
echarp Sep 18, 2023
e710950
La méthode #to_s des dates et heures renommée en #to_fs
echarp Sep 18, 2023
fe853f5
La gemme nio4r n'a plus besoin d'être bloquée à une anciennce version
echarp Sep 19, 2023
1ef8a5e
Mise à jour vers les sous-projets github
echarp Sep 20, 2023
69a7142
Mise à jour à redis v5
echarp Sep 20, 2023
50cf4f2
Dépréciation de méthode File.exists?
echarp Sep 23, 2023
6befab8
Depuis rails 6 il est recommandé d'hériter d'une classe centrale géré…
echarp Sep 26, 2023
529abef
Ajout de tests, surtout sur les contrôleurs de premier niveau,
echarp Sep 27, 2023
2e28a12
Déplacement de journal vers forum fonctionnel à nouveau
echarp Sep 29, 2023
2415db9
Plus de tests d'intégration, pour 90% de couverture
echarp Sep 29, 2023
cb0c867
Chemin manquant pour accéder à des "partials" de news en modération
echarp Sep 30, 2023
85c2233
La pluralisation nécessite un helper pour afficher le nombre
echarp Sep 30, 2023
199df52
L'API des errors a évolué, l'ancienne méthode "values" est dépréciée
echarp Sep 30, 2023
18f8ad8
La mise à jour de la gemme doorkeeper nécessite une migration BdD
echarp Oct 1, 2023
a0aa51c
MaJ script schéma BdD
echarp Oct 1, 2023
2a01fd7
Plus de tests, pour une couverture à 95%
echarp Oct 1, 2023
2b06b80
Tous les contrôleurs admin sont testés, à 100%
echarp Oct 2, 2023
fb7859a
Rapide correction, pour pouvoir lister les suivis non assignés
echarp Oct 2, 2023
4482225
Chemin manquant pour accéder à un "partials" de comment
echarp Oct 2, 2023
a788de1
Plus de tests, les contrôleurs sont testés à plus de 99%
echarp Oct 2, 2023
17b6afa
Test des threads de commentaires
echarp Oct 3, 2023
b810dd2
Un peu plus de tests de models
echarp Oct 3, 2023
823a328
La redirection vers duck duck go nécessite une permission explicite p…
echarp Oct 3, 2023
5a0fcf1
Utilisation du serveur web par défaut des derniers rails: puma
echarp Oct 4, 2023
6e9cde0
Tests de contrôleurs à peu près completes, et propres
echarp Oct 4, 2023
2e5878b
Utilisation de Redis.new plutôt que de la variable globale $redis dan…
echarp Oct 4, 2023
cef994c
Utilisation de Redis.new dans les tests de modèle aussi
echarp Oct 4, 2023
91b72ab
L'action "move" des liens n'existe pas
echarp Oct 10, 2023
6c3f87e
Migration à rails 7.1
echarp Oct 10, 2023
f8e36bd
Oubli configuration pour avoir des boutons sous forme de liens
echarp Oct 10, 2023
18719cb
Test plus solide, et utilisation de double quote à certains endroits
echarp Oct 10, 2023
b05f1b6
Utilisation de la gem normalize, plutôt qu'un module npm
echarp Oct 16, 2023
89df8bb
Suppression de node et npm
echarp Oct 16, 2023
c669c42
Suppression de références à node_modules
echarp Oct 16, 2023
6975d53
Migration à rails 7.1.1
echarp Oct 16, 2023
e43e1a9
Nettoyage Gemfile
echarp Oct 17, 2023
bb030d4
Remove CoffeeScript, use plain Javascript instead
nud Aug 20, 2023
145dbc4
Apply remarks from decaffeinate to the new javascript files
nud Dec 21, 2023
a7d948a
Fix scrolling to the bottom of the page when using shift+g
nud Dec 21, 2023
4dd1d20
Update nginx config and docker files to use Debian Bookworm with Ruby…
Trim Mar 24, 2024
a86d3b9
Add note to enable the DOCKER_BUILDKIT builder
Trim Oct 9, 2023
0355686
explain how to run linuxfr with rootless containers
Trim Dec 19, 2023
fc644cf
use container engine agnostic file names as it works with Docker and …
Trim Mar 8, 2024
888c2cc
Bundle update
echarp Mar 10, 2024
4f7b6cf
Upgrade unicorn, carrierwave and acts_as_list, remove coffee gem
echarp Mar 10, 2024
b92d4cf
update linuxfr-board container to use the board-sse-linuxfr.org gem v…
Trim Mar 22, 2024
52e838c
add to Container.md podman compose run, add IFS value for database en…
Trim Mar 22, 2024
eb993fe
URI.encode has been removed from Ruby 3
Trim Mar 23, 2024
4643d39
linuxfr-img container can use bookworm to build the Go service
Trim Mar 24, 2024
2b034eb
Add nodejs back to linuxfr.org container which is used to uglify java…
Trim Mar 24, 2024
be5c15f
compose: share gemfile from host
Trim Mar 26, 2024
db80d85
replace uglifier gem by terser to minimize javascript files
Trim Mar 27, 2024
4aaf26f
Bundle update (removes a small CVE)
echarp Apr 1, 2024
9fcb4ad
Passage à Haml 6+
echarp Apr 1, 2024
b5cba76
Passage to Sass 6+
echarp Apr 1, 2024
1917be6
feat: Update gem dependencies and sitemap generator
echarp Jun 9, 2024
4cccaf2
fix typos
Trim Sep 19, 2024
b365b2a
use custom HTTP public port to use rootless containers by default
Trim Sep 20, 2024
1050dbb
nginx container: fix empty alias error
Trim Jan 11, 2026
fa47a44
chore: upgrade to Rails 7.2 and improve secrets handling
echarp Mar 1, 2025
dcb92c5
chore: upgrade to Rails 8.0
echarp Jan 4, 2026
3c51036
chore: upgrade to Rails 8.1
echarp Jan 4, 2026
bf584a8
chore: upgrade to Rails 8.1.2
echarp Jan 11, 2026
5c37ac5
doc: update installation instructions for Rails 8 and Debian Trixie
echarp Jan 11, 2026
2da42cc
update containers with Debian Trixie as suggested in INSTALL.md
Trim Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
/uploads
/vendor/ruby
/vendor/bundle
/coverage
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
/vendor/bundle
/.env
/docker-compose.*.yaml
.rubocop.yml
Guardfile
coverage
2 changes: 0 additions & 2 deletions Capfile

This file was deleted.

83 changes: 51 additions & 32 deletions Docker.md → Container.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
LinuxFr on Docker
-----------------
LinuxFr with Containers
-----------------------

To simplify set up of a developement environment, LinuxFr.org can be
run on Docker with `docker compose up`.
To simplify set up of a development environment, LinuxFr.org can be
run with a container engine like Docker or Podman with the [`compose.yml`](./compose.yaml)
file which describes how to build all needed services.

To init the SQL database schema, you need to wait upto the `database`
container to be ready to listen MySQL connections.
By default, the LinuxFr.org services will be provided under the domain names
`dlfp.lo` and `image.dlfp.lo`. So you'll need to add the
following line into the `/etc/hosts` file of your machine:

```
127.0.0.1 dlfp.lo image.dlfp.lo
```

Then, if you use the Docker engine, you can use the `docker compose up`
command to start the system (you need to install the
[Docker compose plugin](https://docs.docker.com/compose/) first).

> Note: with the Docker engine, you need to enable the Docker BuildKit builder.
> Either you have a Docker version which uses it by default, or you set the
> environment variable `export DOCKER_BUILDKIT=1`.

If you use the Podman engine, you can either use the same Docker compose plugin
or the [podman-compose](https://github.com/containers/podman-compose/)
tool. The podman cli itself provides a wrapper of one of these two tools
through the
[`podman compose` command](https://docs.podman.io/en/latest/markdown/podman-compose.1.html).
Thus you need to use the `podman compose up` command to start the system.

At this point, this documentation will give you `docker compose` commands,
but you should be able to use `podman compose` without any issue.

To setup the SQL database schema, you need to wait until the `database`
container becomes ready to listen MySQL connections.

For example, you should see in the logs:

> database_1 | 2020-09-21 16:03:12 139820938893312 [Note] mysqld: ready for connections.
> database_1 | 2020-09-21 16:03:12 139820938893312 [Note] *mysqld: ready for connections.*
>
> database_1 | Version: '10.1.46-MariaDB-1\~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution

Or you can check the `database` container status to be "healthy".
Or you can check the `database` container status to be *healthy* with the
`docker compose ps` command.

Then, open a second terminal and run:

```
docker compose exec linuxfr.org bin/rails db:setup
```

Finally, the environment is ready and you can open [http://dlfp.lo](http://dlfp.lo)
Finally, the environment is ready and you can open [http://dlfp.lo:9000](http://dlfp.lo:9000)
in your favorite browser.

Note: to be able to access this URL, you'll need to add the following line
into the `/etc/hosts` file of your machine:

```
127.0.0.1 dlfp.lo image.dlfp.lo
```

Personalize configuration
=========================

Expand All @@ -40,24 +61,22 @@ If you want, you can change the domain names used by the LinuxFr.org
web application. To do this, you can setup `DOMAIN` and `IMAGE_DOMAIN`
variables in the `deployment/default.env` file.

You can also configure your own Redis service and your own MySQL
service.

If you want to change the application port and/or other configurations, you can
[override](https://docs.docker.com/compose/extends/)
the docker compose configuration (in particular the `nginx` service for
the port).
Within the same file, you can update the HTTP listening ports by updating the
`DOMAIN_HTTP_PORT` and `IMAGE_DOMAIN_HTTP_PORT` variables (both are set to
`9000` by default). If you modify them, don't forget to add the new values as
published ports for the `nginx` service in the `compose.yaml` file (they have
to target the `8080` container port).

Notice, that if LinuxFr.org doesn't run on port 80, the image cache
service won't work well and so you won't be able to see images in the news.
You can also configure your own Redis service and your own MySQL
service by updating environment variables in the same file.

Test modifications
==================

The docker compose is currently configured to share `./app`, `./db` and
`./public` directories with the docker container.
The compose file currently shares `./app`, `./db` and
`./public` directories with the container.

So you can update files with your prefered IDE on your machine. Rails
So you can update files with your preferred IDE on your machine. Rails
will directly detect changes and apply them on next page reload.

Furthermore, if you need to access the Rails console, you need a second
Expand All @@ -75,13 +94,13 @@ Run application tests
=====================

To help maintainers, we are in the process of adding tests to check the
application has still the expected behaviour.
application has still the expected behavior.

To get help about writing tests, see the
[Ruby on Rails documentation](https://guides.rubyonrails.org/testing.html#the-rails-test-runner)
.

To run tests with Docker environment, you need to use this command:
To run tests with containers, you need to use this command:

```
docker compose exec linuxfr.org bin/rails test -v
Expand Down Expand Up @@ -114,10 +133,10 @@ use:
docker compose exec linuxfr.org bin/rails db:reset
```

Services provided by the docker compose
Services provided by the compose file
=======================================

Currently, these services are directly enabled by docker compose:
Currently, these services are directly enabled by compose:

1. The [LinuxFr.org](https://github.com/linuxfrorg/linuxfr.org)
ruby on rails application itself
Expand Down
54 changes: 23 additions & 31 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
source 'https://rubygems.org'
source "https://rubygems.org"

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end

gem "rails", "~>5.2"
gem "nio4r", "2.5.2" # 2.5.3 is not compatible with ruby 2.3
gem "rails", "~>8.1.0"

gem "actionpack-page_caching", github: "linuxfrorg/actionpack-page_caching"
# Latest 6.0.1 is not starting any tests
gem 'minitest', '< 6.0'

gem "actionpack-page_caching"
gem "acts_as_list", "~>1.1"
gem "ansi", "~>1.4", require: false
gem "acts_as_list", "~>0.4"
gem "bitfields", "~>0.4"
gem "bootsnap", "~>1.3", require: false
gem "canable", "~>0.1"
gem "carrierwave", "~>1.1"
gem "carrierwave", "~>3.0"
gem "devise", "~>4.3"
gem "diff_match_patch", github: "nono/diff_match_patch-ruby", require: "diff_match_patch"
gem "doorkeeper", "~>4.2"
gem "doorkeeper"
gem "ffi-hunspell", github: "postmodern/ffi-hunspell"
gem "french_rails", "~>0.4"
gem "french_rails", "~>0.7", github: "echarp/french-rails"
gem "friendly_id", "~>5.1"
gem "haml", "~>5.0"
gem "html-pipeline-linuxfr", "~>0.15"
gem "haml", "~>6.3"
gem "htmlentities", "~>4.3"
gem "html-pipeline-linuxfr", "~>0.17", github: "echarp/html-pipeline-linuxfr"
gem "html_spellchecker", "~>0.1"
gem "html_truncator", "~>0.4"
gem "htmlentities", "~>4.3"
gem "inherited_resources", "~>1.8"
gem "kaminari", "~>1.2"
gem "mini_magick", "~>4.9"
gem "mysql2", "~>0.5.0"
gem "nokogiri", "~>1.10"
gem "redis", "~>5.0"
gem "rinku", "~>2.0"
gem "redis", "~>4.0"
gem "sitemap_generator", "~>2.1"
gem "state_machine", "~>1.2"
gem "sitemap_generator"
gem "state_machines-activerecord"

# Gems used for assets
assets = !%w(production alpha).include?(ENV['RAILS_ENV'])
assets = true if ENV['RAILS_GROUPS'] == "assets"
gem "jquery-rails", "~>4.0", require: assets
gem "coffee-rails", "~>4.1", require: assets
gem "sass-rails", "~>5.0", require: assets
gem "rails-sass-images", require: assets
gem "uglifier", require: assets
gem "jquery-rails", "~>4.0", require: assets
gem "normalize-rails", "~>8.0", require: assets
gem "sassc-rails", require: assets
gem "terser", "~> 1.2", require: assets

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
Expand All @@ -54,25 +55,16 @@ group :development do
gem "annotate"
gem "better_errors"
gem "binding_of_caller"
gem "capistrano", "~>2.15", github: 'capistrano', branch: 'legacy-v2'
gem "capistrano-maintenance"
gem "letter_opener"
gem "listen", github: "guard/listen"
gem "mo"
gem "pry-rails"
gem "spring"
gem "sushi"
gem "thin"
gem "puma"
gem "web-console"
end

group :test do
# Adds support for Capybara system testing and selenium driver
gem "capybara", ">= 2.15"
gem "selenium-webdriver"
gem "simplecov"
end

group :production, :alpha do
gem "unicorn", "~>5.1"
gem "gctools", "~>0.2"
gem "unicorn", "~>6.1"
end
Loading