소스 검색

Merge branch 'master' of git.superglue.it:superglue/serverfiles

Michael 10 년 전
부모
커밋
1884067c6e

+ 1 - 1
openwrt/DIR505A1/etc/config/system

@@ -1,5 +1,5 @@
 config system
-  option hostname 'sg'
+  option hostname 'superglue'
   ## Made in Berlin
   option timezone 'CET-1CEST'
 

+ 3 - 4
openwrt/TLWR710/etc/config/system

@@ -1,8 +1,7 @@
-
 config system
-  option hostname 'sg'
-  ## Made in Berlin
-	option timezone 'CET-1CEST'
+  option hostname 'superglue'
+  ## Made in Berlin 
+  option timezone 'CET-1CEST'
 
 config timeserver 'ntp'
 	list server '0.openwrt.pool.ntp.org'

+ 1 - 1
openwrt/common/etc/banner

@@ -5,7 +5,7 @@
            |_|   personal |___| server
  http://superglue.it 
  -----------------------------------------------------
- based on OpenWRT r40774 (trunk)
+ version %VERSION% - based on OpenWRT %REVISION%
  -----------------------------------------------------
  provides now:            will provide:
    * HTTP (lighttpd)        * SMTP      

+ 2 - 2
openwrt/common/etc/config/dhcp

@@ -6,8 +6,8 @@ config dnsmasq
 	option localise_queries '1'
 	option rebind_protection '1'
 	option rebind_localhost '1'
-	option local '/lan/'
-	option domain 'lan'
+	option local '/home/'
+	option domain 'home'
 	option expandhosts '1'
 	option nonegcache '0'
 	option authoritative '1'

+ 7 - 6
openwrt/common/etc/config/fstab

@@ -10,12 +10,13 @@ config 'global' 'automount'
   option  'from_fstab'  '1' 
   option  'anon_mount'  '0' 
 
-config 'mount'
-  option 'label'        'sg-user'
-  option 'target'       '/www/htdocs'
-  option 'enabled'      '1' 
-  option 'enabled_fsck' '0' 
-  option 'options'      'noatime,nodiratime'
+## btrfs is not picked up here
+#config 'mount'
+#  option 'label'        'sg-user'
+#  option 'target'       '/www/htdocs'
+#  option 'enabled'      '1' 
+#  option 'enabled_fsck' '0' 
+#  option 'options'      'noatime,nodiratime'
 
 ## this is for vfat
 #config 'mount'

+ 0 - 1
openwrt/common/etc/config/network

@@ -1,4 +1,3 @@
-
 config interface 'loopback'
 	option ifname 'lo'
 	option proto 'static'

+ 2 - 0
openwrt/common/etc/crontabs/root

@@ -0,0 +1,2 @@
+1 6 * * *	/root/logrotate.sh /www/htdocs/logs/access.log; /root/logrotate.sh /www/htdocs/logs/error.log; /etc/init.d/lighttpd restart
+

+ 3 - 0
openwrt/common/etc/firewall.user

@@ -5,6 +5,9 @@
 # allow Superglue!
 iptables -A input_rule -p tcp --dport 80 -j ACCEPT
 
+# allow SSH
+# iptables -A input_rule -p tcp --dport 22 -j ACCEPT
+
 # Internal uci firewall chains are flushed and recreated on reload, so
 # put custom rules into the root chains e.g. INPUT or FORWARD or into the
 # special user chains, e.g. input_wan_rule or postrouting_lan_rule.

+ 8 - 8
openwrt/common/etc/lighttpd/lighttpd.conf

@@ -74,13 +74,13 @@ $HTTP["request-method"] == "POST" {
    }
 }
 
-#auth.require = ( 
-#  "/post.sh" => ( "method" => "digest", 
-#                  "realm" => "superglue", 
-#                  "require" => "valid-user" ),
-#  "/admin" => ( "method" => "digest", 
-#                  "realm" => "superglue", 
-#                  "require" => "valid-user" )
-#)
+auth.require = ( 
+  "/post.sh" => ( "method" => "digest", 
+                  "realm" => "superglue", 
+                  "require" => "valid-user" ),
+  "/admin" => ( "method" => "digest", 
+                  "realm" => "superglue", 
+                  "require" => "valid-user" )
+)
 
 include "/etc/lighttpd/mime.conf"

+ 3 - 2
openwrt/common/etc/lighttpd/mime.conf

@@ -70,8 +70,9 @@ mimetype.assign             = (
   ".mp4"          =>      "video/mp4",
   ".webm"         =>      "video/webm; codecs='vorbis'",
   ".ogv"          =>      "video/ogg",
-  ""              =>      "text/html",
-# ""              =>      "application/octet-stream",
+  ".ttf"          =>  	  "application/font-sfnt",
+  ".otf"          =>  	  "application/font-sfnt",
+  ""              =>      "text/html"
  )
 
 

+ 9 - 1
openwrt/common/etc/rc.local

@@ -4,7 +4,11 @@
 _SG=/www/htdocs
 
 ## mount if needed
-mountpoint -q $_SG || block mount $_SG
+#mountpoint -q $_SG || block mount $_SG
+#mountpoint -q $_SG || mount -L sg-user -o rw,noatime,nodiratime $_SG
+
+## this seems to be the only way to mount btrfs on boot, ups                                                                       
+(sleep 15; mount /dev/sda3 -o rw,noatime,nodiratime $_SG 
 
 ## if /www is mounted
 mountpoint -q $_SG && (
@@ -41,4 +45,8 @@ mountpoint -q $_SG && (
 
   )
 
+## needed to make lighty use mounted location for logs
+/etc/init.d/lighttpd restart
+)&
+
 exit 0

+ 1 - 1
openwrt/common/etc/uci-defaults/20-set-ssid

@@ -1,5 +1,5 @@
 _MAC=$(iw wlan0 info | awk 'BEGIN { FS=":" } /addr/ { print $5$6 }')                 
-_MAC="SuperGlue-"$_MAC                                                               
+_MAC="Superglue-"$_MAC                                                               
 
 [ $(uci get wireless.@wifi-iface[0].ssid) != $_MAC ] && (
   uci set wireless.@wifi-iface[0].ssid=$_MAC

+ 11 - 0
openwrt/common/root/logrotate.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+_FILE=$1
+_DATE=$(date +%s)
+
+gzip -f $_FILE && 
+mv $_FILE.gz $_FILE.$_DATE.gz
+
+
+
+

+ 26 - 67
openwrt/common/www/htdocs/default.html

@@ -1,69 +1,28 @@
 <!DOCTYPE html>
-<html lang="de">
-	<head class="html5">
-		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-		<meta name="generator" content="SuperGlue">
-		<meta name="generator-version" content="0.1">
-		<title>SuperGlue Rocks!</title>
-		<link rel="stylesheet" href="../resources/default/css/normalize.css">
-		<link rel="stylesheet" href="../resources/default/css/style.css">
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
-		<style type="text/css"></style>
+<html>
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="generator" content="Superglue" data-superglue-version="1.0" data-superglue-settings="">
+		<title>Superglue test</title>
+		<style type="text/css" data-superglue="default-css">
+			body { margin: 0px; padding: 0px; }
+			#sg-page { position: relative; top: 0px; }
+			#sg-page.sg-page-centered { margin: 0px auto; }
+			.sg-element { position: absolute; overflow: hidden; }
+		</style>
+		<link rel="stylesheet" href="/resources/css/SuperGlue.css" data-superglue="text-css">
 	</head>
-	<body class="space root" data-type="AbsoluteSpace" data-grid-size="29" style="height: 370px; width: 868px; background-color: rgb(153, 151, 161); overflow: visible;"><div class="spaceContent" style="">
-		<div class="shape" data-type="TextShape" style="position: absolute; left: 431px; top: 222px; width: 407px; height: 88px; z-index: 2; margin-left: inherit;"><div class="shapeContent" style="border-width: 0px; border-color: transparent; background-color: transparent; background-image: none; padding: 0px; display: block; background-repeat: repeat repeat;"><b style="font-family: Dosis; font-size: 32px;"><span style="font-family: Montserrat; font-size: 14px; color: rgb(213, 1, 1);">NO STORAGE IS&nbsp;AVAILABLE !!!<br>PLEASE MAKE SURE YOUR USB DRIVE IS CONNECTED<br></span></b><span style="font-family: Dosis; font-size: 32px;"><b><br></b></span></div></div>
-		<div class="shape" data-type="TextShape" style="position: absolute; left: 427px; top: 177px; width: 252px; height: 43px; z-index: 1; margin-left: inherit;"><div class="shapeContent" style="border-width: 0px; border-color: transparent; background-color: transparent; background-image: none; padding: 0px; display: block; background-repeat: repeat repeat;"><span style="font-size: 32px;"><b><span style="font-size: 40px; font-family: Montserrat;">SUPERGLUE</span><br><br></b></span></div></div>
-		<div class="shape" data-type="ImageShape" style="position: absolute; left: 315px; top: 75px; width: 120px; height: 227px; z-index: 0; margin-left: inherit;"><img class="shapeContent" src="../resources/default/img/placeholder.png"></div>
-	</div></body>
-</html>
+	<body style="background-color: rgb(153, 151, 161); background-repeat: repeat;">
+		<div id="sg-page" class="sg-page-centered" style="width: 1156px;" data-superglue-grid="off/7px">
+			<div class="sg-element" data-superglue-type="ImageElement" style="left: 193px; top: 93px; width: 105px; height: 225px;">
+	<div style="width: 100%; height: 100%; background-image: url(/resources/default/img/superglueLogo.png); background-repeat: repeat-y;"></div>
+			</div>
+			<div class="sg-element" data-superglue-type="TextElement" style="left: 313px; top: 193px; width: 270px; height: 55px;">
+<p style="font-size: 40px; font-family: Sans;"><span style="font-family: Montserrat;"><b><span style="font-size: 40px;">SUPERGLUE</span></b></span></p>
+			</div>
+			<div class="sg-element" data-superglue-type="TextElement" style="left: 315px; top: 266px; width: 456px; height: 80px;">
+<span style="font-size: 14px; font-family: Montserrat;"><b></b></span><span style="font-size: 14px; font-family: Montserrat;"><b><span style="color: rgb(214, 44, 44); font-size: 14px;">NO STORAGE IS AVAILABLE !!</span></b></span><div><font color="#d62c2c" face="Montserrat"><span style="font-size: 14px;"><b><br></b></span></font><div><b style="font-family: Montserrat; color: rgb(214, 44, 44);"><span style="font-size: 14px;">PLEASE MAKE SURE YOUR USB DRIVE IS CONNECTED</span></b><br></div></div>
+			</div>
+		</div>
+	</body>
+</html>

+ 1 - 1
openwrt/common/www/lib/admin/admin.sh

@@ -202,7 +202,7 @@ showMesg() {
   fi
   htmlHead "<meta http-equiv='refresh' content='5;url=${HTTP_REFERER}'>"
   echo "<body>
-<img src='/resources/default/img/placeholder.png' class='logo'>
+<img src='/resources/img/superglueLogo.png' class='logo'>
 <hr>
 <h2 style='display:inline'>$_TYPE $_MSG</h2>
 <span style='display:inline; margin-left: 50px;'>$_SUBMSG</span>

BIN
openwrt/common/www/lib/resources/img/superglueLogo.png


+ 2 - 0
openwrt/make_fw.sh

@@ -41,6 +41,8 @@ for _TARGET in $_TARGETS; do
   cp -Ra $_COMMON $_TARGET.tmp
   cp -Ra $_TARGET/* $_TARGET.tmp/
 
+  sed -e "s/%REVISION%/$_OPENWRT/g" -e "s/%VERSION%/$_VERSION/g" $_COMMON/etc/banner > $_TARGET.tmp/etc/banner
+
   echo $_VERSION > $_TARGET.tmp/etc/superglue_version
   cd $_IMAGEBUILDER && make clean