├── desktop_gui ├── Stormy │ ├── gui │ │ ├── __init__.py │ │ ├── components │ │ │ ├── __init__.py │ │ │ └── logoImage.py │ │ ├── howToWidget.py │ │ ├── installWidget.py │ │ ├── completeWidget.py │ │ ├── mainWidget.py │ │ ├── helpWidget.py │ │ └── homeWidget.py │ ├── __init__.py │ ├── assets │ │ ├── how_to │ │ │ ├── irc.html │ │ │ ├── ghost.html │ │ │ ├── jabber.html │ │ │ ├── stormy.html │ │ │ ├── web.html │ │ │ └── cozy.html │ │ ├── images │ │ │ └── logo.png │ │ └── shell_script │ │ │ ├── installer │ │ │ ├── irc.sh │ │ │ ├── cozy.sh │ │ │ ├── ghost.sh │ │ │ ├── jabber.sh │ │ │ └── web.sh │ │ │ └── visit_service │ │ │ ├── irc.sh │ │ │ ├── cozy.sh │ │ │ ├── ghost.sh │ │ │ ├── jabber.sh │ │ │ └── web.sh │ ├── models │ │ ├── __init__.py │ │ └── shellScriptExecutor.py │ ├── controllers │ │ ├── __init__.py │ │ ├── homeController.py │ │ ├── helpController.py │ │ ├── howToController.py │ │ ├── installController.py │ │ └── completeController.py │ └── apps.py ├── Stormy.egg-info │ ├── dependency_links.txt │ ├── top_level.txt │ ├── PKG-INFO │ └── SOURCES.txt ├── README.txt ├── setup.cfg ├── MANIFEST.in ├── PKG-INFO ├── StormyApps └── setup.py ├── roadmap_notes.md ├── design ├── logo1.png ├── logo1.xcf ├── logo-small.png ├── logo2-small.png └── wireframes │ ├── 1-home.png │ ├── 3-help.png │ ├── 2-how-to.png │ ├── 4-install.png │ └── 5-complete.png ├── .gitignore ├── README.md ├── stormy.1 ├── one-click-blog.sh ├── stormy.sh ├── one-click-jabber.sh └── LICENSE /desktop_gui/Stormy/gui/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /desktop_gui/Stormy.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /desktop_gui/Stormy.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | Stormy 2 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/how_to/irc.html: -------------------------------------------------------------------------------- 1 | How to use IRC. -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/how_to/ghost.html: -------------------------------------------------------------------------------- 1 | How to use ghost. -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/how_to/jabber.html: -------------------------------------------------------------------------------- 1 | How to use jabber. -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/how_to/stormy.html: -------------------------------------------------------------------------------- 1 | how to use Stormy. -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/how_to/web.html: -------------------------------------------------------------------------------- 1 | How to use web server. -------------------------------------------------------------------------------- /desktop_gui/README.txt: -------------------------------------------------------------------------------- 1 | Stormy are software installer with GUI. 2 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/models/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | -------------------------------------------------------------------------------- /roadmap_notes.md: -------------------------------------------------------------------------------- 1 | ###Features 2 | 3 | ###Misc/All scripts 4 | 5 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/controllers/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/gui/components/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | -------------------------------------------------------------------------------- /design/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/design/logo1.png -------------------------------------------------------------------------------- /design/logo1.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/design/logo1.xcf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | stormy_outline 3 | .c9revisions 4 | .hypnotoad 5 | incremental* 6 | -------------------------------------------------------------------------------- /design/logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/design/logo-small.png -------------------------------------------------------------------------------- /design/logo2-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/design/logo2-small.png -------------------------------------------------------------------------------- /desktop_gui/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = 3 | tag_date = 0 4 | tag_svn_revision = 0 5 | 6 | -------------------------------------------------------------------------------- /design/wireframes/1-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/design/wireframes/1-home.png -------------------------------------------------------------------------------- /design/wireframes/3-help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/design/wireframes/3-help.png -------------------------------------------------------------------------------- /design/wireframes/2-how-to.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/design/wireframes/2-how-to.png -------------------------------------------------------------------------------- /design/wireframes/4-install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/design/wireframes/4-install.png -------------------------------------------------------------------------------- /design/wireframes/5-complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/design/wireframes/5-complete.png -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glamrock/Stormy/HEAD/desktop_gui/Stormy/assets/images/logo.png -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/how_to/cozy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Cozy How To 4 | 5 | 6 |

How To Use Cozy

7 | 8 | How to use cozy content. 9 | 10 | 11 | -------------------------------------------------------------------------------- /desktop_gui/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include StormyApps README.txt 2 | 3 | recursive-include Stormy/assets/how_to *.html 4 | recursive-include Stormy/assets/images *.png 5 | recursive-include Stormy/assets/shell_script/installer *.sh 6 | recursive-include Stormy/assets/shell_script/visit_service *.sh 7 | -------------------------------------------------------------------------------- /desktop_gui/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: Stormy 3 | Version: 0.1.0 4 | Summary: Stormy software installer. 5 | Home-page: http://pypi.python.org/pypi/Stormy/ 6 | Author: stormy author 7 | Author-email: author@stormy.com 8 | License: UNKNOWN 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /desktop_gui/Stormy.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: Stormy 3 | Version: 0.1.0 4 | Summary: Stormy software installer. 5 | Home-page: http://pypi.python.org/pypi/Stormy/ 6 | Author: stormy author 7 | Author-email: author@stormy.com 8 | License: UNKNOWN 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /desktop_gui/StormyApps: -------------------------------------------------------------------------------- 1 | ##This will work in development on a relative folder basis 2 | ##It will then work when installed in site-packages on a target system 3 | ##where the runner script is in /usr/bin (or wherever) 4 | ## 5 | ##So, you don't need anything special - no fancy path tri 6 | import Stormy.apps 7 | 8 | Stormy.apps.start() 9 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/installer/irc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "IRC installer Starting" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Installing irc step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "IRC installer finish!" -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/installer/cozy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Cozy installer Starting" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Installing cozy step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "Cozy installer finish!" 14 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/installer/ghost.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Ghost installer Starting" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Installing ghost step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "Ghost installer finish!" -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/installer/jabber.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Jabber installer Starting" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Installing jabber step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "Jabber installer finish!" -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/installer/web.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Web Server installer Starting" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Installing web server step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "Web Server installer finish!" -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/visit_service/irc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Try to find irc service location:" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Finding irc service location step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "IRC is located at : /usr/bin/irc!" 14 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/visit_service/cozy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Try to find cozy service locaktion:" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Finding cozy service location step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "Cozy is located at : /usr/bin/cozy!" 14 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/visit_service/ghost.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Try to find ghost service locaktion:" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Finding ghost service location step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "Ghost is located at : /usr/bin/ghost!" 14 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/visit_service/jabber.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Try to find jabber service locaktion:" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Finding jabber service location step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "Jabber is located at : /usr/bin/jabber!" 14 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/assets/shell_script/visit_service/web.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Try to find web server service location:" 3 | echo "----------------------------------" 4 | 5 | c=1 6 | while [ $c -le 10 ] 7 | do 8 | echo "Finding web server service location step " $c 9 | (( c++ )) 10 | sleep 1 # 11 | done 12 | echo "==================================" 13 | echo "Web Server is located at : /usr/bin/apache2!" 14 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/controllers/homeController.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | 3 | class HomeController(): 4 | 5 | def __init__(self, mainWidget): 6 | self.mainWidget = mainWidget 7 | 8 | def goToHome(self): 9 | # cek for other installation in progress. will show popup and stop execution 10 | if self.mainWidget.otherInstallationOnProgress() : 11 | return 12 | 13 | # data for widget 14 | 15 | # show install widget with specific software data 16 | self.mainWidget.stack.setCurrentWidget( self.mainWidget.homeWidget ) -------------------------------------------------------------------------------- /desktop_gui/Stormy/apps.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | 3 | import sys, os 4 | 5 | from Stormy.gui.mainWidget import MainWidget 6 | from PyQt4.QtGui import * 7 | 8 | # if not root...kick out 9 | if not os.geteuid()==0: 10 | sys.exit("\nOnly root can run Stormy\n") 11 | 12 | def start(): 13 | # apps directory for "Stormy" 14 | appsDir = os.path.dirname(os.path.abspath(__file__)) 15 | 16 | app = QApplication(sys.argv) 17 | w = MainWidget() 18 | w.setWindowTitle("Stormy") 19 | # append appsDir data to mainWidget 20 | w.appsDir = appsDir 21 | w.show() 22 | app.exec_() 23 | sys.exit() 24 | 25 | if __name__ == "__main__": 26 | start() 27 | 28 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/controllers/helpController.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | 3 | import webbrowser 4 | 5 | class HelpController(): 6 | 7 | def __init__(self, mainWidget): 8 | self.mainWidget = mainWidget 9 | 10 | def showHelp(self): 11 | # cek for other installation in progress. will show popup and stop execution 12 | if self.mainWidget.otherInstallationOnProgress() : 13 | return 14 | # data for widget 15 | 16 | # show install widget with specific software data 17 | self.mainWidget.stack.setCurrentWidget( self.mainWidget.helpWidget ) 18 | 19 | def openInWebBrowser(self, url): 20 | webbrowser.open( url ) 21 | -------------------------------------------------------------------------------- /desktop_gui/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup( 4 | 5 | # Application name: 6 | name="Stormy", 7 | 8 | # Version number (initial): 9 | version="0.1.0", 10 | 11 | # Application author details: 12 | author="stormy author", 13 | author_email="author@stormy.com", 14 | 15 | scripts = ["StormyApps"], # scrypt for first call on this apps 16 | 17 | # Packages 18 | packages=find_packages(), 19 | 20 | include_package_data=True, 21 | package_data={'Stormy': ['Stormy/assets/how_to/*'], 'Stormy': ['Stormy/assets/images/*'], 'Stormy': ['Stormy/assets/shell_script/installer/*'], 'Stormy': ['Stormy/assets/shell_script/visit_service/*']}, 22 | 23 | # Details 24 | url="http://pypi.python.org/pypi/Stormy/", 25 | 26 | # license="LICENSE.txt", 27 | description="Stormy software installer.", 28 | 29 | # long_description=open("README.txt").read(), 30 | 31 | ) 32 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/gui/components/logoImage.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | 3 | import os 4 | from PyQt4.QtGui import * 5 | from PyQt4.QtCore import * 6 | 7 | try: 8 | _fromUtf8 = QString.fromUtf8 9 | except AttributeError: 10 | def _fromUtf8(s): 11 | return s 12 | 13 | try: 14 | _encoding = QApplication.UnicodeUTF8 15 | def _translate(context, text, disambig): 16 | return QApplication.translate(context, text, disambig, _encoding) 17 | except AttributeError: 18 | def _translate(context, text, disambig): 19 | return QApplication.translate(context, text, disambig) 20 | 21 | class LogoImage(QLabel): 22 | 23 | def __init__(self, QWidget): 24 | super(LogoImage, self).__init__(QWidget) 25 | 26 | scriptDir = os.path.dirname(os.path.abspath(__file__)) 27 | imagesDir = scriptDir + "/../.." +"/assets/images" 28 | logoImageFile = imagesDir + "/" +"logo.png" 29 | logoPixmap = QPixmap(logoImageFile) 30 | logoPixmap = logoPixmap.scaledToHeight(141) 31 | logoPixmap = logoPixmap.scaledToWidth(101) 32 | self.setPixmap(logoPixmap) 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ##Notice 3 | Stormy is currently under heavy development, and only usable by developers. 4 | 5 | Stormy 6 | ========= 7 | 8 | *Stormy* is a wizard to help people create Tor Onion Services with just a couple of clicks. Originally, it was setup to install Ghost (a swanky nodejs-based blog platform), but has since expanded to include Jabber, IRC, Cozy (personal cloud), and Diaspora (social media) options. 9 | 10 | 11 | ##Options 12 | 13 | Running `one-click-blog.sh` will install Ghost and Tor, as well as configuring torrc and nginx. 14 | 15 | Running `stormy.sh` will guide you through several options to set up a Tor onion service that meets your needs. 16 | 17 | There are plans to package Stormy in the future. 18 | 19 | **Reminder:** Always create onion sites and services on *their own machine*. ***Always***. 20 | 21 | ###Dependencies 22 | * Ghost 23 | * Python 2.4+ 24 | * Nodejs 25 | * npm: supervisor 26 | 27 | ###[Roadmap & Ideas](https://github.com/glamrock/Stormy/blob/master/roadmap_notes.md) 28 | 29 | ###License 30 | All code is licensed under GPL, a supervillain-friendly license. I'm still working on the [evil laugh](http://www.youtube.com/watch?v=IGqwqxRF598). 31 | 32 | ![Ignore Me!](http://i.imgur.com/1xV099o.jpg) 33 | -------------------------------------------------------------------------------- /stormy.1: -------------------------------------------------------------------------------- 1 | .TH STORMY 1 2 | .SH NAME 3 | stormy \- install and configure tor onion services 4 | .SH SYNOPSIS 5 | .B stormy 6 | [option] 7 | .SH DESCRIPTION 8 | .B stormy 9 | install and configure tor onion services 10 | .SH EXAMPLES 11 | .TP 12 | .BR stormy 13 | Starts Stormy's wizard to guide you through options for setup. 14 | .TP 15 | .BR "stormy --ghost" 16 | Installs the Ghost blogging platform and configures the onion service. 17 | .SH OPTIONS 18 | .TP 19 | .BR \-\-wizard 20 | Launches the wizard manually. 21 | .TP 22 | .BR \-g ", " \-\-ghost 23 | Installs the Ghost blogging platform and configures the onion service. 24 | .TP 25 | .BR \-\-cozy ", " \-\-cloud 26 | Sets up Cozy Cloud and all modules (calendar, tasklist, files) 27 | .TP 28 | .BR \-\-rss 29 | Installs tt-rss reader for lightweight, censorship-resistant reading of RSS feeds. 30 | .TP 31 | .BR \-w ", " \-\-website 32 | Installs a basic webserver with hidden service, ready for users to add their static website. 33 | .TP 34 | .BR \-t ", " \-\-tor 35 | Configures only the tor settings. Ideal for offering an existing website as an onion site. 36 | .TP 37 | .BR \-\-irc 38 | Installs and configures an IRC server (ircd-hybrid) 39 | .TP 40 | .BR \-\-jabber 41 | Configures ejabberd XMPP chat server for use with a client. -------------------------------------------------------------------------------- /desktop_gui/Stormy.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | MANIFEST.in 2 | README.txt 3 | StormyApps 4 | setup.py 5 | Stormy/__init__.py 6 | Stormy/apps.py 7 | Stormy.egg-info/PKG-INFO 8 | Stormy.egg-info/SOURCES.txt 9 | Stormy.egg-info/dependency_links.txt 10 | Stormy.egg-info/top_level.txt 11 | Stormy/assets/how_to/cozy.html 12 | Stormy/assets/how_to/ghost.html 13 | Stormy/assets/how_to/irc.html 14 | Stormy/assets/how_to/jabber.html 15 | Stormy/assets/how_to/stormy.html 16 | Stormy/assets/how_to/web.html 17 | Stormy/assets/images/logo.png 18 | Stormy/assets/shell_script/installer/cozy.sh 19 | Stormy/assets/shell_script/installer/ghost.sh 20 | Stormy/assets/shell_script/installer/irc.sh 21 | Stormy/assets/shell_script/installer/jabber.sh 22 | Stormy/assets/shell_script/installer/web.sh 23 | Stormy/assets/shell_script/visit_service/cozy.sh 24 | Stormy/assets/shell_script/visit_service/ghost.sh 25 | Stormy/assets/shell_script/visit_service/irc.sh 26 | Stormy/assets/shell_script/visit_service/jabber.sh 27 | Stormy/assets/shell_script/visit_service/web.sh 28 | Stormy/controllers/__init__.py 29 | Stormy/controllers/completeController.py 30 | Stormy/controllers/helpController.py 31 | Stormy/controllers/homeController.py 32 | Stormy/controllers/howToController.py 33 | Stormy/controllers/installController.py 34 | Stormy/gui/__init__.py 35 | Stormy/gui/completeWidget.py 36 | Stormy/gui/helpWidget.py 37 | Stormy/gui/homeWidget.py 38 | Stormy/gui/howToWidget.py 39 | Stormy/gui/installWidget.py 40 | Stormy/gui/mainWidget.py 41 | Stormy/gui/components/__init__.py 42 | Stormy/gui/components/logoImage.py 43 | Stormy/models/__init__.py 44 | Stormy/models/shellScriptExecutor.py -------------------------------------------------------------------------------- /desktop_gui/Stormy/controllers/howToController.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | 3 | class HowToController(): 4 | 5 | def __init__(self, mainWidget): 6 | self.mainWidget = mainWidget 7 | 8 | def showHowTo(self, software): 9 | 10 | # cek for other installation in progress. will show popup and stop execution 11 | if self.mainWidget.otherInstallationOnProgress() : 12 | return 13 | 14 | if software == "website" : 15 | softwareName = "Website" 16 | howToContentFile = "web.html" 17 | 18 | elif software == "ghost" : 19 | softwareName = "Ghost" 20 | howToContentFile = "ghost.html" 21 | 22 | elif software == "jabber" : 23 | softwareName = "Jabber / XMPP Service" 24 | howToContentFile = "jabber.html" 25 | 26 | elif software == "irc" : 27 | softwareName = "IRC Server" 28 | howToContentFile = "irc.html" 29 | 30 | elif software == "cozy" : 31 | softwareName = "Cozy" 32 | howToContentFile = "cozy.html" 33 | 34 | else: 35 | softwareName = "Stormy" 36 | howToContentFile = "stormy.html" 37 | 38 | # data for widget 39 | self.mainWidget.howToWidget.howToUseLabel.setText("How to use " + softwareName) 40 | 41 | # read how to content from file 42 | appsDir = self.mainWidget.appsDir 43 | howToDir = appsDir + "/assets" + "/how_to" 44 | howToContent = open(howToDir + "/" + howToContentFile , "r").read() 45 | 46 | # show how to content 47 | self.mainWidget.howToWidget.howToUseTextBrowser.setHtml( howToContent ) 48 | 49 | # show install widget with specific software data 50 | self.mainWidget.stack.setCurrentWidget( self.mainWidget.howToWidget ) 51 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/controllers/installController.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | 3 | 4 | class InstallController(): 5 | 6 | def __init__(self, mainWidget): 7 | self.mainWidget = mainWidget 8 | 9 | def install(self, software): 10 | if software == "website" : 11 | softwareName = "Website" 12 | softwareDescription = "This will install a simple web server and configure Tor to use it." 13 | 14 | elif software == "ghost" : 15 | softwareName = "Ghost" 16 | softwareDescription = "Ghost is blogging platform is easy to use." 17 | 18 | elif software == "jabber" : 19 | softwareName = "Jabber / XMPP Service" 20 | softwareDescription = "One-on-one conversations. Chat client such as Adium and Pidgin allow for encrypted chats." 21 | 22 | elif software == "irc" : 23 | softwareName = "IRC Server" 24 | softwareDescription = "Group chat service. Use you own chat client or the included web interface." 25 | 26 | else: 27 | software == "cozy" 28 | softwareName = "Cozy" 29 | softwareDescription = "Your Contacts, calendars and files are stored on your hardware." 30 | 31 | # data for widget 32 | self.mainWidget.installWidget.softwareToInstall = software 33 | self.mainWidget.installWidget.installLabel.setText("Install " + softwareName) 34 | 35 | softwareInfo = "\n" 36 | softwareInfo += "\n" 39 | softwareInfo += "

"+ softwareName +"

\n" 40 | softwareInfo += "


\n" 41 | softwareInfo += "

"+ softwareDescription +"

" 42 | 43 | self.mainWidget.installWidget.installInfoTextBrowser.setHtml(softwareInfo) 44 | 45 | # show install widget with specific software data 46 | self.mainWidget.stack.setCurrentWidget( self.mainWidget.installWidget ) 47 | 48 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/gui/howToWidget.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'gui-design/how-to.ui' 4 | # 5 | # Created: Sun Feb 22 18:45:09 2015 6 | # by: PyQt4 UI code generator 4.10.4 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt4 import QtCore, QtGui 11 | from Stormy.gui.components.logoImage import LogoImage 12 | 13 | try: 14 | _fromUtf8 = QtCore.QString.fromUtf8 15 | except AttributeError: 16 | def _fromUtf8(s): 17 | return s 18 | 19 | try: 20 | _encoding = QtGui.QApplication.UnicodeUTF8 21 | def _translate(context, text, disambig): 22 | return QtGui.QApplication.translate(context, text, disambig, _encoding) 23 | except AttributeError: 24 | def _translate(context, text, disambig): 25 | return QtGui.QApplication.translate(context, text, disambig) 26 | 27 | class Ui_howToWidget(QtGui.QWidget): 28 | 29 | def __init__(self, parent=None): 30 | super(Ui_howToWidget, self).__init__(parent) 31 | self.setupUi(self) 32 | 33 | 34 | def setupUi(self, howToWidget): 35 | howToWidget.setObjectName(_fromUtf8("howToWidget")) 36 | howToWidget.resize(800, 600) 37 | howToWidget.setStyleSheet(_fromUtf8("")) 38 | self.logoImg = LogoImage(howToWidget) 39 | self.logoImg.setGeometry(QtCore.QRect(698, 10, 141, 101)) 40 | self.logoImg.setObjectName(_fromUtf8("logoImg")) 41 | self.howToUseLabel = QtGui.QLabel(howToWidget) 42 | self.howToUseLabel.setGeometry(QtCore.QRect(60, 50, 271, 31)) 43 | font = QtGui.QFont() 44 | font.setPointSize(16) 45 | font.setBold(True) 46 | font.setWeight(75) 47 | self.howToUseLabel.setFont(font) 48 | self.howToUseLabel.setObjectName(_fromUtf8("howToUseLabel")) 49 | self.setupPushButton = QtGui.QPushButton(howToWidget) 50 | self.setupPushButton.setGeometry(QtCore.QRect(714, 130, 71, 27)) 51 | self.setupPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 52 | "color:rgb(255,255,255)")) 53 | self.setupPushButton.setObjectName(_fromUtf8("setupPushButton")) 54 | self.helpPushButton = QtGui.QPushButton(howToWidget) 55 | self.helpPushButton.setGeometry(QtCore.QRect(713, 163, 71, 27)) 56 | self.helpPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 57 | "color:rgb(255,255,255)")) 58 | self.helpPushButton.setObjectName(_fromUtf8("helpPushButton")) 59 | self.howToUseTextBrowser = QtGui.QTextBrowser(howToWidget) 60 | self.howToUseTextBrowser.setGeometry(QtCore.QRect(60, 110, 561, 431)) 61 | self.howToUseTextBrowser.setObjectName(_fromUtf8("howToUseTextBrowser")) 62 | 63 | self.retranslateUi(howToWidget) 64 | QtCore.QMetaObject.connectSlotsByName(howToWidget) 65 | 66 | def retranslateUi(self, howToWidget): 67 | howToWidget.setWindowTitle(_translate("howToWidget", "Stormy - How To", None)) 68 | self.howToUseLabel.setText(_translate("howToWidget", "How to use Stormy", None)) 69 | self.setupPushButton.setText(_translate("howToWidget", "Setup", None)) 70 | self.helpPushButton.setText(_translate("howToWidget", "Help", None)) 71 | 72 | 73 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/models/shellScriptExecutor.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | 3 | import os, sys, time, subprocess 4 | 5 | from PyQt4 import QtCore 6 | 7 | # Handle difference timer in windows and linux 8 | if sys.platform == "win32": 9 | # in windows, best timer is time.clock() 10 | default_timer = time.clock 11 | else: 12 | # in other platform, best timer is time.time() 13 | default_timer = time.time 14 | 15 | 16 | class ShellScriptExecutor(QtCore.QThread): 17 | 18 | def __init__(self): 19 | # this class will execute as thread 20 | QtCore.QThread.__init__(self) 21 | 22 | def setScriptFile(self, scriptFile): 23 | self.shellScriptFile = scriptFile 24 | 25 | def setScriptType(self, scriptType): 26 | self.shellScriptType = scriptType 27 | 28 | def setObjectForDisplayResponse(self, myobject): 29 | self.ObjectForDisplayResponse = myobject 30 | 31 | 32 | # this method will be executed after object from this class is run as thread 33 | def run(self ): 34 | # make sure current user have access right to execute shellScriptFile 35 | try : 36 | isFileExecuteable = os.access( self.shellScriptFile, os.X_OK ) 37 | if not isFileExecuteable : 38 | response = "Error: Please make sure your shell script file has execute permission!" 39 | self.emit(QtCore.SIGNAL("updateResponseShellScript(QString)"), response) 40 | 41 | except OSError as e: 42 | response = "Error: Cannot read shell script file!" 43 | self.emit(QtCore.SIGNAL("updateResponseShellScript(QString)"), response) 44 | 45 | 46 | if self.shellScriptType == "installer" : 47 | self.doInstall() 48 | 49 | else: 50 | self.visitService() 51 | 52 | 53 | def doInstall(self): 54 | # lock all button on complete widget 55 | self.ObjectForDisplayResponse.installingOnProgress = True 56 | 57 | softwareToInstall = self.ObjectForDisplayResponse.mainWidget.installWidget.softwareToInstall 58 | 59 | infoResponse = "Installation of " + softwareToInstall + " starting. Please wait until finish ..." 60 | self.emit(QtCore.SIGNAL("updateResponseInstalledLabel(QString)"), infoResponse) 61 | 62 | # command to run shell script file 63 | shellScriptRunner = [self.shellScriptFile, ""] 64 | 65 | try: 66 | ## eksekusi shell script pilihan 67 | popen = subprocess.Popen(shellScriptRunner, stdout=subprocess.PIPE) 68 | lines_iterator = iter(popen.stdout.readline, b"") 69 | 70 | for response in lines_iterator: 71 | self.emit(QtCore.SIGNAL("updateResponseShellScript(QString)"), response) 72 | 73 | except OSError as e: 74 | response = "Error: error at try to execute installer shell script file!" 75 | self.emit(QtCore.SIGNAL("updateResponseShellScript(QString)"), response) 76 | 77 | # unlock all button on complete widget 78 | self.ObjectForDisplayResponse.installingOnProgress = False 79 | 80 | infoResponse = "Installation of " + softwareToInstall + " finish." 81 | self.emit(QtCore.SIGNAL("updateResponseInstalledLabel(QString)"), infoResponse) 82 | 83 | def visitService(self): 84 | 85 | softwareInstalled = self.ObjectForDisplayResponse.mainWidget.completeWidget.softwareInstalled 86 | 87 | infoResponse = "Try to find " + softwareInstalled + " location. Please wait until finish ..." 88 | self.emit(QtCore.SIGNAL("updateResponseInstalledLabel(QString)"), infoResponse) 89 | 90 | # command to run shell script file 91 | shellScriptRunner = [self.shellScriptFile, ""] 92 | 93 | try: 94 | ## execute shell script 95 | popen = subprocess.Popen(shellScriptRunner, stdout=subprocess.PIPE) 96 | lines_iterator = iter(popen.stdout.readline, b"") 97 | 98 | for response in lines_iterator: 99 | self.emit(QtCore.SIGNAL("updateResponseShellScript(QString)"), response) 100 | 101 | except OSError as e: 102 | response = "Error: error at try to execute visit service shell script file!" 103 | self.emit(QtCore.SIGNAL("updateResponseShellScript(QString)"), response) 104 | 105 | infoResponse = "Finding " + softwareInstalled + " service finish." 106 | self.emit(QtCore.SIGNAL("updateResponseInstalledLabel(QString)"), infoResponse) 107 | 108 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/gui/installWidget.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'gui-design/install.ui' 4 | # 5 | # Created: Sun Feb 22 18:45:22 2015 6 | # by: PyQt4 UI code generator 4.10.4 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt4 import QtCore, QtGui 11 | from Stormy.gui.components.logoImage import LogoImage 12 | 13 | try: 14 | _fromUtf8 = QtCore.QString.fromUtf8 15 | except AttributeError: 16 | def _fromUtf8(s): 17 | return s 18 | 19 | try: 20 | _encoding = QtGui.QApplication.UnicodeUTF8 21 | def _translate(context, text, disambig): 22 | return QtGui.QApplication.translate(context, text, disambig, _encoding) 23 | except AttributeError: 24 | def _translate(context, text, disambig): 25 | return QtGui.QApplication.translate(context, text, disambig) 26 | 27 | class Ui_installWidget(QtGui.QWidget): 28 | 29 | def __init__(self, parent=None): 30 | super(Ui_installWidget, self).__init__(parent) 31 | self.setupUi(self) 32 | self.softwareToInstall = "" 33 | 34 | def setupUi(self, installWidget): 35 | installWidget.setObjectName(_fromUtf8("installWidget")) 36 | installWidget.resize(800, 600) 37 | installWidget.setStyleSheet(_fromUtf8("")) 38 | self.logoImg = LogoImage(installWidget) 39 | self.logoImg.setGeometry(QtCore.QRect(698, 10, 141, 101)) 40 | self.logoImg.setObjectName(_fromUtf8("logoImg")) 41 | self.installLabel = QtGui.QLabel(installWidget) 42 | self.installLabel.setGeometry(QtCore.QRect(60, 50, 561, 31)) 43 | font = QtGui.QFont() 44 | font.setPointSize(16) 45 | font.setBold(True) 46 | font.setWeight(75) 47 | self.installLabel.setFont(font) 48 | self.installLabel.setObjectName(_fromUtf8("installLabel")) 49 | self.howPushButton = QtGui.QPushButton(installWidget) 50 | self.howPushButton.setGeometry(QtCore.QRect(714, 130, 71, 27)) 51 | self.howPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 52 | "color:rgb(255,255,255)")) 53 | self.howPushButton.setObjectName(_fromUtf8("howPushButton")) 54 | self.helpPushButton = QtGui.QPushButton(installWidget) 55 | self.helpPushButton.setGeometry(QtCore.QRect(713, 163, 71, 27)) 56 | self.helpPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 57 | "color:rgb(255,255,255)")) 58 | self.helpPushButton.setObjectName(_fromUtf8("helpPushButton")) 59 | self.installInfoTextBrowser = QtGui.QTextBrowser(installWidget) 60 | self.installInfoTextBrowser.setGeometry(QtCore.QRect(60, 110, 561, 271)) 61 | self.installInfoTextBrowser.setObjectName(_fromUtf8("installInfoTextBrowser")) 62 | self.continuePushButton = QtGui.QPushButton(installWidget) 63 | self.continuePushButton.setGeometry(QtCore.QRect(460, 400, 120, 50)) 64 | font = QtGui.QFont() 65 | font.setPointSize(12) 66 | self.continuePushButton.setFont(font) 67 | self.continuePushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 68 | "color:rgb(255,255,255)")) 69 | self.continuePushButton.setObjectName(_fromUtf8("continuePushButton")) 70 | self.goBackPushButton = QtGui.QPushButton(installWidget) 71 | self.goBackPushButton.setGeometry(QtCore.QRect(100, 400, 120, 50)) 72 | font = QtGui.QFont() 73 | font.setPointSize(12) 74 | self.goBackPushButton.setFont(font) 75 | self.goBackPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 76 | "color:rgb(255,255,255)")) 77 | self.goBackPushButton.setObjectName(_fromUtf8("goBackPushButton")) 78 | 79 | self.retranslateUi(installWidget) 80 | QtCore.QMetaObject.connectSlotsByName(installWidget) 81 | 82 | def retranslateUi(self, installWidget): 83 | installWidget.setWindowTitle(_translate("installWidget", "Stormy - Install", None)) 84 | self.installLabel.setText(_translate("installWidget", "Install { Jabber / XMPP Service }", None)) 85 | self.howPushButton.setText(_translate("homeWidget", "How?", None)) 86 | self.helpPushButton.setText(_translate("installWidget", "Help", None)) 87 | self.installInfoTextBrowser.setHtml(_translate("installWidget", "\n" 88 | "\n" 91 | "

Jabber / XMPP Service

\n" 92 | "


\n" 93 | "

One-on-one conversations. Chat client such as Adium and Pidgin allow for encrypted chats.

", None)) 94 | self.continuePushButton.setText(_translate("installWidget", "Continue", None)) 95 | self.goBackPushButton.setText(_translate("installWidget", "Go Back", None)) 96 | 97 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/controllers/completeController.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | 3 | from Stormy.models.shellScriptExecutor import ShellScriptExecutor 4 | 5 | from PyQt4.QtGui import * 6 | from PyQt4.QtCore import * 7 | 8 | class CompleteController(): 9 | 10 | def __init__(self, mainWidget): 11 | self.mainWidget = mainWidget 12 | self.shellScriptExecutor = ShellScriptExecutor() 13 | # self.softwareInstalled = "" 14 | 15 | def doCompleteInstall(self, software): 16 | # cek for other installation in progress. will show popup and stop execution 17 | if self.mainWidget.otherInstallationOnProgress() : 18 | return 19 | 20 | if software == "website" : 21 | shellScriptFile = "web.sh" 22 | 23 | elif software == "ghost" : 24 | shellScriptFile = "ghost.sh" 25 | 26 | elif software == "jabber" : 27 | shellScriptFile = "jabber.sh" 28 | 29 | elif software == "irc" : 30 | shellScriptFile = "irc.sh" 31 | 32 | else: 33 | shellScriptFile = "cozy.sh" 34 | 35 | # do installation for software choosed by user 36 | appsDir = self.mainWidget.appsDir 37 | shellScriptDir = appsDir + "/assets/shell_script" 38 | scriptFile = shellScriptDir + "/installer/" + shellScriptFile 39 | 40 | self.shellScriptExecutor.setScriptFile( scriptFile ) 41 | self.shellScriptExecutor.setObjectForDisplayResponse(self.mainWidget.completeWidget) 42 | self.shellScriptExecutor.setScriptType("installer") 43 | 44 | self.shellScriptExecutor.start() # run as thread 45 | 46 | # data for widget 47 | self.mainWidget.completeWidget.softwareInstalled = software 48 | 49 | # clean installed info teks browser 50 | self.mainWidget.completeWidget.installedInfoTextBrowser.setText( "" ) 51 | 52 | # show install widget with specific software data 53 | self.mainWidget.stack.setCurrentWidget( self.mainWidget.completeWidget ) 54 | 55 | 56 | def showHiddenServiceLocation(self, hiddenService): 57 | # cek for other installation in progress 58 | # will show popup and stop execution 59 | if self.mainWidget.otherInstallationOnProgress() : 60 | return 61 | 62 | if hiddenService == "website" : 63 | serviceName = "Website" 64 | shellScriptFile = "web.sh" 65 | 66 | elif hiddenService == "ghost" : 67 | serviceName = "Ghost" 68 | shellScriptFile = "ghost.sh" 69 | 70 | elif hiddenService == "jabber" : 71 | serviceName = "Jabber / XMPP Service" 72 | shellScriptFile = "jabber.sh" 73 | 74 | elif hiddenService == "irc" : 75 | serviceName = "IRC Server" 76 | shellScriptFile = "irc.sh" 77 | 78 | else: 79 | hiddenService == "cozy" 80 | serviceName = "Cozy" 81 | shellScriptFile = "cozy.sh" 82 | 83 | # do installation for software choosed by user 84 | appsDir = self.mainWidget.appsDir 85 | shellScriptDir = appsDir + "/assets/shell_script" 86 | scriptFile = shellScriptDir + "/visit_service/" + shellScriptFile 87 | 88 | self.shellScriptExecutor.setScriptFile( scriptFile ) 89 | self.shellScriptExecutor.setObjectForDisplayResponse(self.mainWidget.completeWidget) 90 | self.shellScriptExecutor.setScriptType("visit_service") 91 | 92 | self.shellScriptExecutor.start() # run as thread 93 | 94 | """ 95 | hiddenServiceInfo = "\n" 96 | hiddenServiceInfo += "\n" 99 | hiddenServiceInfo += "

Your new hidden service is located at:

\n" 100 | hiddenServiceInfo += "


\n" 101 | hiddenServiceInfo += "


\n" 102 | hiddenServiceInfo += "


\n" 103 | hiddenServiceInfo += "

Keys are located in:

" 104 | """ 105 | 106 | #self.mainWidget.completeWidget.installedLabel.setText(self.serviceName + " Installed.") 107 | # self.mainWidget.completeWidget.installedInfoTextBrowser.setHtml(hiddenServiceInfo) 108 | 109 | def updateResponseShellScript(self, response): 110 | self.mainWidget.completeWidget.installedInfoTextBrowser.append( response ) 111 | 112 | def updateResponseInstalledLabel(self, response): 113 | self.mainWidget.completeWidget.installedLabel.setText( response ) 114 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/gui/completeWidget.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'gui-design/complete.ui' 4 | # 5 | # Created: Sun Feb 22 18:44:33 2015 6 | # by: PyQt4 UI code generator 4.10.4 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt4 import QtCore, QtGui 11 | from Stormy.gui.components.logoImage import LogoImage 12 | 13 | try: 14 | _fromUtf8 = QtCore.QString.fromUtf8 15 | except AttributeError: 16 | def _fromUtf8(s): 17 | return s 18 | 19 | try: 20 | _encoding = QtGui.QApplication.UnicodeUTF8 21 | def _translate(context, text, disambig): 22 | return QtGui.QApplication.translate(context, text, disambig, _encoding) 23 | except AttributeError: 24 | def _translate(context, text, disambig): 25 | return QtGui.QApplication.translate(context, text, disambig) 26 | 27 | class Ui_completeWidget(QtGui.QWidget): 28 | showHowToWidgetSignal = QtCore.pyqtSignal() 29 | 30 | 31 | def __init__(self, parent=None): 32 | super(Ui_completeWidget, self).__init__(parent) 33 | self.setupUi(self) 34 | self.mainWidget = parent 35 | 36 | # to lock all button in complete widget will installation running 37 | self.installingOnProgress = False 38 | 39 | def setupUi(self, completeWidget): 40 | completeWidget.setObjectName(_fromUtf8("completeWidget")) 41 | completeWidget.resize(800, 600) 42 | completeWidget.setStyleSheet(_fromUtf8("")) 43 | self.logoImg = LogoImage(completeWidget) 44 | self.logoImg.setGeometry(QtCore.QRect(698, 10, 141, 101)) 45 | self.logoImg.setObjectName(_fromUtf8("logoImg")) 46 | self.installedLabel = QtGui.QLabel(completeWidget) 47 | self.installedLabel.setGeometry(QtCore.QRect(60, 50, 561, 31)) 48 | font = QtGui.QFont() 49 | font.setPointSize(16) 50 | font.setBold(True) 51 | font.setWeight(75) 52 | self.installedLabel.setFont(font) 53 | self.installedLabel.setObjectName(_fromUtf8("installedLabel")) 54 | self.setupPushButton = QtGui.QPushButton(completeWidget) 55 | self.setupPushButton.setGeometry(QtCore.QRect(714, 130, 71, 27)) 56 | self.setupPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 57 | "color:rgb(255,255,255)")) 58 | self.setupPushButton.setObjectName(_fromUtf8("setupPushButton")) 59 | self.helpPushButton = QtGui.QPushButton(completeWidget) 60 | self.helpPushButton.setGeometry(QtCore.QRect(713, 163, 71, 27)) 61 | self.helpPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 62 | "color:rgb(255,255,255)")) 63 | self.helpPushButton.setObjectName(_fromUtf8("helpPushButton")) 64 | self.installedInfoTextBrowser = QtGui.QTextBrowser(completeWidget) 65 | self.installedInfoTextBrowser.setGeometry(QtCore.QRect(60, 110, 561, 181)) 66 | self.installedInfoTextBrowser.setObjectName(_fromUtf8("installedInfoTextBrowser")) 67 | self.visitHiddenServicePushButton = QtGui.QPushButton(completeWidget) 68 | self.visitHiddenServicePushButton.setGeometry(QtCore.QRect(396, 330, 225, 50)) 69 | font = QtGui.QFont() 70 | font.setPointSize(12) 71 | self.visitHiddenServicePushButton.setFont(font) 72 | self.visitHiddenServicePushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 73 | "color:rgb(255,255,255)")) 74 | self.visitHiddenServicePushButton.setObjectName(_fromUtf8("visitHiddenServicePushButton")) 75 | self.howToGuidePushButton = QtGui.QPushButton(completeWidget) 76 | self.howToGuidePushButton.setGeometry(QtCore.QRect(59, 330, 225, 50)) 77 | font = QtGui.QFont() 78 | font.setPointSize(12) 79 | self.howToGuidePushButton.setFont(font) 80 | self.howToGuidePushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 81 | "color:rgb(255,255,255)")) 82 | self.howToGuidePushButton.setObjectName(_fromUtf8("howToGuidePushButton")) 83 | 84 | self.retranslateUi(completeWidget) 85 | QtCore.QMetaObject.connectSlotsByName(completeWidget) 86 | 87 | def retranslateUi(self, completeWidget): 88 | completeWidget.setWindowTitle(_translate("completeWidget", "Stormy - Complete", None)) 89 | self.installedLabel.setText(_translate("completeWidget", "{ Jabber / XMPP Service } Installed", None)) 90 | self.setupPushButton.setText(_translate("completeWidget", "Setup", None)) 91 | self.helpPushButton.setText(_translate("completeWidget", "Help", None)) 92 | self.installedInfoTextBrowser.setHtml(_translate("completeWidget", "\n" 93 | "\n" 96 | "

Your new hidden service is located at:

\n" 97 | "


\n" 98 | "


\n" 99 | "


\n" 100 | "

Keys are located in:

", None)) 101 | self.visitHiddenServicePushButton.setText(_translate("completeWidget", "Visit your hidden service", None)) 102 | self.howToGuidePushButton.setText(_translate("completeWidget", "Read the how-to guides", None)) 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/gui/mainWidget.py: -------------------------------------------------------------------------------- 1 | __author__ = 'phpgeek' 2 | 3 | import sys 4 | from functools import partial 5 | from PyQt4 import QtCore 6 | from PyQt4.QtGui import * 7 | 8 | from Stormy.gui.homeWidget import Ui_homeWidget 9 | from Stormy.gui.installWidget import Ui_installWidget 10 | from Stormy.gui.completeWidget import Ui_completeWidget 11 | from Stormy.gui.howToWidget import Ui_howToWidget 12 | from Stormy.gui.helpWidget import Ui_helpWidget 13 | 14 | from Stormy.controllers.installController import InstallController 15 | from Stormy.controllers.howToController import HowToController 16 | from Stormy.controllers.helpController import HelpController 17 | from Stormy.controllers.homeController import HomeController 18 | from Stormy.controllers.completeController import CompleteController 19 | 20 | class MainWidget(QWidget): 21 | 22 | def __init__(self, parent=None): 23 | super(MainWidget, self).__init__(parent) 24 | 25 | # get controller 26 | self.installController = InstallController(self) 27 | self.howToController = HowToController(self) 28 | self.helpController = HelpController(self) 29 | self.homeController = HomeController(self) 30 | self.completeController = CompleteController(self) 31 | 32 | 33 | self.setFixedSize(860, 600) 34 | self.stack = QStackedWidget() 35 | layout = QVBoxLayout(self) 36 | layout.addWidget(self.stack) 37 | 38 | self.homeWidget = Ui_homeWidget(self) 39 | self.installWidget = Ui_installWidget(self) 40 | self.completeWidget = Ui_completeWidget(self) 41 | self.howToWidget = Ui_howToWidget(self) 42 | self.helpWidget = Ui_helpWidget(self) 43 | 44 | self.stack.addWidget(self.homeWidget) 45 | self.stack.addWidget(self.installWidget) 46 | self.stack.addWidget(self.completeWidget) 47 | self.stack.addWidget(self.howToWidget) 48 | self.stack.addWidget(self.helpWidget) 49 | 50 | self.stack.setCurrentWidget(self.homeWidget) 51 | 52 | self.setSignalAndSlot() 53 | 54 | 55 | # We choose to handle all signal and slot here because we want maint object as main controller to route specific controller 56 | def setSignalAndSlot(self): 57 | # connecting signal from homeWidget 58 | self.homeWidget.websiteCommandLinkButton.clicked.connect(lambda : self.installController.install("website")) 59 | self.homeWidget.ghostCommandLinkButton.clicked.connect(lambda : self.installController.install("ghost")) 60 | self.homeWidget.jabberCommandLinkButton.clicked.connect(lambda : self.installController.install("jabber")) 61 | self.homeWidget.ircServerCommandLinkButton.clicked.connect(lambda : self.installController.install("irc")) 62 | self.homeWidget.cozyCommandLinkButton.clicked.connect(lambda : self.installController.install("cozy")) 63 | self.homeWidget.howPushButton.clicked.connect(lambda : self.howToController.showHowTo("stormy")) 64 | self.homeWidget.helpPushButton.clicked.connect(lambda : self.helpController.showHelp()) 65 | 66 | # connecting signal from installWidget 67 | self.installWidget.goBackPushButton.clicked.connect(lambda : self.homeController.goToHome()) 68 | self.installWidget.continuePushButton.clicked.connect(lambda : self.completeController.doCompleteInstall(self.installWidget.softwareToInstall)) 69 | self.installWidget.howPushButton.clicked.connect(lambda : self.howToController.showHowTo( self.installWidget.softwareToInstall )) 70 | self.installWidget.helpPushButton.clicked.connect(lambda : self.helpController.showHelp()) 71 | 72 | #connecting signal from completeWidget 73 | self.completeWidget.howToGuidePushButton.clicked.connect( lambda: self.howToController.showHowTo( self.completeWidget.softwareInstalled ) ) 74 | self.completeWidget.helpPushButton.clicked.connect( lambda: self.helpController.showHelp() ) 75 | self.completeWidget.setupPushButton.clicked.connect( lambda : self.homeController.goToHome()) 76 | self.completeWidget.visitHiddenServicePushButton.clicked.connect(lambda : self.completeController.showHiddenServiceLocation( self.completeWidget.softwareInstalled )) 77 | 78 | # signal and slot for ShellScriptExecutor thread from CompleteWidget 79 | self.connect(self.completeController.shellScriptExecutor, QtCore.SIGNAL("updateResponseShellScript(QString)") 80 | , self.completeController.updateResponseShellScript) 81 | self.connect(self.completeController.shellScriptExecutor, QtCore.SIGNAL("updateResponseInstalledLabel(QString)") 82 | , self.completeController.updateResponseInstalledLabel) 83 | 84 | 85 | #connecting signal from helpWidget 86 | self.helpWidget.webServerCommandLinkButton.clicked.connect(lambda: self.howToController.showHowTo("website") ) 87 | self.helpWidget.ghostCommandLinkButton.clicked.connect(lambda : self.howToController.showHowTo("ghost")) 88 | self.helpWidget.ircServerCommandLinkButton.clicked.connect(lambda : self.howToController.showHowTo("irc")) 89 | self.helpWidget.jabberServerCommandLinkButton.clicked.connect(lambda : self.howToController.showHowTo("jabber")) 90 | self.helpWidget.cozyCommandLinkButton.clicked.connect(lambda : self.howToController.showHowTo("cozy")) 91 | self.helpWidget.setupPushButton.clicked.connect(lambda : self.homeController.goToHome()) 92 | self.helpWidget.howPushButton.clicked.connect(lambda : self.howToController.showHowTo("stormy")) 93 | 94 | self.helpWidget.stormyHowToGuideCommandLinkButton.clicked.connect(lambda : self.helpController.openInWebBrowser("http://www.stormy.com")) 95 | self.helpWidget.torProjectWebsiteCommandLinkButton.clicked.connect(lambda : self.helpController.openInWebBrowser("http://www.tor.com")) 96 | self.helpWidget.torTalkMailingListCommandLinkButton.clicked.connect(lambda : self.helpController.openInWebBrowser("http://www.tortalk.com")) 97 | 98 | #connecting signal from howToWidget 99 | self.howToWidget.setupPushButton.clicked.connect(lambda : self.homeController.goToHome()) 100 | self.howToWidget.helpPushButton.clicked.connect(lambda : self.helpController.showHelp()) 101 | 102 | def otherInstallationOnProgress(self): 103 | # cek for installation progress that already exist 104 | if self.completeWidget.installingOnProgress : 105 | message = "Please wait ... Other software on installation progress!!!" 106 | QMessageBox.warning(self, "Warning", message) 107 | return True 108 | 109 | else: 110 | return False 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/gui/helpWidget.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'gui-design/help.ui' 4 | # 5 | # Created: Sun Feb 22 18:44:53 2015 6 | # by: PyQt4 UI code generator 4.10.4 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt4 import QtCore, QtGui 11 | from Stormy.gui.components.logoImage import LogoImage 12 | 13 | try: 14 | _fromUtf8 = QtCore.QString.fromUtf8 15 | except AttributeError: 16 | def _fromUtf8(s): 17 | return s 18 | 19 | try: 20 | _encoding = QtGui.QApplication.UnicodeUTF8 21 | def _translate(context, text, disambig): 22 | return QtGui.QApplication.translate(context, text, disambig, _encoding) 23 | except AttributeError: 24 | def _translate(context, text, disambig): 25 | return QtGui.QApplication.translate(context, text, disambig) 26 | 27 | class Ui_helpWidget(QtGui.QWidget): 28 | 29 | def __init__(self, parent=None): 30 | super(Ui_helpWidget, self).__init__(parent) 31 | self.setupUi(self) 32 | 33 | def setupUi(self, helpWidget): 34 | helpWidget.setObjectName(_fromUtf8("helpWidget")) 35 | helpWidget.resize(800, 600) 36 | helpWidget.setStyleSheet(_fromUtf8("")) 37 | self.logoImg = LogoImage(helpWidget) 38 | self.logoImg.setGeometry(QtCore.QRect(698, 10, 141, 101)) 39 | self.logoImg.setObjectName(_fromUtf8("logoImg")) 40 | self.helpOptionsLabel = QtGui.QLabel(helpWidget) 41 | self.helpOptionsLabel.setGeometry(QtCore.QRect(60, 50, 561, 31)) 42 | font = QtGui.QFont() 43 | font.setPointSize(16) 44 | font.setBold(True) 45 | font.setWeight(75) 46 | self.helpOptionsLabel.setFont(font) 47 | self.helpOptionsLabel.setObjectName(_fromUtf8("helpOptionsLabel")) 48 | self.setupPushButton = QtGui.QPushButton(helpWidget) 49 | self.setupPushButton.setGeometry(QtCore.QRect(714, 130, 71, 27)) 50 | self.setupPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 51 | "color:rgb(255,255,255)")) 52 | self.setupPushButton.setObjectName(_fromUtf8("setupPushButton")) 53 | self.howPushButton = QtGui.QPushButton(helpWidget) 54 | self.howPushButton.setGeometry(QtCore.QRect(713, 163, 71, 27)) 55 | self.howPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 56 | "color:rgb(255,255,255)")) 57 | self.howPushButton.setObjectName(_fromUtf8("howPushButton")) 58 | self.visitHowToGuideLabel = QtGui.QLabel(helpWidget) 59 | self.visitHowToGuideLabel.setGeometry(QtCore.QRect(60, 260, 561, 31)) 60 | font = QtGui.QFont() 61 | font.setPointSize(16) 62 | font.setBold(True) 63 | font.setWeight(75) 64 | self.visitHowToGuideLabel.setFont(font) 65 | self.visitHowToGuideLabel.setObjectName(_fromUtf8("visitHowToGuideLabel")) 66 | self.warningLabel = QtGui.QLabel(helpWidget) 67 | self.warningLabel.setGeometry(QtCore.QRect(80, 90, 541, 16)) 68 | font = QtGui.QFont() 69 | font.setPointSize(11) 70 | self.warningLabel.setFont(font) 71 | self.warningLabel.setStyleSheet(_fromUtf8("color: rgb(255, 0, 0);")) 72 | self.warningLabel.setObjectName(_fromUtf8("warningLabel")) 73 | self.noteLabel = QtGui.QLabel(helpWidget) 74 | self.noteLabel.setGeometry(QtCore.QRect(80, 300, 541, 16)) 75 | font = QtGui.QFont() 76 | font.setPointSize(11) 77 | self.noteLabel.setFont(font) 78 | self.noteLabel.setStyleSheet(_fromUtf8("color: rgb(0, 162, 0);")) 79 | self.noteLabel.setObjectName(_fromUtf8("noteLabel")) 80 | self.stormyHowToGuideCommandLinkButton = QtGui.QCommandLinkButton(helpWidget) 81 | self.stormyHowToGuideCommandLinkButton.setGeometry(QtCore.QRect(70, 110, 211, 41)) 82 | font = QtGui.QFont() 83 | font.setPointSize(12) 84 | self.stormyHowToGuideCommandLinkButton.setFont(font) 85 | self.stormyHowToGuideCommandLinkButton.setStyleSheet(_fromUtf8("color:rgb(85, 170, 255);")) 86 | self.stormyHowToGuideCommandLinkButton.setObjectName(_fromUtf8("stormyHowToGuideCommandLinkButton")) 87 | self.torProjectWebsiteCommandLinkButton = QtGui.QCommandLinkButton(helpWidget) 88 | self.torProjectWebsiteCommandLinkButton.setGeometry(QtCore.QRect(70, 150, 211, 41)) 89 | font = QtGui.QFont() 90 | font.setPointSize(12) 91 | self.torProjectWebsiteCommandLinkButton.setFont(font) 92 | self.torProjectWebsiteCommandLinkButton.setStyleSheet(_fromUtf8("color:rgb(85, 170, 255);")) 93 | self.torProjectWebsiteCommandLinkButton.setObjectName(_fromUtf8("torProjectWebsiteCommandLinkButton")) 94 | self.torTalkMailingListCommandLinkButton = QtGui.QCommandLinkButton(helpWidget) 95 | self.torTalkMailingListCommandLinkButton.setGeometry(QtCore.QRect(70, 190, 211, 41)) 96 | font = QtGui.QFont() 97 | font.setPointSize(12) 98 | self.torTalkMailingListCommandLinkButton.setFont(font) 99 | self.torTalkMailingListCommandLinkButton.setStyleSheet(_fromUtf8("color:rgb(85, 170, 255);")) 100 | self.torTalkMailingListCommandLinkButton.setObjectName(_fromUtf8("torTalkMailingListCommandLinkButton")) 101 | self.webServerCommandLinkButton = QtGui.QCommandLinkButton(helpWidget) 102 | self.webServerCommandLinkButton.setGeometry(QtCore.QRect(80, 320, 211, 41)) 103 | font = QtGui.QFont() 104 | font.setPointSize(12) 105 | self.webServerCommandLinkButton.setFont(font) 106 | self.webServerCommandLinkButton.setStyleSheet(_fromUtf8("color:rgb(85, 170, 255);")) 107 | self.webServerCommandLinkButton.setObjectName(_fromUtf8("webServerCommandLinkButton")) 108 | self.ircServerCommandLinkButton = QtGui.QCommandLinkButton(helpWidget) 109 | self.ircServerCommandLinkButton.setGeometry(QtCore.QRect(80, 400, 211, 41)) 110 | font = QtGui.QFont() 111 | font.setPointSize(12) 112 | self.ircServerCommandLinkButton.setFont(font) 113 | self.ircServerCommandLinkButton.setStyleSheet(_fromUtf8("color:rgb(85, 170, 255);")) 114 | self.ircServerCommandLinkButton.setObjectName(_fromUtf8("ircServerCommandLinkButton")) 115 | self.ghostCommandLinkButton = QtGui.QCommandLinkButton(helpWidget) 116 | self.ghostCommandLinkButton.setGeometry(QtCore.QRect(80, 360, 211, 41)) 117 | font = QtGui.QFont() 118 | font.setPointSize(12) 119 | self.ghostCommandLinkButton.setFont(font) 120 | self.ghostCommandLinkButton.setStyleSheet(_fromUtf8("color:rgb(85, 170, 255);")) 121 | self.ghostCommandLinkButton.setObjectName(_fromUtf8("ghostCommandLinkButton")) 122 | self.cozyCommandLinkButton = QtGui.QCommandLinkButton(helpWidget) 123 | self.cozyCommandLinkButton.setGeometry(QtCore.QRect(80, 480, 211, 41)) 124 | font = QtGui.QFont() 125 | font.setPointSize(12) 126 | self.cozyCommandLinkButton.setFont(font) 127 | self.cozyCommandLinkButton.setStyleSheet(_fromUtf8("color:rgb(85, 170, 255);")) 128 | self.cozyCommandLinkButton.setObjectName(_fromUtf8("cozyCommandLinkButton")) 129 | self.jabberServerCommandLinkButton = QtGui.QCommandLinkButton(helpWidget) 130 | self.jabberServerCommandLinkButton.setGeometry(QtCore.QRect(80, 440, 211, 41)) 131 | font = QtGui.QFont() 132 | font.setPointSize(12) 133 | self.jabberServerCommandLinkButton.setFont(font) 134 | self.jabberServerCommandLinkButton.setStyleSheet(_fromUtf8("color:rgb(85, 170, 255);")) 135 | self.jabberServerCommandLinkButton.setObjectName(_fromUtf8("jabberServerCommandLinkButton")) 136 | 137 | self.retranslateUi(helpWidget) 138 | QtCore.QMetaObject.connectSlotsByName(helpWidget) 139 | 140 | def retranslateUi(self, helpWidget): 141 | helpWidget.setWindowTitle(_translate("helpWidget", "Stormy - Help", None)) 142 | self.helpOptionsLabel.setText(_translate("helpWidget", "Help Options", None)) 143 | self.howPushButton.setText(_translate("helpWidget", "How?", None)) 144 | self.setupPushButton.setText(_translate("helpWidget", "Setup", None)) 145 | self.visitHowToGuideLabel.setText(_translate("helpWidget", "Visit the how-to guides", None)) 146 | self.warningLabel.setText(_translate("helpWidget", "Warning: these link will open in your default browser", None)) 147 | self.noteLabel.setText(_translate("helpWidget", "Note: these link will open in inside Stormy", None)) 148 | self.stormyHowToGuideCommandLinkButton.setText(_translate("helpWidget", "Stormy how-to guides", None)) 149 | self.torProjectWebsiteCommandLinkButton.setText(_translate("helpWidget", "Tor project website", None)) 150 | self.torTalkMailingListCommandLinkButton.setText(_translate("helpWidget", "tor-talk mailing list", None)) 151 | self.webServerCommandLinkButton.setText(_translate("helpWidget", "Web Server", None)) 152 | self.ircServerCommandLinkButton.setText(_translate("helpWidget", "IRC Server", None)) 153 | self.ghostCommandLinkButton.setText(_translate("helpWidget", "Ghost", None)) 154 | self.cozyCommandLinkButton.setText(_translate("helpWidget", "Cozy", None)) 155 | self.jabberServerCommandLinkButton.setText(_translate("helpWidget", "Jabber Server", None)) 156 | 157 | 158 | -------------------------------------------------------------------------------- /desktop_gui/Stormy/gui/homeWidget.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'gui-design/home.ui' 4 | # 5 | # Created: Sun Feb 22 18:43:18 2015 6 | # by: PyQt4 UI code generator 4.10.4 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt4 import QtCore, QtGui 11 | from Stormy.gui.components.logoImage import LogoImage 12 | 13 | try: 14 | _fromUtf8 = QtCore.QString.fromUtf8 15 | except AttributeError: 16 | def _fromUtf8(s): 17 | return s 18 | 19 | try: 20 | _encoding = QtGui.QApplication.UnicodeUTF8 21 | def _translate(context, text, disambig): 22 | return QtGui.QApplication.translate(context, text, disambig, _encoding) 23 | except AttributeError: 24 | def _translate(context, text, disambig): 25 | return QtGui.QApplication.translate(context, text, disambig) 26 | 27 | class Ui_homeWidget(QtGui.QWidget): 28 | 29 | def __init__(self, parent=None): 30 | super(Ui_homeWidget, self).__init__(parent) 31 | self.setupUi(self) 32 | 33 | def setupUi(self, homeWidget): 34 | homeWidget.setObjectName(_fromUtf8("homeWidget")) 35 | homeWidget.resize(800, 600) 36 | homeWidget.setStyleSheet(_fromUtf8("")) 37 | self.logoImg = LogoImage(homeWidget) 38 | self.logoImg.setGeometry(QtCore.QRect(698, 10, 141, 101)) 39 | self.logoImg.setObjectName(_fromUtf8("logoImg")) 40 | self.writeLabel = QtGui.QLabel(homeWidget) 41 | self.writeLabel.setGeometry(QtCore.QRect(60, 110, 61, 31)) 42 | font = QtGui.QFont() 43 | font.setPointSize(16) 44 | font.setBold(True) 45 | font.setWeight(75) 46 | self.writeLabel.setFont(font) 47 | self.writeLabel.setObjectName(_fromUtf8("writeLabel")) 48 | self.communicateLabel = QtGui.QLabel(homeWidget) 49 | self.communicateLabel.setGeometry(QtCore.QRect(60, 260, 141, 51)) 50 | font = QtGui.QFont() 51 | font.setPointSize(16) 52 | font.setBold(True) 53 | font.setWeight(75) 54 | self.communicateLabel.setFont(font) 55 | self.communicateLabel.setObjectName(_fromUtf8("communicateLabel")) 56 | self.organizeLabel = QtGui.QLabel(homeWidget) 57 | self.organizeLabel.setGeometry(QtCore.QRect(60, 430, 101, 31)) 58 | font = QtGui.QFont() 59 | font.setPointSize(16) 60 | font.setBold(True) 61 | font.setWeight(75) 62 | self.organizeLabel.setFont(font) 63 | self.organizeLabel.setObjectName(_fromUtf8("organizeLabel")) 64 | self.websiteCommandLinkButton = QtGui.QCommandLinkButton(homeWidget) 65 | self.websiteCommandLinkButton.setGeometry(QtCore.QRect(140, 150, 201, 31)) 66 | font = QtGui.QFont() 67 | font.setPointSize(12) 68 | self.websiteCommandLinkButton.setFont(font) 69 | self.websiteCommandLinkButton.setIconSize(QtCore.QSize(0, 0)) 70 | self.websiteCommandLinkButton.setObjectName(_fromUtf8("websiteCommandLinkButton")) 71 | self.websiteInfoLabel = QtGui.QLabel(homeWidget) 72 | self.websiteInfoLabel.setGeometry(QtCore.QRect(150, 186, 191, 41)) 73 | font = QtGui.QFont() 74 | font.setPointSize(10) 75 | self.websiteInfoLabel.setFont(font) 76 | self.websiteInfoLabel.setObjectName(_fromUtf8("websiteInfoLabel")) 77 | self.writeGraphicsView = QtGui.QGraphicsView(homeWidget) 78 | self.writeGraphicsView.setGeometry(QtCore.QRect(70, 160, 61, 51)) 79 | self.writeGraphicsView.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255)")) 80 | self.writeGraphicsView.setObjectName(_fromUtf8("writeGraphicsView")) 81 | self.ghostGraphicsView = QtGui.QGraphicsView(homeWidget) 82 | self.ghostGraphicsView.setGeometry(QtCore.QRect(370, 160, 61, 51)) 83 | self.ghostGraphicsView.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255)")) 84 | self.ghostGraphicsView.setObjectName(_fromUtf8("ghostGraphicsView")) 85 | self.ghostCommandLinkButton = QtGui.QCommandLinkButton(homeWidget) 86 | self.ghostCommandLinkButton.setGeometry(QtCore.QRect(440, 150, 181, 31)) 87 | font = QtGui.QFont() 88 | font.setPointSize(12) 89 | self.ghostCommandLinkButton.setFont(font) 90 | self.ghostCommandLinkButton.setIconSize(QtCore.QSize(0, 0)) 91 | self.ghostCommandLinkButton.setObjectName(_fromUtf8("ghostCommandLinkButton")) 92 | self.ghostInfoLabel = QtGui.QLabel(homeWidget) 93 | self.ghostInfoLabel.setGeometry(QtCore.QRect(450, 180, 191, 41)) 94 | font = QtGui.QFont() 95 | font.setPointSize(10) 96 | self.ghostInfoLabel.setFont(font) 97 | self.ghostInfoLabel.setObjectName(_fromUtf8("ghostInfoLabel")) 98 | self.jabberGraphicsView = QtGui.QGraphicsView(homeWidget) 99 | self.jabberGraphicsView.setGeometry(QtCore.QRect(70, 320, 61, 51)) 100 | self.jabberGraphicsView.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255)")) 101 | self.jabberGraphicsView.setObjectName(_fromUtf8("jabberGraphicsView")) 102 | self.ircServerGraphicsView = QtGui.QGraphicsView(homeWidget) 103 | self.ircServerGraphicsView.setGeometry(QtCore.QRect(370, 320, 61, 51)) 104 | self.ircServerGraphicsView.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255)")) 105 | self.ircServerGraphicsView.setObjectName(_fromUtf8("ircServerGraphicsView")) 106 | self.jabberCommandLinkButton = QtGui.QCommandLinkButton(homeWidget) 107 | self.jabberCommandLinkButton.setGeometry(QtCore.QRect(140, 310, 201, 31)) 108 | font = QtGui.QFont() 109 | font.setPointSize(12) 110 | self.jabberCommandLinkButton.setFont(font) 111 | self.jabberCommandLinkButton.setIconSize(QtCore.QSize(0, 0)) 112 | self.jabberCommandLinkButton.setObjectName(_fromUtf8("jabberCommandLinkButton")) 113 | self.ircServerInfoLabel = QtGui.QLabel(homeWidget) 114 | self.ircServerInfoLabel.setGeometry(QtCore.QRect(450, 346, 191, 41)) 115 | font = QtGui.QFont() 116 | font.setPointSize(10) 117 | self.ircServerInfoLabel.setFont(font) 118 | self.ircServerInfoLabel.setObjectName(_fromUtf8("ircServerInfoLabel")) 119 | self.jabberInfoLabel = QtGui.QLabel(homeWidget) 120 | self.jabberInfoLabel.setGeometry(QtCore.QRect(150, 342, 191, 61)) 121 | font = QtGui.QFont() 122 | font.setPointSize(10) 123 | self.jabberInfoLabel.setFont(font) 124 | self.jabberInfoLabel.setObjectName(_fromUtf8("jabberInfoLabel")) 125 | self.ircServerCommandLinkButton = QtGui.QCommandLinkButton(homeWidget) 126 | self.ircServerCommandLinkButton.setGeometry(QtCore.QRect(440, 310, 181, 31)) 127 | font = QtGui.QFont() 128 | font.setPointSize(12) 129 | self.ircServerCommandLinkButton.setFont(font) 130 | self.ircServerCommandLinkButton.setIconSize(QtCore.QSize(0, 0)) 131 | self.ircServerCommandLinkButton.setObjectName(_fromUtf8("ircServerCommandLinkButton")) 132 | self.cozyCommandLinkButton = QtGui.QCommandLinkButton(homeWidget) 133 | self.cozyCommandLinkButton.setGeometry(QtCore.QRect(140, 470, 201, 31)) 134 | font = QtGui.QFont() 135 | font.setPointSize(12) 136 | self.cozyCommandLinkButton.setFont(font) 137 | self.cozyCommandLinkButton.setIconSize(QtCore.QSize(0, 0)) 138 | self.cozyCommandLinkButton.setObjectName(_fromUtf8("cozyCommandLinkButton")) 139 | self.cozyGraphicsView = QtGui.QGraphicsView(homeWidget) 140 | self.cozyGraphicsView.setGeometry(QtCore.QRect(70, 480, 61, 51)) 141 | self.cozyGraphicsView.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255)")) 142 | self.cozyGraphicsView.setObjectName(_fromUtf8("cozyGraphicsView")) 143 | self.cozyInfoLabel = QtGui.QLabel(homeWidget) 144 | self.cozyInfoLabel.setGeometry(QtCore.QRect(150, 497, 191, 61)) 145 | font = QtGui.QFont() 146 | font.setPointSize(10) 147 | self.cozyInfoLabel.setFont(font) 148 | self.cozyInfoLabel.setObjectName(_fromUtf8("cozyInfoLabel")) 149 | self.howPushButton = QtGui.QPushButton(homeWidget) 150 | self.howPushButton.setGeometry(QtCore.QRect(714, 130, 71, 27)) 151 | self.howPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 152 | "color:rgb(255,255,255)")) 153 | self.howPushButton.setObjectName(_fromUtf8("howPushButton")) 154 | self.helpPushButton = QtGui.QPushButton(homeWidget) 155 | self.helpPushButton.setGeometry(QtCore.QRect(713, 163, 71, 27)) 156 | self.helpPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n" 157 | "color:rgb(255,255,255)")) 158 | self.helpPushButton.setObjectName(_fromUtf8("helpPushButton")) 159 | 160 | self.retranslateUi(homeWidget) 161 | QtCore.QMetaObject.connectSlotsByName(homeWidget) 162 | 163 | def retranslateUi(self, homeWidget): 164 | homeWidget.setWindowTitle(_translate("homeWidget", "Stormy - Home", None)) 165 | self.writeLabel.setText(_translate("homeWidget", "Write", None)) 166 | self.communicateLabel.setText(_translate("homeWidget", "Communicate", None)) 167 | self.organizeLabel.setText(_translate("homeWidget", "Organize", None)) 168 | self.websiteCommandLinkButton.setText(_translate("homeWidget", "Website", None)) 169 | self.websiteInfoLabel.setText(_translate("homeWidget", "This will install a simple\n" 170 | " web server and configure\n" 171 | " Tor to use it.", None)) 172 | self.ghostCommandLinkButton.setText(_translate("homeWidget", "Ghost", None)) 173 | self.ghostInfoLabel.setText(_translate("homeWidget", "This blogging platform is \n" 174 | "easy to use.", None)) 175 | self.jabberCommandLinkButton.setText(_translate("homeWidget", "Jabber / XMPP Service", None)) 176 | self.ircServerInfoLabel.setText(_translate("homeWidget", "Group chat service. Use \n" 177 | "your own chat client or the \n" 178 | "included web interface. ", None)) 179 | self.jabberInfoLabel.setText(_translate("homeWidget", "One-on-one conversations. \n" 180 | "Chat client such as Adium \n" 181 | "and pidgin allow for \n" 182 | "encrypted chats.", None)) 183 | self.ircServerCommandLinkButton.setText(_translate("homeWidget", "IRC Server", None)) 184 | self.cozyCommandLinkButton.setText(_translate("homeWidget", "Cozy", None)) 185 | self.cozyInfoLabel.setText(_translate("homeWidget", "Your Contacts, calendars \n" 186 | "and files are stored on your \n" 187 | "hardware.", None)) 188 | self.howPushButton.setText(_translate("homeWidget", "How?", None)) 189 | self.helpPushButton.setText(_translate("homeWidget", "Help", None)) 190 | 191 | -------------------------------------------------------------------------------- /one-click-blog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # -*- Mode: sh; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- 3 | # 4 | # =========================================================================== # 5 | # Stormy, the easy hidden service creator 6 | # by Griffin Boyce , with review from various dags 7 | # 8 | # https://github.com/glamrock/Stormy 9 | # 10 | # Usage: 11 | # run script as root to install a blog and set it as an onion site 12 | # =========================================================================== # 13 | 14 | # CHECK IF ROOT 15 | 16 | function root { 17 | if [[ `whoami` != root ]]; then 18 | echo "This install script should be run as root. (aka administrator)" 19 | exit; 20 | else 21 | keyfob 22 | fi 23 | } 24 | 25 | #----- VARIOUS ITEMS -----# 26 | version=$(lsb_release -cs) 27 | dist=$(lsb_release -is) 28 | 29 | 30 | #----- ADD DEVELOPER KEYS -----# 31 | 32 | function keyfob { 33 | 34 | #NodeJS 35 | gpg --keyserver keys.mayfirst.org --recv-keys 136221EE520DDFAF0A905689B9316A7BC7917B12 36 | 37 | # Tor build keys 38 | gpg --keyserver keys.mayfirst.org --recv-keys 74A941BA219EC810 A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 39 | 40 | # Other Tor development keys 41 | gpg --keyserver keys.mayfirst.org --recv-keys \ 42 | 4A90646C0BAED9D456AB3111E5B81856D0220E4B \ 43 | 35CD74C24A9B15A19E1A81A194373AA94B7C3223 \ 44 | 8C4CD511095E982EB0EFBFA21E8BF34923291265 \ 45 | AD1AB35C674DF572FBCE8B0A6BC758CBC11F6276 \ 46 | 0D24B36AA9A2A651787876451202821CBE2CD9C1 \ 47 | 25FC1614B8F87B52FF2F99B962AF4031C82E0039 \ 48 | 261C5FBE77285F88FB0C343266C8C2D7C5AA446D \ 49 | C963C21D63564E2B10BB335B29846B3C683686CC \ 50 | 68278CC5DD2D1E85C4E45AD90445B7AB9ABBEEC6 \ 51 | 0291ECCBE42B22068E685545627DEE286B4D6475 \ 52 | 02959AA7190AB9E9027E07363B9D093F31B0974B \ 53 | C2E34CFC13C62BD92C7579B56B8AAEB1F1F5C9B5 \ 54 | 8738A680B84B3031A630F2DB416F061063FEE659 \ 55 | B35BF85BF19489D04E28C33C21194EBB165733EA \ 56 | F65CE37F04BA5B360AE6EE17C218525819F78451 \ 57 | B1172656DFF983C3042BC699EB5A896A28988BF5 \ 58 | 879BDA5BF6B27B6127450A2503CF4A0AB3C79A63 59 | 60 | # Update 61 | apt-get update -y -qq 62 | 63 | addsource 64 | } 65 | 66 | 67 | #----- ADD SOFTWARE SOURCES -----# 68 | 69 | function addsource { 70 | # Adds sources for various dependencies 71 | echo 'Adding software sources' 72 | local sources_list_d='/etc/apt/sources.list.d' 73 | local sources_list_file='single.list' 74 | 75 | # Detect if Ubuntu or Debian 76 | if [[ $dist == "Ubuntu" ]]||[[ $dist == "Debian" ]]; then 77 | [ -d $sources_list_d ] || mkdir -p $sources_list_d 78 | echo "deb http://deb.torproject.org/torproject.org $version main"| tee -a $sources_list_d/$sources_list_file 79 | # Detect Wat 80 | else 81 | echo 'Sorry, this script is just for Ubuntu or Debian systems!' 82 | echo 'Using another OS? Send a request to griffin@torproject.org' 83 | echo 'https://github.com/glamrock/stormy' 84 | exit 85 | fi 86 | 87 | # Update after the new sources 88 | apt-get update -y -qq 89 | apt-get install deb.torproject.org-keyring -y -qq #better safe than sorry 90 | echo 'Done.' 91 | 92 | ghost #head to ghost install function 93 | } 94 | 95 | #----- Install Ghost and related dependencies -----# 96 | 97 | function ghost { 98 | echo 'Installing dependencies...' 99 | apt-get build-dep python-defaults -y -qq 100 | apt-get update -y -qq 101 | apt-get install iptables python python-dev python-software-properties -y -qq 102 | apt-get install tor -y -qq 103 | 104 | # NODE 105 | apt-get install g++ make nodejs -y -qq 106 | apt-get update -y -qq 107 | apt-get install npm -y -qq 108 | npm install forever -g --silent 109 | npm install ghost -g --silent 110 | npm config set loglevel warn # sets the log to only log warnings and above - good to reduce noise 111 | 112 | 113 | # Double-check for broken deps before finishing up 114 | echo 'Checking integrity...' 115 | apt-get check -y -qq 116 | 117 | # Debian users are less nervous than Ubuntu users, but still. 118 | echo 'Dependencies installed!' 119 | 120 | # Get and install Ghost from source 121 | 122 | echo 'Installing your blog' 123 | cd /var/www 124 | wget https://ghost.org/zip/ghost-latest.zip --quiet --server-response --timestamping --ignore-length 125 | unzip -d ghost ghost-latest.zip 126 | rm ghost-latest.zip 127 | cd ghost 128 | npm install --production #this installs Ghost 129 | 130 | # Start Ghost and set Forever 131 | cd /var/www/ghost 132 | NODE_ENV=production forever --minUptime=100ms --spinSleepTime=3000ms start index.js -e error.log 133 | 134 | echo 'Configuring your blog' 135 | if [[ $dist == "Ubuntu" ]]; then 136 | touch /etc/init/ghost.conf 137 | cat < /etc/init/ghost.conf 138 | start on startup 139 | stop on shutdown 140 | 141 | exec forever --sourceDir=/var/www/ghost -p ~/.forever --minUptime=100ms --spinSleepTime=3000ms start index.js -e error.log 142 | EOF 143 | 144 | else #For Debian and non-Debian derivatives, manual labor is required 145 | 146 | # Init.d file to auto-start forever+ghost 147 | cat < /etc/init.d/forever 148 | #!/bin/sh 149 | 150 | export PATH=\$PATH:/usr/local/bin 151 | export NODE_PATH=\$NODE_PATH:/usr/local/lib/node_modules 152 | export SERVER_PORT=80 153 | export SERVER_IFACE=127.0.0.1 154 | 155 | case "\$1" in 156 | start) 157 | exec forever --sourceDir=/var/www/ghost -p ~/.forever --minUptime=100ms --spinSleepTime=3000ms start index.js -e error.log 158 | ;; 159 | 160 | stop) 161 | exec forever stop --sourceDir=/var/www/ghost index.js 162 | ;; 163 | esac 164 | 165 | exit 0 166 | EOF 167 | fi 168 | chmod +x /etc/init.d/forever 169 | ln -s /etc/init.d/forever /etc/rc.d/ 170 | update-rc.d forever defaults #forever+ghost will now rise on boot 171 | 172 | #backup content on a regular basis 173 | 174 | mkdir /var/lib/tor/backups 175 | 176 | cat < /etc/cron.monthly/ghost-backup 177 | #!/bin/sh 178 | 179 | for file in /var/www/ghost/content/data/*.db; 180 | do cp "\$file" /var/lib/tor/backups/"\${file}-ghost-\`date +%Y-%m\`"; 181 | done 182 | 183 | EOF 184 | 185 | #check for updates, and if they exist, execute them 186 | 187 | cat < /etc/cron.daily/ghost 188 | #!bin/sh 189 | 190 | cd /var/www/ghost 191 | 192 | wget https://ghost.org/zip/ghost-latest.zip --timestamping --ignore-length --quiet 193 | unzip -d ghost-update ghost-latest.zip 194 | 195 | service ghost stop #stop ghost before updating 196 | 197 | cp ghost-update/*.md ghost-update/*.js ghost-update/*.json .. 198 | rm -R core 199 | cp -R ghost-update/core .. 200 | cp -R ghost-update/content/themes/caspar content/themes 201 | chown -R ghost:ghost /var/www/ghost 202 | 203 | npm install --production 204 | 205 | rm -R ghost-update 206 | 207 | service ghost start #starts ghost again 208 | 209 | EOF 210 | 211 | # ensure cron scripts have execution permissions 212 | chmod 0755 /etc/cron.monthly/ghost-backup /etc/cron.daily/ghost 213 | 214 | # kick over to tor 215 | torque 216 | } 217 | 218 | 219 | #----- Tor Dependencies and creation -----# 220 | 221 | function torque { 222 | 223 | echo 'Configuring your Tor Hidden Service' 224 | 225 | # overwrite the existing torrc, but check if it contains an existing hs first 226 | 227 | if ! grep -qw "#HiddenServiceDir /var/lib/tor/hidden_service" /etc/tor/torrc; then 228 | echo "You are about to replace an existing tor configuration file." 229 | echo 'Continue? (Y)es / (N)o' 230 | read -p '' REPLY 231 | 232 | if [ "$REPLY" == "y" ]||[ "$REPLY" == "Y" ]; then 233 | cp /etc/tor/torrc /etc/tor/torrc.original 234 | >| /etc/tor/torrc #truncate the torrc 235 | 236 | cat << EOF > /etc/tor/torrc 237 | 238 | #Log notice file /var/log/tor/notices.log 239 | RunAsDaemon 1 # Will run tor in the background 240 | 241 | HiddenServiceDir /var/lib/tor/ghost/ 242 | # HiddenServicePort 80 127.0.0.1:80 # uncomment if creating a clearnet website. 243 | HiddenServicePort 2368 127.0.0.1:2368 #default ghost port 244 | 245 | EOF 246 | 247 | 248 | else #no - cancels hs setup 249 | echo "Stormy will now cancel hidden service setup. However, your blog is still installed." 250 | echo 'Delete blog? (Y)es / (N)o' 251 | read -p '' SEANCE 252 | if [ "$SEANCE" == "y" ]||[ "$SEANCE" == "Y" ]; then 253 | rm -rf '/var/www/ghost' 254 | apt-get autoclean -y -qq 255 | apt-get autoremove -y -qq 256 | apt-get update -y -qq 257 | apt-get -f install -y -qq 258 | rm /etc/init.d/forever #this will call a collision if there was already a forever init.d 259 | clear && echo "Goodbye." 260 | exit 261 | else 262 | clear && echo "Goodbye." 263 | exit 264 | fi 265 | fi 266 | else 267 | >| /etc/tor/torrc #empty the current torrc 268 | 269 | cat << EOF > /etc/tor/torrc 270 | 271 | #Log notice file /var/log/tor/notices.log 272 | RunAsDaemon 1 # Will run tor in the background 273 | 274 | HiddenServiceDir /var/lib/tor/ghost/ 275 | # HiddenServicePort 80 127.0.0.1:80 # uncomment if creating a clearnet website. 276 | HiddenServicePort 2368 127.0.0.1:2368 #default ghost port 277 | 278 | EOF 279 | 280 | fi 281 | 282 | chown -hR debian-tor /var/lib/tor #set ownership for this folder and all subfolders to user debian-tor 283 | mkdir -p /var/lib/tor/ghost 284 | chmod 0700 /var/lib/tor/ghost 285 | 286 | sed -i '/RUN_DAEMON=.*/c\RUN_DAEMON="yes"' /etc/default/tor #allow to start on boot, even if it was previously set to no 287 | update-rc.d tor defaults 288 | echo 'Your hidden service will start on boot.' 289 | 290 | server # 291 | } 292 | 293 | function server { # killed off nginx because it's unecessary for one-click 294 | 295 | true 296 | 297 | spooky #let's bring it all together now 298 | } 299 | 300 | function spooky { 301 | 302 | echo 'Generating .onion address' 303 | sudo -u debian-tor tor --runasdaemon 1 #run tor to generate a hostname 304 | 305 | hostname=$(cat /var/lib/tor/ghost/hostname) 306 | echo "Your onion address is": "$hostname" 307 | 308 | # map the .onion address to ghost's config file 309 | 310 | cp /var/www/ghost/config.example.js /var/www/ghost/config.js 311 | 312 | sed -i "s/my-ghost-blog.com/$hostname/g" /var/www/ghost/config.js 313 | 314 | popcon #disable popularity contest 315 | } 316 | 317 | 318 | #----- DISABLE POPULARITY -----# 319 | 320 | function popcon { 321 | 322 | # Long live the king 323 | # Note: in Ubuntu, while it is a dep of ubuntu metapackages, removing both might 324 | # not destroy the system. It is also toggled off by default: PARTICIPATE="no" 325 | # http://ubuntuforums.org/showthread.php?t=1654103 gives me pause. 326 | 327 | if [ "$(dpkg-query -l | grep -c popularity-contest)" -ne 0 ]; 328 | then 329 | if [[ $dist == "Debian" ]]; then 330 | apt-get purge popularity-contest #not a dependency for Debian 331 | elif [[ $dist == "Ubuntu" ]]; then 332 | # delete the entire config string, then replace with a "no" 333 | sed -i '/PARTICIPATE/c\PARTICIPATE="no"' /etc/popularity-contest.conf 334 | chmod -x /etc/cron.daily/popularity-contest # Ensure popularity-contest cronjob does not run daily 335 | fi 336 | fi 337 | cleanup 338 | } 339 | 340 | #----- Cleanup -----# 341 | 342 | function cleanup { 343 | clear 344 | echo '' 345 | echo 'Finishing up!' 346 | echo '' 347 | 348 | # Check for broken packages 349 | echo 'Checking software integrity' 350 | apt-get -f install -y -qq 351 | 352 | # Remove leftover files 353 | echo 'Removing leftover packages...' 354 | apt-get autoremove -y -qq 355 | echo 'Cleaning up temporary cache...' 356 | apt-get clean -y -qq 357 | echo 'Done!' 358 | sleep 5 359 | clear 360 | 361 | echo "Please take a moment to write down your hidden service address." 362 | echo "" 363 | echo "Your onion address is": "$hostname" 364 | echo "" 365 | echo "To access your blog dashboard, go to $hostname/ghost" 366 | echo "" 367 | echo "To easily download a copy of your posts, go to $hostname/debug" 368 | echo "" 369 | echo "Your hidden service's private key is located in /var/lib/tor/ghost" 370 | sleep 10 371 | 372 | 373 | log #kick to start services function 374 | } 375 | 376 | #----- Start services -----# 377 | 378 | function log { 379 | echo '>>> Starting Tor service' 380 | invoke-rc.d tor stop &>/dev/null 381 | invoke-rc.d tor start 382 | 383 | echo '>>> Starting Forever service' 384 | invoke-rc.d forever stop &>/dev/null 385 | invoke-rc.d forever start 386 | } 387 | 388 | root #start at the beginning 389 | 390 | ## END OF TRANSMISSION ## 391 | 392 | -------------------------------------------------------------------------------- /stormy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # -*- Mode: sh; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- 3 | # 4 | # =========================================================================== # 5 | # Stormy, the easy onion service creator 6 | # by Griffin Boyce , with review from various dags 7 | # 8 | # https://github.com/glamrock/Stormy 9 | # 10 | # Usage: 11 | # run script as root to install a service and set it as an onion service 12 | # =========================================================================== # 13 | 14 | # CHECK IF ROOT 15 | 16 | function root { 17 | if [[ "$(whoami)" != root ]]; then 18 | echo "This install script should be run as root. (aka administrator)" 19 | exit; 20 | else 21 | keyfob 22 | fi 23 | } 24 | 25 | #----- VARIOUS ITEMS -----# 26 | version=$(lsb_release -cs) 27 | dist=$(lsb_release -is) 28 | 29 | 30 | #----- ADD DEVELOPER KEYS -----# 31 | 32 | function keyfob { 33 | gpg --keyserver keys.mayfirst.org --recv-keys 136221EE520DDFAF0A905689B9316A7BC7917B12 #node 34 | 35 | # Tor build keys 36 | gpg --keyserver keys.mayfirst.org --recv-keys 74A941BA219EC810 A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 37 | 38 | # Other Tor development keys 39 | gpg --keyserver keys.mayfirst.org --recv-keys 4A90646C0BAED9D456AB3111E5B81856D0220E4B 35CD74C24A9B15A19E1A81A194373AA94B7C3223 8C4CD511095E982EB0EFBFA21E8BF34923291265 AD1AB35C674DF572FBCE8B0A6BC758CBC11F6276 0D24B36AA9A2A651787876451202821CBE2CD9C1 25FC1614B8F87B52FF2F99B962AF4031C82E0039 261C5FBE77285F88FB0C343266C8C2D7C5AA446D C963C21D63564E2B10BB335B29846B3C683686CC 68278CC5DD2D1E85C4E45AD90445B7AB9ABBEEC6 0291ECCBE42B22068E685545627DEE286B4D6475 02959AA7190AB9E9027E07363B9D093F31B0974B C2E34CFC13C62BD92C7579B56B8AAEB1F1F5C9B5 8738A680B84B3031A630F2DB416F061063FEE659 B35BF85BF19489D04E28C33C21194EBB165733EA F65CE37F04BA5B360AE6EE17C218525819F78451 B1172656DFF983C3042BC699EB5A896A28988BF5 879BDA5BF6B27B6127450A2503CF4A0AB3C79A63 40 | 41 | # Update 42 | apt-get update -y -qq 43 | 44 | addsource 45 | } 46 | 47 | #----- ADD SOFTWARE SOURCES -----# 48 | 49 | function addsource { 50 | # Adds sources for various dependencies 51 | echo 'Adding software sources' 52 | cp /etc/apt/sources.list /etc/apt/sources.list.original #backup original sources file 53 | 54 | # Detect if Ubuntu or Debian 55 | if [[ $dist == "Ubuntu" ]]||[[ $dist == "Debian" ]]; then 56 | 57 | echo "deb http://deb.torproject.org/torproject.org $version main"| tee -a /etc/apt/sources.list 58 | # Detect Wat 59 | else 60 | echo 'Sorry, this script is just for Ubuntu or Debian systems!' 61 | echo 'Using another OS? Send a request to griffin@torproject.org' 62 | echo 'https://github.com/glamrock/stormy' 63 | exit 64 | fi 65 | 66 | # Update after the new sources 67 | apt-get update -y -qq 68 | apt-get install deb.torproject.org-keyring #better safe than sorry 69 | apt-get update -y -qq 70 | echo 'Done.' 71 | 72 | wizard #fly off to the wizard function 73 | } 74 | 75 | #----- INSTALL Wizard / MENU -----# 76 | function wizard { 77 | INPUT=0 78 | echo '' 79 | echo 'MAIN MENU' 80 | echo 'What would you like to do? (Enter the number of your choice)' 81 | echo '' 82 | echo '1. Install hidden service dependencies' # webserver + tor 83 | echo '2. Set up a Ghost-based hidden service (blog)' 84 | echo '3. Create a personal cloud server (for files, calendar, tasks)' 85 | echo '4. Install a Jabber server' 86 | echo '5. Install a IRC server' 87 | echo '7. View more instructions' 88 | echo 'X. Exit without installing anything' 89 | echo '' 90 | read INPUT 91 | 92 | ## set hstype=$(whatever) depending on which selected 93 | ## ask for hsnick at some point, and set it ("Set a nickname for this hidden service? [Y/n]") 94 | 95 | if [ "$INPUT" -eq 1 ]; then 96 | hstype=$(basic) 97 | basic 98 | 99 | elif [ "$INPUT" -eq 2 ]; then 100 | hstype=$(ghost) 101 | ghost 102 | 103 | elif [ "$INPUT" -eq 3 ]; then 104 | hstype=$(cozy) 105 | cloud 106 | 107 | elif [ "$INPUT" -eq 4 ]; then 108 | hstype=$(jabber) 109 | jabber 110 | 111 | elif [ "$INPUT" -eq 5 ]; then 112 | hstype=$(irc) 113 | irc 114 | 115 | elif [ "$INPUT" -eq 7 ]; then 116 | man 117 | 118 | elif [ "$INPUT" = X ]||[ "$INPUT" = x ]; then 119 | clear && end #goes to end function 120 | 121 | else 122 | clear 123 | echo 'Wrong option. Try again.' 124 | exit 125 | fi 126 | } 127 | 128 | 129 | 130 | #----- Install Ghost and related dependencies -----# 131 | 132 | function ghost { 133 | echo 'Installing dependencies...' 134 | apt-get build-dep python-defaults -y -qq 135 | apt-get update -y -qq 136 | apt-get install iptables python python-dev python-software-properties -y -qq 137 | apt-get install tor -y -qq 138 | 139 | # NODE 140 | apt-get install g++ make nodejs -y -qq 141 | apt-get update -y -qq 142 | apt-get install npm -y -qq 143 | npm install forever -g --silent 144 | npm install ghost -g --silent 145 | npm config set loglevel warn # sets the log to only log warnings and above - good to reduce unnecessary noise 146 | 147 | 148 | # Double-check for broken deps before finishing up 149 | echo 'Checking integrity...' 150 | apt-get check -y -qq 151 | 152 | # Debian users are less nervous than Ubuntu users, but still. 153 | echo 'Dependencies installed!' 154 | 155 | # Get and install Ghost from source 156 | 157 | echo 'Installing your blog' 158 | cd /var/www 159 | wget https://ghost.org/zip/ghost-latest.zip --quiet --server-response --timestamping --ignore-length 160 | unzip -d ghost ghost-latest.zip 161 | rm ghost-latest.zip 162 | cd ghost 163 | npm install --production #this installs Ghost 164 | 165 | # Install nginx 166 | apt-get install nginx -y -qq 167 | 168 | # Start Ghost and set Forever 169 | cd /var/www/ghost 170 | NODE_ENV=production forever --minUptime=100ms --spinSleepTime=3000ms start index.js -e error.log 171 | 172 | echo 'Configuring your blog' 173 | if [[ $dist == "Ubuntu" ]]; then 174 | touch /etc/init/ghost.conf 175 | bash -c 'cat << EOF > /etc/init/ghost.conf 176 | start on startup 177 | stop on shutdown 178 | 179 | exec forever --sourceDir=/var/www/ghost -p ~/.forever --minUptime=100ms --spinSleepTime=3000ms start index.js -e error.log 180 | EOF' 181 | 182 | else #For Debian and non-Debian derivatives, manual labor is required 183 | 184 | # Init.d file to auto-start forever+ghost 185 | bash -c 'cat << EOF > /etc/init.d/forever 186 | #!/bin/sh 187 | 188 | export PATH=$PATH:/usr/local/bin 189 | export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules 190 | export SERVER_PORT=80 191 | export SERVER_IFACE=127.0.0.1 192 | 193 | case "$1" in 194 | start) 195 | exec forever --sourceDir=/var/www/ghost -p ~/.forever --minUptime=100ms --spinSleepTime=3000ms start index.js -e error.log 196 | ;; 197 | 198 | stop) 199 | exec forever stop --sourceDir=/var/www/ghost index.js 200 | ;; 201 | esac 202 | 203 | exit 0 204 | EOF' 205 | fi 206 | chmod +x /etc/init.d/forever 207 | ln -s /etc/init.d/forever /etc/rc.d/ 208 | update-rc.d forever defaults #forever+ghost will now rise on boot 209 | 210 | #backup content on a regular basis 211 | 212 | mkdir /var/lib/tor/backups 213 | 214 | bash -c 'cat << EOF > /etc/cron.monthly/ghost-backup 215 | #!/bin/sh 216 | 217 | for file in /var/www/ghost/content/data/*.db; 218 | do cp "$file" /var/lib/tor/backups/"${file}-ghost-`date +%Y-%m`"; 219 | done 220 | 221 | EOF' 222 | 223 | #check for updates, and if they exist, execute them 224 | 225 | bash -c 'cat < /etc/cron.daily/ghost 226 | #!bin/sh 227 | 228 | cd /var/www/ghost 229 | 230 | wget https://ghost.org/zip/ghost-latest.zip --timestamping --ignore-length --quiet 231 | unzip -d ghost-update ghost-latest.zip 232 | 233 | service ghost stop #stop ghost before updating 234 | 235 | cp ghost-update/*.md ghost-update/*.js ghost-update/*.json .. 236 | rm -R core 237 | cp -R ghost-update/core .. 238 | cp -R ghost-update/content/themes/caspar content/themes 239 | chown -R ghost:ghost /var/www/ghost 240 | 241 | npm install --production 242 | 243 | rm -R ghost-update 244 | 245 | service ghost start #starts ghost again 246 | 247 | EOF' 248 | 249 | seance 250 | 251 | } 252 | 253 | function seance { 254 | 255 | echo 'Configuring your Tor Hidden Service' 256 | 257 | # overwrite the existing torrc, but check if it contains an existing hs first 258 | 259 | if ! grep -qw "#HiddenServiceDir /var/lib/tor/hidden_service" /etc/tor/torrc; then 260 | echo "You are about to replace an existing tor configuration file." 261 | echo 'Continue? (Y)es / (N)o' 262 | read -p '' REPLY 263 | 264 | if [ "$REPLY" == "y" ]||[ "$REPLY" == "Y" ]; then 265 | cp /etc/tor/torrc /etc/tor/torrc.original 266 | >| /etc/tor/torrc #truncate the torrc 267 | 268 | bash -c 'cat << EOF > /etc/tor/torrc 269 | 270 | #Log notice file /var/log/tor/notices.log 271 | RunAsDaemon 1 # Will run tor in the background 272 | 273 | HiddenServiceDir /var/lib/tor/ghost/ 274 | HiddenServicePort 80 127.0.0.1:2368 275 | HiddenServicePort 2368 127.0.0.1:2368 #default ghost port 276 | 277 | EOF' 278 | 279 | 280 | else #no - cancels hs setup 281 | echo "Stormy will now cancel hidden service setup. However, your blog is still installed." 282 | echo 'Delete blog? (Y)es / (N)o' 283 | read -p '' SEANCE 284 | if [ "$SEANCE" == "y" ]||[ "$SEANCE" == "Y" ]; then 285 | rm -rf '/var/www/ghost' 286 | apt-get purge nodejs npm tor 287 | apt-get autoclean -y -qq 288 | apt-get autoremove -y -qq 289 | apt-get update -y -qq 290 | apt-get -f install -y -qq 291 | rm /etc/init.d/forever 292 | clear && echo "Goodbye." 293 | exit 294 | else 295 | clear && echo "Goodbye." 296 | exit 297 | fi 298 | fi 299 | else 300 | >| /etc/tor/torrc #empty the current torrc 301 | 302 | bash -c 'cat << EOF > /etc/tor/torrc 303 | 304 | #Log notice file /var/log/tor/notices.log 305 | RunAsDaemon 1 # Will run tor in the background 306 | 307 | HiddenServiceDir /var/lib/tor/"$hstype"/ 308 | HiddenServicePort 80 127.0.0.1:80 309 | HiddenServicePort 2368 127.0.0.1:2368 #default ghost port 310 | 311 | EOF' 312 | 313 | fi 314 | 315 | chown -hR debian-tor /var/lib/tor #set ownership for this folder and all subfolders to user debian-tor 316 | chmod 0700 /var/lib/tor/"$hstype" 317 | 318 | sed -i '/RUN_DAEMON="no"/c\RUN_DAEMON="yes"' ./etc/default/tor #allow to start on boot, even if it was previously set to no 319 | update-rc.d tor defaults 320 | echo 'Your hidden service will start on boot.' 321 | 322 | hostname=$(cat /var/lib/tor/"$hstype"/hostname) #assign $hostname for address display later 323 | 324 | popcon #disable popularity contest 325 | } 326 | 327 | #----- XMPP Server -----# 328 | 329 | function jabber { 330 | 331 | echo "Use the default Jabber configuration file? [Y/n]" 332 | read -p '' JAB 333 | if [ "$JAB" == "y" ]||[ "$JAB" == "Y" ]; then 334 | # edit nginx and ejabberd conf files 335 | 336 | true 337 | 338 | echo "Would you like to install a web-based chat client for your IRC service? [y/N]" 339 | read -p '' STAC 340 | if [ "$STAC" == "y" ]||[ "$STAC" == "Y" ]; then 341 | 342 | hstype=$(jab) 343 | 344 | else 345 | popcon 346 | fi #end of chat-client setup 347 | 348 | fi # end of jabber configuration 349 | } 350 | 351 | 352 | #----- IRC chat -----# 353 | 354 | function irc { 355 | 356 | echo "Would you like to install a web-based chat client for your IRC service?" 357 | read -p '' IRC 358 | if [ "$IRC" == "Y" ]||[ "$IRC" == "y" ]; then 359 | hstype=$(IRC) 360 | 361 | else true 362 | 363 | fi 364 | 365 | } 366 | 367 | 368 | 369 | #----- DISABLE POPULARITY -----# 370 | 371 | function popcon { 372 | 373 | # Long live the king 374 | # Note: in Ubuntu, while it is a dep of ubuntu metapackages, removing both might 375 | # not destroy the system. It is also toggled off by default: PARTICIPATE="no" 376 | # http://ubuntuforums.org/showthread.php?t=1654103 gives me pause. 377 | 378 | if [ "$(dpkg-query -l | grep -c popularity-contest)" -ne 0 ]; 379 | then 380 | if [[ "$(lsb_release -is)" == "Debian" ]];then 381 | apt-get purge popularity-contest -y -qq #not a dependency for Debian 382 | cleanup 383 | elif [[ "$(lsb_release -is)" == "Ubuntu" ]];then 384 | sed -i '/PARTICIPATE/c\PARTICIPATE="no"' ./etc/popularity-contest.conf 385 | chmod -x /etc/cron.daily/popularity-contest #I need more info here 386 | cleanup 387 | fi 388 | else 389 | cleanup 390 | fi 391 | 392 | cleanup 393 | } 394 | 395 | #----- Cleanup -----# 396 | function cleanup { 397 | clear 398 | echo '' 399 | echo 'Finishing up!' 400 | echo '' 401 | 402 | # Check for broken packages 403 | echo 'Checking software integrity' 404 | apt-get -f install -y -qq 405 | 406 | # Remove leftover files 407 | echo 'Removing leftover packages...' 408 | apt-get autoremove -y -qq 409 | echo 'Cleaning up temporary cache...' 410 | apt-get clean -y -qq 411 | echo 'Done!' 412 | sleep 5 413 | clear 414 | 415 | echo "Please take a moment to write down your hidden service address." 416 | echo "" 417 | echo "Your onion address is": "$hostname" 418 | echo "" 419 | echo "To access your blog dashboard, go to $hostname/ghost" 420 | echo "" 421 | echo "To easily download a copy of your posts, go to $hostname/debug" 422 | echo "" 423 | echo "Your hidden service's private key is located in /var/lib/tor/ghost" 424 | sleep 10 425 | 426 | 427 | log #kick to logoff/reboot function 428 | } 429 | 430 | #----- Logout Dialogue -----# 431 | 432 | function log { 433 | echo 'Please reboot if possible. Your hidden service will start automatically.' 434 | echo "(O)kay! / (I) can't yet." 435 | read -p "" REPLY 436 | echo "" 437 | 438 | if [ "$REPLY" = "o" ]||[ "$REPLY" = "O" ]; then 439 | shutdown -r +1 "Rebooting!" 440 | 441 | else 442 | echo 'Please reboot your system when possible.' 443 | echo 'Remember, your hidden services will start automatically whenever the system starts.' 444 | exit 445 | fi 446 | } 447 | 448 | #----- Man Page -----# 449 | 450 | function man { 451 | echo 'You have exited the wizard.' 452 | man stormy 453 | } 454 | 455 | #----- Exit Dialogue -----# 456 | 457 | function end { 458 | echo '' 459 | read -p "Are you sure you want to quit? (Y)es/(n)o " REPLY 460 | if [ "$REPLY" = "n" ]; then 461 | clear && wizard 462 | else 463 | clear && exit 464 | fi 465 | 466 | } 467 | 468 | root #start at the beginning 469 | 470 | ## END OF TRANSMISSION ## 471 | -------------------------------------------------------------------------------- /one-click-jabber.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # -*- Mode: sh; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- 3 | # 4 | # =========================================================================== # 5 | # Stormy, the easy hidden service creator 6 | # by Griffin Boyce , with review from various dags 7 | # 8 | # https://github.com/glamrock/Stormy 9 | # 10 | # Usage: 11 | # run script as root to install a jabber server 12 | # =========================================================================== # 13 | 14 | # CHECK IF ROOT 15 | 16 | function root { 17 | if [[ `whoami` != root ]]; then 18 | echo "This install script should be run as root. (aka administrator)" 19 | exit; 20 | else 21 | keyfob 22 | fi 23 | } 24 | 25 | #----- VARIOUS ITEMS -----# 26 | version=$(lsb_release -cs) 27 | dist=$(lsb_release -is) 28 | 29 | 30 | #----- ADD DEVELOPER KEYS -----# 31 | 32 | function keyfob { 33 | 34 | #NodeJS 35 | gpg --keyserver keys.mayfirst.org --recv-keys 136221EE520DDFAF0A905689B9316A7BC7917B12 36 | 37 | # Tor build keys 38 | gpg --keyserver keys.mayfirst.org --recv-keys 74A941BA219EC810 A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 39 | 40 | # Other Tor development keys 41 | gpg --keyserver keys.mayfirst.org --recv-keys \ 42 | 4A90646C0BAED9D456AB3111E5B81856D0220E4B \ 43 | 35CD74C24A9B15A19E1A81A194373AA94B7C3223 \ 44 | 8C4CD511095E982EB0EFBFA21E8BF34923291265 \ 45 | AD1AB35C674DF572FBCE8B0A6BC758CBC11F6276 \ 46 | 0D24B36AA9A2A651787876451202821CBE2CD9C1 \ 47 | 25FC1614B8F87B52FF2F99B962AF4031C82E0039 \ 48 | 261C5FBE77285F88FB0C343266C8C2D7C5AA446D \ 49 | C963C21D63564E2B10BB335B29846B3C683686CC \ 50 | 68278CC5DD2D1E85C4E45AD90445B7AB9ABBEEC6 \ 51 | 0291ECCBE42B22068E685545627DEE286B4D6475 \ 52 | 02959AA7190AB9E9027E07363B9D093F31B0974B \ 53 | C2E34CFC13C62BD92C7579B56B8AAEB1F1F5C9B5 \ 54 | 8738A680B84B3031A630F2DB416F061063FEE659 \ 55 | B35BF85BF19489D04E28C33C21194EBB165733EA \ 56 | F65CE37F04BA5B360AE6EE17C218525819F78451 \ 57 | B1172656DFF983C3042BC699EB5A896A28988BF5 \ 58 | 879BDA5BF6B27B6127450A2503CF4A0AB3C79A63 59 | 60 | # Update 61 | apt-get update -y -qq 62 | 63 | addsource 64 | } 65 | 66 | 67 | #----- ADD SOFTWARE SOURCES -----# 68 | 69 | function addsource { 70 | # Adds sources for various dependencies 71 | echo 'Adding software sources' 72 | local sources_list_d='/etc/apt/sources.list.d' 73 | local sources_list_file='single.list' 74 | 75 | # Detect if Ubuntu or Debian 76 | if [[ $dist == "Ubuntu" ]]||[[ $dist == "Debian" ]]; then 77 | [ -d $sources_list_d ] || mkdir -p $sources_list_d 78 | echo "deb http://deb.torproject.org/torproject.org $version main"| tee -a $sources_list_d/$sources_list_file 79 | # Detect Wat 80 | else 81 | echo 'Sorry, this script is just for Ubuntu or Debian systems!' 82 | echo 'Using another OS? Send a request to griffin@torproject.org' 83 | echo 'https://github.com/glamrock/stormy' 84 | exit 85 | fi 86 | 87 | # Update after the new sources 88 | apt-get update -y -qq 89 | apt-get install deb.torproject.org-keyring -y -qq #better safe than sorry 90 | echo 'Done.' 91 | 92 | torque #head to jabber install function 93 | } 94 | 95 | 96 | #----- Tor Dependencies and creation -----# 97 | 98 | #----- Because the jabber installation process requires the onionsite hostname, tor must be configured first 99 | 100 | function torque { 101 | 102 | echo 'Configuring your Tor Hidden Service' 103 | 104 | # overwrite the existing torrc, but check if it contains an existing hs first 105 | 106 | if ! grep -qw "#HiddenServiceDir /var/lib/tor/hidden_service" /etc/tor/torrc; then 107 | echo "You are about to replace an existing tor configuration file." 108 | echo 'Continue? (Y)es / (N)o' 109 | read -p '' REPLY 110 | 111 | if [ "$REPLY" == "y" ]||[ "$REPLY" == "Y" ]; then 112 | cp /etc/tor/torrc /etc/tor/torrc.original 113 | >| /etc/tor/torrc #truncate the torrc 114 | 115 | cat << EOF > /etc/tor/torrc 116 | 117 | #Log notice file /var/log/tor/notices.log 118 | RunAsDaemon 1 # Will run tor in the background 119 | 120 | HiddenServiceDir /var/lib/tor/jabber/ 121 | # HiddenServicePort 80 127.0.0.1:80 # uncomment if creating a clearnet website. 122 | HiddenServicePort 2368 127.0.0.1:2368 #default ghost port 123 | 124 | EOF 125 | 126 | 127 | else #no - cancels hs setup 128 | echo "Stormy will now cancel onion service setup." 129 | echo 'Continue? (Y)es / (N)o' 130 | read -p '' SEANCE 131 | if [ "$SEANCE" == "y" ]||[ "$SEANCE" == "Y" ]; then 132 | apt-get purge ejabberd -y -qq 133 | apt-get autoclean -y -qq 134 | apt-get autoremove -y -qq 135 | apt-get update -y -qq 136 | apt-get -f install -y -qq 137 | clear && echo "Goodbye." 138 | exit 139 | else 140 | clear && echo "Goodbye." 141 | exit 142 | fi 143 | fi 144 | else 145 | >| /etc/tor/torrc #empty the current torrc 146 | 147 | cat << EOF > /etc/tor/torrc 148 | 149 | #Log notice file /var/log/tor/notices.log 150 | RunAsDaemon 1 # Will run tor in the background 151 | 152 | HiddenServiceDir /var/lib/tor/jabber/ 153 | # HiddenServicePort 80 127.0.0.1:80 # uncomment if creating a clearnet website. 154 | HiddenServicePort 2368 127.0.0.1:2368 #default ghost port 155 | 156 | EOF 157 | 158 | fi 159 | 160 | chown -hR debian-tor /var/lib/tor #set ownership for this folder and all subfolders to user debian-tor 161 | mkdir -p /var/lib/tor/jabber 162 | chmod 0700 /var/lib/tor/jabber 163 | 164 | sed -i '/RUN_DAEMON=.*/c\RUN_DAEMON="yes"' /etc/default/tor #allow to start on boot, even if it was previously set to no 165 | update-rc.d tor defaults 166 | echo 'Your hidden service will start on boot.' 167 | 168 | spooky #let's bring it all together now 169 | } 170 | 171 | function spooky { 172 | 173 | echo 'Generating .onion address' 174 | sudo -u debian-tor tor --runasdaemon 1 #run tor to generate a hostname 175 | 176 | hostname=$(cat /var/lib/tor/jabber/hostname) 177 | echo "Your onion address is": "$hostname" 178 | 179 | popcon #disable popularity contest 180 | } 181 | 182 | 183 | #----- DISABLE POPULARITY -----# 184 | 185 | function popcon { 186 | 187 | # Long live the king 188 | # Note: in Ubuntu, while it is a dep of ubuntu metapackages, removing both might 189 | # not destroy the system. It is also toggled off by default: PARTICIPATE="no" 190 | # http://ubuntuforums.org/showthread.php?t=1654103 gives me pause. 191 | 192 | if [ "$(dpkg-query -l | grep -c popularity-contest)" -ne 0 ]; 193 | then 194 | if [[ $dist == "Debian" ]]; then 195 | apt-get purge popularity-contest #not a dependency for Debian 196 | elif [[ $dist == "Ubuntu" ]]; then 197 | # delete the entire config string, then replace with a "no" 198 | sed -i '/PARTICIPATE/c\PARTICIPATE="no"' /etc/popularity-contest.conf 199 | chmod -x /etc/cron.daily/popularity-contest # Ensure popularity-contest cronjob does not run daily 200 | fi 201 | fi 202 | 203 | jabber 204 | } 205 | 206 | 207 | #----- Install Jabber and related XMPP dependencies -----# 208 | 209 | function jabber { 210 | echo 'Installing dependencies...' 211 | 212 | # Open to ideas on replacing OpenSSL 213 | apt-get install openssl -y -qq 214 | apt-get install ejabberd -y -qq 215 | 216 | # Double-check for broken deps before finishing up 217 | echo 'Checking integrity...' 218 | apt-get check -y -qq 219 | 220 | # Debian users are less nervous than Ubuntu users, but still. 221 | echo 'Dependencies installed!' 222 | 223 | #cert 224 | #} 225 | # 226 | # function cert { # now it's time to generate a real certificate to use with jabber 227 | # cd /etc/ejabberd/ 228 | # openssl req -nodes -newkey rsa:4096 -keyout private.key -out CSR.csr -subj "/C=NL/ST=State/L=City/O=Company Name/OU=Department/CN=$hostname" 229 | # >| ejabberd.pem # empty the original snakeoil keyfile 230 | # cat private.key >> ejabberd.pem 231 | # cat certificate.pem >> ejabberd.pem 232 | 233 | scarecrow 234 | } 235 | 236 | 237 | function scarecrow { 238 | 239 | 240 | ADMIN_NAME=admin 241 | SRV_NAME=$(cat /var/lib/tor/jabber/hostname) 242 | PASS_LEN=10 # Length of the generated admin password 243 | # '!"#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'\' 244 | PASS_CHARS="0123456789#$%&+<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz" 245 | 246 | # make_pass len allowed_chars 247 | make_pass() 248 | { 249 | local i 250 | for i in `seq $1`; do printf "%s" "${2:$(($RANDOM%${#2})):1}"; done 251 | } 252 | 253 | # Find ed editor 254 | which ed 2>&- >/dev/null && ED=ed 255 | #which ex 2>&- >/dev/null && ED=ex 256 | 257 | sudo apt-get -y install ejabberd 258 | 259 | cat > /etc/ejabberd/ejabberd.cfg <&2; exit 1; } 385 | 386 | sudo apt-get install unattended-upgrades 387 | cat > /etc/apt/apt.conf.d/20auto-upgrades < /etc/apt/apt.conf.d/50unattended-upgrades < /etc/cron.monthly/ejabberd 408 | #!/bin/sh 409 | 410 | sudo -u ejabberd ejabberdctl --node ejabberd backup /var/lib/tor/backups/jabber.dmp 411 | done 412 | 413 | EOF 414 | 415 | #check for updates, and if they exist, execute them 416 | 417 | cat < /etc/cron.daily/ejabberd 418 | #!bin/sh 419 | done 420 | 421 | EOF 422 | 423 | # ensure cron scripts have execution permissions 424 | chmod 0755 /etc/cron.monthly/ejabberd /etc/cron.daily/ejabberd 425 | 426 | # add restore bash alias 427 | # to restore previous jabber users, simply type restore into a terminal 428 | 429 | if [ -f ~/.bash_aliases ]; 430 | then echo " alias restore='sudo -u ejabberd ejabberdctl --node ejabberd backup /var/lib/tor/backups/jabber.dmp'" >> ~/.bash_aliases 431 | source ~/.bash_aliases 432 | else 433 | echo " alias restore='sudo -u ejabberd ejabberdctl --node ejabberd backup /var/lib/tor/backups/jabber.dmp'" >> ~/.bashrc 434 | source ~/.bashrc 435 | fi 436 | 437 | # time to finish up 438 | cleanup 439 | } 440 | 441 | 442 | #----- Cleanup -----# 443 | 444 | function cleanup { 445 | clear 446 | echo '' 447 | echo 'Finishing up!' 448 | echo '' 449 | 450 | # Check for broken packages 451 | echo 'Checking software integrity' 452 | apt-get -f install -y -qq 453 | 454 | # Remove leftover files 455 | echo 'Removing leftover packages...' 456 | apt-get autoremove -y -qq 457 | echo 'Cleaning up temporary cache...' 458 | apt-get clean -y -qq 459 | echo 'Done!' 460 | sleep 5 461 | clear 462 | 463 | echo "Please take a moment to write down your hidden service address and passwords." 464 | echo "" 465 | echo "Your onion address is": "$hostname" 466 | echo "" 467 | echo "Your hidden service's private key is located in /var/lib/tor/jabber" 468 | echo "Admin user $ADMIN_NAME on server $SRV_NAME has been created with $pass for a password." 469 | 470 | 471 | sleep 10 472 | 473 | 474 | log #kick to start services function 475 | } 476 | 477 | #----- Start services -----# 478 | 479 | function log { 480 | echo '>>> Starting Tor service' 481 | invoke-rc.d tor stop &>/dev/null 482 | invoke-rc.d tor start 483 | 484 | echo '>>> Starting Forever service' 485 | invoke-rc.d ejabberd stop &>/dev/null 486 | invoke-rc.d ejabberd start 487 | } 488 | 489 | root #start at the beginning 490 | 491 | ## END OF TRANSMISSION ## 492 | 493 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------