Merge branch 'release-1.1.0'

* release-1.1.0: (183 commits)
  Revert the changes for the konami code
  Update index.html
  Update page_style.css
  hostapd.conf: default client isolation paramter
  Update motd.txt version
  Droopy: Make chmod optional.
  First Checklist for PirateBox tests
  Fix merge leftover artifact
  Update nothing.html
  Create konami.js
  Update nothing.html
  Create nothing.html
  Update index.html
  Adjust url to daviddarts.com
  lighttpd configuration: add xhtml mime type
  lighttpd configuration: add xhtml mime type
  Update start/stop for miniirc in piratebox_alt
  Update start/stop of IRC in piratebox
  Feature: Firewall rules for non OpenWrt PirateBoxes
  Adding freshly implemented features
  ...
This commit is contained in:
Matthias Strubel 2016-09-20 20:53:58 +02:00
commit b3b1030613
80 changed files with 3469 additions and 525 deletions

5
.gitignore vendored
View File

@ -3,6 +3,9 @@
piratebox/piratebox/version
piratebox/piratebox/www/chat_content.html
image_stuff/*
piratebox/piratebox/bin/miniircd.py
piratebox_ws_*
piratebox-ws_*
tmp/*
piratebox/piratebox/bin/miniircd.py
piratebox/piratebox/www/Shared
piratebox/piratebox/www/cgi-bin/data.pso

View File

@ -1,4 +1,4 @@
Based on idea of David Darts: http://wiki.daviddarts.com/PirateBox
Based on idea of David Darts: http://daviddarts.com
Script collection by:
Matthias Strubel http://piratebox.aod-rpg.de
@ -22,6 +22,8 @@ Contributors for modifications:
# herr-gabriel
# Jess Stubenbord
# Mike Weaver
# bartschat - RTC RPi feature
# casdr
# ... and all others I might have forgotten.

View File

@ -1,5 +1,32 @@
CHANGELOG
=== 1.1.0 ===
* [New] Enable / Disable file provisioning for custom lighttpd directory listing
* [New] ChatBox message is now in conf/chat_init.txt
* [New] Disable the Shoutbox to prevent writing into it
* [New] PHP configuration shipped, to enable easily for modifications
* [New] Mesh implementation, technical preview
* [New] JSON config file to direct client side applications, like "share apps"
* [New] Simply python IRC Server installed and prepareable for automatic start
* [New] Shoutbox-Time via Client-Date possible
* [New] Website is now available under /content and /opt/piratebox/share
* [New] [RPi] Service files for using a RTC at PiratBox
* [New] Redirect all DNS requests to local box via firewall (custom script)
* [New] Redirect all web request option via firewall (disabled) (custom script)
* [New] [OpenWrt] Redirect all DNS requests to local box via firewall
* [New] [OpenWrt] Redirect all web request option via firewall (disabled)
* [New] [OpenWrt] Enable all wifi devices with the PirateBox SSID
* [New] [OpenWrt] AP Client isolation activated per default
* [Changed] Send HTTP-Code 204 via PHP, much cleaner
* [Changed] Update jQuery to 2.2.3, removes IE <=8 support
* [Changed] Redirect happens now always to wished domain name
* [Changed] Droopy, make chmod operation optional (prevent errors on OpenWRT)
* [Fix] License Adjustments
* [Fix] Prevent JS Injection in Shoutbox
* [Fix] Shoutbox: Missing blank between author and content
* [Fix] Fix problem when running in small display mode at direcotry listing.
* [Fix] Add xhtml mime type in lighttpd configuration
=== 1.0.7 ===
* [New] Lock shoutbox when you send a message.
* [New] Display disk space usage on front page.
@ -101,6 +128,8 @@ NOTE: This may only be a partial changelog, check github / your package manager
* [New] install method
* [New] install dependencies
* [Fixed] General cleaning
* [Removed] [Testing] Executable, we will stick to service based
* [Fixed] Overwritten saved timestamp with 1970 one
* [New] possibility in install_piratebox.sh to exchange the hostname easily
* [New] Moved DHCP leasefile into memory on OpenWRT system (/tmp is memory)
* [Fix] Timesave script does not contain parts for OpenWRT anymore
@ -111,8 +140,8 @@ NOTE: This may only be a partial changelog, check github / your package manager
* [Fix] Enable unescaped blanks in Upload-Folder
* [Fix] iOS 7 captive Portal fix
* [New] Sample configuration for UPnP Server
* [New] Image file is ext4 and 50MB
=== v0.6G ===
* [Fix] Hide dot files in directory-listing which are usually hidden files
* [Fixed] Hide dot files in directory-listing which are usually hidden files
* [New] Image file is ext4 and 50MB
* [Fix] Fixed captive Portal detection for iOS7

84
CHECKLIST.md Normal file
View File

@ -0,0 +1,84 @@
# Image Testing Checklist
If you are part of the testing team, this Checklist is for you.
## For RaspberryPi
Download the image, dump it to SD card, connect your PirateBox to the same network the computer you are testing from is connected to and then go through the checklist step by step to make sure everything is working as it should.
Before going through the checklist, make sure your USB WiFi is attached and is one of the supported types. Also make sure you have a *FAT32* formatted USB thumb drive attached to your RPi.
## For OpenWrt
Download the corresponding install_piratebox.zip and .bin file for your device. If you have already a PirateBox running, follow the upgrade instructions. If you install your Software on a fresh device, follow the installation howto
Make sure you PirateBox stopped flashing (indicating the installation is running). On PirateBox 1.1.0 the installation happens in multiple interations.
## Checklist
(Skip sections which are not valid for your architecture).
### Initial configuration setup
* [ ] PirateBox' WiFi is available
* [ ] Connection to PirateBox' WiFi could be established
* [ ] **RPi only** SSH connection to PirateBox with the username *alarm* and the password *alarm* could be established
* [ ] **RPi only** Message of the day containing information about *First Steps* is displayed correctly
* [ ] **RPi only** Change the password for the *alarm* user, log out and log back in
* [ ] **RPi only** Enable USB share
* [ ] Set some date and enable Fake-timeservice
* [ ] Enable Kareha Image and Discussion Board
* [ ] Enable UPnP media server (minidlna)
* [ ] It is possible to post to the chat
* [ ] It is possible to upload files
* [ ] It is possible to post to the board
* [ ] Reboot
* [ ] PirateBox' WiFi is available
* [ ] Connection to PirateBox' WiFi could be established
* [ ] Date matches the set date from the Fake-timeservice
### Functional tests
**UI in General**
* [ ] UI looks proper, no ugly overlapping
* [ ] UI is responsive on small browser size; is adjusts the look
* [ ] Every URL is working, on main screen
* [ ] Title URLs to mainscreen and Forum are working in Directory-Listing
**ImageBoard**
* [ ] It is possible to post new threads
* [ ] These threads can be answered on
* [ ] When I come back later to the imageboard and post a reply, the post order is correct.
* [ ] I can upload files (<5MB) to the posts as well
**Shoutbox**
* [ ] Different color work in Shoutbox , Username can be changed
* [ ] Posting URLs or other HTML like special characters do not break Shoutbox
**Upload**
* [ ] Upload of different filetypes works
* [ ] Multiple files can be uploaded
* [ ] The messages inside the upload box are in english or my language
* [ ] Special characters are correctly uploaded
* [ ] It is not possible to upload a file named index.html
**Directory Listing**
* [ ] Download of files is possible
* [ ] Directory listing reacts responsive on screen size changes
* [ ] Created folders are accessiable (UI is deployed after reboot)
* [ ] URLs to mainpage and forum in subfolder work
* [ ] Special character files uploaded via upload functionality work
**UPNP Server**
* [ ] Streaming of MP3 works via an UPNP client
* [ ] It is possible to stream videos via UPNP
**IRC Server**
* [ ] Is started after activation in piratebox.conf
* [ ] With an IRC client, the IRC server is usable
* [ ] New channels can be created
**Customization**
* [ ] Changes on the folder "content" on the USB Stick (**valid for OpenWrt** and RPI **with USB Storage mod**) are visible on the browser
* [ ] PHP was sucessfully enabled in lighttpd.conf and fastcgi processes are visible in "ps"
* [ ] My custom PHP script is working in /content folder
* [ ] Deleting the content folder creates a new folder after a reboot
* [ ] It is possible to change the visible hostname of piratebox using the install_piratebox.sh script
**Enhanced Network Configuration**
* [ ] Clients with static DNS Server entries work while being connected to PirateBox (PirateBox interferes here)
* [ ] One Client can not ping or connect to another Client (directly via wifi)
* [ ]

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. {http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see {http://www.gnu.org/licenses/}.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
LibraryBox-core Copyright (C) 2013 LibraryBox Development
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
{http://www.gnu.org/licenses/}.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
{http://www.gnu.org/philosophy/why-not-lgpl.html}.

View File

@ -1,5 +1,5 @@
NAME = piratebox-ws
VERSION = 1.0.7
VERSION = 1.1.0
ARCH = all
PB_FOLDER=piratebox
PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER)
@ -8,8 +8,8 @@ PACKAGE_NAME=$(NAME)_$(VERSION)
PACKAGE=$(PACKAGE_NAME).tar.gz
VERSION_FILE=$(PB_FOLDER)/$(PB_FOLDER)/version
IMAGE_FILE=piratebox_ws_1.0_img.gz
TGZ_IMAGE_FILE=piratebox_ws_1.0_img.tar.gz
IMAGE_FILE=piratebox_ws_1.1_img.gz
TGZ_IMAGE_FILE=piratebox_ws_1.1_img.tar.gz
SRC_IMAGE=image_stuff/OpenWRT_ext4_50MB.img.gz
SRC_IMAGE_UNPACKED=image_stuff/piratebox_img
MOUNT_POINT=image_stuff/image
@ -17,16 +17,31 @@ OPENWRT_FOLDER=image_stuff/openwrt
OPENWRT_CONFIG_FOLDER=$(OPENWRT_FOLDER)/conf
OPENWRT_BIN_FOLDER=$(OPENWRT_FOLDER)/bin
WORKFOLDER=tmp
###IRC deployment
IRC_GITHUB_ULR=git://github.com/jrosdahl/miniircd.git
IRC_WORK_FOLDER=$(WORKFOLDER)/irc
IRC_SRC_SERVER=$(IRC_WORK_FOLDER)/miniircd
IRC_TARGET_SERVER=$(PB_SRC_FOLDER)/bin/miniircd.py
.DEFAULT_GOAL = package
$(IRC_TARGET_SERVER):
mkdir -p $(WORKFOLDER)
git clone $(IRC_GITHUB_ULR) $(IRC_WORK_FOLDER)
cp $(IRC_SRC_SERVER) $(IRC_TARGET_SERVER)
$(VERSION):
echo "$(PACKAGE_NAME)" > $(VERSION_FILE)
echo `git status -sb --porcelain` >> $(VERSION_FILE)
echo ` git log -1 --oneline` >> $(VERSION_FILE)
$(PACKAGE): $(VERSION)
$(PACKAGE): $(IRC_TARGET_SERVER) $(VERSION)
tar czf $@ $(PB_FOLDER)
$(IMAGE_FILE): $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) $(OPENWRT_BIN_FOLDER)
$(IMAGE_FILE): $(IRC_TARGET_SERVER) $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) $(OPENWRT_BIN_FOLDER)
mkdir -p $(MOUNT_POINT)
echo "#### Mounting image-file"
sudo mount -o loop,rw,sync $(SRC_IMAGE_UNPACKED) $(MOUNT_POINT)
@ -44,12 +59,16 @@ $(OPENWRT_CONFIG_FOLDER):
cp -rv $(PB_SRC_FOLDER)/conf/* $@
sed 's:OPENWRT="no":OPENWRT="yes":' -i $@/piratebox.conf
sed 's:DO_IFCONFIG="yes":DO_IFCONFIG="no":' -i $@/piratebox.conf
sed 's:IPV6_ENABLE="no":IPV6_ENABLE="yes":' -i $@/ipv6.conf
sed 's:USE_APN="yes":USE_APN="no":' -i $@/piratebox.conf
sed 's:DNSMASQ_INTERFACE="wlan0":DNSMASQ_INTERFACE="br-lan":' -i $@/piratebox.conf
sed 's:192.168.77:192.168.1:g' -i $@/piratebox.conf
sed 's:DROOPY_USE_USER="yes":DROOPY_USE_USER="no":' -i $@/piratebox.conf
sed 's:DROOPY_CHMOD:#DROOPY_CHMOD:' -i $@/piratebox.conf
sed 's:LEASE_FILE_LOCATION=$$PIRATEBOX_FOLDER/tmp/lease.file:LEASE_FILE_LOCATION=/tmp/lease.file:' -i $@/piratebox.conf
sed 's:TIMESAVE_FORMAT="":TIMESAVE_FORMAT="+%C%g%m%d%H%M":' -i $@/piratebox.conf
sed 's:FIREWALL_FETCH_DNS="yes":FIREWALL_FETCH_DNS="no":' -i $@/firewall.conf
sed 's:FIREWALL_FETCH_HTTP="yes":FIREWALL_FETCH_HTTP="no":' -i $@/firewall.conf
$(OPENWRT_BIN_FOLDER):
@ -69,6 +88,13 @@ package: $(PACKAGE)
all: package shortimage
clean: cleanimage
rm -fr $(WORKFOLDER)
rm -fr $(IRC_WORK_FOLDER)
rm -f $(IRC_TARGET_SERVER)
rm -f $(PACKAGE)
rm -f $(VERSION_FILE)
cleanimage:
- rm -f $(TGZ_IMAGE_FILE)
- rm -f $(SRC_IMAGE_UNPACKED)
@ -76,13 +102,9 @@ cleanimage:
- rm -v $(IMAGE_FILE)
- rm -rv $(OPENWRT_BIN_FOLDER)
clean: cleanimage
rm -f $(PACKAGE)
rm -f $(VERSION_FILE)
shortimage: $(IMAGE_FILE) $(TGZ_IMAGE_FILE)
.PHONY: all clean package shortimage

View File

@ -6,53 +6,55 @@
## Maintainers
* [Matthias Strubel](matthias.strubel@aod-rpg.de)
Sources for Running PirateBox with Webserver lighttpd
Contains: Shoutbox, Forum
PirateBox is a collection of scripts / programs that allows you to use your wireless card
as a local network to share files and chat anonymously. For more information please visit
http://daviddarts.com/
## Info
----- Info -----
Packages contains only scripts based PirateBox scripts with running lighttpd webserver.
PirateBox scripts can:
* Setup WLAN Interface via iw
* Setup hotspot functionality (hostapd)
* Setup IP Adresses of wlan interface
* Probing until USB-WLAN is available
* Can add wlan interface to an existing bridge
* Sets Up a DHCP Server with redirect to wlan-interface IP
* Upload landing page (via iframe droopy)
* Browse Uploaded files
* Announce "Internet yes" for iOS
* Announce "Internet yes" for MS devices
* ShoutBox
* Optional small python Forum
* Optional imageboard
* Optional Station counter
* Optional Inihibit starting upload-script
* Optional Timesave script (for devices without RTC) - can be found in piratebox/bin/timesave.sh
* Optional Poll for WLAN device until it available (for USB wifi cards)
* Setup WLAN Interface via iw
* Setup hotspot functionality (hostapd)
* Setup IP Adresses of wlan interface
* Proping until USB-WLAN is available
* Can add wlan interface to an existing bridge
* Sets Up a DHCP Server with redirect to wlan-interface IP
* Upload landing page (via iframe droopy)
* Browse Uploaded files
* Announce "Internet yes" for iOS
* Announce "Internet yes" for MS devices
* ShoutBox
* Optional small python Forum
* Optional imageboard
* Optional Station counter
* Optional Inihibit starting upload-script
* Optional Timesave script (for devices without RTC) - can be found in piratebox/bin/timesave.sh
* Optional Poll for WLAN device until it available (for USB wifi cards)
* Optional IRC-Server
More information can be found on: http://piratebox.aod-rpg.de
Installation-HowTo and current Download-Link: http://piratebox.aod-rpg.de/dokuwiki/doku.php/piratebox_lighttpd
More information can be found ont http://piratebox.aod-rpg.de
Installation-HowTo und current Download-Link: http://piratebox.aod-rpg.de/dokuwiki/doku.php/piratebox_lighttpd
Is supported by [mkPirateBox > v0.5 for OpenWRT Systems](https://github.com/MaStr/mkPirateBox)
and by [PirateBox Manager](https://github.com/TerrorByte/PirateBox-Manager).
Is supported by mkPirateBox > v0.5 for OpenWRT Systems https://github.com/MaStr/mkPirateBox
and by PirateBox Manager https://github.com/TerrorByte/PirateBox-Manager
## Installation
----- Installation -----
PirateBox should be in most common repositories soon, but in the mean time you can use this method:
### For alpha testing
Download the [development package](https://github.com/MaStr/PirateBoxScripts_Webserver/archive/development.zip).
##### For alpha testing
Download the package:
https://github.com/MaStr/PirateBoxScripts_Webserver/archive/development.zip
Unzip the package:
unzip development.zip
$unzip development.zip
Run the installer in the unzipped folder:
$ cd PirateBoxScripts_Webserver/piratebox
$ sudo ./install.sh default #Default can be substituted with 'board' if you want an image board on your PB
cd PirateBoxScripts_Webserver/piratebox
sudo ./install.sh default
#Default can be substituted with 'board' if you want an image board on your PirateBox

View File

@ -0,0 +1,99 @@
## Configuration for Piratebox
server.modules = (
# "mod_access", not needed!
"mod_alias",
# "mod_compress", Disabled, fixing reload Problem??
"mod_redirect",
# "mod_rewrite",
"mod_setenv",
)
var.basedir=env.HOME + /tmp
server.document-root = basedir + "/www"
## Locate the tmp storage into tmp. It is in most cases the ram
## Limit the uploads to 4MB to save - especially on small devices
## the device from dieing because OUT-OF-RAM exceptions
## in KB => 4MB
server.upload-dirs = ( "/tmp" )
server.max-request-size = 4048
server.errorlog = "/tmp/error.log"
server.breakagelog = "/tmp/break.log"
server.pid-file = "/tmp/lighttpd.pid"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm",
" index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
# added .cgi .py
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" )
# Enable lighttpd on ipv6
$SERVER["socket"] == "[::]:8001" { }
server.port = 8001
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"
# Grabs main css
dir-listing.external-css = "/css/page_style.css"
# Header
# Enables header section
dir-listing.show-header = "enable"
dir-listing.encode-header = "disable"
# Hides HEADER.txt from listing
dir-listing.hide-header-file = "enable"
# Footer
# Enables footer section
dir-listing.show-readme = "enable"
dir-listing.encode-readme = "disable"
# Hides README.txt from listing
dir-listing.hide-readme-file = "enable"
# Diables default footer text
dir-listing.set-footer = " "
## custom MIME-Type support
include "piratebox/piratebox/conf/lighttpd/mime.types"
#----------- cgi.conf --------------
server.modules += ( "mod_cgi" )
$HTTP["url"] =~ "^/cgi-bin/" {
cgi.assign = ( ".py" => "/usr/bin/python2" )
}
$HTTP["url"] =~ "^/board/" {
cgi.assign = ( ".pl" => "/usr/bin/perl" , )
}
#-------------------------------------
# 404 Error Page with redirect
#
#server.error-handler-404 = "/redirect.html"
## for better debugging
#server.modules += ( "mod_accesslog" )
#accesslog.filename = "/tmp/access.log"
include "piratebox/piratebox/conf/lighttpd/fastcgi.conf"
setenv.add-environment = (
"SHOUTBOX_GEN_HTMLFILE" => basedir "/chat_content.html" ,
"SHOUTBOX_CHATFILE" => basedir + "/cgi-bin/data.pso" ,
"SHOUTBOX_CLIENT_TIMESTAMP" => "yes"
)

View File

@ -0,0 +1,100 @@
## Configuration for Piratebox
server.modules = (
# "mod_access", not needed!
"mod_alias",
# "mod_compress", Disabled, fixing reload Problem??
"mod_redirect",
# "mod_rewrite",
"mod_setenv",
)
var.basedir=env.PWD
server.document-root = basedir + "/piratebox/piratebox/www"
## Locate the tmp storage into tmp. It is in most cases the ram
## Limit the uploads to 4MB to save - especially on small devices
## the device from dieing because OUT-OF-RAM exceptions
## in KB => 4MB
server.upload-dirs = ( "/tmp" )
server.max-request-size = 4048
server.errorlog = "/tmp/error.log"
server.breakagelog = "/tmp/break.log"
server.pid-file = "/tmp/lighttpd.pid"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm",
" index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
# added .cgi .py
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" )
# Enable lighttpd on ipv6
$SERVER["socket"] == "[::]:8001" { }
server.port = 8001
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"
# Grabs main css
dir-listing.external-css = "/css/page_style.css"
# Header
# Enables header section
dir-listing.show-header = "enable"
dir-listing.encode-header = "disable"
# Hides HEADER.txt from listing
dir-listing.hide-header-file = "enable"
# Footer
# Enables footer section
dir-listing.show-readme = "enable"
dir-listing.encode-readme = "disable"
# Hides README.txt from listing
dir-listing.hide-readme-file = "enable"
# Diables default footer text
dir-listing.set-footer = " "
## custom MIME-Type support
include basedir + "/piratebox/piratebox/conf/lighttpd/mime.types"
#----------- cgi.conf --------------
server.modules += ( "mod_cgi" )
$HTTP["url"] =~ "^/cgi-bin/" {
cgi.assign = ( ".py" => "/usr/bin/python2" )
}
$HTTP["url"] =~ "^/board/" {
cgi.assign = ( ".pl" => "/usr/bin/perl" , )
}
#-------------------------------------
# 404 Error Page with redirect
#
#server.error-handler-404 = "/redirect.html"
## for better debugging
#server.modules += ( "mod_accesslog" )
#accesslog.filename = "/tmp/access.log"
include basedir + "/piratebox/piratebox/conf/lighttpd/fastcgi.conf"
setenv.add-environment = (
"PYTHONPATH" => basedir + "/piratebox/piratebox/python_lib" ,
"SHOUTBOX_GEN_HTMLFILE" => basedir + "/piratebox/piratebox/www/chat_content.html" ,
"SHOUTBOX_CHATFILE" => basedir + "/piratebox/piratebox/www/cgi-bin/data.pso" ,
"SHOUTBOX_CLIENT_TIMESTAMP" => "yes"
)

View File

@ -15,6 +15,7 @@
# COMPANY: ---
# CREATED: 02.02.2013 19:50:34 MST
# REVISION: 0.3.1
# LICENCE: (c) Cale Black, 2013 GPL-3
#=======================================================================
#Import PirateBox conf
CURRENT_CONF=piratebox/conf/piratebox.conf

View File

@ -0,0 +1,27 @@
PIRATEBOX_HOSTS_MESH=/opt/piratebox/conf/hosts_mesh
AVAHI_CACHE_FILE=/tmp/avahi.browse
AVAHI_GEN_OUTPUT="${AVAHI_CACHE_FILE}".hosts
DNSMASQ_PID=/var/run/piratebox_dnsmasq.pid
SLEEPTIME=$((60 * 5 )) # Sleep for 5 Minutes before doing a refresh
PROTOCOLL="_http._tcp"
while true; do
## Browse Avahi discover results and format them into a hosts file
avahi-browse -p -r -t -f $PROTOCOLL | grep -e "=" > $AVAHI_CACHE_FILE
grep \= $AVAHI_CACHE_FILE | \
sed -e 's|\.local||g' \
-e 's|_|\.|g' | \
awk 'BEGIN { FS=";" } { print $8 " " $7; }' > $AVAHI_GEN_OUTPUT
echo "# Updated " `date` >> $AVAHI_GEN_OUTPUT
cp $AVAHI_GEN_OUTPUT $PIRATEBOX_HOSTS_MESH
# Send SIGHUP to dnsmasq for refreshing its cache
kill -1 `cat $DNSMASQ_PID`
sleep $SLEEPTIME
done

View File

@ -1,6 +1,10 @@
#!/bin/sh
# This script is needed for Piratebox on OpenWrt.
# Matthias Strubel (c) 2014,2016 - GPL3
# matthias.strubel@aod-rpg.de
#
# This script deletes 0 Byte files
# This script is needed for Piratebox on OpenWrt.
# The find utility there has only a limited feature set.
IFS='

View File

@ -1,6 +1,8 @@
#!/bin/sh
# The following script is used to distribute a specific file into directoried of the givien folder
# matthias.strubel@aod-rpg.de
#
# The following script is used to distribute a specific file into directories of the givien folder
directory=$1
src_file=$2

View File

@ -1,5 +1,8 @@
#!/bin/sh
# Matthias Strubel (c) 2014 - GPL3
# matthias.strubel@aod-rpg.de
#
# This script distributes a set of files into $1 folder
#Script for single stuff

View File

@ -6,6 +6,7 @@
# Licensed under the New BSD License.
# Changelog
# 20160417 * Block index.php uploads
# 20131121 * Update HTML/CSS for mobile devices
# * Add HTTPS support
# * Add HTTP basic authentication
@ -836,7 +837,7 @@ class HTTPUploadHandler(BaseHTTPServer.BaseHTTPRequestHandler):
continue
if filename.lower() == "index.html" or filename.lower() == "index.htm":
if filename.lower() == "index.html" or filename.lower() == "index.htm" or filename.lower() == "index.php":
self.send_response(303)
self.send_header('Location', '/')
self.end_headers()

View File

@ -0,0 +1,70 @@
#!/bin/sh
# Matthias Strubel (c) 2016 - GPL3
# Script for manipulating firewall rules during start and stop of PirateBox
PIRATEBOX_CONFIG="/opt/piratebox/conf/piratebox.conf"
FIREWALL_CONFIG="/opt/piratebox/conf/firewall.conf"
run=""
help_text(){
echo "Script for setting up Firewall rules on PirateBox. (IPv4 only)"
echo "
Usage:
-s : Start, add IPtables rules
-k : Stop , remove IPtables rules
-c : different PirateBox config location
-f : different PirateBox firewall config location
"
exit 1
}
while getopts "skc:f:" opt ; do
case $opt in
s) run="start" ;;
k) run="end" ;;
c) PIRATEBOX_CONFIG="$OPTARG" ;;
f) FIREWALL_CONFIG="$OPTARG" ;;
h) help_text ;;
\?)
echo "Invalid option: -$OPTARG"
help_text
;;
esac
done
if test -z "$run" ; then
echo "ERROR: You need to select -s (start) or -k (stop) "
help_text
fi
if test -z $PIRATEBOX_CONFIG || test -z "$FIREWALL_CONFIG" ; then
echo "ERROR: one of the config paths is empty, while it should not"
help_text
fi
. $PIRATEBOX_CONFIG || exit 6
. $FIREWALL_CONFIG || exit 5
if [ "$run" = "start" ] ; then
IPT_FLAG="-A"
else
IPT_FLAG="-D"
fi
if [ "$FIREWALL_FETCH_DNS" = "yes" ] ; then
iptables -t nat $IPT_FLAG PREROUTING -i "$DNSMASQ_INTERFACE" -d 0/0 \
-p tcp --dport 53 -j DNAT --to-destination "${IP}:53"
iptables -t nat $IPT_FLAG PREROUTING -i "$DNSMASQ_INTERFACE" -d 0/0 \
-p udp --dport 53 -j DNAT --to-destination "${IP}:53"
fi
if [ "$FIREWALL_FETCH_HTTP" = "yes" ] ; then
iptables -t nat $IPT_FLAG PREROUTING -i "$DNSMASQ_INTERFACE" -d 0/0 \
-p tcp --dport 80 -j DNAT --to-destination "${IP}:80"
fi

View File

@ -1,10 +1,14 @@
#!/bin/sh
# Matthias Strubel (c) 2013-2014
# licenced with GPL-3
#
# Generate severall configuration files out of piratebox.conf
# conf/hosts_generated
# conf/dnsmasq_generated.conf
# conf/radvd_generated.conf
# conf/lighttpd/env
# conf/hosts_mesh
#
# There are files for default configuration or adding custom stuff:
# conf/hosts
@ -25,6 +29,18 @@
# PIRATEBOX = PirateBox Folder
# CHATFILE = data store for Shoutbox-content
#
# NODE_CONFIG = Config file for Mesh-Node parameters
# -
# ipv6.conf (loaded within piratebox.conf)
# IPV6_ENABLE = enables IPv6 config
# IPV6_ADVERT = which service for advertising IPv6 Prefix
# IPV6_MASK = Netmask
# IPV6_PREFIX = Which prefix should be announced.
# -
# node.conf
# NODE_CONFIG_ACTIVE = if yes, configure special ipv6-node-hostname
# NODE_IPV6_IP = Device specific IP
# NODE_NAME & NODE_GEN = Settings for setting up Hostname
#
# Matthias Strubel -- 08.06.2012
# licenced with GPL-3
@ -36,6 +52,8 @@ DEFAULT_HOSTS=""
LEASE_FILE=""
RADVD_CONFIG=""
LIGHTTPD_ENV_CONFIG=""
AVAHI_SRC=""
AVAHI_CONFIG=""
set_pathnames() {
CONFIG_PATH=$1/conf
@ -47,6 +65,9 @@ set_pathnames() {
RADVD_CONFIG=$CONFIG_PATH/radvd_generated.conf
LEASE_FILE=$LEASE_FILE_LOCATION
LIGHTTPD_ENV_CONFIG=$CONFIG_PATH/lighttpd/env
AVAHI_CONFIG=$CONFIG_PATH/avahi/avahi-daemon.conf
AVAHI_SRC=$CONFIG_PATH/avahi/avahi-daemon.conf.schema
}
generate_hosts() {
@ -57,6 +78,7 @@ generate_hosts() {
cat $DEFAULT_HOSTS > $HOSTS_CONFIG
echo "$set_ipv4 $set_hostname " >> $HOSTS_CONFIG
echo "$set_ipv6 $set_hostname " >> $HOSTS_CONFIG
}
generate_dnsmasq() {
@ -97,6 +119,7 @@ generate_radvd(){
mask=$2
interface=$3
echo "Generating config for radvd.."
echo "#---- generated file ---" > $RADVD_CONFIG
echo "
interface $interface {
@ -122,7 +145,9 @@ generate_lighttpd_env() {
local SHOUTBOX_GEN_HTMLFILE=$4
local PIRATEBOX=$5
local SHOUTBOX_CHATFILE=$6
local DISK_GEN_HTMLFILE=$7
local SHOUTBOX_CLIENT_TIMESTAMP=$7
local IN_UPLOAD_PATH=$8
local DISK_GEN_HTMLFILE=$9
echo "Generating Environment-config for lighttpd ....."
@ -135,7 +160,9 @@ generate_lighttpd_env() {
\"PYTHONPATH\" => \"$PYTHONPATH:$PIRATEBOX/python_lib\",
\"SHOUTBOX_GEN_HTMLFILE\" => \"$SHOUTBOX_GEN_HTMLFILE\" ,
\"SHOUTBOX_CHATFILE\" => \"$SHOUTBOX_CHATFILE\" ,
\"DISK_GEN_HTMLFILE\" => \"$DISK_GEN_HTMLFILE\" ,
\"SHOUTBOX_CLIENT_TIMESTAMP\" => \"$SHOUTBOX_CLIENT_TIMESTAMP\" ,
\"UPLOAD_PATH\" => \"$IN_UPLOAD_PATH\" ,
\"DISK_GEN_HTMLFILE\" => \"$DISK_GEN_HTMLFILE\" ,
$LIGHTTPD_ENV_BR_LINE
)"
@ -161,6 +188,9 @@ fi
. $1
. $NODE_CONFIG
. $PIRATEBOX_FOLDER/lib/node_name_generation.sh
IPV6="#"
set_pathnames $PIRATEBOX_FOLDER
@ -168,12 +198,31 @@ set_pathnames $PIRATEBOX_FOLDER
ipv6_call=''
if [ "$IPV6_ENABLE" = "yes" ] ; then
ipv6_call=$IPV6_PREFIX
IPV6=$IPV6_PREFIX:$IPV6_IP
IPV6=$IPV6_IP
[[ "$IPV6_ADVERT" = "radvd" ]] && generate_radvd $IPV6_PREFIX $IPV6_MASK $DNSMASQ_INTERFACE
fi
generate_hosts $HOST $IP $IPV6
generate_dnsmasq $NET $IP_SHORT $START_LEASE $END_LEASE $LEASE_DURATION $DNSMASQ_INTERFACE
generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE $GEN_DISKFILE
generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE $SHOUTBOX_CLIENT_TIMESTAMP $UPLOADFOLDER $GEN_DISKFILE
COMPLETE_HOST=$HOST
if [ "$NODE_CONFIG_ACTIVE" = "yes" ] ; then
echo -n "Appending local node-name hosts entry "
if generate_node_name "$HOST" "$NODE_NAME" "$NODE_GEN" ; then
echo $NODE_GEN_OUTPUT
echo "$NODE_IPV6_IP $NODE_GEN_OUTPUT " >> $HOSTS_CONFIG
COMPLETE_HOST=$NODE_GEN_OUTPUT
else
echo "Error: No valid node-name-config found, skipping"
fi
fi
#We want a long hostname and not only the hostname itself...
### PirateBox Scripts generates its own config in /opt/piratebox/conf/avahi
### but, the daemon works per default only on /etc/avahi
### If you want to enable avahi, then you have to link /etc/avahi to /opt/piratebox/conf/avahi
### On OpenWRT this should happen, if avahi is available before installing the piratebox
### automtically.
AVAHI_HOST=$( echo $COMPLETE_HOST | sed 's|\.|_|g' )
sed "s|#####MASKED_HOSTNAME#####|$AVAHI_HOST|" $AVAHI_SRC > $AVAHI_CONFIG

View File

@ -1,13 +1,23 @@
#!/bin/sh
## PirateBox installer script v.01
## created by Matthias Strubel 2011-08-04
## PirateBox installer script
## created by Matthias Strubel (c)2011-2014 GPL-3
##
## ASH does not support arrays, so no nice foreach
# All Perl packages for kareha
##OPENWRT_PACKAGES_IMAGEBOARD=( perl perlbase-base perlbase-cgi perlbase-essential perlbase-file perlbase-bytes perlbase-config perlbase-data perlbase-db-file perlbase-digest perlbase-encode perlbase-encoding perlbase-fcntl perlbase-gdbm-file perlbase-integer perlbase-socket perlbase-unicode perlbase-utf8 perlbase-xsloader )
create_content_folder(){
echo "Creating 'content' folder on USB stick and move over stuff"
mkdir -p $WWW_CONTENT
cp -r $PIRATEBOX_FOLDER/www_content/* $WWW_CONTENT
[ ! -L $PIRATEBOX_FOLDER/www/content ] && \
ln -s $WWW_CONTENT $WWW_FOLDER/content
[ ! -e $WWW_FOLDER/favicon.ico ] && \
ln -s $WWW_CONTENT/favicon.ico $WWW_FOLDER
chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $WWW_CONTENT -R
chmod u+rw $WWW_CONTENT
return 0
}
# Load configfile
@ -55,7 +65,6 @@ if [ $2 = 'part2' ] ; then
mkdir -p $PIRATEBOX_FOLDER/share/tmp
mkdir -p $PIRATEBOX_FOLDER/tmp
#Copy Forban-Link spacer
#Distribute the Directory Listing files
$PIRATEBOX_FOLDER/bin/distribute_files.sh $SHARE_FOLDER/Shared true
#Set permissions
@ -159,3 +168,6 @@ if [ $2 = "hostname" ] ; then
echo "..done"
fi
if [ $2 = "content" ] ; then
create_content_folder
fi

View File

@ -0,0 +1,46 @@
#!/bin/sh
# Matthias Strubel (c) 2013 - GPL3
# Generate a JSON file, which relfects some part of the current configuration
# First parameter is the piratebox.conf
### Used parameter : JSON_FILE
. $1
# json.conf contains some information about modules on the frontend
. $PIRATEBOX_FOLDER/conf/json.conf
### JSON convert functions
. $PIRATEBOX_FOLDER/lib/json_func.sh
JSON_FILE=$PBX_JSON_FILE
####
# DROOPY_ENABLED => upload_droopy
# DROOPY_PORT => droopy_port
# HOST => droopy_host
json_droopy_enabled=`convert_yn_to_tf $DROOPY_ENABLED`
json_shoutbox_enabled=`convert_yn_to_tf $SHOUTBOX_ENABLED`
echo "Generating json configuration file: $JSON_FILE"
echo "" > $PBX_JSON_FILE
echo "{ \"piratebox\" : { \"module\" : { " >> $JSON_FILE
#------------ upload configuration
echo -n " \"upload\" : { \"status\" : $json_droopy_enabled , \"file\" : \"$UPLOAD_MODULE_FILE\" " >> $JSON_FILE
#----------- droopy specialities
if [ "$DROOPY_ENABLED" == "yes" ] ; then
echo -n ", " >> $JSON_FILE
echo -n " \"upload_style\" : \"droopy\" , " >> $JSON_FILE
echo -n " \"droopy_port\" : \"$DROOPY_PORT\", \"droopy_host\" : \"$HOST\" " >> $JSON_FILE
fi
echo " } " >> $JSON_FILE
#--------------- Shoutbox config file
echo ", \"shoutbox\" : { \"status\" : $json_shoutbox_enabled , \"file\" : \"$CHAT_MODULE_FILE\" } " >> $JSON_FILE
#---------------
echo ", \"version\" : \""$(cat $PIRATEBOX_FOLDER/version )"\"" >> $JSON_FILE
echo " } } }" >> $JSON_FILE

View File

@ -1,10 +1,10 @@
#!/bin/bash
# Author: Matthias Strubel / Feb. 2011
# Author: Matthias Strubel (c) 2011-2014 GPL-3
# Script for setting up the wlan interface
# Parameter 1 i used for the config file providing the parameters
# IP-Adress
# IP-Adress IPv4 + IPv6
# Netmask
# Interface
@ -32,23 +32,23 @@ probe() {
# Load configfile
if [ -z $1 ] || [ -z $2 ]; then
if [ -z $1 ] || [ -z $2 ]; then
echo "Usage piratebox_setup_wlan.sh my_config <start|stop|probe>"
exit 1
fi
if [ ! -f $1 ] ; then
echo "Config-File $1 not found..."
exit 1
if [ ! -f $1 ] ; then
echo "Config-File $1 not found..."
exit 1
fi
#Load config
. $1
. $1
### Check config
if [ -z $INTERFACE ]; then
if [ -z $INTERFACE ]; then
echo "Please define i.e. "
echo " INTERFACE=wlan0 "
exit 1
@ -73,9 +73,9 @@ fi
if [ $2 = "start" ] ; then
echo "Bringing up wifi interface $INTERFACE "
ifconfig $INTERFACE up
ifconfig $INTERFACE up
if [ $? -ne 0 ] ; then
if [ $? -ne 0 ] ; then
echo "..failed ";
exit 1
fi
@ -83,22 +83,36 @@ if [ $2 = "start" ] ; then
echo "Setting up $INTERFACE"
ifconfig $INTERFACE $IP netmask $NETMASK
if [ $? -ne 0 ] ; then
if [ $? -ne 0 ] ; then
echo "..failed ";
exit 1
fi
if [ $IPV6_ENABLE = "yes" ] ; then
echo "Setting up IPv6 stuff"
IPv6="$IPV6_PREFIX:$IPV6_IP"/"$IPV6_MASK"
IPv6="$IPV6_IP"/"$IPV6_MASK"
echo " $INTERFACE -->$IPv6<--"
ifconfig $INTERFACE add $IPv6
#That ip is a local IP only
ip addr change $IPv6 dev $INTERFACE scope link
fi
. $NODE_CONFIG
if [ "$NODE_CONFIG_ACTIVE" == "yes" ] && [ "$NODE_IPV6_SET_IP" == "yes" ]; then
echo "Setting up IPv6 Mesh-Node IP on interface $NODE_INTERFACE"
ifconfig $NODE_INTERFACE add $NODE_IPV6_IP"$NODE_IPV6_MASK"
fi
elif [ $2 = "stop" ] ; then
echo "Stopping wifi interface $INTERFACE "
ifconfig $INTERFACE down
elif [ $ = "probe" ] ; then
if [ "$NODE_CONFIG_ACTIVE" == "yes" ] && [ "$NODE_IPV6_SET_IP" == "yes" ] ; then
echo "Removing the Node-Address again..."
ifconfig $NODE_INTERFACE del $NODE_IPV6_IP"$NODE_IPV6_MASK"
fi
elif [ $2 = "probe" ] ; then
# simply check if the interface is available
probe
fi

View File

@ -0,0 +1,7 @@
#!/bin/bash
# This small shell script initializes the I2C bus on a Raspberry Pi
# and activates an installed real time clock module.
# Afterwards the system time is synced to the hardware clock.
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s

View File

@ -3,8 +3,8 @@
# Starts deamon for global shoutbox service
# requires piratebox.conf as first parameter
#
# Matthias Strubel - 2012
# Licenced with GPL
# Matthias Strubel - 2012-2014
# Licenced with GPL-3
. $1

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Matthias Strubel - 2012-09-15
# Matthias Strubel - (c)2012-2014 with GPL-3
#
# Only calls generate-Routing in piratebox-folder
# gets Piratebox-Folder into www
@ -18,17 +18,25 @@ cd python_lib
export SHOUTBOX_CHATFILE=$CHATFILE
export SHOUTBOX_GEN_HTMLFILE=$GEN_CHATFILE
export SHOUTBOX_CLIENT_TIMESTAMP=$SHOUTBOX_CLIENT_TIMESTAMP
export DISK_GEN_HTMLFILE=$GEN_DISKFILE
#Writing init-message and reset chat..
if [ "$RESET_CHAT" = "yes" ] ; then
echo $CHATMSG > $CHATFILE
cat $PIRATEBOX_FOLDER/conf/chat_init.txt > $CHATFILE
fi
#Generate content file for Shoutbox
python psogen.py generate
if [ "$SHOUTBOX_ENABLED" = "no" ] ; then
# If the shoutbox is disabled, we remove the writable flag
echo -n "Making shoutbox readonly..."
chmod a-w $CHATFILE
echo "done"
fi
#Generate content file for DiskUsage
python diskusage.py generate

View File

@ -1,4 +1,7 @@
#!/bin/sh
## By Matthias Strubel , Licenced by GPL-3 (c)2012-2014
CNT=`iw wlan0 station dump | grep Station | wc -l`
#DATE=`date`
#echo $DATE - $CNT

View File

@ -8,7 +8,7 @@
# gives a sort of stability to complete standalone
# systems.
#
# Licenced under GPL-2 @ 2012,2015
# Licenced under GPL-3 @ 2012,2015
# Matthias Strubel matthias.strubel@aod-rgp.de
##function for similar saving & getting time

View File

@ -0,0 +1,30 @@
[server]
host-name=#####MASKED_HOSTNAME#####
use-ipv4=no
use-ipv6=yes
check-response-ttl=no
use-iff-running=no
[publish]
publish-addresses=yes
publish-hinfo=yes
publish-workstation=no
publish-domain=yes
[reflector]
enable-reflector=no
reflect-ipv=no
[rlimits]
#rlimit-as=
rlimit-core=0
rlimit-data=4194304
rlimit-fsize=0
rlimit-nofile=30
rlimit-stack=4194304
rlimit-nproc=3

View File

@ -0,0 +1,10 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Web Server on %h</name>
<service>
<type>_http._tcp</type>
<port>80</port>
<txt-record>path=/</txt-record>
</service>
</service-group>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<!--
This file is part of avahi.
avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
avahi is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with avahi; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
-->
<!-- See avahi.service(5) for more information about this configuration file -->
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>

View File

@ -0,0 +1 @@
<div class='message'><date>00:00:00</date> <name>PirateBox:</name> <data class='def'>Chat and share files anonymously!</data></div>

View File

@ -0,0 +1,12 @@
#!/bin/sh
# Configuration file for PirateBox firewall configuration
#
# Collect all incoming DNS requests, even these are not addressed
# to this machine.
FIREWALL_FETCH_DNS="yes"
# Collect all incoming Port 80 request, even these should be
# relayed to a different machine
FIREWALL_FETCH_HTTP="no"

View File

@ -5,3 +5,7 @@ hw_mode=g
channel=1
#auth_algs=1
#ieee80211n=1
# Put a # in front of the following line to allow
# direct client 2 client communication
ap_isolate=1

View File

@ -2,18 +2,18 @@
# Config file will be filled up partly on init-step
####--------------
#Enable IPv6 Setup (yes|no)
#Enable IPv6 Setup (yes|no) on you interface
IPV6_ENABLE="no"
# Which kind of router-adverticement should be used ( radvd | dnsmasq )
IPV6_ADVERT="dnsmasq"
# Which kind of router-adverticement should be used ( radvd | dnsmasq | none )
#
IPV6_ADVERT="radvd"
#Node-Adress - Is stringed together with the IPV6_PREFIX below to
# .. the Prefix is generated on init-setup
IPV6_IP=":1"
#absolute Node-Adress
IPV6_IP="fdc0:ffea::1"
#Netmask without /
IPV6_MASK="64"
# Prefix to piratebox ipv6 adress
IPV6_PREFIX="fd00"
IPV6_PREFIX="fdc0:ffea"

View File

@ -0,0 +1,13 @@
### Configuration file for mniircd server
IRC_CONFIG_FOLDER=$PIRATEBOX_FOLDER/conf/irc
#Save state ; keeps topic config. Enable with removing #
#IRC_STATEDIR=$IRC_CONFIG_FOLDER/state
#MOTD Message
IRC_MOTD=$IRC_CONFIG_FOLDER/motd.txt

View File

@ -0,0 +1,7 @@
Welcome to PirateBox IRC!
Inspired by pirate radio and the free culture movement, PirateBox is a DIY anonymous offline file-sharing and communications system. PirateBox creates offline wireless networks designed for anonymous file sharing, chatting, message boarding, and media streaming. You can think of it as your very own portable offline Internet in a box!
PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.
PirateBox was created by David Darts and the Lead Developer is Matthias Strubel. The project is licensed under the GPLv3. To learn more about the project or to find out how to build your own PirateBox, please visit http://piratebox.cc

View File

@ -0,0 +1,9 @@
#!/bin/sh
###
# This file contains some valid informations for the content
##
CHAT_MODULE_FILE="modules/chat.html"
UPLOAD_MODULE_FILE="modules/upload.html"

View File

@ -0,0 +1,16 @@
#-------------------- FAST CGI stuff
# Run a specific php script when the URL /generate_204 is requested.
# Android clients request this URL to check for a full working
# internet connection, we want to fake a reply. This config section is
# a hack to make a php script without the ".php" extension work when
# mod_rewrite is not available.
$HTTP["url"] =~ "^/generate_204$" {
fastcgi.server = (
"" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/tmp/php.socket",
"max-procs" => 1
))
)
}

View File

@ -0,0 +1,11 @@
#-------------------- FAST CGI stuff
$HTTP["url"] =~ "^/content/" {
fastcgi.server = (
".php" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/tmp/php.socket",
"max-procs" => 1
))
)
}

View File

@ -2,15 +2,23 @@
server.modules = (
# "mod_access", not needed!
# "mod_alias",
"mod_alias",
# "mod_compress", Disabled, fixing reload Problem??
"mod_redirect",
# "mod_rewrite",
"mod_setenv",
"mod_fastcgi"
)
server.document-root = "/opt/piratebox/www"
server.upload-dirs = ( "/opt/piratebox/share/tmp" )
## Locate the tmp storage into tmp. It is in most cases the ram
## Limit the uploads to 5MB to save - especially on small devices
## the device from dieing because OUT-OF-RAM exceptions
## in KB => 5MB
server.upload-dirs = ( "/tmp" )
server.max-request-size = 5120
server.errorlog = "/opt/piratebox/tmp/error.log"
server.breakagelog = "/opt/piratebox/tmp/break.log"
server.pid-file = "/opt/piratebox/tmp/lighttpd.pid"
@ -29,13 +37,15 @@ url.access-deny = ( "~", ".inc" )
# added .cgi .py
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" )
#include_shell "/usr/share/lighttpd/use-ipv6.pl"
# Enable lighttpd on ipv6
$SERVER["socket"] == "[::]:80" { }
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"
# Grabs main css
dir-listing.external-css = "/style.css"
dir-listing.external-css = "/content/css/page_style.css"
# Header
# Enables header section
@ -71,10 +81,6 @@ $HTTP["url"] =~ "^/cgi-bin/" {
cgi.assign = ( ".py" => "/usr/bin/python" )
}
$HTTP["url"] =~ "^/generate_204" {
cgi.assign = ( "generate_204" => "/usr/bin/python" )
}
## Warning this represents a security risk, as it allow to execute any file
## with a .pl/.py even outside of /usr/lib/cgi-bin.
#
@ -109,3 +115,9 @@ $HTTP["useragent"] =~ "CaptiveNetworkSupport" {
server.error-handler-404 = "/success.html"
}
include "/opt/piratebox/conf/lighttpd/fastcgi-php-generate203.conf"
## Uncommenting the following line enables PHP for the
## complete PirateBox
#include "/opt/piratebox/conf/lighttpd/fastcgi-php.conf"

View File

@ -38,6 +38,7 @@ mimetype.assign = (
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".xhtml" => "application/xhtml+xml",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",

View File

@ -0,0 +1,27 @@
# Mesh-Node configuration
# Contains the configuration which makes this node individual, like
# random hostname & and specific IPv6 IP.
NODE_CONFIG_ACTIVE='no'
#
NODE_IPV6_IP=''
NODE_IPV6_MASK='/64'
# Node-Name without domain suffix, like
# foobar = Node-name
# piratebox.lan = Host-Name (and base Domain-Name)
# Fully Name will be later
# foobar.piratebox.lan
# If your leave the nodename empty, that will result in publishing hostname only.
# Setting NODE_GEN to "no" it will take the NODE_NAME 1:1 for anouncements etc. without
# adding the hostname as a suffix
NODE_NAME=''
NODE_GEN="yes"
## Node-Interface
# Currently the same interface then the other wlan interface
# But had to be used if mesh node interface is different and
# initialized by PBx scripts.
# If the node_interface is different, it has to be up and running.
NODE_INTERFACE='$INTERFACE'
# Should the Node-Interface setup via the PirateBox-Scripts
NODE_IPV6_SET_IP='no'

View File

@ -1,17 +1,8 @@
#########
## Config for pirate-box WWW Release
## written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22
## licenced by gpl ; feel free to improve or send me feedback
##
## 2012-04-12 Created
## 2012-06-08 Changed IP Stuff to generating dnsmasq.conf stuff
## ADDed SubConfig for IPV6 config
## Changed Order of config
## 2013-08-14 Added timesave url
##
## written by Matthias Strubel (matthias.strubel@aod-rpg.de) (c)2011-2014
## licenced under the GPL-3 ; feel free to improve or send me feedback
########
#######
## Configuration help
## If you plan to use one laptop as the piratebox:
## Set DO_IFCONFIG , USE_APN, USE_DNSMASQ to yes
@ -20,7 +11,7 @@
## Set DO_IFCONFIG , USE_APN, USE_DNSMASQ to no
## Configure your ethernet eth0 (or whatever) to a static IP
## force your router to publish the HOST Option with your static IP; in case of dnsmasq add the /etc/hosts entrys
## Have a look at http://wiki.daviddarts.com/piratebox for futher instructions
## Have a look at http://www.piratebox.cc for futher instructions
##
## You may deactivated severall option as needed. It's flexible.
@ -29,6 +20,7 @@
PIRATEBOX_FOLDER="/opt/piratebox"
WWW_FOLDER="/opt/piratebox/www"
WWW_CONTENT="/opt/piratebox/share/content"
#Do not change untill really needed.
PIRATEBOX_PYTHONPATH="$PIRATEBOX_FOLDER/python_lib"
@ -69,8 +61,9 @@ USE_APN="yes"
USE_DNSMASQ="yes"
#HOSTNAME ... if you really want to change it, plz change:
# bin/droopy
# conf/hosts
# www/index.html
#
# That is the Domain-Specifi part, where you reach always the local box
HOST="piratebox.lan"
#----------------- Configuration for DNSMASQ & IF-Setup -------------------#
@ -80,7 +73,7 @@ INTERFACE="wlan0"
# Make it empty to disable
DNSMASQ_INTERFACE="wlan0"
#Brdige add interfacce (setr yes to enable bridging)
#Brdige add interface (setr yes to enable bridging)
DO_BRIDGE="no"
BRIDGE="br-lan"
@ -88,7 +81,7 @@ BRIDGE="br-lan"
NET=192.168.77
#IP-SHORT (is stringed together)
# Which IP is your Box?? i.e. 1 => 192.168.77.1
# What IP does your Box have?? i.e. 1 => 192.168.77.1
IP_SHORT=1
#DHCP LEASE Start
@ -112,10 +105,15 @@ IP=$NET.$IP_SHORT
. $PIRATEBOX_FOLDER/conf/ipv6.conf
#--------------------------------------------------------------------------#
# Node-Config path
NODE_CONFIG="$PIRATEBOX_FOLDER/conf/node.conf"
#----------------- Configuration for the pure piratebox -------------------#
## droopy, webserver, shoutbox- and forum-server
## Timesave file for non RTC devices
## Timesave file for non-RTC devices
TIMESAVE="$PIRATEBOX_FOLDER/share/timesave_file"
#On non OpenWRT you can use the default output format
@ -131,7 +129,9 @@ IMAGE="$PIRATEBOX_FOLDER/src/$IMAGENAME"
DROOPY_TXT=""
DROOPY_PORT="8080"
# Set correct permissions for an uploaded file
# The following line needs to be commented for FAT32 / vfat partitions
DROOPY_CHMOD="755"
DROOPY_USERDIR=""
# Uncomment line below for adding directory feature
#DROOPY_USERDIR=" -u True "
@ -151,8 +151,23 @@ GEN_DISKFILE="$WWW_FOLDER/diskusage.html"
# Reset Shoutbox on Startup?
RESET_CHAT="yes"
### Shoutbox is enabled.
# When you set this option to "no", then the shoutbox file is not writable anymore
# and in the json file the module is disabled. You should adjust the chat_init.txt
# to make clear, that the box is not working anymore.
SHOUTBOX_ENABLED="yes"
SHOUTBOX_CLIENT_TIMESTAMP="no"
#Inititiation Chat-Message
CHATMSG="<div class='message'><date>00:00:00</date> <name>PirateBox:</name> <data class='def'>Chat and share files anonymously!</data></div>"
### This option was removed, you can find the chat message in conf/chat_init.txt
#Provide files needed for PirateBox custom dirlisting
CUSTOM_DIRLIST_COPY="yes"
#Generate config json for frontend
PBX_JSON_GENERATION="yes"
PBX_JSON_FILE="$WWW_FOLDER/piratebox_config.json"
#Activate Global chat
# Still experimentall!
@ -167,5 +182,10 @@ LIGHTTPD_USER=nobody
LIGHTTPD_GROUP=nogroup
#------------------------ IRC Configuration
#Switch to yes if you want to enable the IRC-Server
ENABLE_IRC_SERVER="no"
#------------------------ Hook in user-config
. $PIRATEBOX_FOLDER/conf/hook_custom.conf

View File

@ -8,7 +8,7 @@
# Default-Start: 2 3 4 5
# Default-Stop: 6 1 0
# Short-Description: All services around piratebox
# Description: Based on /opt/piratebox/conf/piratebox.conf starts: * DNSMASQ * HOSTAPD * DROOPY * WLAN-config * CHAT
# Description: Based on /opt/piratebox/conf/piratebox.conf starts several services
### END INIT INFO
###
@ -29,15 +29,20 @@ PIDFILE_HOSTAPN=/var/run/piratebox_hostapn.pid
PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid
PIDFILE_LIGHTTPD=/opt/piratebox/tmp/lighttpd.pid
PIDFILE_SHOUTBOX=/opt/piratebox/tmp/shoutbox_daemon.pid
PIDFILE_RADVD=/opt/piratebox/tmp/radvd.pid
PIDFILE_IRC=/opt/piratebox/tmp/irc.pid
PIRATEBOX=/opt/piratebox
CONF=$PIRATEBOX/conf/piratebox.conf
CONF_IRC=$PIRATEBOX/conf/irc.conf
#CONF_DROOPY=/opt/piratebox/conf/droopy.conf #not used
CONF_APN=$PIRATEBOX/conf/hostapd.conf
#Some extra config files for dnsmasq
CONF_DNSMASQ=$PIRATEBOX/conf/dnsmasq_generated.conf
CONF_RADVD=$PIRATEBOX/conf/radvd_generated.conf
CONF_LIGHTTPD=$PIRATEBOX/conf/lighttpd/lighttpd.conf
export PYTHONPATH=:$PYTHONPATH:$PIRATEBOX_PYTHONPATH
@ -64,7 +69,12 @@ else
fi
# Recreate the content folder, if it was deleted
# only if it is not already existing.
# This can be any time.
if [ ! -d $WWW_CONTENT ] ; then
$PIRATEBOX/bin/install_piratebox.sh "$CONF" content
fi
# Command Line for DNSMASQ, use extra config file generated from command above
CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ "
@ -83,8 +93,14 @@ case "$1" in
echo "Empty tmp folder"
find $PIRATEBOX/tmp/ -exec rm {} \;
echo "Copy over design files"
$PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared
if [ "$CUSTOM_DIRLIST_COPY" = "yes" ]; then
echo "Copy over design files"
$PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared
fi
if [ "$PBX_JSON_GENERATION" = "yes" ]; then
$PIRATEBOX_FOLDER/bin/json_generation.sh $CONF
fi
if [ "$DO_IW" = "yes" ] ; then
log_daemon_msg " Setting up Interface (iw) "
@ -133,9 +149,22 @@ case "$1" in
log_end_msg $?
fi
#Setting up firewall rules
log_daemon_msg "Setting up firewall rules..."
$PIRATEBOX_FOLDER/bin/firewall.sh -s
log_end_msg $?
if [ "$IPV6_ENABLE" == "yes" ] && [ "$IPV6_ADVERT" == "radvd" ] ; then
log_daemon_msg "Starting radvd..."
start-stop-daemon --start --quiet --exec radvd -- -p $PIDFILE_RADVD -C $CONF_RADVD
log_end_msg $?
fi
if [ "$DROOPY_ENABLED" = "yes" ] ; then
#Start here the PirateBox-Parts droopy i.e.
log_daemon_msg "Starting droopy..."
#Delete 0 Byte Files
delete_empty.sh $UPLOADFOLDER
find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \;
@ -144,8 +173,9 @@ case "$1" in
if [ "$DROOPY_USE_USER" = "yes" ] ; then
DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP "
fi
log_daemon_msg "Starting droopy..."
start-stop-daemon $DROOPY_USER -m --start --background --pidfile $PIDFILE_DROOPY --exec $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" --chmod $DROOPY_CHMOD $DROOPY_USERDIR $DROOPY_PORT
DROOPY_DO_CHMOD=""
test -n "$DROOPY_CHMOD" && DROOPY_DO_CHMOD="--chmod $DROOPY_CHMOD"
start-stop-daemon $DROOPY_USER -m --start --background --pidfile $PIDFILE_DROOPY --exec $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" $DROOPY_DO_CHMOD $DROOPY_USERDIR $DROOPY_PORT
log_end_msg $?
fi
@ -164,6 +194,22 @@ case "$1" in
start-stop-daemon -m --start --background --pidfile $PIDFILE_SHOUTBOX --startas $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF
log_end_msg $?
fi
#Start IRC Server
if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then
. $CONF_IRC
IRC_PARMS="--daemon --motd $IRC_MOTD "
if [ ! -z $STATEDIR ] ; then
IRC_PARMS=" $IRCPARMS --statedir $STATEDIR "
fi
log_daemon_msg "Starting Miniircd..."
start-stop-daemon $DROOPY_USER -m -S -p $PIDFILE_IRC -x $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS
log_end_msg $?
fi
fi
$PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF"
@ -175,6 +221,16 @@ case "$1" in
$PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF"
if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then
log_daemon_msg "Stopping IRC..."
start-stop-daemon -K -q -p $PIDFILE_IRC
log_end_msg $?
fi
log_daemon_msg "Removing firewall rules..."
$PIRATEBOX_FOLDER/bin/firewall.sh -k
log_end_msg $?
if [ "$USE_APN" = "yes" ] ; then
log_daemon_msg "Stopping hostap... "
start-stop-daemon --stop --quiet --pidfile $PIDFILE_HOSTAPN --oknodo --startas "hostapd"
@ -186,6 +242,12 @@ case "$1" in
log_end_msg $?
fi
if [ -e $PIDFILE_RADVD ] ; then
log_daemon_msg "Stopping radvd..."
start-stop-daemon --stop --quite --pidfile $PIDFILE_RADVD
log_end_msg $?
fi
#Stop Global Chat daemon
if [ "$GLOBAL_CHAT" = "yes" ] ; then
log_daemon_msg "Stopping global chat service..."

View File

@ -11,9 +11,9 @@
# Description: Based on /opt/piratebox/conf/piratebox.conf starts: * DNSMASQ * HOSTAPD * DROOPY * WLAN-config * CHAT
### END INIT INFO
###
###
# Default start-stop script for piratebox services on a laptop
# written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22
# written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22
# licenced by gpl, feel free to improve and send me comments
@ -27,35 +27,46 @@ PIDFILE_HOSTAPN=/var/run/piratebox_hostapn.pid
PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid
PIDFILE_LIGHTTPD=/opt/piratebox/tmp/lighttpd.pid
PIDFILE_SHOUTBOX=/opt/piratebox/tmp/shoutbox_daemon.pid
PIDFILE_RADVD=/opt/piratebox/tmp/radvd.pid
PIDFILE_IRC=/opt/piratebox/tmp/irc.pid
PIRATEBOX=/opt/piratebox
CONF=$PIRATEBOX/conf/piratebox.conf
#CONF_DROOPY=/opt/piratebox/conf/droopy.conf #not used
CONF_IRC=$PIRATEBOX/conf/irc.conf
CONF_APN=$PIRATEBOX/conf/hostapd.conf
#Some extra config files for dnsmasq
CONF_DNSMASQ=$PIRATEBOX/conf/dnsmasq_generated.conf
CONF_LIGHTTPD=$PIRATEBOX/conf/lighttpd/lighttpd.conf
CONF_RADVD=$PIRATEBOX/conf/radvd_generated.conf
CONF_LIGHTTPD=$PIRATEBOX/conf/lighttpd/lighttpd.conf
export PYTHONPATH=:$PYTHONPATH:$PIRATEBOX_PYTHONPATH
if [ -f $CONF ] ; then
. $CONF
else
. $CONF
else
echo "Configuration file not found"
exit 1
fi
#If you can't find this file
#If you can't find this file
if [[ -f $PIRATEBOX/conf/init_done ]] ; then
INIT=OK
else
$PIRATEBOX/bin/hooks/hook_pre_init.sh "$CONF"
$PIRATEBOX/bin/hooks/hook_pre_init.sh "$CONF"
$PIRATEBOX/bin/install_piratebox.sh "$CONF" part2
$PIRATEBOX/bin/hooks/hook_post_init.sh "$CONF"
touch $PIRATEBOX/conf/init_done
touch $PIRATEBOX/conf/init_done
fi
# Recreate the content folder, if it was deleted
# only if it is not already existing.
# This can be any time.
if [ ! -d $WWW_CONTENT ] ; then
$PIRATEBOX/bin/install_piratebox.sh "$CONF" content
fi
@ -69,22 +80,27 @@ case "$1" in
# Generate hosts & dnsmasq file
$PIRATEBOX/bin/generate_config_files.sh "$CONF"
$PIRATEBOX/bin/hooks/hook_piratebox_start.sh "$CONF"
echo "Empty tmp folder"
find $PIRATEBOX/tmp/ -exec rm {} \;
echo "Copy over design files"
$PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared
if [ "$CUSTOM_DIRLIST_COPY" = "yes" ]; then
echo "Copy over design files"
$PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared
fi
if [ "$PBX_JSON_GENERATION" = "yes" ]; then
$PIRATEBOX_FOLDER/bin/json_generation.sh $CONF
fi
if [ "$DO_IW" = "yes" ] ; then
log_daemon_msg " Setting up Interface (iw) "
iw $PHY_IF interface add $INTERFACE type managed
fi
if [ "$PROBE_INTERFACE" = yes ] ; then
if [ "$PROBE_INTERFACE" = "yes" ] ; then
echo " Probe wlan"
#Setting up WLAN Interface
piratebox_setup_wlan.sh $CONF probe
@ -100,7 +116,7 @@ case "$1" in
echo $?
fi
if [ "$DO_IFCONFIG" = yes ] ; then
if [ "$DO_IFCONFIG" = "yes" ] ; then
echo " Setting up wlan"
#Setting up WLAN Interface
piratebox_setup_wlan.sh $CONF start
@ -123,13 +139,26 @@ case "$1" in
if [ "$USE_DNSMASQ" = "yes" ] ; then
echo "Starting dnsmasq... "
# pidfile is written by dnsmasq
start-stop-daemon -S -q -x /usr/sbin/dnsmasq -- $CMD_DNSMASQ
start-stop-daemon -S -q -x /usr/sbin/dnsmasq -- $CMD_DNSMASQ
echo $?
fi
echo "Setting up firewall rules..."
$PIRATEBOX_FOLDER/bin/firewall.sh -s
echo $?
if [ "$IPV6_ENABLE" == "yes" ] && [ "$IPV6_ADVERT" == "radvd" ] ; then
echo "Starting radvd..."
start-stop-daemon -S -q -x radvd -- -p $PIDFILE_RADVD -C $CONF_RADVD
echo $?
fi
if [ "$DROOPY_ENABLED" = "yes" ] ; then
#Start here the PirateBox-Parts droopy i.e.
echo "Starting droopy..."
#Start here the PirateBox-Parts droopy i.e.
echo "Starting droopy..."
find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \;
#Delete 0 Byte Files
delete_empty.sh $UPLOADFOLDER
@ -138,7 +167,9 @@ case "$1" in
if [ "$DROOPY_USE_USER" = "yes" ] ; then
DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP "
fi
start-stop-daemon $DROOPY_USER -m -S -b -p $PIDFILE_DROOPY -x $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" --chmod $DROOPY_CHMOD $DROOPY_USERDIR $DROOPY_PORT
DROOPY_DO_CHMOD=""
test -n "$DROOPY_CHMOD" && DROOPY_DO_CHMOD="--chmod $DROOPY_CHMOD"
start-stop-daemon $DROOPY_USER -m -S -b -p $PIDFILE_DROOPY -x $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" $DROOPY_DO_CHMOD $DROOPY_USERDIR $DROOPY_PORT
echo $?
fi
@ -157,6 +188,19 @@ case "$1" in
start-stop-daemon -S -m -b -p $PIDFILE_SHOUTBOX -x $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF
echo $?
fi
#Start IRC Server
if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then
. $CONF_IRC
IRC_PARMS="--daemon --motd $IRC_MOTD "
if [ ! -z $STATEDIR ] ; then
IRC_PARMS=" $IRCPARMS --statedir $STATEDIR "
fi
echo "Starting Miniircd..."
start-stop-daemon $DROOPY_USER -m -S -p $PIDFILE_IRC -x $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS
echo $?
fi
fi
$PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF"
@ -169,19 +213,31 @@ case "$1" in
if [ "$USE_APN" = "yes" ] ; then
echo "Stopping hostap... "
start-stop-daemon -K -q -p $PIDFILE_HOSTAPN
start-stop-daemon -K -q -p $PIDFILE_HOSTAPN
echo $?
fi
if [ "$USE_DNSMASQ" = "yes" ] ; then
if [ "$USE_DNSMASQ" = "yes" ] ; then
echo "Stopping dnsmasq..."
start-stop-daemon -K -q -p $PIDFILE_DNSMASQ
start-stop-daemon -K -q -p $PIDFILE_DNSMASQ
echo $?
fi
echo "Removing firewall rules..."
$PIRATEBOX_FOLDER/bin/firewall.sh -k
echo $?
if [ -e $PIDFILE_RADVD ] ; then
echo "Stopping radvd..."
start-stop-daemon -K -q -p $PIDFILE_RADVD
echo $?
fi
if [ "$DROOPY_ENABLED" = "yes" ] ; then
#Kill Droopy
echo "Stopping droopy... "
start-stop-daemon -s 9 -K -q -p $PIDFILE_DROOPY
start-stop-daemon -s 9 -K -q -p $PIDFILE_DROOPY
echo $?
fi
@ -190,7 +246,13 @@ case "$1" in
echo "Stopping global chat service..."
start-stop-daemon -K -q -p $PIDFILE_SHOUTBOX
echo $?
fi
fi
if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then
echo "Stopping IRC..."
start-stop-daemon -K -q -p $PIDFILE_IRC
echo $?
fi
@ -199,7 +261,7 @@ case "$1" in
echo $?
if [ "$DO_IFCONFIG" = yes ] ; then
if [ "$DO_IFCONFIG" = "yes" ] ; then
piratebox_setup_wlan.sh $CONF stop
fi
@ -209,7 +271,7 @@ case "$1" in
#BRIDGE
if [ "$DO_BRIDGE" = "yes" ] ; then
echo "Remove $INTERFACE to bridge $BRIDGE // brctl addif
echo "Remove $INTERFACE to bridge $BRIDGE // brctl addif
$BRIDGE $INTERFACE "
sleep 1
BR_CMD="brctl delif $BRIDGE $INTERFACE"

View File

@ -0,0 +1,12 @@
#!/bin/sh
# Matthias Strubel (c) 2013 - GPL3
convert_yn_to_tf(){
local value=$1 ; shift
if [ "$value" == "yes" ] ; then
echo "true"
else
echo "false"
fi
}

View File

@ -0,0 +1,32 @@
#!/bin/sh
# Script for node name generation.
# Requires:
# argument 1: HOST (hostname)
# argument 2: NODE_NAME
# argument 3: NODE_GEN
#-
# Output in var NODE_GEN_OUTPUT
#
generate_node_name() {
local in_host=$1
local in_node_name=$2
local in_node_gen=$3
local complete_node_name=$in_node_name"."$in_host
if [ "$in_node_gen" = "no" ] ; then
complete_node_name=$in_node_name
fi
if [ "$in_node_name" = "" ] ; then
complete_node_name=$in_host
fi
if [ "$complete_node_name" != "" ] ; then
export NODE_GEN_OUTPUT=$complete_node_name
return 0
else
echo "Error: No valid node-name found"
return 1
fi
}

View File

@ -0,0 +1,30 @@
#!/bin/sh
## Library for some kind of avahi-node name resolution
## over piratebox mesh network
NODE_IP=""
## This function takes the normal
# gjgtjtjt.piratebox.lan
# hostname converts it to:
# gjgtjtjt_piratebox_lan.local
# makes an avahi resolution and gives back the IP in NODE_IP
# uf it was found
resolve_node_hostname() {
local in_nodename=$1
local AVAHI_HOST=$( echo $in_nodename | sed 's|\.|_|g' )
local bonjour_hostname="$AVAHI_HOST"".local"
local output=$( avahi-resolve-host-name -6 $bonjour_hostname )
if [ ! -z "$output" ] ; then
echo "Found host: $output"
#Sorry for that worse splitup of name and IP
NODE_IP=$( echo $output | sed "s|$bonjour_hostname||" )
return 0
else
return 1
fi
}

View File

@ -1,4 +1,4 @@
# PirateBox send Message lib
# PirateBox send Message lib (C)2012-2014
# modified by Matthias Strubel
#
# Original Version by
@ -36,80 +36,80 @@ import sys
flogger = None
debug = 0
class broadcast:
def __init__(self,name="notset", uuid=None, port="12556", timestamp=None,
auth=None, destination=["ff02::1","255.255.255.255", ]):
self.name = name
self.uuid = uuid
self.port = port
self.count = 0
self.destination = destination
self.ipv6_disabled = 0
class broadcast:
def __init__(self, name="notset", uuid=None, port="12556", timestamp=None,
auth=None, destination=["ff02::1", "255.255.255.255", ]):
self.name = name
self.uuid = uuid
self.port = port
self.count = 0
self.destination = destination
self.ipv6_disabled = 0
def disableIpv6(self):
self.ipv6_disabled = 1
self.destination = ["255.255.255.255", ]
self.ipv6_disabled = 1
self.destination = ["255.255.255.255", ]
def setDestination(self, destination=["ff02::1","255.255.255.255", ] ):
self.destination = destination
def setDestination(self, destination=["ff02::1", "255.255.255.255", ]):
self.destination = destination
def set (self, content ):
self.payload = content
def set(self, content):
self.payload = content
def get (self):
return self.payload
def get(self):
return self.payload
def __debugMessage (self, msg ):
if flogger != None:
flogger.debug ( msg )
def __debugMessage(self, msg):
if flogger is not None:
flogger.debug(msg)
elif debug == 1:
print msg
def __errorMessage (self, msg):
if flogger != None:
flogger.error ( msg )
def __errorMessage(self, msg):
if flogger is not None:
flogger.error(msg)
elif debug == 1:
print msg
def send(self):
for destination in self.destination:
if socket.has_ipv6 and re.search(":", destination) and not self.ipv6_disabled == 1:
self.__debugMessage( "working in ipv6 part on destination " + destination )
if socket.has_ipv6 and re.search(":", destination) and not \
self.ipv6_disabled == 1:
# Even if Python is compiled with IPv6, it doesn't mean that the os
# is supporting IPv6. (like the Nokia N900)
self.__debugMessage("working in ipv6 part on destination " +
destination)
# Even if Python is compiled with IPv6, it doesn't mean that
# the os is supporting IPv6. (like the Nokia N900)
try:
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
# Required on some version of MacOS X while sending IPv6 UDP
# datagram
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM,
socket.IPPROTO_UDP)
# Required on some version of MacOS X while sending IPv6
# UDP datagram
sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1)
except:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
socket.IPPROTO_UDP)
else:
self.__debugMessage ( "open ipv4 socket on destination " + destination )
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
self.__debugMessage("open ipv4 socket on destination " +
destination)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
socket.IPPROTO_UDP)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
try:
sock.sendto(self.payload, (destination, int(self.port)))
except socket.error, msg:
self.__errorMessage ( "Error sending to "+ destination + " : " + msg.strerror )
self.__errorMessage("Error sending to " + destination + " : " +
msg.strerror)
continue
sock.close()
def managetest():
msg = broadcast()
msg.set("Test")
@ -118,4 +118,3 @@ def managetest():
if __name__ == "__main__":
managetest()

View File

@ -1,3 +1,6 @@
# PirateBox Message broadcasting lib (C)2012-2014
# Matthias Strubel
import SocketServer
import socket
import sys
@ -6,18 +9,18 @@ import os
import messages
from psogen import writeToDisk, generate_html_from_file
global lastmsg
lastmsg = ""
class MyUDPHandler(SocketServer.BaseRequestHandler):
class MyUDPHandler(SocketServer.BaseRequestHandler):
def handle(self):
global lastmsg
data = self.request[0].strip()
socket = self.request[1]
if data[:9] == "piratebox":
if data[10:12] == "sb":
if data != lastmsg :
if data != lastmsg:
msg = messages.shoutbox_message()
msg.set_message(data)
content = msg.get()
@ -30,24 +33,23 @@ class MyUDPHandler(SocketServer.BaseRequestHandler):
else:
print "debug : not a piratebox message"
class UDPServer(SocketServer.UDPServer):
def setIPv6 (self, ipv6 = 1 ):
if ipv6 == 0 :
def setIPv6(self, ipv6=1):
if ipv6 == 0:
self.disable_ipv6 = 1
else:
self.disable_ipv6 = 0
def useIPv6 (self ):
def useIPv6(self):
return True
if self.disable_ipv6 == 1 :
if self.disable_ipv6 == 1:
return False
else:
return True
if socket.has_ipv6 :
if socket.has_ipv6:
try:
socktest = socket.socket(socket.AF_INET6)
socktest.close()
@ -56,28 +58,25 @@ class UDPServer(SocketServer.UDPServer):
address_family = socket.AF_INET
def server_bind(self):
if self.useIPv6():
self.v6success = True
try:
socktest = socket.socket(socket.AF_INET6)
socktest.close()
except:
self.v6success = False
self.v6success = True
try:
socktest = socket.socket(socket.AF_INET6)
socktest.close()
except:
self.v6success = False
if socket.has_ipv6 and self.v6success:
address_family = socket.AF_INET6
if socket.has_ipv6 and self.v6success:
address_family = socket.AF_INET6
#allowing to work in dual-stack when IPv6 is used
if socket.has_ipv6 and self.v6success:
self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
#allowing to work in dual-stack when IPv6 is used
if socket.has_ipv6 and self.v6success:
self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY,
0)
self.socket.bind(self.server_address)
if __name__ == "__main__":
HOST, PORT = ("::",12556)
server = UDPServer((HOST, PORT), MyUDPHandler)
server.setIPv6(0)
server.serve_forever()
HOST, PORT = ("::", 12556)
server = UDPServer((HOST, PORT), MyUDPHandler)
server.setIPv6(0)
server.serve_forever()

View File

@ -1,48 +1,50 @@
# PirateBox Message lib (C)2012-2014
# Matthias Strubel
import string
import socket
import base64
import sys
class message:
def __init__(self, name="generate" ):
def __init__(self, name="generate"):
if name == "generate":
self.name=socket.gethostname()
self.name = socket.gethostname()
else:
self.name=name
self.name = name
self.type="gc"
self.decoded=""
self.type = "gc"
self.decoded = ""
def set ( self, content=" " ):
base64content = base64.b64encode ( content )
self.decoded="piratebox;"+ self.type + ";01;" + self.name + ";" + base64content
def set(self, content=" "):
base64content = base64.b64encode(content)
self.decoded = "piratebox;" + self.type + ";01;" + self.name + ";" + \
base64content
def get ( self ):
def get(self):
# TODO Split decoded part
message_parts = string.split ( self.decoded , ";" )
message_parts = string.split(self.decoded, ";")
if message_parts[0] != "piratebox":
return None
if message_parts[0] != "piratebox":
return None
b64_content_part = message_parts[4]
content = base64.b64decode ( b64_content_part )
content = base64.b64decode(b64_content_part)
return content
def get_sendername (self):
def get_sendername(self):
return self.name
def get_message ( self ):
def get_message(self):
return self.decoded
def set_message ( self , decoded):
def set_message(self, decoded):
self.decoded = decoded
class shoutbox_message(message):
def __init__(self, name="generate" ):
message.__init__( self , name)
self.type="sb"
def __init__(self, name="generate"):
message.__init__(self, name)
self.type = "sb"

View File

@ -1,142 +1,167 @@
#!/usr/bin/python
# Modificated ShoutBox Library
# Modificated ShoutBox Library (C)2013-2014
# enables further modifications for the ShoutBox
# Run without to generate htmlfile
# Run the following to enter a new line from command line
# psogen.py input Anonymous default "Text"
# psogen.py input Anonymous default "Text"
import os, datetime, re
import os
import datetime
import re
import messages
import broadcast
import messages, broadcast
datafilename = os.environ["SHOUTBOX_CHATFILE"]
htmlfilename = os.environ["SHOUTBOX_GEN_HTMLFILE"]
clienttimestamp = os.environ["SHOUTBOX_CLIENT_TIMESTAMP"]
try:
raw_dest = os.environ["SHOUTBOX_BROADCAST_DESTINATIONS"]
finished_dest = re.sub ( '#' , '"' , raw_dest )
broadcast_destination = eval ( finished_dest )
raw_dest = os.environ["SHOUTBOX_BROADCAST_DESTINATIONS"]
finished_dest = re.sub('#', '"', raw_dest)
broadcast_destination = eval(finished_dest)
except KeyError:
broadcast_destination = False
broadcast_destination = False
def html_escape(text):
"""Remove HTML chars from the given text and replace them with HTML
entities. """
"""
Removes HTML chars from the given text and replace them with HTML entities.
"""
html_escape_table = {
'"': "&quot;", "'": "&apos;", ">": "&gt;",
"<": "&lt;"}
return "".join(html_escape_table.get(c,c) for c in text)
return "".join(html_escape_table.get(c, c) for c in text)
#--------------
# Generates Shoutbox-HTML-Frame ...
# Imports:
# content - String containing preformatted data
#--------------
def generate_html(content):
htmlstring = "<html><head><meta http-equiv='cache-control' content='no-cache'><meta name='GENERATOR' content='PyShoutOut'><title>Shout-Out Data</title><body>"
htmlstring += content
htmlstring += "</body></html>"
return htmlstring
"""
Generates Shoutbox-HTML-Frame...
Args:
content: String containing preformatted data
"""
htmlstring = "<html><head><meta http-equiv='cache-control' content=" \
"'no-cache'><meta name='GENERATOR' content='PyShoutOut'>" \
"<title>Shout-Out Data</title><body>"
htmlstring += content
htmlstring += "</body></html>"
return htmlstring
#--------------
# Generates HTML Data based on given content and write it to static html file
# Imports:
# content - String containing preformatted data
#--------------
def generate_html_into_file(content):
htmlstring = generate_html ( content )
"""
Generates HTML Data based on given content and write it to static html
file.
htmlfile = open( htmlfilename , 'w' )
htmlfile.write( htmlstring )
Args:
content: String containing preformatted data
"""
htmlstring = generate_html(content)
htmlfile = open(htmlfilename, 'w')
htmlfile.write(htmlstring)
htmlfile.close()
#--------------
# Generates HTML Data based on datafilename 's content
#--------------
def generate_html_from_file():
old = read_data_file()
generate_html_into_file( old )
"""
Generates HTML Data based on datafilename's content
"""
old = read_data_file()
generate_html_into_file(old)
def generate_html_to_display_from_file():
"""
Generates and Displays generated HTML
"""
old = read_data_file()
htmlstring = generate_html(old)
print htmlstring
#--------------
# Generates and Displays generated HTML
#--------------
def generate_html_to_display_from_file():
old = read_data_file()
htmlstring = generate_html ( old )
print htmlstring
#--------------
# Reads Data file from datafilename given name
#--------------
def read_data_file():
"""
Reads Data file from datafilename given name
"""
datafile = open(datafilename, 'r')
old = datafile.read()
datafile.close()
return old
#--------------
# Function for saving new Shoubox-Content & Regenerate static HTML file -- usually called by HTML-Form
#--------------
def process_form( name , indata , color ):
content = save_input( name , indata , color )
if broadcast_destination == False:
generate_html_into_file ( content )
def process_form(name, indata, color, timestamp):
"""
Function for saving new Shoubox-Content & Regenerate static
HTML file.
-> usually called by HTML-Form
"""
content = save_input(name, indata, color, timestamp)
if not broadcast_destination:
generate_html_into_file(content)
#--------------
# Acutally Saves SB-Content to datafile
#--------------
def save_input( name , indata , color ):
def save_input(name, indata, color, timestamp):
"""
Acutally saves SB-Content to datafile
"""
content = prepare_line(name, indata, color, timestamp)
content = prepare_line ( name, indata, color )
if broadcast_destination != False:
return writeToNetwork( content , broadcast_destination )
if broadcast_destination:
return writeToNetwork(content, broadcast_destination)
else:
return writeToDisk ( content )
return writeToDisk(content)
def writeToNetwork ( content , broadcast_destination ):
def writeToNetwork(content, broadcast_destination):
message = messages.shoutbox_message()
message.set(content)
casting = broadcast.broadcast( )
casting = broadcast.broadcast()
casting.setDestination(broadcast_destination)
casting.set( message.get_message() )
casting.set(message.get_message())
casting.send()
return None
def writeToDisk ( content ):
def writeToDisk(content):
old = read_data_file()
finalcontent = content + old
finalcontent = content + old
datafile = open(datafilename, 'r+')
datafile.write(finalcontent)
#datafile.truncate(0)
datafile.close()
return finalcontent
return finalcontent
def prepare_line (name, indata, color):
def prepare_line(name, indata, color, timestamp):
name = html_escape(name)
data = html_escape(indata)
color = html_escape(color)
curdate = datetime.datetime.now()
# Trying to make it look like this:
if clienttimestamp == 'yes':
curdate = datetime.datetime.fromtimestamp(timestamp)
else:
curdate = datetime.datetime.now()
# Trying to make it look like this:
# <div class="message">
# <date>00:00:00</date> <name>Nickname:</name> <data class="def">Lorem ipsum dolor sit amet</data>
# <date>00:00:00</date> <name>Nickname:</name> <data class="def">
# Lorem ipsum dolor sit amet</data>
# </div>
content = "<div class='message'><date>" + curdate.strftime("%H:%M:%S") + "</date> <name>" + name + ":</name> <data class='" + color + "'>" + data + "</data></div>\n"
#
content = "<div class='message'><date>%s</date> <name>%s:</name> " \
"<data class='%s'>%s</data></div>\n" \
% (curdate.strftime("%H:%M:%S"), name, color, data)
return content
#--------------
# Testing or Generating static HTML File
#--------------
if __name__ == "__main__":
import sys
if sys.argv.count("input") >= 1 :
save_input( sys.argv[2] , sys.argv[3] , sys.argv[4] )
generate_html_to_display_from_file()
print "Entered Text."
generate_html_from_file ()
print "Generated HTML-Shoutbox File."
import sys
if sys.argv.count("input") >= 1:
save_input(sys.argv[2], sys.argv[3], sys.argv[4])
generate_html_to_display_from_file()
print "Entered Text."
generate_html_from_file()
print "Generated HTML-Shoutbox File."

View File

@ -5,8 +5,8 @@ ____________________.__ __ __________
|____|_ /|____| |__||__| (____ /__| \___ >______ /\____/__/\_ \
\/ \/ \/ \/ \/
Website: http://piratebox.cc PirateBox Version: 1.0.7
Forum: http://forum.piratebox.cc RPi Image Version: 1.0.7-1
Website: http://piratebox.cc PirateBox Version: 1.1.0
Forum: http://forum.piratebox.cc RPi Image Version: 1.1.0-1
IRC: #piratebox irc.freenode.net Be open -- Share freely!
First Steps After Flashing
@ -30,3 +30,5 @@ First Steps After Flashing
> sudo cp /opt/piratebox/src/linux.example.minidlna.conf /etc/minidlna.conf
> sudo systemctl start minidlna
> sudo systemctl enable minidlna
6. Enable RealTimeClock timekeeping (needs DS3231 or 1307 RTC module!)
> sudo systemctl enable rpi_hwclock

View File

@ -0,0 +1,10 @@
[Unit]
Description=rpi_hwclock initialization and sync
After=multi-user.target
[Service]
Type=idle
ExecStart=/opt/piratebox/bin/rpi_hwclock.sh
[Install]
WantedBy=multi-user.target

View File

@ -1,7 +1,7 @@
<head>
<title>PirateBox - Share Freely!</title>
<script src="/jquery.min.js"></script>
<script src="/scripts.js"></script>
<script src="/content/js/jquery.min.js"></script>
<script src="/content/js/scripts.js"></script>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
</head>
<header id="header">
@ -9,11 +9,11 @@
<div id="logo">
<h1>
<a href="/">
<img src="/piratebox-logo-horizontal-white.png" alt="PirateBox" title="PirateBox - Share Freely">
<img src="/content/img/piratebox-logo-horizontal-white.png" alt="PirateBox" title="PirateBox - Share Freely">
</a>
</h1>
</div>
<div id="menu-icon"><img src="/menu.png" alt="Menu"></div>
<div id="menu-icon"><img src="/content/img/menu.png" alt="Menu"></div>
<nav id="top-nav">
<ul>
<li><a href="/">Home</a></li>

View File

@ -14,7 +14,7 @@
use constant TITLE => 'PirateBox board'; # Name of this image board
use constant SHOWTITLETXT => 1; # Show TITLE at top (1: yes 0: no)
use constant SHOWTITLEIMG => 1; # Show image at top (0: no, 1: single, 2: rotating)
use constant TITLEIMG => '/piratebox-logo-small.png'; # Title image (point to a script file if rotating)
use constant TITLEIMG => '/content/img/piratebox-logo-small.png'; # Title image (point to a script file if rotating)
#use constant THREADS_DISPLAYED => 10; # Number of threads on the front page
#use constant THREADS_LISTED => 40; # Number of threads in the thread list
#use constant REPLIES_PER_THREAD => 10; # Replies shown
@ -42,7 +42,7 @@ use constant ALLOW_TEXT_REPLIES => 1; # Allow users to make text replies
#use constant ALLOW_IMAGE_THREADS => 1; # Allow users to create image threads
#use constant ALLOW_IMAGE_REPLIES => 1; # Allow users to make image replies
#use constant IMAGE_REPLIES_PER_THREAD => 0; # Number of image replies per thread to show, set to 0 for no limit.
use constant MAX_KB => 10000; # Maximum upload size in KB
use constant MAX_KB => 5000; # Maximum upload size in KB
#use constant MAX_W => 200; # Images exceeding this width will be thumbnailed
#use constant MAX_H => 200; # Images exceeding this height will be thumbnailed
#use constant THUMBNAIL_SMALL => 1; # Thumbnail small images (1: yes, 0: no)

View File

@ -1,6 +1,6 @@
<html>
<head><title>Redirect...</title>
<meta http-equiv='refresh' content='0;url=http://#####HOST#####/' />
<meta http-equiv='refresh' content='0;url=http://#####HOST#####/content' />
<meta http-equiv='cache-control' content='no-cache, no-store, must-revalidate' />
<meta http-equiv='pragma' content='no-cache' />
<meta http-equiv='expires' content='0' />

View File

@ -28,7 +28,7 @@ body {margin: 0; border: 0; padding: 0px; background-color: #fafafa;
<p>
PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.
<p>
PirateBox was created by David Darts and is registered under a Free Art License (2011). To learn more about the project or to find out how to build your own PirateBox system, please visit http://wiki.daviddarts.com/piratebox
PirateBox was created by David Darts and is registered under a Free Art License (2011). To learn more about the project or to find out how to build your own PirateBox system, please visit http://daviddarts.com/piratebox
</td>
<td width="25"><br></td>
</tr>

View File

@ -0,0 +1,3 @@
<div class='message'><date>09:52:54</date> <name>Anonymous:</name><data class='red'>ttttttttt</data></div>
<div class='message'><date>09:52:25</date> <name>Anonymous:</name><data class='def'>ttt</data></div>
<div class='message'><date>09:32:38</date> <name>Anonymous:</name><data class='def'>test</data></div>

View File

@ -6,9 +6,8 @@
# Changed by Matthias Strubel / 2011-02-27 for piratebox-path
from psogen import generate_html_to_display_from_file
from psogen import generate_html_to_display_from_file
print "Content-type:text/html\r\n\r\n"
generate_html_to_display_from_file()

View File

@ -2,29 +2,26 @@
# PyShoutOut by Joey C. (http://www.joeyjwc.x3fusion.com)
# Writes the recieved information to the data file.
import cgi, datetime
from psogen import process_form
import cgi
from psogen import process_form
print "Content-type:text/html\r\n\r\n"
values = cgi.FieldStorage()
if values.has_key("name"):
rawname = values["name"].value
if "name" in values:
rawname = values["name"].value
else:
rawname = "&nbsp;"
if values.has_key("data"):
rawdata = values["data"].value
rawname = "&nbsp;"
if "data" in values:
rawdata = values["data"].value
else:
rawdata = "&nbsp;"
rawdata = "&nbsp;"
color = values["color"].value
curdate = datetime.datetime.now()
timestamp = float(values["timestamp"].value)
process_form(rawname, rawdata, color)
process_form(rawname, rawdata, color, timestamp)
print "Status:200\r\n\r\n"
print """<html><body>ok</body></html>"""

View File

@ -1,3 +1,5 @@
print("Status: 204 No response")
print("Content-Type: text/html; charset=ISO-8859-1")
print("")
<?php
// Return an empty page to fake a working internet connection for
// android
http_response_code(204);
?>

105
piratebox/piratebox/www/index.html Normal file → Executable file
View File

@ -1,102 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<title>PirateBox - Share Freely!</title>
<script src="jquery.min.js"></script>
<script src="scripts.js"></script>
<link rel="stylesheet" href="jquery-ui.min.css">
<script src="jquery-ui.min.js"></script>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
<head><title>Redirect...</title>
<meta http-equiv="refresh" content="0;url=http://piratebox.lan/content" />
<meta http-equiv='cache-control' content='no-cache, no-store, must-revalidate' />
<meta http-equiv='pragma' content='no-cache' />
<meta http-equiv='expires' content='0' />
</head>
<body id="main-index">
<header id="header">
<div class="container">
<div id="logo">
<h1>
<a href="/">
<img src="piratebox-logo-horizontal-white.png" alt="PirateBox" title="PirateBox - Share Freely">
</a>
</h1>
</div>
<div id="menu-icon"><img src="menu.png" alt="Menu"></div>
<nav id="top-nav">
<ul>
<li><a href="/" class="current">Home</a></li>
<li><a href="/board/">Forum</a></li>
<li><a href="/Shared/">Files</a></li>
<li><a href="#about">About</a></li>
</ul>
</nav>
</div>
</header>
<section id="content">
<div class="container">
<div id="welcome">
<div id="greeting" class="card">
<h2>Welcome</h2>
<p>Now, first of all, there is nothing illegal or scary going on here. This is a social place where you can chat and share files with people around you, <strong>anonymously</strong>! This is an off-line network, specially designed and developed for file-sharing and chat services. Staying off the grid is a precaution to maintain your full anonymity. Please have fun, chat with people, and feel free to share any files you may like.</p>
<input id="thanks" class="button" type="submit" value="Thanks">
</div>
</div>
<div id="sidebar">
<div id="upload" class="card">
<h2>Upload</h2>
<iframe width="100%" height="80" src='http://piratebox.lan:8080' style='border:0px'>
Your browser does not support iframes.. If you want to upload something, follow this <a href='http://piratebox.lan:8080'>Link</a>.
</iframe>
<h3><a href="/Shared">Browse Files -></a></h3>
<div id="station"></div>
</div>
<div id="diskusagecard" class="card">
<h2>Disk Usage</h2>
<div id="diskusage"></div>
<div id="refresh-diskusage">
<form method="POST" name="diskusage" id="du_form" >
<input class="button" type="submit" name="refresh" value="Refresh" id="du_form_button" title="Disk usage can only be refreshed every 5 minutes">
</form>
</div>
</div>
</div>
<div id="main">
<div id="chat" class="card">
<h2>Chat</h2>
<div id="shoutbox" class="shoutbox_content"></div>
<form method="POST" name="psowrte" id="sb_form" >
<div id="shoutbox-input">
<input class="nickname" type="text" name="name" value="Anonymous" placeholder="Nickname">
<input class="message" type="text" name="data" placeholder="Message...">
<input class="button" type="submit" name="submit" value="Send" id="send-button">
</div>
<div id="shoutbox-options">
<h3>Text Color:</h3>
<label for="def" class="bg-black"> <input name="color" type="radio" value="def" id="def" checked>Default</label>
<label for="blue" class="bg-blue"> <input name="color" type="radio" value="blue" id="blue" >Blue</label>
<label for="green" class="bg-green"> <input name="color" type="radio" value="green" id="green" >Green</label>
<label for="orange" class="bg-orange"> <input name="color" type="radio" value="orange" id="orange" >Orange</label>
<label for="red" class="bg-red"> <input name="color" type="radio" value="red" id="red" >Red</label>
</div>
</form>
</div>
</div>
</div>
</section>
<footer id="about">
<div class="container">
<div id="details">
<p class="to-top"><a href="#header">Back to top</a></p>
<h2>About PirateBox</h2>
<p>Inspired by pirate radio and the free culture movement, PirateBox is a self-contained mobile collaboration and file sharing device. PirateBox utilizes Free, Libre and Open Source software (FLOSS) to create mobile wireless file sharing networks where users can anonymously share images, video, audio, documents, and other digital content.</p>
<p>PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.</p>
<small>PirateBox is licensed under GPLv3.</small>
</div>
</div>
</footer>
<body>
Redirect
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
<html>
<head><title>Redirect...</title>
<meta http-equiv="refresh" content="0;url=http://piratebox.lan/" />
<meta http-equiv="refresh" content="0;url=http://piratebox.lan/content" />
<meta http-equiv='cache-control' content='no-cache, no-store, must-revalidate' />
<meta http-equiv='pragma' content='no-cache' />
<meta http-equiv='expires' content='0' />

View File

@ -0,0 +1,3 @@
*
!.gitignore
!.htaccess

View File

@ -136,13 +136,19 @@ header img, footer img {
}
#logo {
background-image: url('/content/img/piratebox-logo-horizontal-white.png');
width: 215px;
height: 36px;
float: left;
overflow: hidden;
}
#menu-icon {
background-image: url('/content/img/menu.png');
float: right;
width: 36px;
height: 36px;
overflow: hdden;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,110 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/content/css/page_style.css">
<title>PirateBox - Share Freely!</title>
<script src="/content/js/jquery.min.js"></script>
<script src="/content/js/scripts.js"></script>
<link rel="stylesheet" href="/css/jquery-ui.min.css">
<script src="/content/js/jquery-ui.min.js"></script>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
<link rel="prefetch" type="application/l10n" href="locales/locales.ini" />
<script type="text/javascript" src="/content/js/l10n.js"></script>
</head>
<body id="main-index">
<header id="header">
<div class="container">
<a href="/">
<div id="logo" scrolling="no" >&nbsp;</div>
</a>
<div id="menu-icon"></div>
<nav id="top-nav">
<ul>
<li><a href="/" class="current" data-l10n-id="navbarHome">Home</a></li>
<li><a href="/board/" data-l10n-id="navbarForum">Forum</a></li>
<li><a href="/Shared/" data-l10n-id="navbarFiles">Files</a></li>
<li><a href="#about" data-l10n-id="navbarAbout">About</a></li>
</ul>
</nav>
</div>
</header>
<section id="content">
<div class="container">
<div id="welcome">
<div id="greeting" class="card">
<h2 data-l10n-id="welcomeWelcome">Welcome</h2>
<p data-l10n-id="welcomeDescription">Now, first of all, there is nothing illegal or scary going on here. This is a social place where you can chat and share files with people around you, <strong data-l10n-id="anonymously">anonymously</strong>! This is an off-line network, specially designed and developed for file-sharing and chat services. Staying off the grid is a precaution to maintain your full anonymity. Please have fun, chat with people, and feel free to share any files you may like.</p>
<input id="thanks" class="button" type="submit" value="Thanks" data-l10n-id="welcomeThanksButton">
</div>
</div>
<div id="sidebar">
<div id="upload" class="card">
<h2 data-l10n-id="sidebarUpload">Upload</h2>
<iframe width="100%" height="80" src='http://piratebox.lan:8080' data-l10n-id="sidebarIframeNotSupported" scrolling="no">
Your browser does not support iframes.. If you want to upload something, follow this <a href='http://piratebox.lan:8080' data-l10n-id="link">Link</a>.
</iframe>
<h3><a href="/Shared" data-l10n-id="sidebarBrowseFiles">Browse Files -></a></h3>
<div id="station"></div>
</div>
<div id="diskusagecard" class="card">
<h2 data-l10n-id="diskUsage" >Disk Usage</h2>
<div id="diskusage"></div>
<div id="refresh-diskusage">
<form method="POST" name="diskusage" id="du_form" >
<input class="button" type="submit" name="refresh" value="Refresh" data-l10n-id="refreshButton" id="du_form_button" title="Disk usage can only be refreshed every 5 minutes">
</form>
</div>
</div>
</div>
<div id="main">
<div id="chat" class="card">
<h2 data-l10n-id="mainChatChat">Chat</h2>
<div id="shoutbox" class="shoutbox_content"></div>
<form method="POST" name="psowrte" id="sb_form" onsubmit='getTime();'>
<div id="shoutbox-input">
<input class="nickname" type="text" name="name" value="Anonymous" placeholder="Nickname" data-l10n-id="mainChatName" >
<input class="message" type="text" name="data" placeholder="Message..." data-l10n-id="mainChatMessage.placeholder" >
<input class="button" type="submit" name="submit" value="Send" id="send-button" data-l10n-id="mainChatSend" >
</div>
<div id="shoutbox-options">
<h3 data-l10n-id="mainChatTextColor">Text Color:</h3>
<label for="def" class="bg-black" data-l10n-id="mainShoutboxDefault"> <input name="color" type="radio" value="def" id="def" checked>Default</label>
<label for="blue" class="bg-blue" data-l10n-id="mainShoutboxBlue"> <input name="color" type="radio" value="blue" id="blue">Blue</label>
<label for="green" class="bg-green" data-l10n-id="mainShoutboxGreen"> <input name="color" type="radio" value="green" id="green">Green</label>
<label for="orange" class="bg-orange" data-l10n-id="mainShoutboxOrange"> <input name="color" type="radio" value="orange" id="orange">Orange</label>
<label for="red" class="bg-red" data-l10n-id="mainShoutboxRed"> <input name="color" type="radio" value="red" id="red">Red</label>
</div>
<input type="hidden" name="timestamp" id="timestamp">
<script language='JavaScript'>
function getTime(){
var date = new Date();
var timestamp = Math.round(date.getTime() / 1000);
document.getElementById('timestamp').value = timestamp;
}
</script>
</form>
</div>
</div>
</div>
</section>
<footer id="about">
<div class="container">
<div id="details">
<p class="to-top"><a href="#header" data-l10n-id="footerBackToTop">Back to top</a></p>
<h2 data-l10n-id="footerAbout">About PirateBox</h2>
<p data-l10n-id="footerInspired">Inspired by pirate radio and the free culture movement, PirateBox is a self-contained mobile collaboration and file sharing device. PirateBox utilizes Free, Libre and Open Source software (FLOSS) to create mobile wireless file sharing networks where users can anonymously share images, video, audio, documents, and other digital content.</p>
<p data-l10n-id="footerFilesTopSafety">PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.</p>
<small data-l10n-id="footerLicenceMain">PirateBox is licensed under GPLv3.</small>
</div>
</div>
</footer>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
$(document).ready(function() {
$.get('station_cnt.txt', function(data) {
$.get('/station_cnt.txt', function(data) {
$('div#station').html(data);
});
@ -23,7 +23,9 @@ $(document).ready(function() {
display_shoutbox();
// Add Tooltips
$('#du_form_button').tooltip();
if ( $('#du_form_button').lenght ) {
$('#du_form_button').tooltip();
}
// Spin menu icon and toggle nav
$('#menu-icon').click(function() {
@ -104,7 +106,7 @@ $(document).ready(function() {
});
function refresh_shoutbox () {
$.get('chat_content.html', function(data) {
$.get('/chat_content.html', function(data) {
$('div#shoutbox').html(data);
});
}
@ -133,7 +135,7 @@ function display_shoutbox() {
}
function refresh_diskusage() {
$.get('diskusage.html', function(data) {
$.get('/diskusage.html', function(data) {
$('div#diskusage').html(data);
});
}

View File

@ -0,0 +1,39 @@
# German strings
# vim: ft=jproperties
link = link
navbarHome = Home
navbarForum = Forum
navbarFiles = Dateien
navbarAbout.innerHTML = &uuml;ber
logoIMG.alt = PirateBox
logoIMG.title = PirateBox - Share Freely
welcomeWelcome = Wilkommen
welcomeDescription.innerHTML = Das Wichtigste vorweg: Hier geht nichts Illegales oder Unheimliches vor. Dies ist ein sozialer Platz, wo jeder chatten und Dateien austauschen kann und zwar anonym! Dies ist ein Offline-Netzwerk, speziell zum Filesharing und Chatten entwickelt. Vom Netz getrennt zu sein, ist die Voraussetzung fuer volle Anonymitaet. Hab Spass, chatte mit Menschen und teile Dateien, die du magst.
welcomeThanksButton.value = Thanks
sidebarUpload = Go to Upload ->
sidebarIframeNotSupported = Your browser does not support iframes.. If you want to upload something, follow this
sidebarBrowseFiles.innerHTML = St&ouml;bere Dateien ->
diskUsage = Disk Usage
refreshButton.value = Refresh
refreshButton.title = Disk usage can only be refreshed every 5 minutes
mainChatChat = Chat
mainChatSend.value = Send
mainChatName.placeholder = Alias
mainChatName.value = Anonymous
mainChatMessage.placeholder = Message...
mainChatTextColor = Text Color:
mainShoutboxDefault = Default
mainShoutboxBlue = Blue
mainShoutboxGreen = Green
mainShoutboxOrange = Orange
mainShoutboxRed = Red
footerBackToTop = Back to top
footerAbout = About
footerInspired = Inspiriert durch Piratensender und der Freien Kultur Bewegung, ist die PirateBox ein in sich abgeschlossenes Geraet zur mobilen Zusammenarbeit und zum Filesharing. Die PirateBox nutzt freie, offene Software (FLOSS) um mobile, drahtlose Filesharing-Netzwerke aufzubauen, wo Nutzer Bilder, Video-, Audio-Dateien, Dokumente und andere digitale Inhalte teilen koennen.
footerFilesTopSafety = Die PirateBox wurde designt um sicher und ungefaehrlich zu sein. Es sind keine Logins/Anmeldungen erforderlich und keine Benutzer-Daten werden geloggt. Um Tracking zu vermeiden und Datenschutz sicherzustellen, ist das System absichtlich nicht mit dem Internet verbunden.
footerLicenceMain = PirateBox ist lizensiert unter GPLv3.

View File

@ -0,0 +1,39 @@
# English strings
# vim: ft=jproperties
link = link
navbarHome = Home
navbarForum = Forum
navbarFiles = Files
navbarAbout = About
logoIMG.alt = PirateBox
logoIMG.title = PirateBox - Share Freely
welcomeWelcome = Welcome
welcomeDescription.innerHTML = Now, first of all, there is nothing illegal or scary going on here. This is a social place where you can chat and share files with people around you, <strong>anonymously</strong>! This is an off-line network, specially designed and developed for file-sharing and chat services. Staying off the grid is a precaution to maintain your full anonymity. Please have fun, chat with people, and feel free to share any files you may like.
welcomeThanksButton.value = Thanks
sidebarUpload = Go to Upload ->
sidebarIframeNotSupported = Your browser does not support iframes.. If you want to upload something, follow this
sidebarBrowseFiles = Browse Files ->
diskUsage = Disk Usage
refreshButton.value = Refresh
refreshButton.title = Disk usage can only be refreshed every 5 minutes
mainChatChat = Chat
mainChatSend.value = Send
mainChatName.placeholder = Alias
mainChatName.value = Anonymous
mainChatMessage.placeholder = Message...
mainChatTextColor = Text Color:
mainShoutboxDefault = Default
mainShoutboxBlue = Blue
mainShoutboxGreen = Green
mainShoutboxOrange = Orange
mainShoutboxRed = Red
footerBackToTop = Back to top
footerAbout = About
footerInspired = Inspired by pirate radio and the free culture movement, PirateBox is a self-contained mobile collaboration and file sharing device. PirateBox utilizes Free, Libre and Open Source software (FLOSS) to create mobile wireless file sharing networks where users can anonymously share images, video, audio, documents, and other digital content.
footerFilesTopSafety = LibraryBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.
footerLicenceMain = PirateBox is licensed under GPLv3.

View File

@ -0,0 +1,39 @@
# French strings
# vim: ft=jproperties
link = lien
navbarHome = Accueil
navbarForum = Forum
navbarFiles = Fichiers
navbarAbout = À propos
logoIMG.alt = PirateBox
logoIMG.title = PirateBox - Partagez librement
welcomeWelcome = Bienvenue
welcomeDescription.innerHTML = Tout d'abord, il ne se passe rien d'illégal ou d'effrayant ici. C'est un lieu social où vous pouvez discuter et partager <strong>anonymement</strong> des fichiers avec les personnes qui vous cotoient! C'est un réseau hors ligne, spécialement conçu et développé pour le partage de fichiers et la discussion. Rester hors du web est une précaution qui permet de garantir votre total anonymat. Amusez vous, discutez, et surtout partagez les fichiers que vous aimez.
welcomeThanksButton.value = Merci
sidebarUpload = Partagez des fichiers ->
sidebarIframeNotSupported = Votre navigateur ne supporte pas les iframes. Si vous souhaitez uploader quelque chose, suivez ce
sidebarBrowseFiles = Parcourir les fichiers ->
diskUsage = Espace de stockage
refreshButton.value = Rafra chir
refreshButton.title = Le taux d'utilisation du disque ne peut être rafraîchi que toutes les 5 minutes
mainChatChat = Chat
mainChatSend.value = Envoyer
mainChatName.placeholder = Pseudo
mainChatName.value = Anonyme
mainChatMessage.placeholder = Message...
mainChatTextColor = Couleur du texte:
mainShoutboxDefault = Défaut
mainShoutboxBlue = Bleu
mainShoutboxGreen = Vert
mainShoutboxOrange = Orange
mainShoutboxRed = Rouge
footerBackToTop = Vers le haut
footerAbout = À propos
footerInspired = Inspiré par les radios pirate et le mouvement de la culture libre, PirateBox est un dispositif mobile autonome de collaboration et de partage de fichiers. PirateBox utilise des logiciels libres pour créer des réseaux mobiles sans fils de partage de fichiers dont les utilisateurs peuvent partager de manière anonyme des images, des vidéos, de l'audio, des documents ou tout autre contenu numérique.
footerFilesTopSafety = LibraryBox est conçue pour être sûre et sécurisée. Aucun compte utilisateur n'est requis et aucune donnée utilisateur n'est sauvegardée. Le système n'est volontairement pas connecté à Internet afin de prévenir toute tentative de suivi et de préserver la vie privée de ses utilisateurs.
footerLicenceMain = PirateBox est distribuée sous licence GPLv3.

View File

@ -0,0 +1,8 @@
[de]
@import url(data.de.properties)
[en]
@import url(data.en.properties)
[fr]
@import url(data.fr.properties)

View File

@ -1,77 +1,4 @@
## Piratebox for laptop (eeePc) script collection WITH LIGHTTPD
## created by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-03-19
## licenced by gpl ;; please feel for improvements or feedback :)
## Changes:
## 2011-03-19 First concept release with shoutbox left in python and droopy in perl
## 2011-08-04 Image-Board integration
## created by Matthias Strubel (matthias.strubel@aod-rpg.de) 2014-01-17
## licenced by GPL-3 ;; please feel for improvements or feedback :)
##
####### OLD ###########
What to do? / Install
---------------------
> Install debian
> Install following Packages:
- Perl
# apt-get install perl
- lighttpd
# apt-get install lighttpd
- if needed : hostapn and/or dnsmasq
# apt-get install hostapn
# apt-get install dnsmasq
> copy over the piratebox folder into /opt/ (as root)
# sudo mkdir /opt
# sudo cp -rv piratebox /opt
> create a symlink /opt/piratebox/init.d/piratebox /etc/init.d/
# sudo ln -s /opt/piratebox/init.d/piratebox /etc/init.d/piratebox
> add piratebox to you runlevel (optional)
# sudo update-rc.d piratebox defaults
> create a link from your share-device to /opt/piratebox/share
# sudo ln -s /mnt/usbstick /opt/piratebox/share
> define your personall options in
# /opt/piratebox/conf/piratebox.conf # Start which services, IPs etc
# /opt/piratebox/conf/hostapd.conf # Some stuff about beeing an APN
> Now please mount your usb-stick, share drive ..
> Run the follow script
# /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf part2
> If you want to install kareha, please do the following steps:
# /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard
>> This step installs a basic configuration for the board...
>> Edit /opt/piratebox/share/board/config.pl and change ADMIN_PASS and SECRET
I created
/opt/piratebox/bin - Binarys and Scripts
/opt/piratebox/conf - Piratebox related configs (seperated from the normal system-configs!)
/opt/piratebox/share - Mountpoint (with the first start of piratebox, the correct permissions will be set)
/opt/piratebox/share/Shared - Unsorted upload folder
/opt/piratebox/share/board - imageboard location
/opt/piratebox/init.d - the init-script (later more?)
/opt/piratebox/www - Webfolder with cgi-scripts and static html pages
/opt/piratebox/tmp - Folder with the error-log
Change directory?
-------------------
If you decide not to run piratebox under /opt you have to change following scripts:
piratebox/conf/piratebox.conf
piratebox/init.d/piratebox
piratebox/conf/lighttpd/lighttpd.conf
Seperate Runlevel
-----------------
I'm using the piratebox on another runlevel, because I don't want to use it on daily work. So do not use the above update-rc.d command if you don't intend to start it always.
If you want to use it on another runlevel you can use
# update-rc.d piratebox enable 4
and disable other services, you don't need
i.e. # update-rc.d acpid disable 4
These examples are for debian based distributions.