diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index e7bd077..4c9ef5f 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -2,7 +2,12 @@ ## Our Pledge -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, +body size, disability, ethnicity, gender identity and expression, level of +experience, nationality, personal appearance, race, religion, or sexual +identity and orientation. ## Our Standards @@ -24,23 +29,43 @@ Examples of unacceptable behavior by participants include: ## Our Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. ## Scope -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an +appointed representative at an online or offline event. Representation of a +project may be further defined and clarified by project maintainers. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at bastilimbach@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at bastilimbach@gmail.com. The project +team will review and investigate all complaints, and will respond in a way that +it deems appropriate to the circumstances. The project team is obligated to +maintain confidentiality with regard to the reporter of an incident. Further +details of specific enforcement policies may be posted separately. -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at +[http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ diff --git a/.github/workflows/superlinter.yaml b/.github/workflows/superlinter.yaml new file mode 100644 index 0000000..0e6ee78 --- /dev/null +++ b/.github/workflows/superlinter.yaml @@ -0,0 +1,28 @@ +name: Super-Linter + +# Run this workflow every time a new commit pushed to your repository +on: push + +jobs: + # Set the job key. The key is displayed as the job name + # when a job name is not provided + super-lint: + # Name the Job + name: Lint code base + # Set the type of machine to run on + runs-on: ubuntu-latest + + steps: + # Checks out a copy of your repository on the ubuntu-latest machine + - name: Checkout code + uses: actions/checkout@v2 + + # Runs the Super-Linter action + - name: Run Super-Linter + uses: github/super-linter@v3 + env: + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # the standard config conflicts heavily with the upstream config.js + # hence I opted to disable it + VALIDATE_JAVASCRIPT_STANDARD: false diff --git a/Dockerfile b/Dockerfile index 1aecfce..ed8b839 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ FROM node:12-buster +# hadolint ignore=DL3008 RUN set -e; \ - apt update; \ - apt install -y gettext; \ + apt-get update; \ + apt-get install -y --no-install-recommends gettext; \ rm -rf /var/lib/apt/lists/* ARG branch=master @@ -16,7 +17,6 @@ RUN cp -R config /opt/default_config RUN npm install --unsafe-perm --silent COPY mm-docker-config.js docker-entrypoint.sh ./ -RUN chmod +x ./docker-entrypoint.sh EXPOSE 8080 ENTRYPOINT ["./docker-entrypoint.sh"] diff --git a/README.md b/README.md index d40cf26..8517ded 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![MagicMirror²: The open source modular smart mirror platform. ](https://github.com/MichMich/MagicMirror/raw/master/.github/header.png)](https://github.com/MichMich/MagicMirror) + +[![MagicMirror²: The open source modular smart mirror platform.](https://github.com/MichMich/MagicMirror/raw/master/.github/header.png)](https://github.com/MichMich/MagicMirror) **MagicMirror²** is an open source modular smart mirror platform. With a growing list of installable modules, the **MagicMirror²** allows you to convert your hallway or bathroom mirror into your personal assistant. diff --git a/build.sh b/build.sh index 1ff6a00..5ad9d31 100755 --- a/build.sh +++ b/build.sh @@ -4,7 +4,7 @@ set -e # https://stackoverflow.com/a/51761312/4934537 latest_release=$(git ls-remote --tags --refs --sort="v:refname" https://github.com/MichMich/MagicMirror.git | tail -n1 | sed 's/.*\///') if [ "$(docker manifest inspect bastilimbach/docker-magicmirror:"${latest_release}" > /dev/null; echo $?)" != 0 ]; then - docker buildx build --progress plain --platform=linux/amd64,linux/arm64,linux/arm/v7 ${1} --build-arg branch="${latest_release}" -t bastilimbach/docker-magicmirror:"${latest_release}" -t bastilimbach/docker-magicmirror:latest . + docker buildx build --progress plain --platform=linux/amd64,linux/arm64,linux/arm/v7 "${1}" --build-arg branch="${latest_release}" -t bastilimbach/docker-magicmirror:"${latest_release}" -t bastilimbach/docker-magicmirror:latest . fi -docker buildx build --progress plain --platform=linux/amd64,linux/arm64,linux/arm/v7 ${1} --build-arg branch=develop -t bastilimbach/docker-magicmirror:develop . +docker buildx build --progress plain --platform=linux/amd64,linux/arm64,linux/arm/v7 "${1}" --build-arg branch=develop -t bastilimbach/docker-magicmirror:develop . diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh old mode 100644 new mode 100755 diff --git a/mm-docker-config.js b/mm-docker-config.js index 7ae119c..bdd0553 100644 --- a/mm-docker-config.js +++ b/mm-docker-config.js @@ -9,78 +9,78 @@ */ var config = { - address: "0.0.0.0", // Address to listen on, can be: - // - "localhost", "127.0.0.1", "::1" to listen on loopback interface + address: '0.0.0.0', // Address to listen on, can be: + // - 'localhost', '127.0.0.1', '::1' to listen on loopback interface // - another specific IPv4/6 to listen on a specific interface - // - "0.0.0.0" to listen on any interface - // Default, when address config is left out, is "localhost" + // - '0.0.0.0' to listen on any interface + // Default, when address config is left out, is 'localhost' port: 8080, ipWhitelist: [], // Set [] to allow all IP addresses // or add a specific IPv4 of 192.168.1.5 : - // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"], + // ['127.0.0.1', '::ffff:127.0.0.1', '::1', '::ffff:192.168.1.5'], // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format : - // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"], + // ['127.0.0.1', '::ffff:127.0.0.1', '::1', '::ffff:192.168.3.0/28'], - language: "en", + language: 'en', timeFormat: 24, - units: "metric", + units: 'metric', modules: [ { - module: "alert", + module: 'alert', }, { - module: "updatenotification", - position: "top_bar" + module: 'updatenotification', + position: 'top_bar' }, { - module: "clock", - position: "top_left" + module: 'clock', + position: 'top_left' }, { - module: "calendar", - header: "US Holidays", - position: "top_left", + module: 'calendar', + header: 'US Holidays', + position: 'top_left', config: { calendars: [ { - symbol: "calendar-check", - url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics" + symbol: 'calendar-check', + url: 'webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics' } ] } }, { - module: "compliments", - position: "lower_third" + module: 'compliments', + position: 'lower_third' }, { - module: "currentweather", - position: "top_right", + module: 'currentweather', + position: 'top_right', config: { - location: "New York", - locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city - appid: "YOUR_OPENWEATHER_API_KEY" + location: 'New York', + locationID: '', //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city + appid: 'YOUR_OPENWEATHER_API_KEY' } }, { - module: "weatherforecast", - position: "top_right", - header: "Weather Forecast", + module: 'weatherforecast', + position: 'top_right', + header: 'Weather Forecast', config: { - location: "New York", - locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city - appid: "YOUR_OPENWEATHER_API_KEY" + location: 'New York', + locationID: '5128581', //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city + appid: 'YOUR_OPENWEATHER_API_KEY' } }, { - module: "newsfeed", - position: "bottom_bar", + module: 'newsfeed', + position: 'bottom_bar', config: { feeds: [ { - title: "New York Times", - url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml" + title: 'New York Times', + url: 'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml' } ], showSourceTitle: true, @@ -94,4 +94,4 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") { module.exports = config; } +if (typeof module !== 'undefined') { module.exports = config; } diff --git a/test-build.sh b/test-build.sh index a8b7b48..e11f207 100755 --- a/test-build.sh +++ b/test-build.sh @@ -1,3 +1,5 @@ +#!/bin/bash + rm -rf ./config rm -rf ./modules mkdir config @@ -8,7 +10,7 @@ docker build -t mm:latest . docker run -d \ --publish 80:8080 \ --restart always \ - --volume $PWD/config:/opt/magic_mirror/config \ - --volume $PWD/modules:/opt/magic_mirror/modules \ + --volume "$PWD"/config:/opt/magic_mirror/config \ + --volume "$PWD"/modules:/opt/magic_mirror/modules \ --name magic_mirror \ mm:latest