Skip to content

Commit

Permalink
Release/v2019.2.5 (#200)
Browse files Browse the repository at this point in the history
* added init file for dist directory (#167)

* fix: responsive layout (#178)

* fix: users are able to reset their pw (#184)

* fix: users are able to reset their pw

* added tests

* updated deps (#185)

* fix: UI errors (#187)

* fix: url format

* updated deps (#196)

* use salt 3000 (#197)

* fixed ui

* ignore eslint

* fix warning

* int: build doc on develop (#199)

* bumped version, updated changelog
  • Loading branch information
mattLLVW authored Apr 26, 2020
1 parent c095b5e commit 5b7a811
Show file tree
Hide file tree
Showing 75 changed files with 2,386 additions and 1,708 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/assets/js/local-echo
25 changes: 25 additions & 0 deletions .github/workflows/build-statics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Node.js Build

on:
push:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install dependencies
run: npm install
- name: Build statics
run: npm run build
- name: Commit statics
uses: stefanzweifel/[email protected]
with:
file_pattern: dist/index.html dist/static/*
commit_message: commit statics
37 changes: 37 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: github pages

on:
push:
branches:
- develop

defaults:
run:
working-directory: docs

jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.6'
architecture: 'x64'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r ../requirements/docs.txt
mkdocs build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/site
cname: alcali.dev
user_name: Matt Melquiond
user_email: [email protected]
20 changes: 20 additions & 0 deletions .github/workflows/test-statics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Node.js Test

on:
push:
branches-ignore:
- develop

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install dependencies
run: npm install
- name: Build statics
run: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
__pycache__
node_modules/
.coverage
dist/__init__.py
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [2019.2.5] - 2020-04-26

- updated deps (#185)

- fix: UI errors (#187)

- fix: users are able to reset their pw (#184)

- fix: responsive layout (#178)

[2019.2.5]: https://github.com/latenighttales/alcali/compare/v2019.2.5...HEAD

## [2019.2.4] - 2020-02-14

- fix: password update (#164)
Expand All @@ -8,7 +20,7 @@

- fix: Less restrictive minion_id regex and error mgmt (#140)

[2019.2.4]: https://github.com/latenighttales/alcali/compare/v2019.2.4...HEAD
[2019.2.4]: https://github.com/latenighttales/alcali/compare/v2019.2.4...v2019.2.5

## [2019.2.3] - 2019-12-10

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG USER_ID=1000
# Upgrade System and Install dependencies
RUN apt-get update \
&& seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} \
&& apt-get install -y --no-install-recommends -o DPkg::Options::=--force-confold netcat libmariadbclient-dev libpq-dev build-essential libldap2-dev libsasl2-dev ldap-utils
&& apt-get install -y --no-install-recommends -o DPkg::Options::=--force-confold netcat libmariadbclient-dev libpq-dev build-essential libldap2-dev libsasl2-dev ldap-utils git

# Upgrade pip
RUN pip install --upgrade pip
Expand Down
84 changes: 83 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,90 @@ More [here](https://github.com/latenighttales/alcali/blob/2019.2/docs/docs/scree

[MIT](LICENSE)

<sub><sub>Image: Jean-Philippe WMFr, derivative work : User:Benoit Rochon [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0)</sub></sub>

## Contributing

If you'd like to contribute, check the [contribute](https://alcali.dev/contribute/) documentation on how to install a dev environment and submit PR!

<sub><sub>Image: Jean-Philippe WMFr, derivative work : User:Benoit Rochon [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0)</sub></sub>
## Changelog

## [2019.2.5] - 2020-04-26

- updated deps (#185)

- fix: UI errors (#187)

- fix: users are able to reset their pw (#184)

- fix: responsive layout (#178)

[2019.2.5]: https://github.com/latenighttales/alcali/compare/v2019.2.5...HEAD

## [2019.2.4] - 2020-02-14

- fix: password update (#164)

- update deps 20200207 (#155)

- fix: Less restrictive minion_id regex and error mgmt (#140)

[2019.2.4]: https://github.com/latenighttales/alcali/compare/v2019.2.4...v2019.2.5

## [2019.2.3] - 2019-12-10

- feat: Google OAuth2 (#130)

- updated deps (#111)

- feat: Group jobs by jid (#106)

- int: error mgmt (#105)

- fix: favicon and boolrepr (#102)

- fix: removed useless icon files, fixed boolean repr (#100)

- fix: state render,Layout removed admin

- feat: predefined jobs (#98)

- fix: Boolean repr (#97)

- feat: LDAP auth backend (#84)

- fix: async run, updated deps (#82)

- feat: fold/unfold all

- feat: display current version in gui and cli dynamically (#76)

- fix: timezone, success bool for custom modules (#75)

- async link: resolve #69 (#74)

- feat: schedule disable/enable (#72)

- fix: schedules, keys, updated vuetify (#71)

- int: updated docs, added contribute section, screenshots (#62)

[2019.2.3]: https://github.com/latenighttales/alcali/compare/v2019.2.3...v2019.2.4

## [2019.2.2] - 2019-09-21

- use slim docker image

- Added rest auth

- Added pillar override

- Updated deps

[2019.2.2]: https://github.com/latenighttales/alcali/compare/v2019.2.2...v2019.2.3

## [2019.2.1] - 2019-09-21

- Frontend refactor

[2019.2.1]: https://github.com/latenighttales/alcali/compare/v2019.2.1...v2019.2.2
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2019.2.4
2019.2.5
13 changes: 13 additions & 0 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class UsersSerializer(serializers.ModelSerializer):
user_settings = UserSettingsSerializer(read_only=True)

def create(self, validated_data):
# Remove useless fields.
for param in ["is_active", "groups", "user_permissions"]:
del validated_data[param]
user = User(**validated_data)
Expand All @@ -114,6 +115,10 @@ def create(self, validated_data):
return user

def update(self, instance, validated_data):
# Prevent an unprivileged user to escalate status.
current_user = self.context["request"].user
if not current_user.is_staff:
validated_data.pop("is_staff", None)
password = validated_data.pop("password", None)
for k, v in validated_data.items():
setattr(instance, k, v)
Expand All @@ -122,6 +127,14 @@ def update(self, instance, validated_data):
instance.save()
return instance

def get_extra_kwargs(self):
# Override password validation on update.
extra_kwargs = super(UsersSerializer, self).get_extra_kwargs()
action = self.context["view"].action
if action in ["update", "partial_update"]:
extra_kwargs["password"] = {"write_only": True, "required": False}
return extra_kwargs

class Meta:
model = User
fields = "__all__"
Expand Down
14 changes: 8 additions & 6 deletions api/views/alcali.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,20 @@ class UsersViewSet(viewsets.ModelViewSet):
queryset = User.objects.all()
serializer_class = UsersSerializer

def get_queryset(self):
if not self.request.user.is_staff:
return User.objects.filter(id=self.request.user.id)
else:
return User.objects.all()

def get_permissions(self):
permission_classes = []
# Only Staff users are allowed to create users.
if self.action == "create":
permission_classes = [IsAdminUser]
elif (
self.action == "retrieve"
or self.action == "update"
or self.action == "partial_update"
):
elif self.action in ["retrieve", "update", "partial_update", "list"]:
permission_classes = [IsLoggedInUserOrAdmin]
elif self.action == "list" or self.action == "destroy":
elif self.action == "destroy":
permission_classes = [IsAdminUser]
return [permission() for permission in permission_classes]

Expand Down
Empty file added dist/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/static/favicon.ico><title>ALCALI</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link href="https://fonts.googleapis.com/css?family=Material+Icons" rel=stylesheet><link href=/static/css/app.630a9e31.css rel=preload as=style><link href=/static/css/chunk-vendors.06af5d77.css rel=preload as=style><link href=/static/js/app.3d9f856c.js rel=preload as=script><link href=/static/js/chunk-vendors.8132a196.js rel=preload as=script><link href=/static/css/chunk-vendors.06af5d77.css rel=stylesheet><link href=/static/css/app.630a9e31.css rel=stylesheet></head><body><noscript><strong>We're sorry but my-app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.8132a196.js></script><script src=/static/js/app.3d9f856c.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/static/favicon.ico><title>ALCALI</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link href="https://fonts.googleapis.com/css?family=Material+Icons" rel=stylesheet><link href=/static/css/app.ef41b39d.css rel=preload as=style><link href=/static/css/chunk-vendors.e3234c14.css rel=preload as=style><link href=/static/js/app.a8637cac.js rel=preload as=script><link href=/static/js/chunk-vendors.8941a7de.js rel=preload as=script><link href=/static/css/chunk-vendors.e3234c14.css rel=stylesheet><link href=/static/css/app.ef41b39d.css rel=stylesheet></head><body><noscript><strong>We're sorry but my-app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.8941a7de.js></script><script src=/static/js/app.a8637cac.js></script></body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dist/static/css/chunk-vendors.06af5d77.css

This file was deleted.

1 change: 1 addition & 0 deletions dist/static/css/chunk-vendors.e3234c14.css

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/static/js/app.3d9f856c.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/static/js/app.3d9f856c.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions dist/static/js/app.a8637cac.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/static/js/app.a8637cac.js.map

Large diffs are not rendered by default.

38 changes: 0 additions & 38 deletions dist/static/js/chunk-vendors.8132a196.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/static/js/chunk-vendors.8132a196.js.map

This file was deleted.

38 changes: 38 additions & 0 deletions dist/static/js/chunk-vendors.8941a7de.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/static/js/chunk-vendors.8941a7de.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docker/Dockerfile-master
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN apt-get update && \
apt-get install -y -o DPkg::Options::=--force-confold curl python3-mysqldb netcat

# Install Latest Salt from the stable Branch
RUN curl -L https://bootstrap.saltstack.com | sh -s -- -X -M -x python3 stable 2019.2.2
RUN curl -L https://bootstrap.saltstack.com | sh -s -- -X -M -x python3 stable 2019.2.3

# Set master and id
RUN echo "master: master\nid: master">/etc/salt/minion
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-minion
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN apt-get update && \
apt-get install -y -o DPkg::Options::=--force-confold curl netcat

# Install Latest Salt from the stable Branch
RUN curl -L https://bootstrap.saltstack.com | sh -s -- -x python3 stable 2019.2.2
RUN curl -L https://bootstrap.saltstack.com | sh -s -- -x python3 stable 2019.2.3

# Set master
RUN echo "master: master">/etc/salt/minion
Expand Down
Loading

0 comments on commit 5b7a811

Please sign in to comment.