This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 3b309cf status
3b309cf is described below
commit 3b309cf836fd9f3002a17138159a47d477cca060
Author: Sam Ruby <[email protected]>
AuthorDate: Sat Nov 30 15:29:44 2019 -0500
status
---
config/setupmymac | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/config/setupmymac b/config/setupmymac
index c09790c..26436d5 100755
--- a/config/setupmymac
+++ b/config/setupmymac
@@ -229,6 +229,10 @@ directories = [
'/srv/whimsy/www/public',
]
+files = [
+ '/srv/whimsy/www/status/status.json'
+]
+
directories.each do |dir|
sudo {run 'mkdir', '-p', dir} unless Dir.exist? dir
@@ -237,6 +241,14 @@ directories.each do |dir|
end
end
+files.each do |file|
+ sudo {run 'touch', file} unless File.exist? file
+
+ unless File.stat(file).uid == uid
+ sudo {run 'chown', "#{uid}:#{gid}", file}
+ end
+end
+
### Docker installation
if option == :docker
@@ -343,7 +355,7 @@ end
### Collate minutes
if Process.uid != 0
- if force[:minutes] or not Dir.exist? '/srv/svn/www/board/minutes'
+ if force[:minutes] or not Dir.exist? '/srv/whimsy/www/board/minutes'
run 'tools/collate_minutes.rb'
end
end
@@ -379,6 +391,8 @@ HTTPD_CONF = '/etc/apache2/httpd.conf'
config = File.read(HTTPD_CONF)
+# uncomment necessary modules
+
instructions = File.read(File.expand_path('../MACOSX.md', __dir__))
section = instructions[/^Configure whimsy.local vhost\n--+\n.*?\n--/m]
@@ -397,15 +411,26 @@ end
config += "\n" unless config.end_with? "\n"
+# add additional lines from the instructions
+
add.scan(/^\S.*/).each do |line|
if config !~ /^\s*#{line}\s*$/
config += "#{line}\n"
end
end
+# run under the specified user
+
config[/^User\s+(.*)/, 1] = user
config[/^Group\s+(.*)/, 1] = group
+# add index.cgi to DirectoryIndex
+unless config =~ /^\s*DirectoryIndex\s+.*index\.cgi\b/i
+ config[/^\s*DirectoryIndex\s.*()/, 1] = ' index.cgi'
+end
+
+# replace configuration file if changed
+
if config != File.read(HTTPD_CONF)
sudo do
color "$ edit #{HTTPD_CONF}"