Skip to content

Commit

Permalink
Install Symfony console in domserver_bindir as dj_console
Browse files Browse the repository at this point in the history
This makes it easily available to admins.
  • Loading branch information
eldering committed Nov 25, 2024
1 parent 7ab1eab commit 38f4b0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions misc-tools/force-passwords.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import subprocess

webappdir = '@domserver_webappdir@'
bindir = '@domserver_bindir@'
etcdir = '@domserver_etcdir@'

subprocess.run([bindir + '/dj_setup_database', 'update-password'])
Expand All @@ -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])
2 changes: 2 additions & 0 deletions webapp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38f4b0c

Please sign in to comment.