Skip to content

Commit

Permalink
remove unnecessary symlink use, remove other access to /opt/Mycodo
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Jan 15, 2024
1 parent 281df50 commit 4837681
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This release updates several python packages that require Python >= 3.8. You can

This release changes the Desktop grid width from 20 to 24, enabling the use of 3 column layouts that are evenly-spaced. You will need to resize/rearrange Dashboard Widgets after this update to correct for the new width. The update of Gridstack to 10.0.1 also now allows the ability to drag Desktop widgets on mobile devices. If you don't like this behavior, you should lock the desktop from the Dashboard Configuration menu to prevent widgets from being dragged/rearranged.

This release changes the install directory from ~/Mycodo to /opt/Mycodo. This should occur automatically during the upgrade.
This release changes the install directory from ~/Mycodo to /opt/Mycodo. This necessitates deleting and regenerating the Python virtual environment. If you have any custom changes to the Mycodo venv, you will need to make those changes again after the upgrade. As a result of moving the install directory, following the upgrade, you will need to either run "sudo service mycodoflask restart" in a terminal or reboot your system for the web interface to become accessible again.

### Bugfixes

Expand Down
10 changes: 5 additions & 5 deletions mycodo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@
'cp -rf Highcharts-Stock-9.1.2/code/modules/data.js /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/data-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/data.js.map /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/data.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/exporting.js /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/exporting-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/exporting.js.map /var/mycodo-root/mycodo/mycodo_flask/static/js/user_js/exporting.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/export-data.js /var/mycodo-root/mycodo/mycodo_flask/static/js/user_js/export-data-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/export-data.js.map /var/mycodo-root/mycodo/mycodo_flask/static/js/user_js/export-data.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/offline-exporting.js /var/mycodo-root/mycodo/mycodo_flask/static/js/user_js/offline-exporting-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/offline-exporting.js.map /var/mycodo-root/mycodo/mycodo_flask/static/js/user_js/offline-exporting.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/exporting.js.map /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/exporting.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/export-data.js /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/export-data-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/export-data.js.map /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/export-data.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/offline-exporting.js /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/offline-exporting-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/offline-exporting.js.map /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/offline-exporting.js.map',
'rm -rf Highcharts-Stock-9.1.2'
])
]
Expand Down
1 change: 1 addition & 0 deletions mycodo/scripts/upgrade_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ case "${1:-''}" in

find "${MYCODO_PATH}" -type d -exec chmod u+wx,g+wx {} +
find "${MYCODO_PATH}" -type f -exec chmod u+w,g+w,o+r {} +
chmod 770 /opt/Mycodo # Exclude other users from viewing files

chown root:mycodo "${MYCODO_PATH}"/mycodo/scripts/mycodo_wrapper
chmod 4770 "${MYCODO_PATH}"/mycodo/scripts/mycodo_wrapper
Expand Down
1 change: 1 addition & 0 deletions mycodo/scripts/upgrade_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rm -f "${INSTALL_DIRECTORY}"/statistics.id

# Delete /env if Mycodo symlink target isn't /opt/Mycodo
if [ "$(readlink /var/mycodo-root)" != "/opt/Mycodo" ] ; then
printf "\n#### Deleting and regenerating virtual environment ####\n\n"
rm -rf "${INSTALL_DIRECTORY}"/env
fi

Expand Down
6 changes: 3 additions & 3 deletions mycodo/widgets/widget_graph_synchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ def generate_page_variables(widget_unique_id, widget_options):
'cp -rf Highcharts-Stock-9.1.2/code/modules/exporting.js /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/exporting-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/exporting.js.map /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/exporting.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/export-data.js /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/export-data-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/export-data.js.map /var/mycodo-root/mycodo/mycodo_flask/static/js/user_js/export-data.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/offline-exporting.js /var/mycodo-root/mycodo/mycodo_flask/static/js/user_js/offline-exporting-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/offline-exporting.js.map /var/mycodo-root/mycodo/mycodo_flask/static/js/user_js/offline-exporting.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/export-data.js.map /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/export-data.js.map',
'cp -rf Highcharts-Stock-9.1.2/code/modules/offline-exporting.js /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/offline-exporting-9.1.2.js',
'cp -rf Highcharts-Stock-9.1.2/code/modules/offline-exporting.js.map /opt/Mycodo/mycodo/mycodo_flask/static/js/user_js/offline-exporting.js.map',
'rm -rf Highcharts-Stock-9.1.2.zip',
'rm -rf Highcharts-Stock-9.1.2'
])
Expand Down

0 comments on commit 4837681

Please sign in to comment.