Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mrDoctorWho/vk4xmpp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: r243
Choose a base ref
...
head repository: mrDoctorWho/vk4xmpp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jan 28, 2015

  1. Bunch of fixes:

    * make old users leave from a chat (when they're not in the chat anymore) (fixed #75)
    * fixed receiving xhtml images (fixed #78)
    * transport will show up before user's initialized (fixed #77)
    * transport freeze fix (fixed #76)
    something more...
    mrDoctorWho committed Jan 28, 2015
    Copy the full SHA
    b708870 View commit details

Commits on Feb 3, 2015

  1. Update README.md

    mrDoctorWho committed Feb 3, 2015
    Copy the full SHA
    db97ecf View commit details

Commits on Feb 12, 2015

  1. Fixed transport restart when was started with few agruments instead o…

    …f none
    
    Fixed groupchats users: users weren't showing up unless the "Show all users in
    groupchats" was set
    Fixed groucpats initialization: now transport shouldn't run damn lot of threads when chat
    wasn't created well
    mrDoctorWho committed Feb 12, 2015
    Copy the full SHA
    b537c3c View commit details

Commits on Feb 13, 2015

  1. Fixed #79: now chats should be handled correctly

    Fixed flooding in the main log by "updateFriends" message when user have to pass captcha
    challenge
    mrDoctorWho committed Feb 13, 2015
    Copy the full SHA
    f692388 View commit details
  2. Copy the full SHA
    e62103a View commit details
  3. Fixed possible KeyError in groupchats.py

    Fixed possible NameError in groupchats.py if ConferenceServer isn't set
    Added option "i s/am groot/ghost/" to let user use transport like a ghost
    Added count of user's friend in the main log
    mrDoctorWho committed Feb 13, 2015
    Copy the full SHA
    4572e27 View commit details

Commits on Feb 14, 2015

  1. Test fix

    Atterratio Aeternus committed Feb 14, 2015
    Copy the full SHA
    e842bc7 View commit details
  2. Merge pull request #80 from Atterratio/fix_none_status

    Fix None status if xmpp status empty
    mrDoctorWho committed Feb 14, 2015
    Copy the full SHA
    7eeb390 View commit details

Commits on Feb 15, 2015

  1. Fix possible incorrect access detection in status-to-vk plugin

    Little docstring addition in plugins and core
    Closing #81
    mrDoctorWho committed Feb 15, 2015
    1
    Copy the full SHA
    0379523 View commit details

Commits on Feb 16, 2015

  1. Little code cleanup

    Fix AttributeError in groupchats
    mrDoctorWho committed Feb 16, 2015
    Copy the full SHA
    eb4644e View commit details

Commits on Feb 17, 2015

  1. Copy the full SHA
    5f10f36 View commit details

Commits on Feb 18, 2015

  1. Updated config. Now there is no "evalJID" variable. Now it's ADMIN_JI…

    …DS[]
    
    Fixed formatting error somewhere in groupchats.py
    Little core refactoring. Still trying to figure out why the hell the transport freezes
    sometimes.
    Updated locale, a little
    Fixed #82 ("VK" object has no attr[..]; not tested, but should work fine)
    Fixed #83. Transport was completely untied from simpleapps.ru. Feel free to make your own
    registration url
    Fixed #84. Password registration should work fine now
    mrDoctorWho committed Feb 18, 2015
    Copy the full SHA
    922019d View commit details

Commits on Feb 21, 2015

  1. Fixed registration form strings

    Completed "Check an API token" option in adhoc
    Little refactoring in mod_iq_disco
    Added translation feature to adhoc items, but those are still in english. Translators are
    welcome!
    mrDoctorWho committed Feb 21, 2015
    Copy the full SHA
    a1704ab View commit details

Commits on Feb 23, 2015

  1. Fixed Russian localization

    Manazius committed Feb 23, 2015
    Copy the full SHA
    937873f View commit details
  2. Merge pull request #86 from Manazius/master

    Fixed Russian localization
    mrDoctorWho committed Feb 23, 2015
    Copy the full SHA
    acb99b2 View commit details

Commits on Mar 2, 2015

  1. Fixed typo in "keep_online" setting

    Fixed user settings loading
    Fixed turning off groupchats handling
    mrDoctorWho committed Mar 2, 2015
    Copy the full SHA
    a80ae54 View commit details

Commits on Mar 13, 2015

  1. Change simpleapps.ru to jabberon.ru

    Fixed TypeError in groupchats.py in users list update
    Fixed retrying of groupchats creation in groupcahts.py (now it shouldn't start dozens of threads)
    Same as in groupchats as described in the line above fixed the same error in statustovk.py extension
    Fixed fake user deletion after captcha challenge was completed by a user
    Fixed transport freeze while working in longpoll
    Fixed transport freeze while sending a message or handling any method in the main thread
    Added feature to unload any module
    Vcard requests will be highly limited for the transport stability and such
    Most of the handlers were switched to threaded mode
    mrDoctorWho committed Mar 13, 2015
    Copy the full SHA
    5e9e194 View commit details

Commits on Mar 16, 2015

  1. Update README.md

    Update manuals links
    alexeycv committed Mar 16, 2015
    Copy the full SHA
    4e068d4 View commit details
  2. Merge pull request #87 from alexeycv/patch-1

    Update links in README.md
    mrDoctorWho committed Mar 16, 2015
    Copy the full SHA
    7c8e3bc View commit details

Commits on Mar 18, 2015

  1. Update README.md

    mrDoctorWho committed Mar 18, 2015
    Copy the full SHA
    7991519 View commit details
  2. Update README.md

    Add XEP-0045 to the support xeps
    mrDoctorWho committed Mar 18, 2015
    Copy the full SHA
    fc54c21 View commit details

Commits on Mar 20, 2015

  1. Added a possibility to change vk4xmpp-monitor address

    Added new events: 08 and 09 (see plugin .example.py for more information)
    Replaced code “with Database(...” by runDatabaseQuery()
    Added last_used timestamp for groupchats
    Added inactive groupchats exterminator
    Groupchats are now kept in the database, so nothing will be missed or messed
    As groupchats are now in the database, the function that was calling for Daleks to exterminate a chat was completely rewritten, so now Daleks don't have to exterminate any VK administrator to find out the groupchat owner
    TransportFeatures and UserFeatures was cleared in the kernel and now they must be filled by modules and extensions
    Added "force_vk_date" to user's settings to force VK timestamp for messages
    A brand new Module Loader that allows you easy to load, unload and reload any module
    A bit of optimizations for html unescape
    As there are new events: 08 and 09, the Watcher now is a plugin
    Kilobytes replaced by Megabytes in stats
    Fixed exec command, now it execs the code in the main globals()
    mrDoctorWho committed Mar 20, 2015
    Copy the full SHA
    16fc44d View commit details
  2. More settings: “force vk timestamp for groupchats”, “tie nickname to …

    …groupchat”
    
    New option in transport settings: Transport now can automatically call a Dalek to exterminate user when they leave a chat
    New plugin: interpreter; replaces mod_msg_main features: eval and exec. Now you can disable such commands for better security
    mrDoctorWho committed Mar 20, 2015
    Copy the full SHA
    6203d2f View commit details

Commits on Mar 21, 2015

  1. New extension: user_activity to gather statistics for user's activity

    Little code cleanup in mod_iq_disco
    mrDoctorWho committed Mar 21, 2015
    Copy the full SHA
    0190703 View commit details
  2. Updated description for "tie_chat_to_nickname" user config field

    Fixed a typo in mod_iq_vcard
    New admin feature: now you can easy (re)/(un)load any transport's module and reload extensions
    Little code cleanup in mod_iq_disco and added a warning about it's code
    mrDoctorWho committed Mar 21, 2015
    Copy the full SHA
    92ab5fc View commit details
  3. Copy the full SHA
    e91d4b8 View commit details
  4. Copy the full SHA
    b7a74a5 View commit details
  5. Fix locales

    Manazius committed Mar 21, 2015
    Copy the full SHA
    d7cd110 View commit details
  6. Merge pull request #89 from Manazius/master

    Update locales
    mrDoctorWho committed Mar 21, 2015
    Copy the full SHA
    e7b8c4c View commit details

Commits on Mar 22, 2015

  1. Fixed ValueError if wrong JSON was coming in decoder

    Fixed possible KeyError in Poll if user disappeared while we were initializing Poll
    mrDoctorWho committed Mar 22, 2015
    Copy the full SHA
    16e2f2b View commit details

Commits on Mar 23, 2015

  1. Copy the full SHA
    3eddda3 View commit details

Commits on Mar 25, 2015

  1. Fixed order in groupchat and personal messages

    Fixed user deletion in user_activity
    Fixed a typo in groupchats.py
    mrDoctorWho committed Mar 25, 2015
    Copy the full SHA
    911b643 View commit details

Commits on Apr 3, 2015

  1. I really hope it will be the latest commit.

    Ok. Here we are:
    Add "nick" column to groupchats table to save chat's owner nickname. This will prevent losing messages if chat wasn't initialized
    Split module "writer" into 2: writer and printer. First is for crash logs, second is for printing messages to stdout
    Fixed chats extermination
    Fixed initialization order: logger now should be initialized at the right time
    Fixed stats: no crash should occur on wrong ps output
    mrDoctorWho committed Apr 3, 2015
    Copy the full SHA
    1fcaae7 View commit details
  2. Fixed sending messages if timestamp not forced

    Fixed ignoring messages from stragers
    mrDoctorWho committed Apr 3, 2015
    Copy the full SHA
    e47753c View commit details

Commits on Apr 7, 2015

  1. Use NICK for screen_name and FN for the full name in vcard

    Fix possible exception in groupchats, if user changed their nick
    Add setting to send nicknames (screen_name) instead of full name in
    stanzas
    mrDoctorWho committed Apr 7, 2015
    Copy the full SHA
    8403a2e View commit details

Commits on Apr 15, 2015

  1. Add alive_keeper extension

    Replace URL_VCARD_NO_IMAGE in the config by a new URL
    mrDoctorWho committed Apr 15, 2015
    Copy the full SHA
    57e4db6 View commit details

Commits on Apr 21, 2015

  1. Okay, I'm doing this again.

    The most hard thing was rewriting the core and modules to follow PEP8
    guidelines. Still not complete. And will not be completed.
    Changed config defaults (especially port and pidFile fields)
    New config option: RUN_AS to run the transport as a specified user (root
    access required, I think). Plugin variables removed as well.
    Parts of the code in core was split into the modules: defaults (for
    default variables), settings (for user/transport settings), longpoll
    (for longpoll, obviously), utils (for cross-module used functions)
    Removed unneeded API-call in avatar_hash plugin. Now we hash all user's
    friends avatars
    Removed plugin-specific variables from the core.
    Fixed watcher messages
    The code of vkapi module (APIBinding class) was split into a
    PasswordLogin and APIBinding classes.
    New error handling by vkapi: if it receives “too fast” error, it
    increases waiting timeout for 0.05 sec until it'll be fine
    Brand new API for modules
    In conclusion, I can say that the transport has gone through a huge code
    cleanup process. I cleaned up especially the core, library and modules.
    Well, you can see the diff anyways.
    Meet a brand new VK4XMPP v3.0
    And I really hope it will be the last commit. Really, it's enough, I'm
    done.
    mrDoctorWho committed Apr 21, 2015
    Copy the full SHA
    06e919c View commit details
  2. Update README.md

    Add CodeClimate badge
    mrDoctorWho committed Apr 21, 2015
    Copy the full SHA
    34ecc32 View commit details

Commits on Apr 23, 2015

  1. Add partial RosterX support (add only, for now)

    Add groups support for roster contacts (via RosterX feature)
    Code cleanup & fixes in groupchats extension
    Custom registration forms (not done yet, check out library/forms.py)
    Little refactoring in modulemanager library
    WARNING: This commit may contain breaking changes. It may break
    especially groupchats, module management, settings management,
    registration process. DO NOT UPDATE to this release unless you're a pro.
    mrDoctorWho committed Apr 23, 2015
    Copy the full SHA
    a03e783 View commit details

Commits on Apr 24, 2015

  1. Oh, I forgot to add these

    mrDoctorWho committed Apr 24, 2015
    Copy the full SHA
    0515686 View commit details

Commits on Apr 25, 2015

  1. Brand new refactored function connect() in the User class and auth() in

    VK class
    New logic in mod_iq_register
    Overall code quality changes.
    mrDoctorWho committed Apr 25, 2015
    Copy the full SHA
    8191314 View commit details
  2. Copy the full SHA
    d33f4b4 View commit details
  3. Update README.md

    mrDoctorWho committed Apr 25, 2015
    Copy the full SHA
    ba4fe75 View commit details

Commits on Apr 26, 2015

  1. Fix crash when user has asked for subscription

    Add subscription request after transport have added users to user's roster by RosterX
    Overall code cleanup
    mrDoctorWho committed Apr 26, 2015
    Copy the full SHA
    59d46b7 View commit details

Commits on Apr 28, 2015

  1. Fix wrong admin jids detection

    Fix longpoll: now user won't fall out the Poll
    Fix several captcha exceptions
    Split get&set in mod_iq_register to a different functions
    Fix several wrong argument exceptions in mod_prs_main
    No code climate changes were applied.
    mrDoctorWho committed Apr 28, 2015
    Copy the full SHA
    3dd7438 View commit details

Commits on Apr 29, 2015

  1. Copy the full SHA
    1b433cc View commit details

Commits on Apr 30, 2015

  1. Meet NT compatibility

    Update documentation
    mrDoctorWho committed Apr 30, 2015
    Copy the full SHA
    db435ae View commit details

Commits on May 1, 2015

  1. Copy the full SHA
    83841d3 View commit details
  2. Copy the full SHA
    da833dd View commit details
  3. Merge pull request #91 from mikken/extensions_filelist_fix

    Fix bug: README files in extensions/ were treated as python modules
    mrDoctorWho committed May 1, 2015
    Copy the full SHA
    68e06cd View commit details
Showing with 5,025 additions and 2,217 deletions.
  1. +6 −1 .gitignore
  2. +66 −43 Config_example.txt
  3. +0 −8 DEBIAN/control
  4. +9 −0 DEBIAN/control.template
  5. +2 −5 DEBIAN/{postinst → postinst.initd}
  6. +12 −0 DEBIAN/postinst.systemd
  7. +3 −3 DEBIAN/prerm
  8. +39 −23 Makefile
  9. +145 −61 README.md
  10. +5 −0 extensions.README.md
  11. +43 −9 extensions/.example.py
  12. +10 −0 extensions/alive_keeper.README.md
  13. +41 −0 extensions/alive_keeper.py
  14. +135 −37 extensions/attachments.py
  15. +12 −0 extensions/avatar_hash.README.md
  16. +109 −35 extensions/avatar_hash.py
  17. +43 −21 extensions/captcha_forms.py
  18. +53 −14 extensions/forwarded_messages.py
  19. +3 −1 extensions/geo.py
  20. +29 −0 extensions/groupchats.README.md
  21. +474 −223 extensions/groupchats.py
  22. +34 −0 extensions/interpreter.py
  23. +45 −0 extensions/message_reader.py
  24. +28 −0 extensions/monitor.py
  25. +26 −0 extensions/reply.py
  26. +0 −1 extensions/stats_tracker.py
  27. +0 −23 extensions/status-from-vk.py
  28. +0 −23 extensions/status-to-vk.py
  29. +55 −0 extensions/status.py
  30. +20 −0 extensions/sticker.README.md
  31. +67 −0 extensions/sticker.py
  32. +0 −24 extensions/typing_reader.py
  33. +22 −0 extensions/user_activity.README.md
  34. +70 −0 extensions/user_activity.py
  35. +44 −0 extensions/user_nickname.py
  36. +23 −0 extensions/watcher.py
  37. +851 −918 gateway.py
  38. +1 −1 init.d/vk4xmpp
  39. +16 −0 js/3.0/getChats.js
  40. +6 −0 js/3.0/getLastTime.js
  41. +20 −0 js/3.0/getPhotos.js
  42. +6 −0 js/3.0/getUserID.js
  43. +17 −0 js/5.42/getPhotos_new.js
  44. +2 −0 js/5.42/getUserID_new.js
  45. +2 −0 js/README.md
  46. +3 −0 js/getChats.js
  47. +4 −1 js/getLastTime.js
  48. +16 −0 js/getMessagesBulk.js
  49. +3 −0 js/getPhotos.js
  50. +5 −1 js/getUserID.js
  51. +26 −14 js/vk4xmpp.html
  52. +59 −0 library/defaults.py
  53. +34 −0 library/forms.py
  54. +2 −0 library/itypes.py
  55. +368 −0 library/longpoll.py
  56. +128 −0 library/modulemanager.py
  57. +74 −0 library/printer.py
  58. +72 −0 library/rostermanager.py
  59. +83 −0 library/settings.py
  60. +16 −10 library/stext.py
  61. +121 −10 library/utils.py
  62. +267 −171 library/vkapi.py
  63. +12 −10 library/webtools.py
  64. +26 −32 library/writer.py
  65. +4 −3 library/xmpp/dispatcher.py
  66. +14 −9 library/xmpp/protocol.py
  67. +2 −0 library/xmpp/roster.py
  68. +5 −3 library/xmpp/simplexml.py
  69. +37 −15 library/xmpp/transports.py
  70. +49 −9 locales/locale.ru
  71. +65 −0 modules/mod_groupchat_msg.py
  72. +121 −0 modules/mod_groupchat_prs.py
  73. +22 −9 modules/mod_iq_captcha.py
  74. +335 −135 modules/mod_iq_disco.py
  75. +5 −4 modules/mod_iq_gateway.py
  76. +12 −7 modules/mod_iq_last.py
  77. +15 −8 modules/mod_iq_main.py
  78. +87 −101 modules/mod_iq_register.py
  79. +20 −9 modules/mod_iq_stats.py
  80. +131 −43 modules/mod_iq_vcard.py
  81. +6 −5 modules/mod_iq_version.py
  82. +65 −52 modules/mod_msg_main.py
  83. +17 −10 modules/mod_msg_xhtml.py
  84. +61 −56 modules/mod_prs_main.py
  85. +24 −14 modules/mod_xhtml.py
  86. +2 −2 systemd/vk4xmpp.service
  87. +13 −0 systemd/vk4xmpp.service.debian
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -5,11 +5,16 @@ pidFile.txt
# exclude custom users.db names
*users.db
vk4xmpp.log
vk4xmpp.db
vk4xmpp.sqlite
vk4xmpp.pid
# exclude log file created after init.d/vk4xmpp start
gateway.log
gateway_v5.0.py
# exclude PyDev/Aptana project files
.*project
# exclude PyCharm project files
.idea/
# exclude ~ bak files
*~
/.settings
/.settings
109 changes: 66 additions & 43 deletions Config_example.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# coding: utf-8

# Connection hostname.
# For Prosody: "vk.example.com".
# Connection host.
# For Prosody/Ejabberd: "vk.example.com".
# For Openfire (for new versions): just subdomain ("vk" for vk.example.com).
Host = "localhost"

# Connection server (usually equals hostname).
# For Prosody: "localhost".
# If your transport runs on the same server as the jabber-server
# then it's just "localhost".
Server = "localhost"

# Connection port (as set in Jabber server config).
# Default value for Prosody is 5347.
Port = 5556
Port = 5347

# Transport ID (for all instances of vk4xmpp).
# Transport ID (the ID which the transport will send stanzas from).
TransportID = "vk.example.com"

# Connection password.
Password = "secret"

# Language (ru/en/pl).
DefLang = "ru"

# Photo size (photo_50, photo_100, photo_200_orig).
PhotoSize = "photo_100"
DefLang = "en"

# White list. Put servers here that should be allowed access to the
# transport, e.g., ['yourserver1.tld','yourserver2.tld'].
@@ -34,68 +33,92 @@ WhiteList = []
# Leave it blank to disable notifications.
WatcherList = []

# List of admin jids (JID for "!eval" command and admin-features in adhoc).
# Example: ["mrdoctorwho@example.com", "lindsey@somehost.com"]
ADMIN_JIDS = []

# Additional description. It will be shown after "about" text in transport's vCard.
AdditionalAbout = ""

# Conference server. Leave it blank to disable group chats. Depends on Jabber
# server's MUC. E.g., conference.example.com.
ConferenceServer = ""

# Publish this intstance information in public transport list at
# Photo size (photo_50, photo_100, photo_200_orig).
# Affects transport stability & performance
PhotoSize = "photo_100"

# Publish this intstance information in the public transport list at
# http://xmppserv.ru.ru/xmpp-monitor.
allowBePublic = True

# User limit. How many users can be registered on your server?
# Set to 0 for "unlimited".
# Set to 0 for unlimited.
USER_LIMIT = 0

#! Danger zone.
#! Change settings below ONLY IF YOU KNOW WHAT ARE YOU DOING! DEFAULT VALUES ARE RECOMMENDED!
## Thread stack size (WARNING: THIS MAY CAUSE TRANSPORT CRASH WITH SEGMENTATION FAULT ERROR).
## You may need to tune it to optimize memory consuming.
## Minimum value is 32768 bytes (32kb).
THREAD_STACK_SIZE = 0
# URL which will be used in registration form. See the example in js/vk4xmpp.html or in http://simpleapps.ru/vk4xmpp.html (if the site is still alive in your time)
# URL MUST have "%d" somewhere, it's used for access definition. Since 01.08.2014 any plugin can modify the access, so it will be defined in the url.
URL_ACCEPT_APP = "http://opiums.eu/vk4xmpp.html#%d"

## Maximum forwarded messages depth.
MAXIMUM_FORWARD_DEPTH = 20
# Image that will be used if the transport can't recieve image from VK.
URL_VCARD_NO_IMAGE = "https://raw.githubusercontent.com/mrDoctorWho/vk4xmpp/master/vk4xmpp.png"

## Image that will be used if the transport can't recieve image from VK.
URL_VCARD_NO_IMAGE = "http://simpleapps.ru/vk4xmpp.png"
# Allow registration.
# Set to false if you want to forbid registration of new users.
# Old users will be able to update their registration.
ALLOW_REGISTRATION = True

## Eval JID (JID for "!eval" command and admin-features in adhoc).
evalJID = ""
# Friends limit per user.
MAX_FRIENDS = 5000

## Debug xmpppy library.
DEBUG_XMPPPY = False
#! Danger zone.
#! Change the settings below ONLY IF YOU KNOW WHAT ARE YOU DOING! DEFAULT VALUES ARE RECOMMENDED!
# You were warned.
# Thread stack size (WARNING: THIS MAY CAUSE TRANSPORT CRASH WITH SEGMENTATION FAULT ERROR).
# You may need to tune it to optimize memory consuming.
# Minimum value is 32768 bytes (32kb).
THREAD_STACK_SIZE = 0

## Database file (anything you like).
DatabaseFile = "users.db"
# Database file (anything you like).
DatabaseFile = "vk4xmpp.sqlite"

## File to store PID in.
pidFile = "pidFile.txt"
# File to store PID in.
pidFile = "vk4xmpp.pid"

## Log file.
# Log file.
logFile = "vk4xmpp.log"

## Directory for crash logs storage.
# Directory where transport will write crash logs.
crashDir = "crash"

## Log level (logging.INFO, logging.DEBUG, logging.ERROR, logging.CRITICAL).
LOG_LEVEL = logging.DEBUG

## Directory for users settings.
# Directory for users settings.
settingsDir = "settings"

## Stanza send interval (in seconds).
# Stanza send interval (in seconds).
STANZA_SEND_INTERVAL = 0.03125

## Enable photo hashes? This setting is probably can cause weird errors such as captcha, random disconnects (IOError: Disconnected) and others.
## But users like to see avatars in their roster. If it will cause disconnects, but you still want to use it, then just increase the STANZA_SEND_INTERVAL value
## But be careful, this value is global so transport will became slower.
ENABLE_PHOTO_HASHES = False
# Debug xmpppy library.
DEBUG_XMPPPY = False

## Debug longpoll queries.
# Debug longpoll queries.
DEBUG_POLL = False

## Debug api requests. It should contain a list of methods which you would like to debug.
DEBUG_API = []
# Debug api requests.
# Put the list of the methods you like to debug. Set to "all" if you want to debug all the methods.
DEBUG_API = []

# Log level (logging.INFO, logging.DEBUG, logging.ERROR, logging.CRITICAL).
LOG_LEVEL = logging.ERROR

# VK4XMPP Monitor settings
# The server where the stats requests will come from
VK4XMPP_MONITOR_SERVER = "opiums.eu"

# The URL where transport should send POST requests with it's name
# See https://github.com/aawray/xmpp-monitor for more information
VK4XMPP_MONITOR_URL = "http://torrent.opiums.eu/hosts_xmpp.php"

# THE FOLLOWING OPTIONS ARE FOR POSIX-LIKE SYSTEMS ONLY
# Run as a specified user. Set to "username" to run as "username" instead of current user.
# Bear in mind that transport must have permission to run as this user.
RUN_AS = None
8 changes: 0 additions & 8 deletions DEBIAN/control

This file was deleted.

9 changes: 9 additions & 0 deletions DEBIAN/control.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: vk4xmpp
Version: VERSION
Section: network, chat
Priority: optional
Architecture: all
Depends: python2.7
Maintainer: mrDoctorWho <support@simpleapps.ru>
Description: XMPP vk.com transport service
Homepage: https://github.com/mrDoctorWho/vk4xmpp/
7 changes: 2 additions & 5 deletions DEBIAN/postinst → DEBIAN/postinst.initd
Original file line number Diff line number Diff line change
@@ -3,14 +3,11 @@
set -e

if [ "$1" = configure ]; then
#update-rc.d vk4xmpp start 99 0 1 6 . stop 01 0 1 6 .

if ! getent passwd vk4xmpp >/dev/null; then
adduser --disabled-password --quiet --system \
--home "/usr/share/vk4xmpp" --no-create-home \
--gecos "Vkontakte XMPP Transport" --group vk4xmpp
fi

update-rc.d vk4xmpp defaults

fi
update-rc.d vk4xmpp defaults
fi
12 changes: 12 additions & 0 deletions DEBIAN/postinst.systemd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -e

if [ "$1" = configure ]; then

if ! getent passwd vk4xmpp >/dev/null; then
adduser --disabled-password --quiet --system \
--home "/usr/share/vk4xmpp" --no-create-home \
--gecos "Vkontakte XMPP Transport" --group vk4xmpp
fi
fi
6 changes: 3 additions & 3 deletions DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@

case "$1" in
remove|purge)
# Remove all .pyc files from installation directories
DIR="/usr/share/vk4xmpp/"
rm -f `find "$DIR" -name *.py`
# Remove all compiled python files from installation directories
DIR="/usr/lib/vk4xmpp/"
find "$DIR" -type f -name "*.py[cod]" -delete
;;
esac
62 changes: 39 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
#
# Makefile
#
# this makefile is currently only used to make snapshots


VERSION=2.`git log --pretty=format:''|wc -l`
PACKAGE_VERSION=2
GLOBAL_VERSION=3.0
PACKAGE_VERSION:=$(shell git describe --tags)
VERSION=$(GLOBAL_VERSION)+$(PACKAGE_VERSION)
PROG=dpkg-deb
SOURCE=/tmp/vk4xmpp_build
SOURCE:=$(shell mktemp -d)
FLAGS=--build
DEBTARGET=vk4xmpp_$(VERSION)-$(PACKAGE_VERSION)_all.deb
DEBTARGET=vk4xmpp_$(VERSION)_all.deb
TARGET=vk4xmpp-$(VERSION)

default:
@echo "options are 'snapshot', 'clean'"
DOCS=LICENSE README.md extensions.README.md

.PHONY: help hierarchy

help:
@echo "VK4XMPP build script"
@echo "===================="
@echo "help - display this help and exit"
@echo "init-package - build package with SysV flavour"
@echo "systemd-package - build package with SystemD flavour"

hierarchy:
mkdir -p $(SOURCE)/usr/share/doc/vk4xmpp
mkdir -p $(SOURCE)/usr/bin
mkdir -p $(SOURCE)/var/lib/vk4xmpp
mkdir -p $(SOURCE)/etc/vk4xmpp/conf.d
mkdir -p $(SOURCE)/var/log/vk4xmpp
mkdir -p $(SOURCE)/usr/lib/vk4xmpp
mkdir -p $(SOURCE)/run/vk4xmpp
mkdir -p $(SOURCE)/DEBIAN
cp DEBIAN/pre* $(SOURCE)/DEBIAN
sed s/VERSION/$(VERSION)/ < DEBIAN/control.template > $(SOURCE)/DEBIAN/control
cp gateway.py $(SOURCE)/usr/bin/vk4xmpp
cp $(DOCS) $(SOURCE)/usr/share/doc/vk4xmpp
cp Config_example.txt $(SOURCE)/etc/vk4xmpp/config.example
cp -R library modules js extensions locales $(SOURCE)/usr/lib/vk4xmpp
find $(SOURCE) -type f -name "*.py" -print0 | xargs -0 python -m compileall

debian_package:
rm -rf $(SOURCE)
mkdir -p $(SOURCE)
mkdir -p $(SOURCE)/usr/share/vk4xmpp
cp -r . $(SOURCE)/usr/share/vk4xmpp
rm -rf $(SOURCE)/usr/share/vk4xmpp/.git
mkdir -p $(SOURCE)/etc
mv $(SOURCE)/usr/share/vk4xmpp/DEBIAN $(SOURCE)
mv $(SOURCE)/usr/share/vk4xmpp/init.d $(SOURCE)/etc/init.d
init-package: hierarchy
cp DEBIAN/postinst.initd $(SOURCE)/DEBIAN/postinst
cp -R init.d $(SOURCE)/etc/init.d
fakeroot $(PROG) $(FLAGS) $(SOURCE) $(DEBTARGET)

clean:
rm -Rf $(SOURCE)
systemd-package: hierarchy
cp $(SOURCE)/DEBIAN/postinst.systemd $(SOURCE)/DEBIAN/postinst
mkdir -p $(SOURCE)/etc/systemd/system
cp -R systemd/vk4xmpp.service.debian $(SOURCE)/etc/systemd/system/vk4xmpp.service
fakeroot $(PROG) $(FLAGS) $(SOURCE) $(DEBTARGET)
Loading