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
ea24cd1
Suppression des inline/dataURI de certains boutons.
echarp Sep 15, 2023
e4c86c7
Migration de state_machine à state_machines-activerecord, qui est
echarp Sep 15, 2023
ef2f4f6
Mise à jour vers redis 4.8, nouvelle méthode #exists? à la place de e…
echarp Sep 16, 2023
ff7836f
belongs_to est par défaut "not nullable" (depuis rails 5)
echarp Sep 16, 2023
7dbce1c
Complétion de clauses "group by" SQL pour fonctionner sur mysql standard
echarp Sep 17, 2023
7f616d8
image_tag a besoin d'un chemin plus complet
echarp Sep 17, 2023
75b6a3b
Mécanisme de résolution standard pour templates rédaction/modération
echarp Sep 18, 2023
4400b3f
Deux nouveaux templates pour gérer les téléchargements markdown depuis
echarp Sep 18, 2023
bdf8958
Migration à rails 6.1
echarp Sep 18, 2023
1088314
Migration initiale vers rails 7, avec gemmes locales et quelques page…
echarp Sep 18, 2023
87528fe
La méthode #to_s des dates et heures renommée en #to_fs
echarp Sep 18, 2023
fd2d2b5
La gemme nio4r n'a plus besoin d'être bloquée à une anciennce version
echarp Sep 19, 2023
ac5b4f4
Mise à jour vers les sous-projets github
echarp Sep 20, 2023
e89037d
Mise à jour à redis v5
echarp Sep 20, 2023
a18599d
Dépréciation de méthode File.exists?
echarp Sep 23, 2023
e949167
Depuis rails 6 il est recommandé d'hériter d'une classe centrale géré…
echarp Sep 26, 2023
a1e8cbf
Ajout de tests, surtout sur les contrôleurs de premier niveau,
echarp Sep 27, 2023
23d5b19
Déplacement de journal vers forum fonctionnel à nouveau
echarp Sep 29, 2023
1893b75
Plus de tests d'intégration, pour 90% de couverture
echarp Sep 29, 2023
56684eb
Chemin manquant pour accéder à des "partials" de news en modération
echarp Sep 30, 2023
db32248
La pluralisation nécessite un helper pour afficher le nombre
echarp Sep 30, 2023
e0ca36f
L'API des errors a évolué, l'ancienne méthode "values" est dépréciée
echarp Sep 30, 2023
0c46496
La mise à jour de la gemme doorkeeper nécessite une migration BdD
echarp Oct 1, 2023
0ff3314
MaJ script schéma BdD
echarp Oct 1, 2023
4b4a022
Plus de tests, pour une couverture à 95%
echarp Oct 1, 2023
258b8a4
Tous les contrôleurs admin sont testés, à 100%
echarp Oct 2, 2023
2e214a0
Rapide correction, pour pouvoir lister les suivis non assignés
echarp Oct 2, 2023
bac712f
Chemin manquant pour accéder à un "partials" de comment
echarp Oct 2, 2023
b6b4839
Plus de tests, les contrôleurs sont testés à plus de 99%
echarp Oct 2, 2023
a01d05e
Test des threads de commentaires
echarp Oct 3, 2023
c4c7758
Un peu plus de tests de models
echarp Oct 3, 2023
4b8402f
La redirection vers duck duck go nécessite une permission explicite p…
echarp Oct 3, 2023
c9415d4
Utilisation du serveur web par défaut des derniers rails: puma
echarp Oct 4, 2023
edba204
Tests de contrôleurs à peu près completes, et propres
echarp Oct 4, 2023
aa1c779
Utilisation de Redis.new plutôt que de la variable globale $redis dan…
echarp Oct 4, 2023
ec1b6bb
Utilisation de Redis.new dans les tests de modèle aussi
echarp Oct 4, 2023
6e21829
L'action "move" des liens n'existe pas
echarp Oct 10, 2023
ac47726
Migration à rails 7.1
echarp Oct 10, 2023
334dd64
Oubli configuration pour avoir des boutons sous forme de liens
echarp Oct 10, 2023
a759467
Test plus solide, et utilisation de double quote à certains endroits
echarp Oct 10, 2023
43b62cc
Utilisation de la gem normalize, plutôt qu'un module npm
echarp Oct 16, 2023
7bd1f34
Suppression de node et npm
echarp Oct 16, 2023
f82f596
Suppression de références à node_modules
echarp Oct 16, 2023
ccb8eb6
Migration à rails 7.1.1
echarp Oct 16, 2023
19df4e0
Nettoyage Gemfile
echarp Oct 17, 2023
9898cc2
Remove CoffeeScript, use plain Javascript instead
nud Aug 20, 2023
672ae69
Apply remarks from decaffeinate to the new javascript files
nud Dec 21, 2023
b6e3d32
Fix scrolling to the bottom of the page when using shift+g
nud Dec 21, 2023
d0a63d8
Update nginx config and docker files to use Debian Bookworm with Ruby…
Trim Mar 24, 2024
3a00e7d
Add note to enable the DOCKER_BUILDKIT builder
Trim Oct 9, 2023
c5d3777
explain how to run linuxfr with rootless containers
Trim Dec 19, 2023
2352dcf
use container engine agnostic file names as it works with Docker and …
Trim Mar 8, 2024
4a68dbf
Bundle update
echarp Mar 10, 2024
d060200
Upgrade unicorn, carrierwave and acts_as_list, remove coffee gem
echarp Mar 10, 2024
1c9ed34
update linuxfr-board container to use the board-sse-linuxfr.org gem v…
Trim Mar 22, 2024
90b7c73
add to Container.md podman compose run, add IFS value for database en…
Trim Mar 22, 2024
2ffab9e
URI.encode has been removed from Ruby 3
Trim Mar 23, 2024
9d834c3
linuxfr-img container can use bookworm to build the Go service
Trim Mar 24, 2024
2ac0f90
Add nodejs back to linuxfr.org container which is used to uglify java…
Trim Mar 24, 2024
322c572
compose: share gemfile from host
Trim Mar 26, 2024
399bbaf
replace uglifier gem by terser to minimize javascript files
Trim Mar 27, 2024
7e163c7
Bundle update (removes a small CVE)
echarp Apr 1, 2024
6773c7f
Passage à Haml 6+
echarp Apr 1, 2024
bae7ced
Passage to Sass 6+
echarp Apr 1, 2024
8a926b5
feat: Update gem dependencies and sitemap generator
echarp Jun 9, 2024
fc2bc97
fix typos
Trim Sep 19, 2024
f692b15
use custom HTTP public port to use rootless containers by default
Trim Sep 20, 2024
0340b08
nginx container: fix empty alias error
Trim Jan 11, 2026
ed53bd3
chore: upgrade to Rails 7.2 and improve secrets handling
echarp Mar 1, 2025
7f7f007
chore: upgrade to Rails 8.0
echarp Jan 4, 2026
7a1b876
chore: upgrade to Rails 8.1
echarp Jan 4, 2026
15cc313
chore: upgrade to Rails 8.1.2
echarp Jan 11, 2026
4e5bd34
doc: update installation instructions for Rails 8 and Debian Trixie
echarp Jan 11, 2026
1fc97c8
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