forked from DGNum/infrastructure
chore(ds-fr): Remove unused files
This commit is contained in:
parent
2a7a3aba83
commit
41caf293b0
11 changed files with 0 additions and 6025 deletions
|
@ -1,179 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
git,
|
||||
bun,
|
||||
nodejs,
|
||||
ruby_3_2,
|
||||
bundlerEnv,
|
||||
logDir ? "/var/log/ds-fr",
|
||||
dataDir ? "/var/lib/ds-fr",
|
||||
initialDeploymentDate ? "17941030",
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) getExe;
|
||||
|
||||
# Head of the DGNum repo
|
||||
dgn-id = "f270f1cdd09e643a9c666c94df1841234430de49";
|
||||
|
||||
pname = "ds-fr";
|
||||
meta = import ./meta.nix;
|
||||
|
||||
inherit (meta) version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "demarches-simplifiees";
|
||||
repo = "demarches-simplifiees.fr";
|
||||
rev = version;
|
||||
hash = meta.src-hash;
|
||||
};
|
||||
|
||||
rubyEnv = bundlerEnv {
|
||||
name = "env-${pname}";
|
||||
gemdir = ./rubyEnv;
|
||||
ruby = ruby_3_2;
|
||||
gemset = (import ./rubyEnv/gemset.nix) // {
|
||||
bundler = {
|
||||
groups = [ "default" ];
|
||||
platforms = [ ];
|
||||
source = {
|
||||
remotes = [ "https://rubygems.org" ];
|
||||
sha256 = "deeQ3fNwcSiGSO/yeB2yoTniRq2gHW8WueprXoPX6Jk=";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.3.11";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
node_modules = stdenv.mkDerivation {
|
||||
pname = "${pname}-node_modules";
|
||||
inherit src version;
|
||||
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
|
||||
"GIT_PROXY_COMMAND"
|
||||
"SOCKS_SERVER"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ bun ];
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
buildPhase = ''
|
||||
bun install --no-progress --frozen-lockfile --ignore-scripts
|
||||
rm -r node_modules/.cache
|
||||
|
||||
# Remove inconsistent file
|
||||
rm node_modules/.bin/grunt
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mv node_modules $out
|
||||
'';
|
||||
|
||||
dontFixup = true;
|
||||
|
||||
outputHash = meta.deps-hash or lib.fakeHash;
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
};
|
||||
|
||||
dsModules = stdenv.mkDerivation {
|
||||
pname = "${pname}-modules";
|
||||
inherit src version;
|
||||
|
||||
buildInputs = [ rubyEnv ];
|
||||
nativeBuildInputs = [
|
||||
bun
|
||||
nodejs
|
||||
rubyEnv.wrappedRuby
|
||||
];
|
||||
|
||||
RAILS_ENV = "production";
|
||||
NODE_ENV = "dev";
|
||||
|
||||
patches = [
|
||||
# Disable functionnalities as we only precompile assets
|
||||
./patches/build.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
${getExe git} apply -p1 < ${builtins.fetchurl "https://git.dgnum.eu/DGNum/demarches-normaliennes/commit/${dgn-id}.patch"}
|
||||
'';
|
||||
|
||||
OTP_SECRET_KEY = "precompile_placeholder";
|
||||
SECRET_KEY_BASE = "precompile_placeholder";
|
||||
APP_HOST = "precompile_placeholder";
|
||||
|
||||
buildPhase = ''
|
||||
cp -R ${node_modules} node_modules
|
||||
chmod u+w -R node_modules
|
||||
|
||||
patchShebangs node_modules
|
||||
patchShebangs bin/
|
||||
|
||||
bin/rake assets:precompile
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/public
|
||||
cp -r public/* $out/public
|
||||
'';
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "demarches-simplifiees.fr-${version}";
|
||||
|
||||
inherit src;
|
||||
|
||||
buildInputs = [ rubyEnv ];
|
||||
propagatedBuildInputs = [ rubyEnv.wrappedRuby ];
|
||||
|
||||
patches = [
|
||||
./patches/replay_routing_engine_for_a_cloned_procedure.patch
|
||||
./patches/smtp_settings.patch
|
||||
./patches/garage.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
${getExe git} apply -p1 < ${builtins.fetchurl "https://git.dgnum.eu/DGNum/demarches-normaliennes/commit/${dgn-id}.patch"}
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
rm -rf public
|
||||
ln -s ${dsModules}/public/ public
|
||||
|
||||
patchShebangs bin/
|
||||
|
||||
rm -rf log storage
|
||||
ln -s ${logDir} log
|
||||
ln -s ${dataDir}/tmp tmp
|
||||
ln -s ${dataDir}/storage storage
|
||||
|
||||
for f in $(ls lib/tasks/deployment/); do
|
||||
[[ ! ${initialDeploymentDate} < $f ]] \
|
||||
&& rm lib/tasks/deployment/$f;
|
||||
done;
|
||||
|
||||
echo "Removed unused data migrations"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r * $out/
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit rubyEnv;
|
||||
ruby = rubyEnv.wrappedRuby;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Dématérialiser et simplifier les démarches administratives";
|
||||
homepage = "https://github.com/demarches-simplifiees/demarches-simplifiees.fr";
|
||||
license = licenses.agpl3Only;
|
||||
maintainers = with maintainers; [ thubrecht ];
|
||||
};
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
version = "2024-04-24-01";
|
||||
src-hash = "sha256-+FjthJZb1KqqFttFmXr/FN5qaFcY9RGTKAqhdLGVFSg=";
|
||||
deps-hash = "sha256-Vj8WCB+LSHJM67qbsZ5CPc+jK1KWO1MXnSFp/LH0Ow8=";
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
diff --git a/config/environments/production.rb b/config/environments/production.rb
|
||||
index 16d8c8e84..6262b8782 100644
|
||||
--- a/config/environments/production.rb
|
||||
+++ b/config/environments/production.rb
|
||||
@@ -118,7 +118,7 @@ Rails.application.configure do
|
||||
# the I18n.default_locale when a translation cannot be found).
|
||||
config.i18n.fallbacks = true
|
||||
|
||||
- config.active_storage.service = ENV.fetch("ACTIVE_STORAGE_SERVICE").to_sym
|
||||
+ config.active_storage.service = ENV.fetch("ACTIVE_STORAGE_SERVICE", 'local').to_sym
|
||||
|
||||
# Send deprecation notices to registered listeners.
|
||||
config.active_support.deprecation = :notify
|
||||
@@ -174,5 +174,5 @@ Rails.application.configure do
|
||||
# The Content-Security-Policy is NOT in Report-Only mode
|
||||
config.content_security_policy_report_only = false
|
||||
|
||||
- config.lograge.enabled = ENV['LOGRAGE_ENABLED'] == 'enabled'
|
||||
+ config.lograge.enabled = ENV.fetch('LOGRAGE_ENABLED', 'disabled') == 'enabled'
|
||||
end
|
||||
|
||||
diff --git a/config/initializers/mailcatcher.rb b/config/initializers/mailcatcher.rb
|
||||
index 8b931f704..dbeceb4ec 100644
|
||||
--- a/config/initializers/mailcatcher.rb
|
||||
+++ b/config/initializers/mailcatcher.rb
|
||||
@@ -1,4 +1,4 @@
|
||||
-if ENV.fetch('MAILCATCHER_ENABLED') == 'enabled'
|
||||
+if ENV.fetch('MAILCATCHER_ENABLED', 'disabled') == 'enabled'
|
||||
ActiveSupport.on_load(:action_mailer) do
|
||||
module Mailcatcher
|
||||
class SMTP < ::Mail::SMTP; end
|
||||
|
||||
diff --git a/config/initializers/mailtrap.rb b/config/initializers/mailtrap.rb
|
||||
index 6d1faa04b..658673ed1 100644
|
||||
--- a/config/initializers/mailtrap.rb
|
||||
+++ b/config/initializers/mailtrap.rb
|
||||
@@ -1,4 +1,4 @@
|
||||
-if ENV.fetch('MAILTRAP_ENABLED') == 'enabled'
|
||||
+if ENV.fetch('MAILTRAP_ENABLED', 'disabled') == 'enabled'
|
||||
ActiveSupport.on_load(:action_mailer) do
|
||||
module Mailtrap
|
||||
class SMTP < ::Mail::SMTP; end
|
|
@ -1,16 +0,0 @@
|
|||
diff --git a/config/storage.yml b/config/storage.yml
|
||||
index d2b2d241f..1b2744504 100644
|
||||
--- a/config/storage.yml
|
||||
+++ b/config/storage.yml
|
||||
@@ -19,3 +19,11 @@ amazon:
|
||||
secret_access_key: <%= ENV.fetch("S3_SECRET_ACCESS_KEY", "") %>
|
||||
region: <%= ENV.fetch("S3_REGION", "") %>
|
||||
bucket: <%= ENV.fetch("S3_BUCKET", "") %>
|
||||
+garage:
|
||||
+ service: S3
|
||||
+ access_key_id: <%= ENV.fetch("S3_ACCESS_KEY_ID", "") %>
|
||||
+ secret_access_key: <%= ENV.fetch("S3_SECRET_ACCESS_KEY", "") %>
|
||||
+ region: <%= ENV.fetch("S3_REGION", "garage") %>
|
||||
+ bucket: <%= ENV.fetch("S3_BUCKET", "") %>
|
||||
+ endpoint: <%= ENV.fetch("S3_ENDPOINT", "") %>
|
||||
+ force_path_style: <%= ENV.fetch("S3_FORCE_PATH_STYLE", "").present? %>
|
|
@ -1,35 +0,0 @@
|
|||
diff --git a/lib/tasks/deployment/20230613114744_replay_routing_engine_for_a_cloned_procedure.rake b/lib/tasks/deployment/20230613114744_replay_routing_engine_for_a_cloned_procedure.rake
|
||||
index 9d4f3a284..04d62a63b 100644
|
||||
--- a/lib/tasks/deployment/20230613114744_replay_routing_engine_for_a_cloned_procedure.rake
|
||||
+++ b/lib/tasks/deployment/20230613114744_replay_routing_engine_for_a_cloned_procedure.rake
|
||||
@@ -4,18 +4,18 @@ namespace :after_party do
|
||||
puts "Running deploy task 'replay_routing_engine_for_a_cloned_procedure'"
|
||||
|
||||
# Put your task implementation HERE.
|
||||
- dossiers = Procedure
|
||||
- .find(76266)
|
||||
- .dossiers
|
||||
- .en_construction
|
||||
-
|
||||
- progress = ProgressReport.new(dossiers.count)
|
||||
-
|
||||
- dossiers.find_each do |dossier|
|
||||
- RoutingEngine.compute(dossier)
|
||||
- progress.inc
|
||||
- end
|
||||
- progress.finish
|
||||
+ # dossiers = Procedure
|
||||
+ # .find(76266)
|
||||
+ # .dossiers
|
||||
+ # .en_construction
|
||||
+ #
|
||||
+ # progress = ProgressReport.new(dossiers.count)
|
||||
+ #
|
||||
+ # dossiers.find_each do |dossier|
|
||||
+ # RoutingEngine.compute(dossier)
|
||||
+ # progress.inc
|
||||
+ # end
|
||||
+ # progress.finish
|
||||
|
||||
# Update task as completed. If you remove the line below, the task will
|
||||
# run with every deploy (or every time you call after_party:run).
|
|
@ -1,14 +0,0 @@
|
|||
diff --git a/config/environments/production.rb b/config/environments/production.rb
|
||||
index 16d8c8e84..e0326d26d 100644
|
||||
--- a/config/environments/production.rb
|
||||
+++ b/config/environments/production.rb
|
||||
@@ -86,7 +86,8 @@ Rails.application.configure do
|
||||
user_name: ENV.fetch("SMTP_USER"),
|
||||
password: ENV.fetch("SMTP_PASS"),
|
||||
authentication: ENV.fetch("SMTP_AUTHENTICATION"),
|
||||
- enable_starttls_auto: ENV.fetch("SMTP_TLS").present?
|
||||
+ enable_starttls_auto: ENV.fetch("SMTP_TLS").present?,
|
||||
+ ssl: ENV.fetch("SMTP_SSL").present?
|
||||
}
|
||||
elsif ENV['SENDMAIL_ENABLED'] == 'enabled'
|
||||
config.action_mailer.delivery_method = :sendmail
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/app/controllers/concerns/uninterlace_png_concern.rb b/app/controllers/concerns/uninterlace_png_concern.rb
|
||||
index 8e9d06251..0870357c6 100644
|
||||
--- a/app/controllers/concerns/uninterlace_png_concern.rb
|
||||
+++ b/app/controllers/concerns/uninterlace_png_concern.rb
|
||||
@@ -14,6 +14,6 @@ module UninterlacePngConcern
|
||||
|
||||
def interlaced?(png_path)
|
||||
png = MiniMagick::Image.open(png_path)
|
||||
- png.data["interlace"] != "None"
|
||||
+ png.details["interlace"] != "None"
|
||||
end
|
||||
end
|
|
@ -1,160 +0,0 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
gem 'rails', '~> 7.0.8' # allows update to security fixes at any time
|
||||
|
||||
gem 'aasm'
|
||||
gem 'acsv'
|
||||
gem 'active_model_serializers'
|
||||
gem 'activestorage-openstack'
|
||||
gem 'active_storage_validations'
|
||||
gem 'addressable'
|
||||
gem 'administrate'
|
||||
gem 'administrate-field-enum' # Allow using Field::Enum in administrate
|
||||
gem 'after_commit_everywhere'
|
||||
gem 'after_party'
|
||||
gem 'ancestry'
|
||||
gem 'anchored'
|
||||
gem 'bcrypt'
|
||||
gem 'bootsnap', '>= 1.4.4', require: false # Reduces boot times through caching; required in config/boot.rb
|
||||
gem 'browser'
|
||||
gem 'charlock_holmes'
|
||||
gem 'chartkick'
|
||||
gem 'chunky_png'
|
||||
gem 'clamav-client', require: 'clamav/client'
|
||||
gem 'daemons'
|
||||
gem 'deep_cloneable' # Enable deep clone of active record models
|
||||
gem 'delayed_cron_job', require: false # Cron jobs
|
||||
gem 'delayed_job_active_record'
|
||||
gem 'delayed_job_web'
|
||||
gem 'devise'
|
||||
gem 'devise-i18n'
|
||||
gem 'devise-two-factor'
|
||||
gem 'discard'
|
||||
gem 'dotenv-rails', require: 'dotenv/rails-now' # dotenv should always be loaded before rails
|
||||
gem 'dry-monads'
|
||||
gem 'faraday-jwt'
|
||||
gem 'flipper'
|
||||
gem 'flipper-active_record'
|
||||
gem 'flipper-active_support_cache_store'
|
||||
gem 'flipper-ui'
|
||||
gem 'fugit'
|
||||
gem 'geocoder'
|
||||
gem 'geo_coord', require: "geo/coord"
|
||||
gem 'gitlab-sidekiq-fetcher', require: 'sidekiq-reliable-fetch', git: 'https://github.com/demarches-simplifiees/reliable-fetch.git'
|
||||
gem 'gon'
|
||||
gem 'graphql', '2.0.24'
|
||||
gem 'graphql-batch', '0.5.1'
|
||||
gem 'graphql-rails_logger'
|
||||
gem 'groupdate'
|
||||
gem 'haml-rails'
|
||||
gem 'hashie'
|
||||
gem 'http_accept_language'
|
||||
gem 'i18n_data'
|
||||
gem 'i18n-tasks', require: false
|
||||
gem 'iban-tools'
|
||||
gem 'image_processing'
|
||||
gem 'invisible_captcha'
|
||||
gem 'json_schemer'
|
||||
gem 'jwt'
|
||||
gem 'kaminari'
|
||||
gem 'kredis'
|
||||
gem 'listen' # Required by ActiveSupport::EventedFileUpdateChecker
|
||||
gem 'lograge'
|
||||
gem 'logstash-event'
|
||||
gem 'maintenance_tasks'
|
||||
gem 'matrix' # needed by prawn and not default in ruby 3.1
|
||||
gem 'mini_magick'
|
||||
gem 'net-imap', require: false # See https://github.com/mikel/mail/pull/1439
|
||||
gem 'net-pop', require: false # same
|
||||
gem 'net-smtp', require: false # same
|
||||
gem 'openid_connect'
|
||||
gem 'parsby'
|
||||
gem 'pg'
|
||||
gem 'phonelib'
|
||||
gem 'prawn-rails' # PDF Generation
|
||||
gem 'premailer-rails'
|
||||
gem 'puma' # Use Puma as the app server
|
||||
gem 'pundit'
|
||||
gem 'rack-attack'
|
||||
gem 'rails-i18n' # Locales par défaut
|
||||
gem 'rails-pg-extras'
|
||||
gem 'rake-progressbar', require: false
|
||||
gem 'redcarpet'
|
||||
gem 'redis'
|
||||
gem 'rexml' # add missing gem due to ruby3 (https://github.com/Shopify/bootsnap/issues/325)
|
||||
gem 'rqrcode'
|
||||
gem 'saml_idp'
|
||||
gem 'sassc-rails' # Use SCSS for stylesheets
|
||||
gem 'sentry-delayed_job'
|
||||
gem 'sentry-rails'
|
||||
gem 'sentry-ruby'
|
||||
gem 'sentry-sidekiq'
|
||||
gem 'sib-api-v3-sdk'
|
||||
gem 'sidekiq'
|
||||
gem 'sidekiq-cron'
|
||||
gem 'skylight'
|
||||
gem 'spreadsheet_architect'
|
||||
gem 'strong_migrations' # lint database migrations
|
||||
gem 'sys-proctable'
|
||||
gem 'turbo-rails'
|
||||
gem 'typhoeus'
|
||||
gem 'ulid-ruby', require: 'ulid'
|
||||
gem 'view_component'
|
||||
gem 'vite_rails'
|
||||
gem 'warden'
|
||||
gem 'webrick', require: false
|
||||
gem 'yabeda-graphql'
|
||||
gem 'yabeda-prometheus'
|
||||
gem 'yabeda-puma-plugin'
|
||||
gem 'yabeda-rails'
|
||||
gem 'yabeda-sidekiq'
|
||||
gem 'zipline'
|
||||
gem 'zxcvbn-ruby', require: 'zxcvbn'
|
||||
|
||||
group :test do
|
||||
gem 'axe-core-rspec' # accessibility rspec matchers
|
||||
gem 'capybara' # Integration testing
|
||||
gem 'capybara-email' # Access emails during integration tests
|
||||
gem 'capybara-screenshot' # Save a dump of the page when an integration test fails
|
||||
gem 'factory_bot'
|
||||
gem 'launchy'
|
||||
gem 'rack_session_access'
|
||||
gem 'rails-controller-testing'
|
||||
gem 'rspec_junit_formatter'
|
||||
gem 'rspec-retry'
|
||||
gem 'selenium-devtools'
|
||||
gem 'selenium-webdriver'
|
||||
gem 'shoulda-matchers', require: false
|
||||
gem 'simplecov', require: false
|
||||
gem 'simplecov-cobertura', require: false
|
||||
gem 'timecop'
|
||||
gem 'vcr'
|
||||
gem 'webmock'
|
||||
end
|
||||
|
||||
group :development do
|
||||
gem 'benchmark-ips', require: false
|
||||
gem 'brakeman', require: false
|
||||
gem 'haml-lint'
|
||||
gem 'letter_opener_web'
|
||||
gem 'memory_profiler'
|
||||
gem 'rack-mini-profiler'
|
||||
gem 'rails-erd', require: false # generates `doc/database_models.pdf`
|
||||
gem 'rubocop', require: false
|
||||
gem 'rubocop-performance', require: false
|
||||
gem 'rubocop-rails', require: false
|
||||
gem 'rubocop-rspec', require: false
|
||||
gem 'scss_lint', require: false
|
||||
gem 'stackprof'
|
||||
gem 'web-console'
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
gem 'graphql-schema_comparator'
|
||||
gem 'irb'
|
||||
gem 'mina', require: false # Deploy
|
||||
gem 'rspec-rails'
|
||||
gem 'simple_xlsx_reader'
|
||||
gem 'spring' # Spring speeds up development by keeping your application running in the background
|
||||
gem 'spring-commands-rspec'
|
||||
end
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,66 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
version=
|
||||
gitArgs=
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
i="$1"
|
||||
shift 1
|
||||
case "$i" in
|
||||
--version | -v)
|
||||
version="$1"
|
||||
shift 1
|
||||
;;
|
||||
--git-args)
|
||||
gitArgs="$gitArgs $1"
|
||||
shift 1
|
||||
;;
|
||||
*)
|
||||
echo "$0: unknown option \`$i'"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Create a working environment
|
||||
CWD=$(pwd)
|
||||
|
||||
TMP=$(mktemp -d)
|
||||
cd "$TMP" || exit 1
|
||||
|
||||
# Fetch the latest source or the required version
|
||||
gitUrl="https://github.com/demarches-simplifiees/demarches-simplifiees.fr.git"
|
||||
|
||||
if [ -n "$version" ]; then
|
||||
git clone --depth 1 --branch "$version" $gitUrl .
|
||||
else
|
||||
git clone --depth 1 $gitUrl .
|
||||
|
||||
version="$(git rev-parse HEAD)"
|
||||
fi
|
||||
|
||||
# Generate gemset.nix
|
||||
nix-shell -p bundix --run "bundix -l" >/dev/null
|
||||
|
||||
# Copy the new files
|
||||
cp gemset.nix Gemfile Gemfile.lock "$CWD/rubyEnv/"
|
||||
|
||||
# Print the new source details
|
||||
SRC_HASH=$(nix-shell -p nurl --run "nurl --hash $gitUrl $version")
|
||||
|
||||
# Switch to bun
|
||||
nix-shell -p bun --run "bun install --frozen-lockfile --no-cache --no-progress --ignore-scripts"
|
||||
|
||||
DEPS_HASH=$(nix-hash --sri --type sha256 node_modules)
|
||||
|
||||
cat <<EOF >"$CWD/meta.nix"
|
||||
{
|
||||
version = "$version";
|
||||
src-hash = "$SRC_HASH";
|
||||
deps-hash = "$DEPS_HASH";
|
||||
}
|
||||
EOF
|
||||
|
||||
nix-shell -p nixfmt-rfc-style --run "nixfmt $CWD"
|
||||
|
||||
rm -rf "$TMP"
|
Loading…
Reference in a new issue