Skip to content

Commit

Permalink
Made some JPEG's progressive, did a lot of SEO, updated sitemap.xml, …
Browse files Browse the repository at this point in the history
…updated social media links on the shop page, updated backup.sh script, added mysql schema, added copyright notice
  • Loading branch information
Molnarfi Laszlo committed Apr 20, 2017
1 parent a889bd6 commit 8482621
Show file tree
Hide file tree
Showing 36 changed files with 703 additions and 230 deletions.
14 changes: 14 additions & 0 deletions COPYRIGHZT
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2017 Laszlo Molnarfi
# This file is part of LaciCloud.
#
# LaciCloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# LaciCloud is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this software.
4 changes: 1 addition & 3 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
TODO for LaciCloud:

*Implement the shop page
TODO for LaciCloud:
5 changes: 3 additions & 2 deletions config/misc/crontab
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
#
# m h dom mon dow command

* * * * * cp /var/ftp/scripts/basic_checks.sh /tmp/scripts/basic_checks.sh && chmod +x /tmp/scripts/basic_checks.sh && /tmp/scripts/basic_checks.sh && srm /tmp/scripts/basic_checks.sh
*/5 * * * * cp /var/ftp/scripts/basic_checks.sh /tmp/scripts/basic_checks.sh && chmod +x /tmp/scripts/basic_checks.sh && /tmp/scripts/basic_checks.sh && srm /tmp/scripts/basic_checks.sh
0 0 * * * cp /var/ftp/scripts/clear_unconfirmed_mysql.sh /tmp/scripts/clear_unconfirmed_mysql.sh && chmod +x /tmp/scripts/clear_unconfirmed_mysql.sh && /tmp/scripts/clear_unconfirmed_mysql.sh && srm /tmp/scripts/clear_unconfirmed_mysql.sh
0 0 */3 * * cp /var/ftp/scripts/backup.sh /tmp/scripts/backup.sh && chmod +x /tmp/scripts/backup.sh && /tmp/scripts/backup.sh && srm /tmp/scripts/backup.sh
45 0 * * * logrotate -f /var/ftp/config/logrotate/custom
0,31 * * * * cp /var/ftp/scripts/exitlist.sh /tmp/scripts/exitlist.sh && chmod +x /tmp/scripts/exitlist.sh && /tmp/scripts/exitlist.sh && srm /tmp/scripts/exitlist.sh
*/5 * * * * cp /var/ftp/scripts/gad.sh /tmp/gad.sh && cp /var/ftp/scripts/gadscript.sh /tmp/gadscript.sh && chmod +x /tmp/gad.sh && chmod +x /tmp/gadscript.sh && /tmp/gadscript.sh && srm /tmp/gad.sh && srm /tmp/gadscript.sh
0 * * * * cp /var/ftp/scripts/gad.sh /tmp/gad.sh && cp /var/ftp/scripts/gadscript.sh /tmp/gadscript.sh && chmod +x /tmp/gad.sh && chmod +x /tmp/gadscript.sh && /tmp/gadscript.sh && srm /tmp/gad.sh && srm /tmp/gadscript.sh
* * * * * python /var/ftp/scripts/ftpactions.py
0 0 1 * * /usr/bin/letsencrypt renew && service nginx restart && cat /var/ftp/config/letsencrypt/live/lacicloud.net/privkey.pem /var/ftp/config/letsencrypt/live/lacicloud.net/fullchain.pem > /var/ftp/config/letsencrypt/live/lacicloud.net/pure-ftpd.pem && rm -r /var/ftp/www/developers/localweb/.well-known

8 changes: 1 addition & 7 deletions config/misc/hosts.deny
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@

# DenyHosts: Fri Jan 13 16:55:09 2017 | sshd: 63.143.42.242
sshd: 63.143.42.242
# DenyHosts: Fri Jan 13 16:55:09 2017 | sshd: 69.162.124.237
sshd: 69.162.124.237
# DenyHosts: Mon Jan 16 21:14:11 2017 | sshd: 192.168.1.2
sshd: 192.168.1.2
# DenyHosts: Tue Jan 24 08:26:14 2017 | sshd: 63.143.42.243
# DenyHosts: Sat Mar 25 10:41:51 2017 | sshd: 63.143.42.243
sshd: 63.143.42.243
2 changes: 1 addition & 1 deletion config/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ http {
limit_conn_status 429;

fastcgi_buffers 256 16k;
fastcgi_max_temp_file_size 0;
proxy_max_temp_file_size 0;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
Expand Down
21 changes: 8 additions & 13 deletions config/nginx/sites-enabled/default_ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ server {
try_files $uri $uri.html $uri/index.html @php;
}


#auth_basic "Under Construction";
#auth_basic_user_file /etc/nginx/.localweb_htpasswd;

Expand All @@ -38,16 +37,11 @@ server {
autoindex on;
}

location ^~ /custom/leaks/ {
autoindex on;
}


#allow more for doidices.eu
location ^~ /custom/doidices.eu/ {
limit_conn alpha 100;
}



location = /custom/doidices.eu {
return 301 https://lacicloud.net/custom/doidices.eu/index.html;
Expand All @@ -56,7 +50,7 @@ server {

location = /custom/doidices.eu/ {
return 301 https://lacicloud.net/custom/doidices.eu/index.html;
}
}

location /status {
stub_status on;
Expand All @@ -69,21 +63,22 @@ server {
limit_req zone=api burst=5 nodelay;
}

location ^~ /files/ {
location ^~ /files/ {
proxy_pass https://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header Host $host;
}

#browswer caching
location ~* \.(html|jpg|jpeg|png|gif|ico|css|js|zip|mp4|ogv|m4v|webm|swf)$ {
expires 2h;
location ~* \.(html|jpg|jpeg|png|gif|ico|css|js|zip|mp4|ogv|m4v|webm|swf|ttf|otf)$ {
expires 1d;
}

#add_header Content-Security-Policy "default-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; child-src 'self' *.bitpay.com *.youtube.com blob:; frame-src 'self' *.bitpay.com *.youtube.com; img-src 'self' http.cat *.imgur.com; report-uri https://lacicloud.net/error?error_code=1337" always;
#add_header X-Content-Type-Options "nosniff" always;
#add_header X-XSS-Protection "1; mode=block" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;

add_header Access-Control-Allow-Origin "*" always;

error_page 400 401 403 404 405 406 414 416 415 431 444 /error.php?error_code=404;

error_page 500 501 502 503 504 505 /error.php?error_code=500;
Expand Down
204 changes: 204 additions & 0 deletions mysql/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
-- MySQL dump 10.13 Distrib 5.6.30, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database:
-- ------------------------------------------------------
-- Server version 5.6.30-1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Current Database: `laci_corporations_users`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `laci_corporations_users` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `laci_corporations_users`;

--
-- Table structure for table `captcha_codes`
--

DROP TABLE IF EXISTS `captcha_codes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `captcha_codes` (
`id` varchar(128) NOT NULL DEFAULT '',
`namespace` varchar(32) NOT NULL,
`code` varchar(32) NOT NULL,
`code_display` varchar(32) NOT NULL,
`created` int(11) NOT NULL,
PRIMARY KEY (`id`,`namespace`),
KEY `created` (`created`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `counter`
--

DROP TABLE IF EXISTS `counter`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `counter` (
`count` bigint(20) DEFAULT NULL,
`logins` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `crypto_payments`
--

DROP TABLE IF EXISTS `crypto_payments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `crypto_payments` (
`paymentID` int(11) unsigned NOT NULL AUTO_INCREMENT,
`boxID` int(11) unsigned NOT NULL DEFAULT '0',
`boxType` enum('paymentbox','captchabox') NOT NULL,
`orderID` varchar(50) NOT NULL DEFAULT '',
`userID` varchar(50) NOT NULL DEFAULT '',
`countryID` varchar(3) NOT NULL DEFAULT '',
`coinLabel` varchar(6) NOT NULL DEFAULT '',
`amount` double(20,8) NOT NULL DEFAULT '0.00000000',
`amountUSD` double(20,8) NOT NULL DEFAULT '0.00000000',
`unrecognised` tinyint(1) unsigned NOT NULL DEFAULT '0',
`addr` varchar(34) NOT NULL DEFAULT '',
`txID` char(64) NOT NULL DEFAULT '',
`txDate` datetime DEFAULT NULL,
`txConfirmed` tinyint(1) unsigned NOT NULL DEFAULT '0',
`txCheckDate` datetime DEFAULT NULL,
`processed` tinyint(1) unsigned NOT NULL DEFAULT '0',
`processedDate` datetime DEFAULT NULL,
`recordCreated` datetime DEFAULT NULL,
PRIMARY KEY (`paymentID`),
KEY `boxID` (`boxID`),
KEY `boxType` (`boxType`),
KEY `userID` (`userID`),
KEY `countryID` (`countryID`),
KEY `orderID` (`orderID`),
KEY `amount` (`amount`),
KEY `amountUSD` (`amountUSD`),
KEY `coinLabel` (`coinLabel`),
KEY `unrecognised` (`unrecognised`),
KEY `addr` (`addr`),
KEY `txID` (`txID`),
KEY `txDate` (`txDate`),
KEY `txConfirmed` (`txConfirmed`),
KEY `txCheckDate` (`txCheckDate`),
KEY `processed` (`processed`),
KEY `processedDate` (`processedDate`),
KEY `recordCreated` (`recordCreated`),
KEY `key1` (`boxID`,`orderID`),
KEY `key2` (`boxID`,`orderID`,`userID`),
KEY `key3` (`boxID`,`orderID`,`userID`,`txID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ftpactions`
--

DROP TABLE IF EXISTS `ftpactions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ftpactions` (
`value` text,
`type` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `truespacecounter`
--

DROP TABLE IF EXISTS `truespacecounter`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `truespacecounter` (
`used_space` bigint(20) DEFAULT NULL,
`id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`password` tinytext,
`email` tinytext,
`first_time_boolean` tinyint(1) DEFAULT NULL,
`api_key` tinytext,
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`unique_id` tinytext,
`reset_key` tinytext,
`tier` int(11) NOT NULL DEFAULT '1',
`lastpayment` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
UNIQUE KEY `email_2` (`email`(255)),
UNIQUE KEY `api_key_3` (`api_key`(255)),
UNIQUE KEY `api_key_4` (`api_key`(255)),
UNIQUE KEY `email` (`email`(255)),
UNIQUE KEY `password` (`password`(255)),
UNIQUE KEY `api_key` (`api_key`(255)),
UNIQUE KEY `api_key_2` (`api_key`(200))
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Current Database: `pureftpd`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `pureftpd` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `pureftpd`;

--
-- Table structure for table `ftp_users`
--

DROP TABLE IF EXISTS `ftp_users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ftp_users` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`home` text,
`quota` double DEFAULT NULL,
`user` tinytext,
`password` tinytext,
`uploadspeed` bigint(20) NOT NULL DEFAULT '0',
`downloadspeed` bigint(20) NOT NULL DEFAULT '0',
`realID` bigint(20) DEFAULT NULL,
`expiration` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
UNIQUE KEY `user` (`user`(255)),
UNIQUE KEY `user_2` (`user`(255)),
UNIQUE KEY `user_3` (`user`(255)),
UNIQUE KEY `password` (`password`(255))
) ENGINE=InnoDB AUTO_INCREMENT=3593 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2017-04-19 18:32:27
27 changes: 0 additions & 27 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ password=`cfget -C /var/ftp/www/developers/secrets.ini secrets/bitbucket_passwor
#for mysqldump
export MYSQL_PWD=`cfget -C /var/ftp/www/developers/secrets.ini secrets/mysql_root_password`

#just to be sure
megamkdir /Root/LaciCloudBackup
megamkdir /Root/LaciCloudBackup/users

#backup permissions and structure (filelist) with temporary filename for Mega
find /var/ftp -ls -path /var/ftp/private -prune -o -iname findme -print -iname findme -print > /var/ftp/config/misc/filelist_"$date".txt

Expand All @@ -41,29 +37,6 @@ megaput --path /Root/LaciCloudBackup /var/ftp/config/misc/filelist_"$date".txt
rm /var/ftp/config/misc/filelist_"$date".txt
find /var/ftp -ls -path /var/ftp/private -prune -o -iname findme -print -iname findme -print > /var/ftp/config/misc/filelist.txt

#Sync files to Mega
#Credits to albertolarripa.com/2013/07/10/megatools-synchronizing-your-backups-to-mega

echo "[$BACKUP_TIME][$(hostname)] synchronization to Mega started!" > $LOG

#Obtain the files that do not exist in the local directory

DELETE=`$MEGASYNC --dryrun --reload --download --local $LOCALDIR --remote $REMOTEDIR | sed 's/F '$SEDLOCALDIR'/'$SEDREMOTEDIR'/g'`

#And remove it

for i in $DELETE; do
$MEGARM $i
done

#Run the synchronization program to Mega

SYNC=`$MEGASYNC --local $LOCALDIR --remote $REMOTEDIR`

echo "[$BACKUP_TIME][$(hostname)] synchronization to Mega done!" > $LOG
echo "Files removed $DELETE" >> $LOG
echo "Files synchronized $SYNC" >> $LOG

#cleanup
rm /var/ftp/tmp/backup/*

Expand Down
6 changes: 6 additions & 0 deletions scripts/bootstrap_stage_2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ ln -sf /var/ftp/config/misc/hosts.deny /etc/hosts.deny
ln -sf /var/ftp/config/denyhosts/denyhosts.conf /etc/denyhosts.conf
/etc/init.d/denyhosts restart

#start lm-sensors
service lm-sensors start

#set-up logrotate
ln -sf /var/ftp/config/logrotate/custom /etc/logrotate.d/custom

Expand Down Expand Up @@ -181,5 +184,8 @@ sleep 3
python /root/maltrail/sensor.py &
python /root/maltrail/server.py &

#start mosquitto server
service mosquitto start

exit 0

3 changes: 2 additions & 1 deletion scripts/ftpactions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
#!/usr/bin/python2
#This script does things that PHP by it's configuration is not allowed to, such as access the /var/ftp directory and create symlinks to /var/ftp/public_files
#Python2 only

import MySQLdb
import time
Expand Down
Loading

0 comments on commit 8482621

Please sign in to comment.