diff --git a/docsite/docs/installation/installation.md b/docsite/docs/installation/installation.md index b88447e1..ee65be0d 100644 --- a/docsite/docs/installation/installation.md +++ b/docsite/docs/installation/installation.md @@ -53,7 +53,7 @@ flatpak install flathub io.github.foxxmd.multiscrobbler The config directory for multi-scrobbler as a flatpak can be found under `/home/YourUser/.var/app/io.github.foxxmd.multiscrobbler/config` ```shell -flatpak run io.github.multiscrobbler +flatpak run io.github.foxxmd.multiscrobbler ``` #### Using [env-based](../configuration/configuration.md#env-based-configuration) configuration diff --git a/flatpak/README.md b/flatpak/README.md index 5008be83..4a17bf4d 100644 --- a/flatpak/README.md +++ b/flatpak/README.md @@ -24,7 +24,7 @@ First, [make sure `node_modules` is deleted or empty.](https://github.com/flatpa Then, from MS project root: -``` +```shell flatpak-node-generator npm package-lock.json ``` @@ -34,8 +34,15 @@ Move `generated-sources.json` into [`/flatpak`](/flatpak) From MS project root: -```console +```shell cd flatpak flatpak-builder --repo=/home/yourUser/multi-scrobbler-repo /home/yourUser/multi-scrobbler-build io.github.foxxmd.multiscrobbler.yml --force-clean ``` Add `--install --user` to have the app installed immediately. +# 5. Run (Locally) + +If built with `--install --user` you can now run MS using the command + +```shell +flatpak run -u io.github.foxxmd.multiscrobbler +``` diff --git a/flatpak/defaultConfig.json b/flatpak/defaultConfig.json index 2593a94c..4e40d29a 100644 --- a/flatpak/defaultConfig.json +++ b/flatpak/defaultConfig.json @@ -1,5 +1,6 @@ { "logging": { "file": false - } + }, + "port": 9078 } diff --git a/flatpak/io.github.foxxmd.multiscrobbler.yml b/flatpak/io.github.foxxmd.multiscrobbler.yml index 14d8a646..5ff13b48 100644 --- a/flatpak/io.github.foxxmd.multiscrobbler.yml +++ b/flatpak/io.github.foxxmd.multiscrobbler.yml @@ -24,10 +24,10 @@ modules: - npm install --offline # build app - - npm run build + - NODE_ENV=production npm run build # makes node and npm available - - mkdir -p /app/bin /app/lib /app/lib/src + - mkdir -p /app/bin /app/lib /app/lib/build - cp -a /usr/lib/sdk/node18/bin/{node,npm} /app/bin - cp -a /usr/lib/sdk/node18/lib/* /app/lib - rm -r /app/lib/node_modules/npm/{docs,man} @@ -38,11 +38,8 @@ modules: # copy node_modules needed to run app - cp -r node_modules/* /app/lib/node_modules - # delete typescript files (not needed for running app) - - find src/ -name "*.ts" -type f -delete - # copy app files to runtime dir - - cp -r src/* /app/lib/src + - cp -r build/* /app/lib/build - cp -r config /app/lib/config - cp flatpak/defaultConfig.json /app/lib/config/config.json @@ -56,8 +53,10 @@ modules: sources: - type: git url: https://github.com/FoxxMD/multi-scrobbler - tag: 0.4.6 - commit: b90ea039245491767baeefc53966b0350016aa4d + branch: develop + # in official builds use tag/commit instead of branch +# tag: 0.4.6 +# commit: ed6bcd60b3448397424ed7c14075479452ff566f dest: main # Wrapper to launch the app - type: script @@ -73,6 +72,6 @@ modules: cp -r /app/lib/config/. "${XDG_CONFIG_HOME}"/ #cp /app/lib/defaultConfig.json $XDG_CONFIG_HOME/config.json fi - - cd /app/lib && CONFIG_DIR=$XDG_CONFIG_HOME IS_LOCAL=true node src/index.js + - cd /app/lib && CONFIG_DIR=$XDG_CONFIG_HOME IS_LOCAL=true NODE_ENV=production node build/server.js - generated-sources.json