Skip to content

Commit

Permalink
removed old functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Kueng committed Aug 31, 2023
1 parent 98d3b6b commit 09e904c
Show file tree
Hide file tree
Showing 17 changed files with 2 additions and 994 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ exit
#### munkireport scripts
[report scripts](https://github.com/SteveKueng/mwa2_scripts)

## Munkiwebadmin with reposado
```bash
docker run --name reposado -d -p 8088:8088 -v Reposado:/reposado mscottblake/reposado
docker run -d -p 8000:80 --name munkiwebadmin -v /Users/Shared/munkirepo:/munkirepo -v Reposado:/reposado -h $HOSTNAME --link postgres_db stevekueng/munkiwebadmin
```


## Munkiwebadmin custom style
create a local folder for your styles:
```bash
Expand Down Expand Up @@ -70,7 +63,6 @@ docker run -d -p 8000:80 --name munkiwebadmin -v /Users/Shared/munkirepo:/munkir
| Variable | Usage | Default|
| ------------- |-------------|:------:|
| APPNAME | Django app name | _MunkiWebAdmin_ |
| SIMPLEMDMKEY | simpleMDM API key. Needed for use with simpleMDM ||
| ALLOWED_HOSTS | django allowed hosts. e.g. _[ munkiwebadmin.example.com ]_ |_[ * ]_|
| DEFAULT_MANIFEST | default manifest to use. _serail_number_ or _hostname_ |_serial_number_ |
| PROXY_ADDRESS | proxy server address ||
Expand Down
6 changes: 0 additions & 6 deletions api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
url(r'^(?P<kind>pkgs)/(?P<filepath>.*$)', api.views.file_api),
url(r'^(?P<kind>vault)/(?P<subclass>[a-zA-Z]+$)', api.views.db_api),
url(r'^(?P<kind>vault)/(?P<subclass>[a-zA-Z]+)/(?P<serial_number>[a-zA-Z0-9]+$)', api.views.db_api),
url(r'^(?P<kind>updates$)', api.views.updates_api),
url(r'^(?P<kind>updates)/(?P<update_id>.*$)', api.views.updates_api),
url(r'^(?P<kind>mdm)(?:/(?P<submission_type>.[a-zA-Z_]+))(?:/(?P<primary_id>[a-zA-Z0-9]+))(?:/(?P<action>[a-zA-Z_]+))(?:/(?P<secondary_id>[a-zA-Z0-9]+))?', api.views.mdm_api),
url(r'^(?P<kind>mdm)(?:/(?P<submission_type>.[a-zA-Z_]+))(?:/(?P<primary_id>[a-zA-Z0-9]+))(?:/(?P<action>[a-zA-Z_]+))?', api.views.mdm_api),
url(r'^(?P<kind>mdm)(?:/(?P<submission_type>.[a-zA-Z_]+))(?:/(?P<primary_id>[a-zA-Z0-9]+))?', api.views.mdm_api),
url(r'^(?P<kind>mdm)(?:/(?P<submission_type>[a-zA-Z_]+))?', api.views.mdm_api),
url(r'^(?P<kind>santa)(?:/(?P<submission_type>[a-zA-Z]+))(?:/(?P<machine_id>[a-zA-Z0-9]+))?', api.views.santa_api),
url(r'^(?P<kind>inventory)/(?P<serial_number>[a-zA-Z0-9]+$)', api.views.db_api),
url(r'^(?P<kind>[a-zA-Z]+$)', api.views.db_api),
Expand Down
46 changes: 0 additions & 46 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
import requests
from multiprocessing.pool import ThreadPool

if os.listdir('/reposado') != []:
sys.path.append('/reposado/code')
from reposadolib import reposadocommon

LOGGER = logging.getLogger('munkiwebadmin')

try:
Expand Down Expand Up @@ -1126,48 +1122,6 @@ def mdm_api(request, kind, submission_type, primary_id=None, action=None, second
# ----------- error 404 -----------------
return HttpResponse(status=404)

@csrf_exempt
@logged_in_or_basicauth()
def updates_api(request, kind, update_id=None):
LOGGER.debug("Got API request for %s" % (kind))
if os.listdir('/reposado') == []:
return HttpResponse(status=404)
if kind not in ['updates']:
return HttpResponse(status=404)
if not request.user.has_perm('updates.view_updates'):
raise PermissionDenied

products = reposadocommon.getProductInfo()
catalog_branches = reposadocommon.getCatalogBranches()

list_of_productids = None
if update_id:
list_of_productids = [update_id]
else:
list_of_productids = products.keys()

updates = []
list_of_productids.sort()
for key in list_of_productids:
if products.get(key):
if not catalog_branches:
branchlist = ''
else:
branchlist = [branch for branch in catalog_branches.keys()
if key in catalog_branches[branch]]
branchlist.sort()

deprecation_state = False
if not products[key].get('AppleCatalogs'):
# not in any Apple catalogs
deprecation_state = True
products[key]['deprecation_state'] = deprecation_state
products[key]['branchlist'] = branchlist
products[key]['id'] = key
updates.append(products[key])
return HttpResponse(json.dumps(updates, sort_keys=True, indent=1, cls=DjangoJSONEncoder),
content_type='application/json')

@csrf_exempt
@logged_in_or_basicauth()
def santa_api(request, kind, submission_type, machine_id):
Expand Down
2 changes: 1 addition & 1 deletion docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ python manage.py collectstatic --noinput
cp static_root/styles/$STYLE/favicon.ico .

#update database
python manage.py makemigrations manifests pkgsinfo process reports updates vault
python manage.py makemigrations manifests pkgsinfo process reports vault
python manage.py migrate --noinput

#chown -R www-data:www-data $APP_DIR
Expand Down
6 changes: 1 addition & 5 deletions munkiwebadmin/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
except:
HOSTNAME = "localhost"

REPOSADO = False
if os.listdir('/reposado') != []:
REPOSADO = True

def index(request):
try:
image = request.user.ldap_user.attrs["thumbnailPhoto"]
Expand All @@ -42,5 +38,5 @@ def index(request):
imgString = static('img/placeholder.jpg')
pass

return {'style': STYLE, 'APPNAME': APPNAME, 'REPOSADO': REPOSADO, 'HOSTNAME': HOSTNAME, 'userImage': imgString }
return {'style': STYLE, 'APPNAME': APPNAME, 'HOSTNAME': HOSTNAME, 'userImage': imgString }

8 changes: 0 additions & 8 deletions munkiwebadmin/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,6 @@ <h3>{{APPNAME}}</h3>
</a>
</li>
{% endif %}
{% if REPOSADO and perms.updates.view_updates %}
<li {% if page == 'updates' %} class="active" {% endif %}>
<a href="{% url 'updates' %}">
<i class="fab fa-apple"></i>
Updates
</a>
</li>
{% endif %}
</ul>
</nav>
{% endblock %}
Expand Down
3 changes: 0 additions & 3 deletions munkiwebadmin/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
url(r'^$', RedirectView.as_view(url='/reports/')),
]

if os.listdir('/reposado') != []:
urlpatterns += [url(r'^updates/', include('updates.urls'))]

# comment out the following if you are serving
# static files a different way
urlpatterns += staticfiles_urlpatterns()
Expand Down
Empty file removed updates/__init__.py
Empty file.
3 changes: 0 additions & 3 deletions updates/admin.py

This file was deleted.

9 changes: 0 additions & 9 deletions updates/models.py

This file was deleted.

Loading

0 comments on commit 09e904c

Please sign in to comment.