From bbc3517272e4c470b9d9a428295ba34e359d9296 Mon Sep 17 00:00:00 2001 From: Anmol Date: Sun, 20 Mar 2016 12:36:33 +0530 Subject: [PATCH] Updated to 1.3.1 --- sources/.homeinstall/README.md | 164 + .../.homeinstall/hubzilla-config.txt.template | 177 + sources/.homeinstall/hubzilla-setup.sh | 949 + sources/.htaccess | 3 + sources/.openshift/action_hooks/deploy | 1 + sources/CHANGELOG | 135 + sources/Zotlabs/Access/AccessList.php | 92 + sources/Zotlabs/Project/System.php | 62 + sources/Zotlabs/Storage/BasicAuth.php | 212 + sources/Zotlabs/Storage/Browser.php | 372 + sources/Zotlabs/Storage/Directory.php | 536 + sources/Zotlabs/Storage/File.php | 322 + sources/Zotlabs/Web/HttpMeta.php | 66 + sources/Zotlabs/Web/Router.php | 199 + sources/Zotlabs/Zot/DReport.php | 55 + sources/Zotlabs/Zot/Receiver.php | 7 +- sources/Zotlabs/Zot/ZotHandler.php | 3 - sources/addons/bookmarker/bookmarker.php | 14 +- sources/addons/bookmarker/bookmarker.png | Bin 0 -> 314 bytes sources/addons/diaspora/diaspora.php | 43 +- sources/addons/diaspora/lang/C/messages.po | 87 + sources/addons/diaspora/lang/nl/strings.php | 20 + .../diaspora/view/tpl/diaspora_comment.tpl | 11 + .../view/tpl/diaspora_comment_relay.tpl | 12 + .../diaspora/view/tpl/diaspora_consensus.tpl | 17 + .../view/tpl/diaspora_conversation.tpl | 29 + .../diaspora/view/tpl/diaspora_like.tpl | 12 + .../diaspora/view/tpl/diaspora_like_relay.tpl | 13 + .../diaspora/view/tpl/diaspora_message.tpl | 16 + .../diaspora/view/tpl/diaspora_photo.tpl | 13 + .../diaspora/view/tpl/diaspora_post.tpl | 13 + .../diaspora/view/tpl/diaspora_profile.tpl | 17 + .../view/tpl/diaspora_relay_retraction.tpl | 10 + .../tpl/diaspora_relayable_retraction.tpl | 11 + .../diaspora/view/tpl/diaspora_reshare.tpl | 13 + .../diaspora/view/tpl/diaspora_retract.tpl | 9 + .../diaspora/view/tpl/diaspora_share.tpl | 8 + .../view/tpl/diaspora_signed_retract.tpl | 10 + .../diaspora/view/tpl/diaspora_vcard.tpl | 57 + sources/addons/diaspost/diaspost.php | 1 + sources/addons/gnusoc/gnusoc-32.png | Bin 0 -> 1426 bytes sources/addons/gnusoc/gnusoc.php | 111 + sources/addons/gnusoc/salmon.php | 387 + sources/addons/hubwall/hubwall.php | 80 + .../addons/hubwall/view/tpl/hubwall_form.tpl | 12 + sources/addons/ijpost/lang/nl/strings.php | 9 + sources/addons/js_upload/lang/nl/strings.php | 11 + sources/addons/keepout/keepout.php | 45 + sources/addons/libertree/lang/nl/strings.php | 9 + sources/addons/ljpost/lang/nl/strings.php | 9 + sources/addons/metatag/LICENSE | 340 + sources/addons/metatag/README.md | 1 + sources/addons/metatag/install.txt | 22 + sources/addons/metatag/metatag.php | 144 + sources/addons/msgfooter/msgfooter.php | 98 + sources/addons/msgfooter/view/tpl/admin.tpl | 2 + sources/addons/noembed/noembed.php | 26 + sources/addons/nsfw/lang/nl/strings.php | 11 + .../addons/openstreetmap/lang/nl/strings.php | 8 + sources/addons/pageheader/README | 8 + sources/addons/pageheader/lang/C/messages.po | 30 + sources/addons/pageheader/lang/ca/strings.php | 5 + sources/addons/pageheader/lang/cs/messages.po | 32 + sources/addons/pageheader/lang/cs/strings.php | 10 + sources/addons/pageheader/lang/de/messages.po | 33 + sources/addons/pageheader/lang/de/strings.php | 10 + sources/addons/pageheader/lang/eo/strings.php | 5 + sources/addons/pageheader/lang/es/strings.php | 5 + sources/addons/pageheader/lang/fr/strings.php | 5 + sources/addons/pageheader/lang/is/strings.php | 5 + sources/addons/pageheader/lang/it/messages.po | 32 + sources/addons/pageheader/lang/it/strings.php | 10 + .../addons/pageheader/lang/nb-no/strings.php | 5 + sources/addons/pageheader/lang/nl/strings.php | 11 + sources/addons/pageheader/lang/pl/strings.php | 5 + .../addons/pageheader/lang/pt-br/strings.php | 5 + sources/addons/pageheader/lang/ro/messages.po | 32 + sources/addons/pageheader/lang/ro/strings.php | 10 + sources/addons/pageheader/lang/ru/strings.php | 5 + sources/addons/pageheader/lang/sv/strings.php | 3 + .../addons/pageheader/lang/zh-cn/strings.php | 5 + sources/addons/pageheader/pageheader.css | 9 + sources/addons/pageheader/pageheader.php | 83 + sources/addons/pubsubhubbub/pubsub.php | 113 + sources/addons/pubsubhubbub/pubsubhubbub.php | 317 + sources/addons/smileybutton/smileybutton.php | 6 +- .../statistics_json/statistics_json.php | 4 +- sources/addons/statusnet/lang/C/messages.po | 157 +- sources/addons/statusnet/lang/nl/strings.php | 36 + sources/addons/statusnet/statusnet.php | 2 + sources/addons/superblock/lang/ca/strings.php | 2 +- sources/addons/superblock/lang/es/strings.php | 2 +- sources/addons/superblock/lang/fr/strings.php | 2 +- sources/addons/superblock/lang/it/strings.php | 2 +- sources/addons/superblock/lang/nl/strings.php | 2 +- .../addons/superblock/lang/pt-br/strings.php | 4 +- sources/addons/superblock/lang/ru/strings.php | 2 +- sources/addons/testdrive/lang/nl/strings.php | 11 + sources/addons/twitter/lang/nl/strings.php | 23 + sources/addons/twitter/twitter.php | 4 +- sources/addons/wppost/lang/C/messages.po | 52 +- sources/addons/wppost/lang/nl/hstrings.php | 16 + sources/addons/wppost/wppost.php | 3 +- sources/addons/xmpp/converse/CONTRIBUTING.rst | 37 + sources/addons/xmpp/converse/README.rst | 110 + .../xmpp/converse/builds/converse.min.js | 237 + .../addons/xmpp/converse/builds/locales.js | 11108 ++++++++++++ .../addons/xmpp/converse/builds/templates.js | 1150 ++ sources/addons/xmpp/converse/css/converse.css | 2041 +++ .../addons/xmpp/converse/css/converse.min.css | 30 + .../addons/xmpp/converse/css/images/arrow.svg | 4 + .../addons/xmpp/converse/css/images/bgbl.svg | 26 + .../addons/xmpp/converse/css/images/bgtr.svg | 26 + .../converse/css/images/bitcoin_qr_code.png | Bin 0 -> 4215 bytes .../xmpp/converse/css/images/dark-arrow.svg | 4 + .../xmpp/converse/css/images/header.jpg | Bin 0 -> 31035 bytes .../xmpp/converse/css/images/overlay.png | Bin 0 -> 48636 bytes .../addons/xmpp/converse/css/images/user.png | Bin 0 -> 1699 bytes sources/addons/xmpp/converse/css/theme.css | 341 + .../xmpp/converse/fonticons/Read Me.txt | 5 + .../converse/fonticons/demo-files/demo.css | 150 + .../converse/fonticons/demo-files/demo.js | 30 + .../addons/xmpp/converse/fonticons/demo.html | 1511 ++ .../xmpp/converse/fonticons/fonts/icomoon.eot | Bin 0 -> 18600 bytes .../xmpp/converse/fonticons/fonts/icomoon.svg | 102 + .../xmpp/converse/fonticons/fonts/icomoon.ttf | Bin 0 -> 18436 bytes .../converse/fonticons/fonts/icomoon.woff | Bin 0 -> 18512 bytes .../xmpp/converse/fonticons/selection.json | 2641 +++ .../addons/xmpp/converse/fonticons/style.css | 301 + sources/addons/xmpp/converse/sounds/README | 5 + .../xmpp/converse/sounds/msg_received.mp3 | Bin 0 -> 13716 bytes .../xmpp/converse/sounds/msg_received.ogg | Bin 0 -> 15405 bytes sources/addons/xmpp/view/tpl/admin.tpl | 3 + sources/addons/xmpp/xmpp.css | 10 + sources/addons/xmpp/xmpp.php | 187 + sources/addons/xmpp/xmpp.png | Bin 0 -> 2151 bytes sources/boot.php | 86 +- sources/doc/DerivedTheme1.md | 26 +- sources/doc/Privacy.md | 3 +- sources/doc/ca/Privacy.md | 78 + sources/doc/ca/TermsOfService.md | 8 + sources/doc/ca/about.bb | 27 + .../ca/accounts_profiles_channels_basics.bb | 19 + sources/doc/ca/admins.bb | 15 + sources/doc/ca/channels.bb | 32 + sources/doc/ca/develop.bb | 34 + sources/doc/ca/features.bb | 202 + sources/doc/ca/first-post.bb | 3 + sources/doc/ca/general.bb | 20 + sources/doc/ca/main.bb | 12 + sources/doc/ca/members.bb | 25 + sources/doc/ca/profiles.bb | 37 + sources/doc/ca/registration.bb | 35 + sources/doc/ca/what_is_zot.bb | 61 + sources/doc/cloud.bb | 2 +- sources/doc/de/general.bb | 4 +- sources/doc/faq_members.bb | 2 +- sources/doc/federate.bb | 68 + sources/doc/git_for_non_developers.bb | 2 +- sources/doc/hidden_configs.bb | 8 +- .../doc/hook/discover_channel_webfinger.bb | 14 + sources/doc/hooklist.bb | 2 +- sources/doc/to_do_code.bb | 3 - sources/include/BaseObject.php | 1 + sources/include/Contact.php | 5 +- sources/include/ConversationObject.php | 23 +- sources/include/ItemObject.php | 10 +- sources/include/account.php | 4 +- sources/include/api.php | 10 +- sources/include/attach.php | 98 +- sources/include/auth.php | 27 - sources/include/bbcode.php | 11 +- sources/include/cli_startup.php | 3 + sources/include/config.php | 66 +- sources/include/conversation.php | 25 + sources/include/crypto.php | 19 +- sources/include/datetime.php | 63 +- sources/include/dba/dba_driver.php | 9 +- sources/include/dba/dba_mysqli.php | 8 +- sources/include/enotify.php | 2 +- sources/include/event.php | 13 +- sources/include/features.php | 8 +- sources/include/follow.php | 4 +- sources/include/group.php | 2 +- sources/include/hubloc.php | 15 +- sources/include/identity.php | 214 +- sources/include/items.php | 536 +- sources/include/language.php | 15 +- sources/include/menu.php | 4 +- sources/include/nav.php | 19 +- sources/include/network.php | 357 +- sources/include/notifier.php | 37 +- sources/include/oembed.php | 61 +- sources/include/permissions.php | 28 +- sources/include/photos.php | 12 +- sources/include/plugin.php | 32 +- sources/include/profile_selectors.php | 12 +- sources/include/queue_fn.php | 6 +- sources/include/ratenotif.php | 1 - sources/include/reddav.php | 22 +- sources/include/salmon.php | 196 + sources/include/security.php | 20 +- sources/include/session.php | 55 +- sources/include/taxonomy.php | 7 +- sources/include/text.php | 92 +- sources/include/widgets.php | 72 +- sources/include/zot.php | 100 +- sources/index.php | 213 +- sources/install/INSTALL.txt | 9 +- sources/install/htconfig.sample.php | 11 + sources/install/schema_mysql.sql | 33 +- sources/install/schema_postgres.sql | 28 + sources/install/update.php | 103 +- sources/library/fullcalendar/CHANGELOG.txt | 905 + sources/library/fullcalendar/LICENSE.txt | 20 + .../library/imagesloaded/imagesloaded.pkgd.js | 487 + .../imagesloaded/imagesloaded.pkgd.min.js | 7 + sources/library/jgrowl/jquery.jgrowl.map | 0 sources/library/readmore.js/readmore.js | 176 +- sources/mod/_well_known.php | 15 +- sources/mod/admin.php | 233 +- sources/mod/cal.php | 346 + sources/mod/channel.php | 2 + sources/mod/chat.php | 6 +- sources/mod/cloud.php | 14 +- sources/mod/connedit.php | 73 +- sources/mod/cover_photo.php | 417 + sources/mod/dav.php | 16 +- sources/mod/display.php | 52 +- sources/mod/events.php | 11 +- sources/mod/feed.php | 2 + sources/mod/filestorage.php | 2 +- sources/mod/follow.php | 8 +- sources/mod/group.php | 4 +- sources/mod/help.php | 6 +- sources/mod/import.php | 26 +- sources/mod/invite.php | 12 +- sources/mod/item.php | 41 +- sources/mod/like.php | 25 +- sources/mod/linkinfo.php | 4 +- sources/mod/mitem.php | 2 +- sources/mod/network.php | 2 + sources/mod/new_channel.php | 43 +- sources/mod/oep.php | 398 + sources/mod/pdledit.php | 3 + sources/mod/photos.php | 19 +- sources/mod/poke.php | 19 +- sources/mod/post.php | 4 - sources/mod/profile.php | 1 + sources/mod/profile_photo.php | 54 +- sources/mod/profiles.php | 169 +- sources/mod/pubsites.php | 25 +- sources/mod/register.php | 56 +- sources/mod/rpost.php | 2 +- sources/mod/settings.php | 84 +- sources/mod/setup.php | 30 +- sources/mod/siteinfo.php | 4 +- sources/mod/thing.php | 4 +- sources/mod/update_display.php | 2 +- sources/mod/webfinger.php | 31 +- sources/mod/webpages.php | 2 + sources/mod/wfinger.php | 18 +- sources/mod/xrd.php | 4 +- sources/util/addons | 132 + sources/util/config | 19 +- sources/util/hmessages.po | 7409 ++++---- sources/util/hz | 38 + sources/util/udall | 17 + sources/version.inc | 2 +- sources/view/cs/htconfig.tpl | 11 + sources/view/css/bootstrap-red.css | 2 +- sources/view/css/conversation.css | 26 +- sources/view/css/default.css | 16 +- sources/view/css/mod_cloud.css | 2 +- sources/view/css/mod_new_channel.css | 173 +- sources/view/css/mod_photos.css | 2 +- sources/view/css/mod_profiles.css | 161 +- sources/view/css/widgets.css | 28 + sources/view/de/hmessages.po | 14284 +++++++-------- sources/view/de/hstrings.php | 2712 +-- sources/view/de/htconfig.tpl | 11 + sources/view/en-au/htconfig.tpl | 11 + sources/view/en-au/update_fail_eml.tpl | 2 +- sources/view/en-gb/htconfig.tpl | 9 + sources/view/en/htconfig.tpl | 9 + sources/view/en/lostpass_eml.tpl | 3 + sources/view/en/passchanged_eml.tpl | 5 + sources/view/en/register_verify_member.tpl | 5 + sources/view/eo/htconfig.tpl | 11 + sources/view/es-es/hmessages.po | 7819 ++++---- sources/view/es-es/hstrings.php | 1636 +- sources/view/fr/hmessages.po | 13832 ++++++++------- sources/view/fr/hstrings.php | 3369 ++-- sources/view/fr/htconfig.tpl | 11 + sources/view/it/hmessages.po | 9939 ++++++----- sources/view/it/hstrings.php | 1802 +- sources/view/it/htconfig.tpl | 11 + sources/view/js/main.js | 169 +- sources/view/js/mod_new_channel.js | 23 +- sources/view/js/mod_register.js | 58 +- sources/view/nb-no/hmessages.po | 14668 ++++++++-------- sources/view/nb-no/hstrings.php | 2744 +-- sources/view/nb-no/htconfig.tpl | 11 + sources/view/nl/hmessages.po | 7799 ++++---- sources/view/nl/hstrings.php | 1620 +- sources/view/nl/register_open_eml.tpl | 10 +- sources/view/pdl/mod_cal.pdl | 3 + sources/view/pdl/mod_channel.pdl | 3 + sources/view/php/choklet.php | 2 +- sources/view/php/default.php | 3 +- sources/view/php/full.php | 2 +- sources/view/php/minimal.php | 2 +- sources/view/php/redable.php | 2 +- sources/view/php/theme_init.php | 1 + sources/view/php/zen.php | 2 +- sources/view/pt-br/htconfig.tpl | 11 + sources/view/ru/htconfig.tpl | 2 + sources/view/sv/htconfig.tpl | 2 + sources/view/theme/redbasic/css/style.css | 118 +- sources/view/theme/redbasic/js/redbasic.js | 5 +- sources/view/theme/redbasic/php/config.php | 1 + sources/view/theme/redbasic/php/style.php | 8 +- sources/view/theme/redbasic/schema/boxy.css | 6 +- sources/view/theme/redbasic/schema/dark.css | 8 + .../redbasic/schema/simple_green_on_black.css | 13 + .../redbasic/schema/simple_white_on_black.css | 8 + .../theme/redbasic/tpl/theme_settings.tpl | 2 + sources/view/tpl/admin_aside.tpl | 2 + sources/view/tpl/admin_plugins_details.tpl | 3 + sources/view/tpl/admin_profiles.tpl | 38 + sources/view/tpl/admin_security.tpl | 31 + sources/view/tpl/admin_site.tpl | 1 - sources/view/tpl/comment_item.tpl | 1 + sources/view/tpl/cover_photo.tpl | 29 + sources/view/tpl/cover_photo_widget.tpl | 53 + sources/view/tpl/cropcover.tpl | 58 + sources/view/tpl/event_cal.tpl | 14 + sources/view/tpl/event_head.tpl | 13 +- sources/view/tpl/events-js.tpl | 2 +- sources/view/tpl/events_cal-js.tpl | 18 + sources/view/tpl/field_input.tpl | 2 +- sources/view/tpl/field_password.tpl | 2 +- sources/view/tpl/head.tpl | 4 +- sources/view/tpl/install_settings.tpl | 1 + sources/view/tpl/invite.tpl | 50 +- sources/view/tpl/jot.tpl | 26 +- sources/view/tpl/magicsig.tpl | 9 + sources/view/tpl/mood_content.tpl | 43 +- sources/view/tpl/new_channel.tpl | 66 +- sources/view/tpl/pdledit.tpl | 4 +- sources/view/tpl/photo_drop.tpl | 3 +- sources/view/tpl/photo_item.tpl | 39 +- sources/view/tpl/photo_view.tpl | 2 + sources/view/tpl/photos_upload.tpl | 2 +- sources/view/tpl/poke_content.tpl | 66 +- sources/view/tpl/profile_advanced.tpl | 103 +- sources/view/tpl/profile_edit.tpl | 653 +- sources/view/tpl/profile_entry.tpl | 20 +- sources/view/tpl/profile_listing_header.tpl | 21 +- sources/view/tpl/profile_photo.tpl | 62 +- sources/view/tpl/profile_vcard.tpl | 26 +- sources/view/tpl/profile_vcard_short.tpl | 42 + sources/view/tpl/register.tpl | 123 +- sources/view/tpl/settings.tpl | 9 +- sources/view/tpl/settings_account.tpl | 1 + sources/view/tpl/settings_display.tpl | 1 + sources/view/tpl/settings_oauth.tpl | 9 +- sources/view/tpl/settings_oauth_edit.tpl | 9 +- sources/view/tpl/zcard.tpl | 144 + 369 files changed, 80519 insertions(+), 45844 deletions(-) create mode 100644 sources/.homeinstall/README.md create mode 100644 sources/.homeinstall/hubzilla-config.txt.template create mode 100755 sources/.homeinstall/hubzilla-setup.sh create mode 100644 sources/CHANGELOG create mode 100644 sources/Zotlabs/Access/AccessList.php create mode 100644 sources/Zotlabs/Project/System.php create mode 100644 sources/Zotlabs/Storage/BasicAuth.php create mode 100644 sources/Zotlabs/Storage/Browser.php create mode 100644 sources/Zotlabs/Storage/Directory.php create mode 100644 sources/Zotlabs/Storage/File.php create mode 100644 sources/Zotlabs/Web/HttpMeta.php create mode 100644 sources/Zotlabs/Web/Router.php create mode 100644 sources/Zotlabs/Zot/DReport.php create mode 100644 sources/addons/bookmarker/bookmarker.png create mode 100644 sources/addons/diaspora/lang/C/messages.po create mode 100644 sources/addons/diaspora/lang/nl/strings.php create mode 100644 sources/addons/diaspora/view/tpl/diaspora_comment.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_comment_relay.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_consensus.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_conversation.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_like.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_like_relay.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_message.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_photo.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_post.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_profile.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_relay_retraction.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_relayable_retraction.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_reshare.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_retract.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_share.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_signed_retract.tpl create mode 100644 sources/addons/diaspora/view/tpl/diaspora_vcard.tpl create mode 100644 sources/addons/gnusoc/gnusoc-32.png create mode 100644 sources/addons/gnusoc/gnusoc.php create mode 100644 sources/addons/gnusoc/salmon.php create mode 100644 sources/addons/hubwall/hubwall.php create mode 100644 sources/addons/hubwall/view/tpl/hubwall_form.tpl create mode 100644 sources/addons/ijpost/lang/nl/strings.php create mode 100644 sources/addons/js_upload/lang/nl/strings.php create mode 100644 sources/addons/keepout/keepout.php create mode 100644 sources/addons/libertree/lang/nl/strings.php create mode 100644 sources/addons/ljpost/lang/nl/strings.php create mode 100644 sources/addons/metatag/LICENSE create mode 100644 sources/addons/metatag/README.md create mode 100644 sources/addons/metatag/install.txt create mode 100644 sources/addons/metatag/metatag.php create mode 100755 sources/addons/msgfooter/msgfooter.php create mode 100644 sources/addons/msgfooter/view/tpl/admin.tpl create mode 100644 sources/addons/noembed/noembed.php create mode 100644 sources/addons/nsfw/lang/nl/strings.php create mode 100644 sources/addons/openstreetmap/lang/nl/strings.php create mode 100755 sources/addons/pageheader/README create mode 100644 sources/addons/pageheader/lang/C/messages.po create mode 100644 sources/addons/pageheader/lang/ca/strings.php create mode 100644 sources/addons/pageheader/lang/cs/messages.po create mode 100644 sources/addons/pageheader/lang/cs/strings.php create mode 100644 sources/addons/pageheader/lang/de/messages.po create mode 100644 sources/addons/pageheader/lang/de/strings.php create mode 100644 sources/addons/pageheader/lang/eo/strings.php create mode 100644 sources/addons/pageheader/lang/es/strings.php create mode 100644 sources/addons/pageheader/lang/fr/strings.php create mode 100644 sources/addons/pageheader/lang/is/strings.php create mode 100644 sources/addons/pageheader/lang/it/messages.po create mode 100644 sources/addons/pageheader/lang/it/strings.php create mode 100644 sources/addons/pageheader/lang/nb-no/strings.php create mode 100644 sources/addons/pageheader/lang/nl/strings.php create mode 100644 sources/addons/pageheader/lang/pl/strings.php create mode 100644 sources/addons/pageheader/lang/pt-br/strings.php create mode 100644 sources/addons/pageheader/lang/ro/messages.po create mode 100644 sources/addons/pageheader/lang/ro/strings.php create mode 100644 sources/addons/pageheader/lang/ru/strings.php create mode 100644 sources/addons/pageheader/lang/sv/strings.php create mode 100644 sources/addons/pageheader/lang/zh-cn/strings.php create mode 100755 sources/addons/pageheader/pageheader.css create mode 100755 sources/addons/pageheader/pageheader.php create mode 100644 sources/addons/pubsubhubbub/pubsub.php create mode 100644 sources/addons/pubsubhubbub/pubsubhubbub.php create mode 100644 sources/addons/statusnet/lang/nl/strings.php create mode 100644 sources/addons/testdrive/lang/nl/strings.php create mode 100644 sources/addons/twitter/lang/nl/strings.php create mode 100644 sources/addons/wppost/lang/nl/hstrings.php create mode 100644 sources/addons/xmpp/converse/CONTRIBUTING.rst create mode 100644 sources/addons/xmpp/converse/README.rst create mode 100644 sources/addons/xmpp/converse/builds/converse.min.js create mode 100644 sources/addons/xmpp/converse/builds/locales.js create mode 100644 sources/addons/xmpp/converse/builds/templates.js create mode 100644 sources/addons/xmpp/converse/css/converse.css create mode 100644 sources/addons/xmpp/converse/css/converse.min.css create mode 100644 sources/addons/xmpp/converse/css/images/arrow.svg create mode 100644 sources/addons/xmpp/converse/css/images/bgbl.svg create mode 100644 sources/addons/xmpp/converse/css/images/bgtr.svg create mode 100644 sources/addons/xmpp/converse/css/images/bitcoin_qr_code.png create mode 100644 sources/addons/xmpp/converse/css/images/dark-arrow.svg create mode 100644 sources/addons/xmpp/converse/css/images/header.jpg create mode 100644 sources/addons/xmpp/converse/css/images/overlay.png create mode 100644 sources/addons/xmpp/converse/css/images/user.png create mode 100644 sources/addons/xmpp/converse/css/theme.css create mode 100644 sources/addons/xmpp/converse/fonticons/Read Me.txt create mode 100644 sources/addons/xmpp/converse/fonticons/demo-files/demo.css create mode 100644 sources/addons/xmpp/converse/fonticons/demo-files/demo.js create mode 100644 sources/addons/xmpp/converse/fonticons/demo.html create mode 100644 sources/addons/xmpp/converse/fonticons/fonts/icomoon.eot create mode 100644 sources/addons/xmpp/converse/fonticons/fonts/icomoon.svg create mode 100644 sources/addons/xmpp/converse/fonticons/fonts/icomoon.ttf create mode 100644 sources/addons/xmpp/converse/fonticons/fonts/icomoon.woff create mode 100644 sources/addons/xmpp/converse/fonticons/selection.json create mode 100644 sources/addons/xmpp/converse/fonticons/style.css create mode 100644 sources/addons/xmpp/converse/sounds/README create mode 100644 sources/addons/xmpp/converse/sounds/msg_received.mp3 create mode 100644 sources/addons/xmpp/converse/sounds/msg_received.ogg create mode 100644 sources/addons/xmpp/view/tpl/admin.tpl create mode 100644 sources/addons/xmpp/xmpp.css create mode 100644 sources/addons/xmpp/xmpp.php create mode 100644 sources/addons/xmpp/xmpp.png create mode 100644 sources/doc/ca/Privacy.md create mode 100644 sources/doc/ca/TermsOfService.md create mode 100644 sources/doc/ca/about.bb create mode 100644 sources/doc/ca/accounts_profiles_channels_basics.bb create mode 100644 sources/doc/ca/admins.bb create mode 100644 sources/doc/ca/channels.bb create mode 100644 sources/doc/ca/develop.bb create mode 100644 sources/doc/ca/features.bb create mode 100644 sources/doc/ca/first-post.bb create mode 100644 sources/doc/ca/general.bb create mode 100644 sources/doc/ca/main.bb create mode 100644 sources/doc/ca/members.bb create mode 100644 sources/doc/ca/profiles.bb create mode 100644 sources/doc/ca/registration.bb create mode 100644 sources/doc/ca/what_is_zot.bb create mode 100644 sources/doc/federate.bb create mode 100644 sources/doc/hook/discover_channel_webfinger.bb create mode 100644 sources/include/salmon.php create mode 100644 sources/library/fullcalendar/CHANGELOG.txt create mode 100644 sources/library/fullcalendar/LICENSE.txt create mode 100644 sources/library/imagesloaded/imagesloaded.pkgd.js create mode 100644 sources/library/imagesloaded/imagesloaded.pkgd.min.js create mode 100644 sources/library/jgrowl/jquery.jgrowl.map create mode 100755 sources/mod/cal.php create mode 100644 sources/mod/cover_photo.php create mode 100644 sources/mod/oep.php create mode 100755 sources/util/addons create mode 100755 sources/util/hz create mode 100755 sources/util/udall create mode 100644 sources/view/pdl/mod_cal.pdl create mode 100644 sources/view/tpl/admin_profiles.tpl create mode 100755 sources/view/tpl/admin_security.tpl create mode 100755 sources/view/tpl/cover_photo.tpl create mode 100755 sources/view/tpl/cover_photo_widget.tpl create mode 100755 sources/view/tpl/cropcover.tpl create mode 100755 sources/view/tpl/event_cal.tpl create mode 100755 sources/view/tpl/events_cal-js.tpl create mode 100644 sources/view/tpl/magicsig.tpl create mode 100755 sources/view/tpl/profile_vcard_short.tpl create mode 100644 sources/view/tpl/zcard.tpl diff --git a/sources/.homeinstall/README.md b/sources/.homeinstall/README.md new file mode 100644 index 00000000..c147f92b --- /dev/null +++ b/sources/.homeinstall/README.md @@ -0,0 +1,164 @@ +# Hubzilla at Home next to your Router + +Run hubzilla-setup.sh for an unattended installation of hubzilla. + +The script is known to work with Debian 8.3 stable (Jessie) + ++ Home-PC (Debian-8.3.0-amd64) ++ DigitalOcean droplet (Debian 8.3 x64 / 512 MB Memory / 20 GB Disk / NYC3) + +# Step-by-Step Overwiew + +## Preconditions + +Hardware + ++ Internet connection and router at home ++ Mini-pc connected to your router ++ USB drive for backups + +Software + ++ Fresh installation of Debian on your mini-pc ++ Router with open ports 80 and 443 for your Debian + +## The basic steps (quick overview) + ++ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS) ++ Log on to your new debian (server) + - apt-get install git + - mkdir -p /var/www/html + - cd /var/www/html + - git clone https://github.com/redmatrix/hubzilla.git . + - cp .homeinstall/hubzilla-config.txt.template .homeinstall/hubzilla-config.txt + - nano .homeinstall/hubzilla-config.txt + - Enter your values there: db pass, domain, values for dyn DNS + - hubzilla-setup.sh as root + - ... wait, wait, wait until the script is finised + - reboot ++ Open your domain with a browser and step throught the initial configuration of hubzilla. + +# Step-by-Step in Detail + +## Preparations Hardware + +### Mini-PC + +### Recommended: USB Drive for Backups + +The installation will create a daily backup. + +If the backup process does not find an external device than the backup goes to +the internal disk. + +The USB drive must be compatible with an encrpyted filesystem LUKS + ext4. + +## Preparations Software + +### Install Debian Linux on the Mini-PC + +Download the stable Debian at https://www.debian.org/ + +Create bootable USB drive with Debian on it. You could use the programm +unetbootin, https://en.wikipedia.org/wiki/UNetbootin + +Switch of your mini pc, plug in your USB drive and start the mini pc from the +stick. Install Debian. Follow the instructions of the installation. + +### Configure your Router + +Open the ports 80 and 443 on your router for your Debian + +## Preparations Dynamic IP Address + +Your Hubzilla must be reachable by a domain that you can type in your browser + + cooldomain.org + +You can use subdomains as well + + my.cooldomain.org + +There are two way to get a domain + +- buy a domain (recommended) or +- register a free subdomain + +### Method 1: Get yourself an own Domain (recommended) + +...for example at selfHOST.de + +### Method 2 Register a (free) Subdomain + +Register a free subdomain for example at + +- freeDNS +- selfHOST + +WATCH THIS: A free subdomain is not the prefered way to get a domain name. Why? + +Let's encrpyt issues a limited number of certificates each +day. Possibly other users of this domain will try to issue a certificate +at the same day as you do. So make sure you choose a domain with as less subdomains as +possible. + +## Install Hubzilla on your Debian + +Login to your debian +(Provided your username is "you" and the name of the mini pc is "debian". You +could take the IP address instead of "debian") + + ssh -X you@debian + +Change to root user + + su -l + +Install git + + apt-get install git + +Make the directory for apache and change diretory to it + + mkdir /var/www + cd /var/www/ + +Clone hubzilla from git ("git pull" will update it later) + + git clone https://github.com/redmatrix/hubzilla html + +Change to the install script + + cd html/.homeinstall/ + +Copy the template file + + cp hubzilla-config.txt.template hubzilla-config.txt + +Change the file "hubzilla-config.txt". Read the instructions there and enter your values. + + nano hubzilla-config.txt + +Run the script + + ./hubzilla-setup.sh + +Wait... The script should not finish with an error message. + +In a webbrowser open your domain. +Expected: A test page of hubzilla is shown. All checks there shoulg be +successfull. Go on... +Expected: A page for the Hubzilla server configuration shows up. + +Leave db server name "127.0.0.1" and port "0" untouched. + +Enter + +- DB user name = hubzilla +- DB pass word = This is the password you entered in "hubzilla-config.txt" +- DB name = hubzilla + +Leave db type "MySQL" untouched. + +Follow the instructions in the next pages. + diff --git a/sources/.homeinstall/hubzilla-config.txt.template b/sources/.homeinstall/hubzilla-config.txt.template new file mode 100644 index 00000000..040b0f2f --- /dev/null +++ b/sources/.homeinstall/hubzilla-config.txt.template @@ -0,0 +1,177 @@ +############################################### +### MANDATORY - database password ############# +# +# Please give your database password +# Example: db_pass=pass_word_with_no_blanks_in_it +# Example: db_pass="this password has blanks in it" +db_pass= + +############################################### +### MANDATORY - let's encrypt ################# +# +# Hubilla requires encrypted communication via secure HTTP (HTTPS). +# This script automates installation of an SSL certificate from +# Let's Encrypt (https://letsencrypt.org) +# +# Please give the domain name of your hub +# +# Example: my.cooldomain.org +# Example: cooldomain.org +# +# Email is optional +# +# +le_domain= +le_email= + +############################################### +### OPTIONAL - selfHOST - dynamic IP address ## +# +# 1. Register a domain at selfhost.de +# - choose offer "DOMAIN dynamisch" 1,50€/mon at 08.01.2016 +# 2. Get your configuration for dynamic IP update +# - Log in at selfhost.de +# - go to "DynDNS Accounte" +# - klick "Details" of your (freshly) registered domain +# - You will find the configuration there +# - Benutzername (user name) > use this for "selfhost_user=" +# - Passwort (pass word) > use this for "selfhost_pass=" +# +# +selfhost_user= +selfhost_pass= + +############################################### +### OPTIONAL - FreeDNS - dynamic IP address ### +# +# Please give the alpha-numeric-key of freedns +# +# Get a free subdomain from freedns and use it for your dynamic ip address +# Documentation under http://www.techjawab.com/2013/06/setup-dynamic-dns-dyndns-for-free-on.html +# +# - Register for a Free domain at http://freedns.afraid.org/signup/ +# - WATCH THIS: Make sure you choose a domain with as less subdomains as +# possible. Why? Let's encrpyt issues a limited count of certificates each +# day. Possible other users of this domain will try to issue a certificate +# at the same day. +# - Logon to FreeDNS (where you just registered) +# - Goto http://freedns.afraid.org/dynamic/ +# - Right click on "Direct Link" and copy the URL and paste it somewhere. +# - You should notice a large and unique alpha-numeric key in the URL +# +# http://freedns.afraid.org/dynamic/update.php?alpha-numeric-key +# +# Provided your url from freedns is +# +# http://freedns.afraid.org/dynamic/update.php?U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5 +# +# Then you have to provide +# +# freedns_key=U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5 +# +# +#freedns_key= + + +############################################### +### OPTIONAL - Backup to external device ###### +# +# The script can use an external device for the daily backup. +# The file system of the device (USB stick for example) must be compatible +# with encrypted LUKS + ext4 +# +# You should test to mount the device befor you run the script +# (hubzilla-setup.sh). +# How to find your (pluged-in) devices? +# +# fdisk -l +# +# Provided your device was listed as is /dev/sdb1. You could check with: +# +# blkid | grep /dev/sdb1 +# +# Try to decrypt +# (You might install cryptsetup befor using apt-get install. +# +# apt-get install cryptsetup +# cryptsetup luksOpen /dev/sdb1 cryptobackup +# +# Try to mount +# You might create the directory /media/hubzilla_backup it it does not exist +# using mkdir. +# +# mkdir /media/hubzilla_backup +# mount /dev/mapper/cryptobackup /media/hubzilla_backup +# +# Unmounting device goes like this +# +# umount /media/hubzilla_backup +# cryptsetup luksClose cryptobackup +# +# To check if still mounted +# +# lsof /media/hubzilla_backup +# +# If you leave the following parameters +# - "backup_device_name" and +# - "backup_device_pass" +# empty the script will create daily backups on the internal disk (which could +# save you as well). +# +# Example: backup_device_name=/dev/sdc1 +# +backup_device_name= +backup_device_pass= + + +############################################### +### OPTIONAL - Owncloud - deprecated ########## +# +# To install owncloud: owncloud=y +# Leave empty if you don't want to install owncloud +# +#owncloud= + + + +############################################### +### OPTIONAL - do not mess with things below ## +# (...if you are not certain) +# +# Usually you are done here +# Everything below is OPTIONAL +# +############################################### +# +# Database for hubzilla +hubzilla_db_name=hubzilla +hubzilla_db_user=hubzilla +hubzilla_db_pass=$db_pass +# +# +# Password for package mysql-server +# Example: mysqlpass=aberhallo +# Example: mysqlpass="aber hallo has blanks in it" +# +mysqlpass=$db_pass + +# Password for package phpmyadmin +# Example: phpmyadminpass=aberhallo +# Example: phpmyadminpass="aber hallo has blanks in it" +phpmyadminpass=$db_pass + +# TODO Prepare hubzilla for programmers +# - install eclipse and plugins +# - install xdebug to debug the php with eclipse +# - weaken permissions on /var/www/html +# - manual steps after this script +# * in eclipse: install plugins for php git hub +# * in eclipse: configure firefox (chrome,...) as browser to run with the php debuger +# * in eclipse: switch php debugger from zend to xdebug +# * in eclipse: add local hubzilla github repository +# +# Which user will use eclipse? +# Leave this empty if you do not want to prepare hubzilla for debugging +# +#developer_name= + diff --git a/sources/.homeinstall/hubzilla-setup.sh b/sources/.homeinstall/hubzilla-setup.sh new file mode 100755 index 00000000..b981666c --- /dev/null +++ b/sources/.homeinstall/hubzilla-setup.sh @@ -0,0 +1,949 @@ +#!/bin/bash +# +# How to use +# ---------- +# +# This file automates the installation of hubzilla under Debian Linux +# +# 1) Copy the file "hubzilla-config.txt.template" to "hubzilla-config.txt" +# Follow the instuctions there +# +# 2) Switch to user "root" by typing "su -" +# +# 3) Run with "./hubzilla-setup.sh" +# If this fails check if you can execute the script. +# - To make it executable type "chmod +x hubzilla-setup.sh" +# - or run "bash hubzilla-setup.sh" +# +# +# What does this script do basically? +# ----------------------------------- +# +# This file automates the installation of hubzilla under Debian Linux +# - install +# * apache webserer, +# * php, +# * mysql - the database for hubzilla, +# * phpmyadmin, +# * git to download and update hubzilla itself +# - download hubzilla core and addons +# - configure cron +# * "poller.php" for regular background prozesses of hubzilla +# * to_do "apt-get update" and "apt-get dist-upgrade" to keep linux +# up-to-date +# * to_do backup hubzillas database and files (rsnapshot) +# - configure dynamic ip with cron +# - to_do letsencrypt +# - to_do redirection to https +# +# +# Discussion +# ---------- +# +# Security - password is the same for mysql-server, phpmyadmin and hubzilla db +# - The script runs into installation errors for phpmyadmin if it uses +# different passwords. For the sake of simplicity one singel password. +# +# Security - suhosin for PHP +# - The script does not install suhosin. +# - Is the security package suhosin usefull or not usefull? +# +# Hubzilla - email verification +# - The script switches off email verification off in all htconfig.tpl. +# Example: /var/www/html/view/en/htconfig.tpl +# - Is this a silly idea or not? +# +# +# Remove Hubzilla (for a fresh start using the script) +# ---------------------------------------------------- +# +# You could use /var/www/hubzilla-remove.sh +# that is created by hubzilla-setup.sh. +# +# The script will remove (almost everything) what was installed by the script. +# After the removal you could run the script again to have a fresh install +# of all applications including hubzilla and its database. +# +# How to restore from backup +# -------------------------- +# +# Daily backup +# - - - - - - +# +# The installation +# - writes a script /var/www/hubzilla-daily.sh +# - creates a daily cron that runs the hubzilla-daily.sh +# +# hubzilla-daily.sh makes a (daily) backup of all relevant files +# - /var/lib/mysql/ > hubzilla database +# - /var/www/html/ > hubzilla from github +# - /var/www/letsencrypt/ > certificates +# +# hubzilla-daily.sh writes the backup +# - either to an external disk compatible to LUKS+ext4 (see hubzilla-config.txt) +# - or to /var/cache/rsnapshot in case the external disk is not plugged in +# +# Restore backup +# - - - - - - - +# +# This was not tested yet. +# Bacically you can copy the files from the backup to the server. +# +# Credits +# ------- +# +# The script is based on Thomas Willinghams script "debian-setup.sh" +# which he used to install the red#matrix. +# +# The script uses another script from https://github.com/lukas2511/letsencrypt.sh +# +# The documentation for bash is here +# https://www.gnu.org/software/bash/manual/bash.html +# +function check_sanity { + # Do some sanity checking. + print_info "Sanity check..." + if [ $(/usr/bin/id -u) != "0" ] + then + die 'Must be run by root user' + fi + + if [ -f /etc/lsb-release ] + then + die "Distribution is not supported" + fi + if [ ! -f /etc/debian_version ] + then + die "Ubuntu is not supported" + fi +} + +function check_config { + print_info "config check..." + # Check for required parameters + if [ -z "$db_pass" ] + then + die "db_pass not set in $configfile" + fi + if [ -z "$le_domain" ] + then + die "le_domain not set in $configfile" + fi + # backup is important and should be checked + if [ -n "$backup_device_name" ] + then + device_mounted=0 + if fdisk -l | grep -i "$backup_device_name.*linux" + then + print_info "ok - filesystem of external device is linux" + if [ -n "$backup_device_pass" ] + then + echo "$backup_device_pass" | cryptsetup luksOpen $backup_device_name cryptobackup + if [ ! -d /media/hubzilla_backup ] + then + mkdir /media/hubzilla_backup + fi + if mount /dev/mapper/cryptobackup /media/hubzilla_backup + then + device_mounted=1 + print_info "ok - could encrypt and mount external backup device" + umount /media/hubzilla_backup + else + print_warn "backup to external device will fail because encryption failed" + fi + cryptsetup luksClose cryptobackup + else + if mount $backup_device_name /media/hubzilla_backup + then + device_mounted=1 + print_info "ok - could mount external backup device" + umount /media/hubzilla_backup + else + print_warn "backup to external device will fail because mount failed" + fi + fi + else + print_warn "backup to external device will fail because filesystem is either not linux or 'backup_device_name' is not correct in $configfile" + fi + if [ $device_mounted == 0 ] + then + die "backup device not ready" + fi + fi +} + +function die { + echo "ERROR: $1" > /dev/null 1>&2 + exit 1 +} + + +function update_upgrade { + print_info "updated and upgrade..." + # Run through the apt-get update/upgrade first. This should be done before + # we try to install any package + apt-get -q -y update && apt-get -q -y dist-upgrade + print_info "updated and upgraded linux" +} + +function check_install { + if [ -z "`which "$1" 2>/dev/null`" ] + then + # export DEBIAN_FRONTEND=noninteractive ... answers from the package + # configuration database + # - q ... without progress information + # - y ... answer interactive questions with "yes" + # DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install $2 + DEBIAN_FRONTEND=noninteractive apt-get -q -y install $2 + print_info "installed $2 installed for $1" + else + print_warn "$2 already installed" + fi +} + +function nocheck_install { + # export DEBIAN_FRONTEND=noninteractive ... answers from the package configuration database + # - q ... without progress information + # - y ... answer interactive questions with "yes" + # DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install $2 + # DEBIAN_FRONTEND=noninteractive apt-get --install-suggests -q -y install $1 + DEBIAN_FRONTEND=noninteractive apt-get -q -y install $1 + print_info "installed $1" +} + + +function print_info { + echo -n -e '\e[1;34m' + echo -n $1 + echo -e '\e[0m' +} + +function print_warn { + echo -n -e '\e[1;31m' + echo -n $1 + echo -e '\e[0m' +} + +function stop_hubzilla { + if [ -d /etc/apache2 ] + then + print_info "stopping apache webserver..." + service apache2 stop + fi + if [ -f /etc/init.d/mysql ] + then + print_info "stopping mysql db..." + /etc/init.d/mysql stop + fi +} + +function install_apache { + print_info "installing apache..." + nocheck_install "apache2 apache2-utils" +} + +function install_curl { + print_info "installing curl..." + nocheck_install "curl" +} + +function install_sendmail { + print_info "installing sendmail..." + nocheck_install "sendmail sendmail-bin" +} + +function install_php { + # openssl and mbstring are included in libapache2-mod-php5 + # to_to: php5-suhosin + print_info "installing php..." + nocheck_install "libapache2-mod-php5 php5 php-pear php5-xcache php5-curl php5-mcrypt php5-gd" + php5enmod mcrypt +} + +function install_mysql { + # http://www.microhowto.info/howto/perform_an_unattended_installation_of_a_debian_package.html + # + # To determine the required package name, key and type you can perform + # a trial installation then search the configuration database. + # + # debconf-get-selections | grep mysql-server + # + # The command debconf-get-selections is provided by the package + # debconf-utils, which you may need to install. + # + # apt-get install debconf-utils + # + # If you want to supply an answer to a configuration question but do not + # want to be prompted for it then this can be arranged by preseeding the + # DebConf database with the required information. + # + # echo mysql-server-5.5 mysql-server/root_password password xyzzy | debconf-set-selections + # echo mysql-server-5.5 mysql-server/root_password_again password xyzzy | debconf-set-selections + # + print_info "installing mysql..." + if [ -z "$mysqlpass" ] + then + die "mysqlpass not set in $configfile" + fi + echo mysql-server-5.5 mysql-server/root_password password $mysqlpass | debconf-set-selections + echo mysql-server-5.5 mysql-server/root_password_again password $mysqlpass | debconf-set-selections + nocheck_install "php5-mysql mysql-server mysql-client" + php5enmod mcrypt +} + +function install_phpmyadmin { + print_info "installing phpmyadmin..." + if [ -z "$phpmyadminpass" ] + then + die "phpmyadminpass not set in $configfile" + fi + echo phpmyadmin phpmyadmin/setup-password password $phpmyadminpass | debconf-set-selections + echo phpmyadmin phpmyadmin/mysql/app-pass password $phpmyadminpass | debconf-set-selections + echo phpmyadmin phpmyadmin/app-password-confirm password $phpmyadminpass | debconf-set-selections + echo phpmyadmin phpmyadmin/mysql/admin-pass password $phpmyadminpass | debconf-set-selections + echo phpmyadmin phpmyadmin/password-confirm password $phpmyadminpass | debconf-set-selections + echo phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2 | debconf-set-selections + nocheck_install "phpmyadmin" + + # It seems to be not neccessary to check rewrite.load because it comes + # with the installation. To be sure you could check this manually by: + # + # nano /etc/apache2/mods-available/rewrite.load + # + # You should find the content: + # + # LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so + + a2enmod rewrite + if [ ! -f /etc/apache2/apache2.conf ] + then + die "could not find file /etc/apache2/apache2.conf" + fi + sed -i \ + "s/AllowOverride None/AllowOverride all/" \ + /etc/apache2/apache2.conf + if [ -z "`grep 'Include /etc/phpmyadmin/apache.conf' /etc/apache2/apache2.conf`" ] + then + echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf + fi + service apache2 restart +} + +function create_hubzilla_db { + print_info "creating hubzilla database..." + if [ -z "$hubzilla_db_name" ] + then + die "hubzilla_db_name not set in $configfile" + fi + if [ -z "$hubzilla_db_user" ] + then + die "hubzilla_db_user not set in $configfile" + fi + if [ -z "$hubzilla_db_pass" ] + then + die "hubzilla_db_pass not set in $configfile" + fi + Q1="CREATE DATABASE IF NOT EXISTS $hubzilla_db_name;" + Q2="GRANT USAGE ON *.* TO $hubzilla_db_user@localhost IDENTIFIED BY '$hubzilla_db_pass';" + Q3="GRANT ALL PRIVILEGES ON $hubzilla_db_name.* to $hubzilla_db_user@localhost identified by '$hubzilla_db_pass';" + Q4="FLUSH PRIVILEGES;" + SQL="${Q1}${Q2}${Q3}${Q4}" + mysql -uroot -p$phpmyadminpass -e "$SQL" +} + +function run_freedns { + print_info "run freedns (dynamic IP)..." + if [ -z "$freedns_key" ] + then + print_info "freedns was not started because 'freedns_key' is empty in $configfile" + else + if [ -n "$selfhost_user" ] + then + die "You can not use freeDNS AND selfHOST for dynamic IP updates ('freedns_key' AND 'selfhost_user' set in $configfile)" + fi + wget --no-check-certificate -O - https://freedns.afraid.org/dynamic/update.php?$freedns_key + fi +} + +function install_run_selfhost { + print_info "install and start selfhost (dynamic IP)..." + if [ -z "$selfhost_user" ] + then + print_info "selfHOST was not started because 'selfhost_user' is empty in $configfile" + else + if [ -n "$freedns_key" ] + then + die "You can not use freeDNS AND selfHOST for dynamic IP updates ('freedns_key' AND 'selfhost_user' set in $configfile)" + fi + if [ -z "$selfhost_pass" ] + then + die "selfHOST was not started because 'selfhost_pass' is empty in $configfile" + fi + if [ ! -d $selfhostdir ] + then + mkdir $selfhostdir + fi + # the old way + # https://carol.selfhost.de/update?username=123456&password=supersafe + # + # the prefered way + wget --output-document=$selfhostdir/$selfhostscript http://jonaspasche.de/selfhost-updater + echo "router" > $selfhostdir/device + echo "$selfhost_user" > $selfhostdir/user + echo "$selfhost_pass" > $selfhostdir/pass + bash $selfhostdir/$selfhostscript update + fi +} + +function ping_domain { + print_info "ping domain $domain..." + # Is the domain resolved? Try to ping 6 times à 10 seconds + COUNTER=0 + for i in {1..6} + do + print_info "loop $i for ping -c 1 $domain ..." + if ping -c 4 -W 1 $le_domain + then + print_info "$le_domain resolved" + break + else + if [ $i -gt 5 ] + then + die "Failed to: ping -c 1 $domain not resolved" + fi + fi + sleep 10 + done + sleep 5 +} + +function configure_cron_freedns { + print_info "configure cron for freedns..." + if [ -z "$freedns_key" ] + then + print_info "freedns is not configured because freedns_key is empty in $configfile" + else + # Use cron for dynamich ip update + # - at reboot + # - every 30 minutes + if [ -z "`grep 'freedns.afraid.org' /etc/crontab`" ] + then + echo "@reboot root https://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab + echo "*/30 * * * * root wget --no-check-certificate -O - https://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab + else + print_info "cron for freedns was configured already" + fi + fi +} + +function configure_cron_selfhost { + print_info "configure cron for selfhost..." + if [ -z "$selfhost_user" ] + then + print_info "freedns is not configured because freedns_key is empty in $configfile" + else + # Use cron for dynamich ip update + # - at reboot + # - every 30 minutes + if [ -z "`grep 'selfhost-updater.sh' /etc/crontab`" ] + then + echo "@reboot root bash /etc/selfhost/selfhost-updater.sh update > /dev/null 2>&1" >> /etc/crontab + echo "*/5 * * * * root /bin/bash /etc/selfhost/selfhost-updater.sh update > /dev/null 2>&1" >> /etc/crontab + else + print_info "cron for selfhost was configured already" + fi + fi +} + +function install_git { + print_info "installing git..." + nocheck_install "git" +} + +function install_letsencrypt { + print_info "installing let's encrypt ..." + # check if user gave domain + if [ -z "$le_domain" ] + then + die "Failed to install let's encrypt: 'le_domain' is empty in $configfile" + fi + # configure apache + apache_le_conf=/etc/apache2/sites-available/le-default.conf + if [ -f $apache_le_conf ] + then + print_info "$apache_le_conf exist already" + else + cat > $apache_le_conf < + Options FollowSymLinks + Allow from all + +END + a2ensite le-default.conf + service apache2 restart + fi + # download the shell script + if [ -d $le_dir ] + then + print_info "letsenrypt exists already (nothing downloaded > no certificate created and registered)" + return 0 + fi + git clone https://github.com/lukas2511/letsencrypt.sh $le_dir + cd $le_dir + # create config file for letsencrypt.sh + echo "WELLKNOWN=$le_dir" > $le_dir/config.sh + if [ -n "$le_email" ] + then + echo "CONTACT_EMAIL=$le_email" >> $le_dir/config.sh + fi + # create domain file for letsencrypt.sh + # WATCH THIS: + # - It did not work wit "sub.domain.org www.sub.domain.org". + # - So just use "sub.domain.org" only! + echo "$le_domain" > $le_dir/domains.txt + # test apache config for letsencrpyt + url_http=http://$le_domain/.well-known/acme-challenge/domains.txt + wget_output=$(wget -nv --spider --max-redirect 0 $url_http) + if [ $? -ne 0 ] + then + die "Failed to load $url_http" + fi + # run letsencrypt.sh + # + ./letsencrypt.sh --cron +} + +function configure_apache_for_https { + print_info "configuring apache to use httpS ..." + # letsencrypt.sh + # + # "${BASEDIR}/certs/${domain}/privkey.pem" + # "${BASEDIR}/certs/${domain}/cert.pem" + # "${BASEDIR}/certs/${domain}/fullchain.pem" + # + SSLCertificateFile=${le_dir}/certs/${le_domain}/cert.pem + SSLCertificateKeyFile=${le_dir}/certs/${le_domain}/privkey.pem + SSLCertificateChainFile=${le_dir}/certs/${le_domain}/fullchain.pem + if [ ! -f $SSLCertificateFile ] + then + print_warn "Failed to configure apache for httpS: Missing certificate file $SSLCertificateFile" + return 0 + fi + # make sure that the ssl mode is enabled + print_info "...configuring apache to use httpS - a2enmod ssl ..." + a2enmod ssl + # modify apach' ssl conf file + if grep -i "ServerName" $sslconf + then + print_info "seems that apache was already configered to use httpS with $sslconf" + else + sed -i "s/ServerAdmin.*$/ServerAdmin webmaster@localhost\\n ServerName ${le_domain}/" $sslconf + fi + sed -i s#/etc/ssl/certs/ssl-cert-snakeoil.pem#$SSLCertificateFile# $sslconf + sed -i s#/etc/ssl/private/ssl-cert-snakeoil.key#$SSLCertificateKeyFile# $sslconf + sed -i s#/etc/apache2/ssl.crt/server-ca.crt#$SSLCertificateChainFile# $sslconf + sed -i s/#SSLCertificateChainFile/SSLCertificateChainFile/ $sslconf + # apply changes + a2ensite default-ssl.conf + service apache2 restart +} + +function check_https { + print_info "checking httpS > testing ..." + url_https=https://$le_domain + wget_output=$(wget -nv --spider --max-redirect 0 $url_https) + if [ $? -ne 0 ] + then + print_warn "check not ok" + else + print_info "check ok" + fi +} + +function install_hubzilla { + print_info "installing hubzilla..." + # rm -R /var/www/html/ # for "stand alone" usage + cd /var/www/ + # git clone https://github.com/redmatrix/hubzilla html # for "stand alone" usage + cd html/ + git clone https://github.com/redmatrix/hubzilla-addons addon + mkdir -p "store/[data]/smarty3" + chmod -R 777 store + touch .htconfig.php + chmod ou+w .htconfig.php + install_hubzilla_plugins + cd /var/www/ + chown -R www-data:www-data html + chown root:www-data /var/www/html/ + chown root:www-data /var/www/html/.htaccess + chmod 0644 /var/www/html/.htaccess + # try to switch off email registration + sed -i "s/verify_email.*1/verify_email'] = 0/" /var/www/html/view/*/ht* + if [ -n "`grep -r 'verify_email.*1' /var/www/html/view/`" ] + then + print_warn "Hubzillas registration prozess might have email verification switched on." + fi + print_info "installed hubzilla" +} + +function install_hubzilla_plugins { + print_info "installing hubzilla plugins..." + cd /var/www/html + plugin_install=.homeinstall/plugin_install.txt + theme_install=.homeinstall/theme_install.txt + # overwrite script to update the plugin and themes + rm -f $plugins_update + echo "cd /var/www/html" >> $plugins_update + ################### + # write plugin file + if [ ! -f "$plugin_install" ] + then + echo "# To install a plugin" >> $plugin_install + echo "# 1. add the plugin in a new line and run" >> $plugin_install + echo "# 2. run" >> $plugin_install + echo "# cd /var/www/html/.homeinstall" >> $plugin_install + echo "# ./hubzilla-setup.sh" >> $plugin_install + echo "https://gitlab.com/zot/ownmapp.git ownMapp" >> $plugin_install + echo "https://gitlab.com/zot/hubzilla-chess.git chess" >> $plugin_install + fi + # install plugins + while read -r line; do + [[ "$line" =~ ^#.*$ ]] && continue + p_url=$(echo $line | awk -F' ' '{print $1}') + p_name=$(echo $line | awk -F' ' '{print $2}') + # basic check of format + if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ] + then + # install addon + util/add_addon_repo $line + util/update_addon_repo $p_name # not sure if this line is neccessary + echo "util/update_addon_repo $p_name" >> $plugins_update + else + print_info "skipping installation of a plugin from file $plugin_install - something wrong with format in line: $line" + fi + done < "$plugin_install" + ################### + # write theme file + if [ ! -f "$theme_install" ] + then + echo "# To install a theme" >> $theme_install + echo "# 1. add the theme in a new line and run" >> $theme_install + echo "# 2. run" >> $theme_install + echo "# cd /var/www/html/.homeinstall" >> $theme_install + echo "# ./hubzilla-setup.sh" >> $theme_install + echo "https://github.com/DeadSuperHero/hubzilla-themes.git DeadSuperHeroThemes" >> $theme_install + + fi + # install plugins + while read -r line; do + [[ "$line" =~ ^#.*$ ]] && continue + p_url=$(echo $line | awk -F' ' '{print $1}') + p_name=$(echo $line | awk -F' ' '{print $2}') + # basic check of format + if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ] + then + # install addon + util/add_theme_repo $line + util/update_theme_repo $p_name # not sure if this line is neccessary + echo "util/update_theme_repo $p_name" >> $plugins_update + else + print_info "skipping installation of a theme from file $theme_install - something wrong with format in line: $line" + fi + done < "$theme_install" + print_info "installed hubzilla plugins and themes" +} + +function rewrite_to_https { + print_info "configuring apache to redirect http to httpS ..." + htaccessfile=/var/www/html/.htaccess + if grep -i "https" $htaccessfile + then + print_info "...configuring apache to redirect http to httpS was already done in $htaccessfile" + else + sed -i "s#QSA]#QSA]\\n RewriteCond %{SERVER_PORT} !^443$\\n RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]#" $htaccessfile + fi + service apache2 restart +} + + +function install_owncloud { + if [ -z "$owncloud" ] + then + print_info "Do not install owncloud" + return 0 + fi + if [ -f /etc/apt/sources.list.d/owncloud.list ] + then + print_info "owncloud is already installed and is left untouched" + return 0 + fi + print_info "installing owncloud..." + # add the repository key to apt + wget -nv https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key -O Release.key + apt-key add - < Release.key + # add the repository and install from there + sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /' >> /etc/apt/sources.list.d/owncloud.list" + apt-get update + nocheck_install "owncloud" + chown -R www-data:www-data /var/www/owncloud/ + # set strong permissions + ocpath='/var/www/owncloud' + htuser='www-data' + htgroup='www-data' + rootuser='root' # On QNAP this is admin + find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 + find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 + chown -R ${rootuser}:${htgroup} ${ocpath}/ + chown -R ${htuser}:${htgroup} ${ocpath}/apps/ + chown -R ${htuser}:${htgroup} ${ocpath}/config/ + chown -R ${htuser}:${htgroup} ${ocpath}/data/ + chown -R ${htuser}:${htgroup} ${ocpath}/themes/ + chown ${rootuser}:${htgroup} ${ocpath}/.htaccess + chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess + chmod 0644 ${ocpath}/.htaccess + chmod 0644 ${ocpath}/data/.htaccess +} + +# This will allways overwrite both config files +# - internal disk +# - external disk (LUKS + ext4) +# of rsnapshot for hubzilla +function install_rsnapshot { + print_info "installing rsnapshot..." + nocheck_install "rsnapshot" + # internal disk + cp -f /etc/rsnapshot.conf $snapshotconfig + sed -i "/hourly/s/retain/#retain/" $snapshotconfig + sed -i "/monthly/s/#retain/retain/" $snapshotconfig + sed -i "s/^cmd_cp/#cmd_cp/" $snapshotconfig + sed -i "s/^backup/#backup/" $snapshotconfig + if [ -z "`grep 'letsencrypt' $snapshotconfig`" ] + then + echo "backup /var/lib/mysql/ localhost/" >> $snapshotconfig + echo "backup /var/www/html/ localhost/" >> $snapshotconfig + echo "backup /var/www/letsencrypt/ localhost/" >> $snapshotconfig + fi + # external disk + if [ -n "$backup_device_name" ] && [ -n "$backup_device_pass" ] + then + cp -f /etc/rsnapshot.conf $snapshotconfig_external_device + sed -i "s#snapshot_root.*#snapshot_root $backup_mount_point#" $snapshotconfig_external_device + sed -i "/hourly/s/retain/#retain/" $snapshotconfig_external_device + sed -i "/monthly/s/#retain/retain/" $snapshotconfig_external_device + sed -i "s/^cmd_cp/#cmd_cp/" $snapshotconfig_external_device + sed -i "s/^backup/#backup/" $snapshotconfig_external_device + if [ -z "`grep 'letsencrypt' $snapshotconfig_external_device`" ] + then + echo "backup /var/lib/mysql/ localhost/" >> $snapshotconfig_external_device + echo "backup /var/www/html/ localhost/" >> $snapshotconfig_external_device + echo "backup /var/www/letsencrypt/ localhost/" >> $snapshotconfig_external_device + fi + else + print_info "No backup configuration (rsnapshot) for external device configured. Reason: backup_device_name and/or backup_device_pass not given in $configfile" + fi +} + +function install_cryptosetup { + print_info "installing cryptsetup..." + nocheck_install "cryptsetup" +} + +function configure_cron_daily { + print_info "configuring cron..." + # every 10 min for poller.php + if [ -z "`grep 'poller.php' /etc/crontab`" ] + then + echo "*/10 * * * * www-data cd /var/www/html; php include/poller.php >> /dev/null 2>&1" >> /etc/crontab + fi + # Run external script daily at 05:30 + # - stop apache and mysql-server + # - backup hubzilla + # - update hubzilla core and addon + # - update and upgrade linux + # - reboot +echo "#!/bin/sh" > /var/www/$hubzilladaily +echo "#" >> /var/www/$hubzilladaily +echo "echo \" \"" >> /var/www/$hubzilladaily +echo "echo \"+++ \$(date) +++\"" >> /var/www/$hubzilladaily +echo "echo \" \"" >> /var/www/$hubzilladaily +echo "echo \"\$(date) - renew certificat if 30 days old...\"" >> /var/www/$hubzilladaily +echo "bash /var/www/letsencrypt/letsencrypt.sh --cron" >> /var/www/$hubzilladaily +echo "#" >> /var/www/$hubzilladaily +echo "# stop hubzilla" >> /var/www/$hubzilladaily +echo "echo \"\$(date) - stoping apaache and mysql...\"" >> /var/www/$hubzilladaily +echo "service apache2 stop" >> /var/www/$hubzilladaily +echo "/etc/init.d/mysql stop # to avoid inconsistancies" >> /var/www/$hubzilladaily +echo "#" >> /var/www/$hubzilladaily +echo "# backup" >> /var/www/$hubzilladaily +echo "echo \"\$(date) - try to mount external device for backup...\"" >> /var/www/$hubzilladaily +echo "backup_device_name=$backup_device_name" >> /var/www/$hubzilladaily +echo "backup_device_pass=$backup_device_pass" >> /var/www/$hubzilladaily +echo "backup_mount_point=$backup_mount_point" >> /var/www/$hubzilladaily +echo "device_mounted=0" >> /var/www/$hubzilladaily +echo "if [ -n \"$backup_device_name\" ]" >> /var/www/$hubzilladaily +echo "then" >> /var/www/$hubzilladaily +echo " if blkid | grep $backup_device_name" >> /var/www/$hubzilladaily +echo " then" >> /var/www/$hubzilladaily + if [ -n "$backup_device_pass" ] + then +echo " echo \"decrypting backup device...\"" >> /var/www/$hubzilladaily +echo " echo "\"$backup_device_pass\"" | cryptsetup luksOpen $backup_device_name cryptobackup" >> /var/www/$hubzilladaily + fi +echo " if [ ! -d $backup_mount_point ]" >> /var/www/$hubzilladaily +echo " then" >> /var/www/$hubzilladaily +echo " mkdir $backup_mount_point" >> /var/www/$hubzilladaily +echo " fi" >> /var/www/$hubzilladaily +echo " echo \"mounting backup device...\"" >> /var/www/$hubzilladaily + if [ -n "$backup_device_pass" ] + then +echo " if mount /dev/mapper/cryptobackup $backup_mount_point" >> /var/www/$hubzilladaily + else +echo " if mount $backup_device_name $backup_mount_point" >> /var/www/$hubzilladaily + fi +echo " then" >> /var/www/$hubzilladaily +echo " device_mounted=1" >> /var/www/$hubzilladaily +echo " echo \"device $backup_device_name is now mounted. Starting backup...\"" >> /var/www/$hubzilladaily +echo " rsnapshot -c $snapshotconfig_external_device daily" >> /var/www/$hubzilladaily +echo " rsnapshot -c $snapshotconfig_external_device weekly" >> /var/www/$hubzilladaily +echo " rsnapshot -c $snapshotconfig_external_device monthly" >> /var/www/$hubzilladaily +echo " echo \"\$(date) - disk sizes...\"" >> /var/www/$hubzilladaily +echo " df -h" >> /var/www/$hubzilladaily +echo " echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily +echo " du -h $backup_mount_point | grep mysql/hubzilla" >> /var/www/$hubzilladaily +echo " echo \"unmounting backup device...\"" >> /var/www/$hubzilladaily +echo " umount $backup_mount_point" >> /var/www/$hubzilladaily +echo " else" >> /var/www/$hubzilladaily +echo " echo \"failed to mount device $backup_device_name\"" >> /var/www/$hubzilladaily +echo " fi" >> /var/www/$hubzilladaily + if [ -n "$backup_device_pass" ] + then +echo " echo \"closing decrypted backup device...\"" >> /var/www/$hubzilladaily +echo " cryptsetup luksClose cryptobackup" >> /var/www/$hubzilladaily + fi +echo " fi" >> /var/www/$hubzilladaily +echo "fi" >> /var/www/$hubzilladaily +echo "if [ \$device_mounted == 0 ]" >> /var/www/$hubzilladaily +echo "then" >> /var/www/$hubzilladaily +echo " echo \"device could not be mounted $backup_device_name. Using internal disk for backup...\"" >> /var/www/$hubzilladaily +echo " rsnapshot -c $snapshotconfig daily" >> /var/www/$hubzilladaily +echo " rsnapshot -c $snapshotconfig weekly" >> /var/www/$hubzilladaily +echo " rsnapshot -c $snapshotconfig monthly" >> /var/www/$hubzilladaily +echo "fi" >> /var/www/$hubzilladaily +echo "#" >> /var/www/$hubzilladaily +echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily +echo "du -h /var/cache/rsnapshot/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily +echo "#" >> /var/www/$hubzilladaily +echo "# update" >> /var/www/$hubzilladaily +echo "echo \"\$(date) - updating letsencrypt.sh...\"" >> /var/www/$hubzilladaily +echo "git -C /var/www/letsencrypt/ pull" >> /var/www/$hubzilladaily +echo "echo \"\$(date) - updating hubhilla core...\"" >> /var/www/$hubzilladaily +echo "git -C /var/www/html/ pull" >> /var/www/$hubzilladaily +echo "echo \"\$(date) - updating hubhilla addons...\"" >> /var/www/$hubzilladaily +echo "git -C /var/www/html/addon/ pull" >> /var/www/$hubzilladaily +echo "bash /var/www/html/$plugins_update" >> /var/www/$hubzilladaily +echo "chown -R www-data:www-data /var/www/html/ # make all accessable for the webserver" >> /var/www/$hubzilladaily +echo "chown root:www-data /var/www/html/.htaccess" >> /var/www/$hubzilladaily +echo "chmod 0644 /var/www/html/.htaccess # www-data can read but not write it" >> /var/www/$hubzilladaily +echo "echo \"\$(date) - updating linux...\"" >> /var/www/$hubzilladaily +echo "apt-get -q -y update && apt-get -q -y dist-upgrade # update linux and upgrade" >> /var/www/$hubzilladaily +echo "echo \"\$(date) - Backup hubzilla and update linux finished. Rebooting...\"" >> /var/www/$hubzilladaily +echo "#" >> /var/www/$hubzilladaily +echo "reboot" >> /var/www/$hubzilladaily + + if [ -z "`grep 'hubzilla-daily.sh' /etc/crontab`" ] + then + echo "30 05 * * * root /bin/bash /var/www/$hubzilladaily >> /var/www/html/hubzilla-daily.log 2>&1" >> /etc/crontab + echo "0 0 1 * * root rm /var/www/html/hubzilla-daily.log" >> /etc/crontab + fi + + # This is active after either "reboot" or "/etc/init.d/cron reload" + print_info "configured cron for updates/upgrades" +} + +function write_uninstall_script { + print_info "writing uninstall script..." + + cat > /var/www/hubzilla-remove.sh <