Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find and migrate to maintained alternative to cssmin #2808

Closed
redshiftzero opened this issue Jan 8, 2018 · 3 comments · Fixed by #4227
Closed

Find and migrate to maintained alternative to cssmin #2808

redshiftzero opened this issue Jan 8, 2018 · 3 comments · Fixed by #4227
Labels
app help wanted Issues we would definitely appreciate volunteer help with

Comments

@redshiftzero
Copy link
Contributor

Description

We use cssmin to minify CSS, but it is no longer maintained: https://github.com/zacharyvoase/cssmin (last commit 4 years ago).

csscompressor is a similar project that is maintained, we might consider using that instead: https://github.com/sprymix/csscompressor.

User Stories

As a SecureDrop maintainer, I want my dependencies to be well-maintained so that breakage or security vulnerabilities are noticed and promptly fixed.

@trankmichael
Copy link
Contributor

trankmichael commented Jan 24, 2018

I looked for references of cssmin but found that last reference to it was removed from the app code in 2ad8678#diff-88383f21e19c9be2cf4d9b6a81184f7a . When I uninstalled it, removed it from requirements, and reprovisioned , all the tests passed.

While looking at a replacement for minifier, I was thinking that the asset management and filtering could also be moved out of the template files and put into a Bundle from flask-assets in a seperate assets.py. I could open a new issue for this and work on it if these types of changes seem reasonable.

@redshiftzero
Copy link
Contributor Author

redshiftzero commented May 4, 2018

Actually, what about we just minify the CSS during the deb package build process, and ship the minified CSS along with the regular CSS? That's one less dependency for the app server

@redshiftzero redshiftzero added help wanted Issues we would definitely appreciate volunteer help with and removed pycon sprint labels Oct 26, 2018
@heartsucker
Copy link
Contributor

sass has a flag to minify and strip source maps, and it looks like we do that already according to grep:

install_files/ansible-base/roles/build-securedrop-app-code-deb-pkg/tasks/sass.yml
2:- name: Install sass Ruby gem
4:    name: sass
25:  shell: "/usr/local/bin/sass --force --stop-on-error --update sass:{{ securedrop_code_filtered }}/static/css --style compressed --sourcemap=none"
35:    - "sass"
36:    - ".sass-cache"

This may be closeable simply by removing it from the requirements files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app help wanted Issues we would definitely appreciate volunteer help with
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants