# HG changeset patch # User wenzelm # Date 1572983235 -3600 # Node ID 4eeff87c5072989001ecfd62e1f38553ad1c7fb8 # Parent 8198ceef0301475261852e213a03ae407b7dd4ee more phabricator setup; diff -r 8198ceef0301 -r 4eeff87c5072 src/Pure/System/linux.scala --- a/src/Pure/System/linux.scala Tue Nov 05 17:32:40 2019 +0100 +++ b/src/Pure/System/linux.scala Tue Nov 05 20:47:15 2019 +0100 @@ -114,6 +114,9 @@ def service_stop(name: String): Unit = Isabelle_System.bash("systemctl stop " + Bash.string(name)).check + def service_restart(name: String): Unit = + Isabelle_System.bash("systemctl restart " + Bash.string(name)).check + def service_install(name: String, spec: String) { val service_file = Path.explode("/lib/systemd/system") + Path.basic(name).ext("service") diff -r 8198ceef0301 -r 4eeff87c5072 src/Pure/Tools/phabricator.scala --- a/src/Pure/Tools/phabricator.scala Tue Nov 05 17:32:40 2019 +0100 +++ b/src/Pure/Tools/phabricator.scala Tue Nov 05 20:47:15 2019 +0100 @@ -166,6 +166,8 @@ val config = Config(name, root_path) write_config(configs ::: List(config)) + config.execute("config set pygments.enabled true") + /* local repository directory */ @@ -187,6 +189,16 @@ progress.echo("MySQL setup...") + File.write(Path.explode("/etc/mysql/mysql.conf.d/phabricator.cnf"), +"""[mysqld] +max_allowed_packet = 32M +innodb_buffer_pool_size = 1600M +local_infile = 0 +""") + + Linux.service_restart("mysql") + + def mysql_conf(R: Regex): Option[String] = split_lines(File.read(Path.explode(options.string("phabricator_mysql_config")))). collectFirst({ case R(a) => a }) @@ -202,6 +214,8 @@ config.execute("config set storage.default-namespace " + Bash.string(prefix_name.replace("-", "_"))) + config.execute("config set storage.mysql-engine.max-size 8388608") + config.execute("storage upgrade --force") @@ -247,6 +261,22 @@ Isabelle_System.bash("chmod 0440 " + File.bash_path(sudoers_file)).check + /* PHP setup */ + + val php_version = + Isabelle_System.bash("""php --run 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;'""") + .check.out + + val php_conf = + Path.explode("/etc/php") + Path.basic(php_version) + // educated guess + Path.explode("apache2/conf.d/phabricator.ini") + + File.write(php_conf, + "post_max_size = 32M\n" + + "opcache.validate_timestamps = 0\n" + + "memory_limit = 512M\n") + + /* Apache setup */ progress.echo("Apache setup...") @@ -271,12 +301,12 @@ # vim: syntax=apache ts=4 sw=4 sts=4 sr noet """) - Isabelle_System.bash(""" + Isabelle_System.bash( """ set -e a2enmod rewrite - a2ensite """ + Bash.string(prefix_name) + """ - systemctl restart apache2 -""").check + a2ensite """ + Bash.string(prefix_name)).check + + Linux.service_restart("apache2") progress.echo("\nDONE\nWeb configuration via http://" + prefix_name + ".lvh.me") }