From 287b3a82a9ced25b8bc80e0223d6e429d622e136 Mon Sep 17 00:00:00 2001 From: Adarnof Date: Tue, 23 Feb 2016 02:45:48 +0000 Subject: [PATCH 1/8] Move default logfile location to log folder chmod 777 log folder so apache can write Addresses #282 --- alliance_auth/settings.py.example | 2 +- log/.gitignore | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 log/.gitignore diff --git a/alliance_auth/settings.py.example b/alliance_auth/settings.py.example index 08fd6cdd..e068b5a1 100755 --- a/alliance_auth/settings.py.example +++ b/alliance_auth/settings.py.example @@ -403,7 +403,7 @@ LOGGING = { 'log_file': { 'level': 'INFO', # edit this line to change logging level to file 'class': 'logging.handlers.RotatingFileHandler', - 'filename': os.path.join(BASE_DIR,'allianceauth.log'), + 'filename': os.path.join(BASE_DIR,'log/allianceauth.log'), 'formatter': 'verbose', 'maxBytes': 1024*1024*5, # edit this line to change max log file size 'backupCount': 5, # edit this line to change number of log backups diff --git a/log/.gitignore b/log/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/log/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore From a5ef9914b82b36a9ac51ec38848b001e48a11dc4 Mon Sep 17 00:00:00 2001 From: Adarnof Date: Wed, 2 Mar 2016 22:39:16 -0500 Subject: [PATCH 2/8] Remove check for corputils permission This permission was removed. Permissions are now enforced in the view. --- stock/templates/registered/corputils.html | 8 -------- 1 file changed, 8 deletions(-) diff --git a/stock/templates/registered/corputils.html b/stock/templates/registered/corputils.html index 603a470b..5836c0aa 100644 --- a/stock/templates/registered/corputils.html +++ b/stock/templates/registered/corputils.html @@ -9,7 +9,6 @@

Corporation Member Data

- {% if perms.auth.corputils %}
{% if corp %}
@@ -188,12 +187,5 @@
{% endif %}
- {% else %} - {% if IS_CORP %} - - {% else %} - - {% endif %} - {% endif %}
{% endblock content %} From 459790982d3b5d8161e3d623595b11a05fd714ef Mon Sep 17 00:00:00 2001 From: Adarnof Date: Thu, 3 Mar 2016 19:18:03 -0500 Subject: [PATCH 3/8] Removed references to depreciated permissions `corp_stats` and `corputils` were replaced with `corp_apis` and `alliance_apis` --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 02d9c2e2..6140d712 100755 --- a/README.md +++ b/README.md @@ -18,10 +18,7 @@ Join us in-game in the channel allianceauth for help and feature requests. Special Thanks: - Thanking Nikdoof, without his old auth - implementation this project wouldn't be as far as it is now. - - Thanks to Raynaldo for his original work on this system and getting it as far as it is today. + Thanking Nikdoof, without his old auth implementation this project wouldn't be as far as it is now. Note: @@ -67,10 +64,8 @@ Special Permissions In Admin: auth | user | jabber_broadcast ( Access to broadcast a message over jabber to own groups) auth | user | jabber_broadcast_all ( Can choose from all groups and the 'all' option when broadcasting) auth | user | blue_member ( Auto Added to people who register has a blue when adding api key) - auth | user | corp_stats ( View basic corp auth stats *who is authed etc*) - auth | user | corputils ( View who has registered APIs, which alts belong to which main, and more. ) - auth | user | corp_apis ( View APIs, andjackKnife, of all member in current corp. ) - auth | user | alliance_apis ( View APIs, andjackKnife, of all member in whole alliance. ) + auth | user | corp_apis ( View APIs, and jackKnife, of all members in user's corp. ) + auth | user | alliance_apis ( View APIs, and jackKnife, of all member in user's alliance member corps. ) auth | user | timer_management ( Access to create and remove timers) auth | user | timer_view ( Access to timerboard to view timers) auth | user | srp_management ( Allows for an individual to create and remove srp fleets and fleet data) From 766f4343aa58dfc6e04d5fdd9f09223c8da93f91 Mon Sep 17 00:00:00 2001 From: Adarnof Date: Sat, 5 Mar 2016 17:53:41 -0500 Subject: [PATCH 4/8] Update update.sh --- update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.sh b/update.sh index f8695c08..dea2e963 100755 --- a/update.sh +++ b/update.sh @@ -1,4 +1,4 @@ -pip install --upgrade -r requirements.txt +pip install -r requirements.txt yes yes | python manage.py syncdb yes yes | python manage.py evolve --hint --execute yes yes | python manage.py collectstatic From b6446f255ea444afa50899b8d4e629f48f4f92a6 Mon Sep 17 00:00:00 2001 From: Adarnof Date: Sat, 5 Mar 2016 18:04:45 -0500 Subject: [PATCH 5/8] lowered loglevel of ApiError on invalid char ID --- services/managers/eve_api_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/managers/eve_api_manager.py b/services/managers/eve_api_manager.py index 721ce02c..bff85c7e 100644 --- a/services/managers/eve_api_manager.py +++ b/services/managers/eve_api_manager.py @@ -237,7 +237,7 @@ class EveApiManager(): logger.debug("Confirmed id %s is a character." % character_id) return True except evelink.api.APIError as error: - logger.exception("APIError occured while checking if id %s is a character. Possibly not character?" % character_id) + logger.debug("APIError occured while checking if id %s is a character. Possibly not character?" % character_id, exc_info=True) logger.debug("Unable to verify id %s is a character." % character_id) return False From fa60be3675c00709a9c8cd92a3da37bf8bdece6c Mon Sep 17 00:00:00 2001 From: Adarnof Date: Sun, 6 Mar 2016 15:58:11 -0500 Subject: [PATCH 6/8] Ensure entered api ID is int Auth accepts these values in either order for building the model, but incorrectly assigns the vcode instead of ID to character models if entered incorrectly which can break certain functions. This is an added layer of stupid-protection to make sure they put the API ID (a number) in the right field. --- eveonline/forms.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eveonline/forms.py b/eveonline/forms.py index eeba2f9e..d81e1cf5 100644 --- a/eveonline/forms.py +++ b/eveonline/forms.py @@ -16,6 +16,13 @@ class UpdateKeyForm(forms.Form): api_id = forms.CharField(max_length=254, required=True, label="Key ID") api_key = forms.CharField(max_length=254, required=True, label="Verification Code") + + def clean_api_id(self): + try: + api_id = int(self.cleaned_data['api_id']) + return api_id + except: + raise forms.ValidationError("API ID must be a number") def clean(self): super(UpdateKeyForm, self).clean() From 8b205ea959b039f25c9cd0ca554d5820b32c1d75 Mon Sep 17 00:00:00 2001 From: Adarnof Date: Sun, 6 Mar 2016 23:49:38 -0500 Subject: [PATCH 7/8] Closes #301 --- celerytask/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/celerytask/tasks.py b/celerytask/tasks.py index dd6281ef..b35c0b0b 100755 --- a/celerytask/tasks.py +++ b/celerytask/tasks.py @@ -555,7 +555,7 @@ def run_api_refresh(): logger.info("User %s main character id %s missing model. Clearning main character." % (user, authserviceinfo.main_char_id)) authserviceinfo.main_char_id = '' authserviceinfo.save() - notify(user, "Main Character Reset", message="Your specified main character no longer has a model.\nThis could be the result of an invalid API\nYour main character ID has been reset." % api_key_pair.api_id, level="warn") + notify(user, "Main Character Reset", message="Your specified main character no longer has a model.\nThis could be the result of an invalid API\nYour main character ID has been reset.", level="warn") set_state(user) def populate_alliance(id, blue=False): From 3fa18a585cc9206f8df03cd96485129ce07aae04 Mon Sep 17 00:00:00 2001 From: orbitroom Date: Tue, 8 Mar 2016 16:37:38 -0500 Subject: [PATCH 8/8] Repurposed Signature Tracker for Wormhole use. --- sigtracker/form.py | 20 +++++++++---------- sigtracker/models.py | 7 +++++-- sigtracker/views.py | 20 ++++++++++++------- stock/templates/public/base.html | 2 +- .../registered/signaturemanagement.html | 15 +++++++++----- 5 files changed, 39 insertions(+), 25 deletions(-) diff --git a/sigtracker/form.py b/sigtracker/form.py index 60a9a6a1..9fd3b49a 100644 --- a/sigtracker/form.py +++ b/sigtracker/form.py @@ -4,20 +4,20 @@ from django.core.validators import MaxValueValidator, MinValueValidator class SignatureForm(forms.Form): - sigtype = [('Wormhole', 'Wormhole'), ('Combat', 'Combat'), ('Data', 'Data'), - ('Relic', 'Relic'), ('Gas', 'Gas'), ('Ore', 'Ore')] - status = [('Open', 'Open'), ('Started', 'Started'), ('Finished', 'Finished'), ('Life cycle has not begun', 'Life cycle has not begun'), - ('Probably wont last another day', 'Probably wont last another day'), ('End of its natural lifetime', 'End of its natural lifetime'), - ('stability not significantly disrupted', 'stability not significantly disrupted'), - ('Stability reduced not critical degree yet', 'Stability reduced not critical degree yet'), - ('Wormhole stability critically disrupted', 'Wormhole stability critically disrupted')] + mass_status = [('More Than 50%', 'More Than 50%'), ('Less Than 50%', 'Less Than 50%'), ('Less Than 10%', 'Less Than 10%')] + lifetime_status = [('More Than 24 Hours', 'More Than 24 Hours'), ('Less Than 24 Hours', 'Less Than 24 Hours'), ('Less Than 4 Hours', 'Less Than 4 Hours')] + ships_size = [('Only Smallest', 'Only Smallest'), ('Up to Medium', 'Up to Medium'), ('Larger', 'Larger'), ('Very Large', 'Very Large')] + system = forms.CharField(max_length=254, required=True, label='System') ident = forms.CharField(max_length=254, required=True, label="ID") - sigtype = forms.ChoiceField(choices=sigtype, required=True, label="Signature Type") - destination = forms.CharField(max_length=254, label="destination", required=True, initial="") - status = forms.ChoiceField(choices=status, required=True, label="Status") + lifetime_status = forms.ChoiceField(choices=lifetime_status, required=True, label="Lifetime Status") + mass_status = forms.ChoiceField(choices=mass_status, required=True, label="Mass Status") + ships_size = forms.ChoiceField(choices=ships_size, required=True, label="Ship Size") + destination = forms.CharField(max_length=254, label="End Destination", required=True, initial="") + through_dest = forms.CharField(max_length=254, label="Goes Through", required=True, initial="") notes = forms.CharField(max_length=254, label="Notes", required=False, initial="") + diff --git a/sigtracker/models.py b/sigtracker/models.py index e1e3a3e4..03c3c344 100644 --- a/sigtracker/models.py +++ b/sigtracker/models.py @@ -11,9 +11,12 @@ class sigtracker(models.Model): ident = models.CharField(max_length=254, default="") system = models.CharField(max_length=254, default="") destination = models.CharField(max_length=254, default="") - sigtype = models.CharField(max_length=254, default="") - status = models.CharField(max_length=254, default="") + lifetime_status = models.CharField(max_length=254, default="") + mass_status = models.CharField(max_length=254, default="") + ships_size = models.CharField(max_length=254, default="") notes = models.CharField(max_length=254, default="") + through_dest = models.CharField(max_length=254, default="") post_time = models.DateTimeField(default=timezone.now) eve_character = models.ForeignKey(EveCharacter) + diff --git a/sigtracker/views.py b/sigtracker/views.py index ddfc4d18..fbe12599 100644 --- a/sigtracker/views.py +++ b/sigtracker/views.py @@ -51,8 +51,10 @@ def add_signature_view(request): sig.ident = form.cleaned_data['ident'] sig.system = form.cleaned_data['system'] sig.destination = form.cleaned_data['destination'] - sig.sigtype = form.cleaned_data['sigtype'] - sig.status = form.cleaned_data['status'] + sig.lifetime_status = form.cleaned_data['lifetime_status'] + sig.mass_status = form.cleaned_data['mass_status'] + sig.ships_size = form.cleaned_data['ships_size'] + sig.through_dest = form.cleaned_data['through_dest'] sig.notes = form.cleaned_data['notes'] sig.create_time = post_time sig.eve_character = character @@ -94,8 +96,10 @@ def edit_signature(request, sigtracker_id): sig.ident = form.cleaned_data['ident'] sig.system = form.cleaned_data['system'] sig.destination = form.cleaned_data['destination'] - sig.sigtype = form.cleaned_data['sigtype'] - sig.status = form.cleaned_data['status'] + sig.lifetime_status = form.cleaned_data['lifetime_status'] + sig.mass_status = form.cleaned_data['mass_status'] + sig.ships_size = form.cleaned_data['ships_size'] + sig.through_dest = form.cleaned_data['through_dest'] sig.notes = form.cleaned_data['notes'] sig.eve_character = character logger.info("User %s updating sigtracker id %s " % (request.user, sigtracker_id)) @@ -108,9 +112,11 @@ def edit_signature(request, sigtracker_id): 'ident': sig.ident, 'system': sig.system, 'destination': sig.destination, - 'sigtype': sig.sigtype, - 'status': sig.status, + 'lifetime_status': sig.lifetime_status, + 'mass_status': sig.mass_status, + 'ships_size': sig.ships_size, + 'through_dest': sig.through_dest, 'notes': sig.notes, } form = SignatureForm(initial= data) - return render_to_response('registered/signatureupdate.html', {'form':form}, context_instance=RequestContext(request)) \ No newline at end of file + return render_to_response('registered/signatureupdate.html', {'form':form}, context_instance=RequestContext(request)) diff --git a/stock/templates/public/base.html b/stock/templates/public/base.html index 1f97835e..bb9ea2d4 100755 --- a/stock/templates/public/base.html +++ b/stock/templates/public/base.html @@ -152,7 +152,7 @@
  • Signature Tracker + class="fa fa-compass fa-fw grayiconecolor"> Wormhole Tracker
  • diff --git a/stock/templates/registered/signaturemanagement.html b/stock/templates/registered/signaturemanagement.html index 8e3d54a1..4c8eaa78 100644 --- a/stock/templates/registered/signaturemanagement.html +++ b/stock/templates/registered/signaturemanagement.html @@ -3,12 +3,12 @@ {% block title %}Alliance Auth{% endblock %} -{% block page_title %}Signature Management{% endblock page_title %} +{% block page_title %}Wormhole Signature Management{% endblock page_title %} {% block extra_css %}{% endblock extra_css %} {% block content %}
    -

    Signatures +

    Wormhole Signatures
    {% if perms.auth.signature_management %} @@ -22,8 +22,10 @@ ID System Destination - Signature Type - Status + Goes Through + Lifetime Status + Mass Status + Ship Size Notes Post Time {% if perms.auth.signature_management %} @@ -40,7 +42,10 @@ {{ sigt.system }} {{ sigt.destination }} - {{ sigt.sigtype }} + {{ sigt.through_dest }} + {{ sigt.lifetime_status }} + {{ sigt.mass_status }} + {{ sigt.ships_size }} {{ sigt.status }} {{ sigt.notes }} {{ sigt.post_time}}