From 38f4b0cdcb5be0c46eb040abe81439081270c0c0 Mon Sep 17 00:00:00 2001 From: Jaap Eldering Date: Sat, 23 Nov 2024 10:40:19 +0100 Subject: [PATCH] Install Symfony console in domserver_bindir as dj_console This makes it easily available to admins. --- Makefile | 1 + misc-tools/force-passwords.in | 6 +++--- webapp/Makefile | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8584274dec..fcfd998979 100644 --- a/Makefile +++ b/Makefile @@ -223,6 +223,7 @@ inplace-install-l: ln -sf $(CURDIR)/judge/runpipe $(judgehost_bindir) ln -sf $(CURDIR)/judge/create_cgroups $(judgehost_bindir) ln -sf $(CURDIR)/sql/dj_setup_database $(domserver_bindir) + ln -sf $(CURDIR)/webapp/bin/console $(domserver_bindir)/dj_console # Create tmpdir and make tmpdir writable for webserver, # because judgehost-create-dirs sets wrong permissions: $(MKDIR_P) $(domserver_tmpdir) diff --git a/misc-tools/force-passwords.in b/misc-tools/force-passwords.in index 0dc4331183..505d1cd337 100755 --- a/misc-tools/force-passwords.in +++ b/misc-tools/force-passwords.in @@ -2,7 +2,7 @@ import subprocess -webappdir = '@domserver_webappdir@' +bindir = '@domserver_bindir@' etcdir = '@domserver_etcdir@' subprocess.run([bindir + '/dj_setup_database', 'update-password']) @@ -16,9 +16,9 @@ with open(f'{etcdir}/restapi.secret', 'r') as f: if len(tokens) == 4 and tokens[0] == 'default': user = tokens[2] password = tokens[3] - subprocess.run([webappdir + '/bin/console', 'domjudge:reset-user-password', user, password]) + subprocess.run([bindir + '/dj_console', 'domjudge:reset-user-password', user, password]) break with open(f'{etcdir}/initial_admin_password.secret', 'r') as f: password = f.readline().strip() - subprocess.run([webappdir + '/bin/console', 'domjudge:reset-user-password', 'admin', password]) + subprocess.run([bindir + '/dj_console', 'domjudge:reset-user-password', 'admin', password]) diff --git a/webapp/Makefile b/webapp/Makefile index f4000332c9..5eac62ea13 100644 --- a/webapp/Makefile +++ b/webapp/Makefile @@ -61,6 +61,8 @@ install-domserver: for d in bin config migrations public resources src templates tests vendor; do \ $(call install_tree,$(DESTDIR)$(domserver_webappdir),$$d) ; \ done +# Add Symlink to Symfony console that is in the standard path + ln -s $(domserver_webappdir)/bin/console $(DESTDIR)$(domserver_bindir)/dj_console # Change webapp/public/doc symlink ln -sf $(domjudge_docdir) $(DESTDIR)$(domserver_webappdir)/public/doc $(INSTALL_DATA) -t $(DESTDIR)$(domserver_webappdir) phpunit.xml.dist .env