tinycm rev 32

Warning on first install if content is not writable
author Christophe Lincoln <pankso@slitaz.org>
date Mon Jan 06 20:48:49 2014 +0000 (2014-01-06)
parents 9d1c1115562a
children 4521322899ee
files Makefile index.cgi
line diff
     1.1 --- a/Makefile	Mon Jan 06 18:47:03 2014 +0000
     1.2 +++ b/Makefile	Mon Jan 06 20:48:49 2014 +0000
     1.3 @@ -34,25 +34,20 @@
     1.4  install:
     1.5  	install -m 0700 -d $(DESTDIR)$(LOGIN)/people
     1.6  	install -m 0700 -d $(DESTDIR)$(LOGIN)/auth
     1.7 -	install -m 0755 -d $(DESTDIR)$(WEB)/content
     1.8  	install -m 0755 -d $(DESTDIR)$(WEB)/cache
     1.9  	install -m 0777 -d $(DESTDIR)$(PREFIX)/share/applications
    1.10  	#install -m 0777 -d $(DESTDIR)$(PREFIX)/share/locale
    1.11  	
    1.12  	cp -a config.cgi favicon.ico index.cgi README style.css \
    1.13 -		images lib plugins content $(DESTDIR)$(WEB)
    1.14 +		images lib plugins content/ $(DESTDIR)$(WEB)
    1.15 +	#cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
    1.16 +	install -m 0644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications
    1.17  	
    1.18 -	install -m 0644 data/tinycm.desktop \
    1.19 -		$(DESTDIR)$(PREFIX)/share/applications
    1.20 -	#cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
    1.21 -	
    1.22 -	# Auth system may be used by an other app
    1.23 -	#touch $(DESTDIR)$(LOGIN)/auth/people
    1.24 -	#chmod 0600 $(DESTDIR)$(LOGIN)/auth/people
    1.25 +	# Set permissions
    1.26  	chown -R www.www $(DESTDIR)$(LOGIN)/auth
    1.27  	chown -R www.www $(DESTDIR)$(LOGIN)/people
    1.28 -	chown www.www $(DESTDIR)$(WEB)/content
    1.29 -	chown www.www $(DESTDIR)$(WEB)/cache
    1.30 +	chown -R www.www $(DESTDIR)$(WEB)/content
    1.31 +	chown -R www.www $(DESTDIR)$(WEB)/cache
    1.32  
    1.33  uninstall:
    1.34  	rm -rf $(DESTDIR)$(WEB)
     2.1 --- a/index.cgi	Mon Jan 06 18:47:03 2014 +0000
     2.2 +++ b/index.cgi	Mon Jan 06 20:48:49 2014 +0000
     2.3 @@ -108,8 +108,9 @@
     2.4  	cat > $wiki/$index.txt << EOT
     2.5  ==== Welcome ====
     2.6  
     2.7 -This is the default index page of your CM, you can start to edit and adding
     2.8 -some content to your TinyCM.
     2.9 +This is the default index page of your TinyCM, you can login then start to
    2.10 +edit and adding some content. You can read the help about text formating
    2.11 +and functions: <a href='?d=en/help'>Help page</a>
    2.12  
    2.13  EOT
    2.14  }
    2.15 @@ -732,6 +733,10 @@
    2.16  		# Generate a default index on first run.
    2.17  		if [ ! -f "$wiki/$index.txt" ]; then
    2.18  			default_index
    2.19 +			if [ ! -f "$wiki/$index.txt" ]; then
    2.20 +				echo "<pre class='error'>Directory: content/ is not writable</pre>"
    2.21 +				html_footer && exit 0
    2.22 +			fi
    2.23  		fi
    2.24  		if [ ! -f "$wiki/$d.txt" ]; then
    2.25  			echo "<h2>$d</h2>"