Commit Graph

31 Commits (f4eee8726a7967b188eddaf67341c87d68dedd64)

Author SHA1 Message Date
G3RB3N 876b5393f7 Dev add nl nl (#1906)
* Added nl-nl voc, dialogs and formatter
2019-01-16 13:48:41 +01:00
Steve Penrod dd697cb765 Tweaks to start/stop scripts
Several minor changes:
* Add mycroft-start and mycroft-stop, which can be used as commands anywhere
  if the user has added this to the PATH.  They are shortcuts to the
  start-mycroft.sh and stop-mycroft.sh scripts.
* Add to the mycroft-help command reference
* Add "reset" parameter for start-mycroft.sh, which forces a service restart.
  If a service is currently running, it will not restart by default anymore.
* Make the 'enclosure' service part of 'all' regardless of platform.  This
  makes sense not that it can handle a remote GUI connection.
* BUG: mycroft-stop would sometimes show odd messages if the skill process
  had active child processes.
2019-01-15 09:08:13 +01:00
Steve Penrod 8fe127bd5d Improve setup and start-mycroft scripts (#1924)
Improved the dev_setup.sh in several ways:
* Add 'wizard' that walks new users through setup
  - Option to put the mycroft-core/bin folder in the path
  - Option to change to 'master' instead of 'dev' branch.  This is
    usually desirable for users who only run Mycroft, not developers.
  - Option to auto-update when running Mycroft
  - Add soft link <mycroft-core>/skills to the /opt/mycroft/skills
    directory

Improve the start-mycroft.sh script
* Unify some duplicated code under init-once() function
* Add support for "auto-update", which attempts a git pull at startup
* Add require-process() function which doesn't restart already
  running services
* Add require-process for messagebus and skills services when running
  the CLI
* Tweak the --help message
2018-12-31 14:05:09 +01:00
Åke Forslund c659faaf92 remove the old generate_sdk_docs.py
replace it with sphinxdoc

./start-mycroft.sh sdkdoc html will generate the same documentation as
on readthedocs.org
2018-11-15 17:49:53 +01:00
Steve Penrod 5e6c1773e4
Unify the command line experience across platforms (#1784)
* Unify the command line experience across platforms

Interacting with Mycroft was slightly different on different platforms
(Mark 1, Github, Picroft), which resulted in confusion and the beginnings of a
documentation/support nightmare.  This moves several of the common commands
into a mycroft-core/bin folder instead of being build in packaging or part
of the Picroft package only.

This required a small changes to the common scripts, in addition to adding
the new scripts.  Here are details:
* dev_setup.sh
  - Stubbed out a setup wizard (TODO)
  - Jumped to latest version of pip (18.0)
  - Set execution flags for new scripts
* start-mycroft.sh
  - Allow auto-execution of dev_setup.sh
  - De-sourced the stop-mycroft.sh calls (not needed)
  - Add quotes to better handle paths with spaces
* stop-mycroft.sh
  - Return exit code to show if a service was stopped or killed
  - Extend the time to wait for a gently shutdown from 2 secs to 5
  - Changed to say "messagebus.service" instead of just "service" to be more clear (the name "service" means nothing to users, but "bus does")
* venv-activate.sh
  - Added help
  - Added -q or --quiet mode
  - Added toggled availability of 'mycroft-venv-activate' and 'mycroft-venv-deactivate' aliases.  Only one is available at any given time.

New scripts:
* mycroft-cli-client: start up the CLI
* mycroft-help: shows hints on using mycroft
* mycroft-mic-test: runs the basic record/playback, playing nicely with a running Mycroft by stopping and restarting services as appropriate
* mycroft-pip: manage the venv via pip
* mycroft-say-to: send utterances, like a user spoke them
* mycroft-speak:  speaks the given phrase using Mycroft
* mycroft-skill-testrunner: invoke the single-skill test runner

All of these scripts are easy to discover by typing "mycroft-" then
hitting the TAB key.

==== INSTALLER NOTES ====
* We no longer need to create mycroft-cli-client and mycroft-pip in the Debian packages.
* mycroft-core/bin should be added to the path

* Corrections after review

Several minor corrections, plus added wrappers for the 'msm' and 'msk'
utilities.

* Set executable flag on script files in bin/

The scripts in the bin/ folder needed to be changed to executable within
git to prevent looking dirty after dev_setup.sh has been run.

* Add executable flag to one more script
2018-09-09 16:55:01 -05:00
Åke Forslund a66e23d8ab start processess using python -m
- rename process main.py to __main__.py
- update start-mycroft.sh/stop-mycroft.sh scripts to reflect the change
2018-08-16 15:21:22 +02:00
Steve Penrod 684230213e Set the directory explicitly start-mycroft.sh scripts
Explicitly setting the directory at the beginning of the start-mycroft.sh
and stop-mycroft.sh scripts.  The behaves better if invoked from a
different directory.
2018-08-15 03:50:37 -05:00
Steve Penrod 1c82945576 Move logs to /var/log/mycroft/ directory
Simplifies permissions and future log-rotations to have all logs
under a single folder instead of having to give permissions to each.
2018-08-02 23:57:13 -05:00
Steve Penrod d1d17c2e08 Fix accidental line-ending change 2018-08-02 23:34:44 -05:00
Steve Penrod f329051743 Move logs to /var/log in all cases
Previously, the location of the log files changed depending
on whether you were running on a Mark1/Picroft or under a
"Github" install.  Now they are always under the same directory
at /var/log/mycroft-*.log

This also updates the CLI to pull from that location always.

Additionally:
* Removed the nonfunctional 'wifi' option from start-mycroft.sh
* Made the validation for dev_setup.sh exit instead of just show
  a warning message in start-mycroft.sh
* Added code to allow dev_setup.sh to be run from different
  directories successfully
2018-08-02 21:21:30 -05:00
Julien Kassar ed556b09df Standardize shell scripts (#1711)
* Standardize shebangs
* Standardize spaces
* Standardize functions declaration
* Standardize conditional constructs
* Standardize double quotes
* Standardize command substitution
* Standardize sed command
2018-08-02 14:48:47 -05:00
Julien Kassar e482254172 Do not enter python virtual env when inside Docker container (#1710)
Using a virtual environment is not necessary under Docker, which is a controlled
environment on its own.  This uses the semi-standard existence check for ```.dockerenv```
as a way to detect when running in a Docker context.
2018-08-01 15:10:48 -05:00
Steve Penrod 365d6d19a0 Add enclosure to the start/stop dev scripts
The start-mycroft.sh and stop-mycroft.sh scripts now automatically
run the enclosure client if the platform is defined as
"mycroft_mark_1".

Also corrected a copy/pasted comment and added a clarifying message during the stop when killing a process.

Add stop support for recent 'python3' change

Necessary after #1703

The -r option eliminates the quotes on output

Clean up the usage of jq, -r removes the quotes on output.  Also eliminated the python2 support in the regex ```[p]ython[2|3]``` and dropped the unnecessary ```[p]```.

Verify platform file existence before read

It might not exist on a desktop install.

Verify platform file existence before read
2018-07-27 15:48:08 -05:00
Julien Kassar 670994b804 Replace python with python3 in start-mycroft.sh script (#1703)
Signed-off-by: Julien Kassar <github@kassisol.com>
2018-07-27 01:30:39 -05:00
Matthew D. Scholefield 0540229cc4
Merge branch 'dev' into feature/cleanup-setup 2018-07-18 10:44:41 -05:00
Åke Forslund 4b2a25df2c Fix audiotest launching
Launch using python -m instead of python SCRIPT_PATH
2018-07-14 08:43:17 +02:00
Åke Forslund fad890ff39 Clean up setup scripts
- Remove setup scripts for mycroft-skills-sdk since it's not used anymore
- Rename mycroft-base-setup.in/MANIFEST.in to setup.py and MANIFEST.in
- Remove skill-container, since it hasn't been used or kept up to date since 17.08 and the cli commands to remove and activate skills is easier to work with

==== Environment Notes ====
Small update of the packaging script is needed due to this change
2018-07-14 08:36:50 +02:00
Åke 23fcc631c4 Bugfix mycroft-use github (#1659)
* Fix startup scripts

- change start.sh to the new start-mycroft.sh
- fix startup of messagebus service
- fix startup of enclosure

* Fix running dev_setup.sh as root

Use --allow-root when calling dev_setup.sh

* Correct default directory for user

On the Mark-1 the script would create the mycroft-core repo in /home/root instead of /root when running the script as root

* Skip mimic installation correctly

* Allow doing the github install without root

Running mycroft under root stumbles into issues accessing the audio. allowing unstall under pi user is also more intuitive.

* Change ownership of the webcache

* fix starting/stopping wifi-service

* Fix switching permissions

* Correct startup order

- load messagebus before enclosure
- reboot to workaround audio input issue

* Disable updates when switched to github install

* Fix identity update

identity updates weren't transfered back to the mycroft user since the linked file was overwritten. Now the identity folder is linked instead.
2018-07-10 03:26:30 -05:00
penrods 490b967a32 Add security notice running Mycroft from desktops
Security researcher w00t pointed out a potential exploit if an user
starts the Mycroft messagebus service on a system with an exposed
network connection with no protection for port 8181.  For now the
start-mycroft.sh script will simply display a CAUTION to point out
this concern and remind them to protect themselves with a firewall.

Future versions of the websocket implementation will use encryption
and authentication.
2018-06-08 12:59:00 -05:00
Matthew D. Scholefield a95fba2bd4 Pass extra start-mycroft arguments to pytest 2018-05-31 19:17:45 -05:00
Matthew D. Scholefield 1205217e25 Re-add checking of dependencies when running start-mycroft.sh 2018-05-22 11:37:17 -05:00
Matthew D. Scholefield 32b14d0a0b Add skillstest to start-mycroft 2018-05-14 14:27:37 -05:00
Matthew D. Scholefield bd51eecd6a Switch test framework to pytest
Also sources the virtualenv before running tests
2018-05-14 14:27:37 -05:00
Åke Forslund 8673f9cbb9 Replace virtualenv with python3 venv
TODO msm
2018-04-27 08:56:47 -05:00
Åke Forslund ba8cfcab30 Update dev_setup.sh to install python3
This also adds the possibility to set the environment variable MYCROFT_VENV to separate the virtual env for python3 from the stable version.

Example:
export MYCROFT_VENV=mycroft-18.02
./dev_setup.sh
./start-mycroft.sh all
2018-04-27 08:50:46 -05:00
Åke Forslund c7da63c536 Fix ./start-mycroft.sh unittest
Move the nose2 commandline from the .travis.yml to the start-mycroft.sh
script and call ./start-mycroft.sh unittest from travis.
2017-12-22 03:51:58 -06:00
Rhett Aultman 35c3af1e2c Make mycroft-core.sh invocable from outside
mycroft-core.sh has a relative-path call (that itself also likes to
be called from inside mycroft-core) that prevents making a clean start
of mycroft from outside the mycroft-core directory.  This makes doing
things like adding it as a Ubuntu Unity startup application slightly
messy.
2017-10-26 19:06:11 -04:00
Steve Penrod f0086d8881 Remove "restart", auto-restart running services
Remove the "restart" option, instead all of the background services
now automatically check to see if they are already running and will
be stopped then restarted if so.

Also fixed a few Codacy complaints.
2017-09-28 01:08:20 -05:00
Steve Penrod 26559388ea Enhance help message, remove extra whitespace 2017-09-28 01:08:20 -05:00
Steve Penrod 4afa64427d Change default to 'help', add 'debug' option
The default when no parameter is entered is now to display the help.
To start services you can use 'all', or 'debug' to start them followed
but starting the CLI
2017-09-28 01:08:20 -05:00
Steve Penrod 07992b49d5 Revamping the scripts used to start/stop Mycroft
Reworking the mechanisms used to interact with Mycroft.  The old
mycroft.sh utilized the 'screen' command, but now with the CLI it
it easier to use that for viewing log files.  Plus there was
confusion between when to use start.sh and when to use mycroft.sh.

Now things are wrapped in the simple and easily discoverable scripts:
* start-mycroft.sh
* stop-mycroft.sh

The start-mycroft.sh allows you to start the background services and
to invoke the various tools (e.g. the CLI, unit tests, etc).

==== Fixed Issues ====

====  Documentation Notes ====
This will require revamp of the getting started guides, etc.
2017-09-28 01:08:20 -05:00