From 8e7e0315762f751d142a98798b25563951b11902 Mon Sep 17 00:00:00 2001 From: wolfez Date: Wed, 10 Sep 2025 14:33:00 +0200 Subject: [PATCH] remove dashboard script --- README.md | 23 ------ scripts/project/config.json | 17 +--- .../project/generate-dashboard-login/run.sh | 80 ------------------- 3 files changed, 1 insertion(+), 119 deletions(-) delete mode 100755 scripts/project/generate-dashboard-login/run.sh diff --git a/README.md b/README.md index 1884f32..4fa218d 100644 --- a/README.md +++ b/README.md @@ -185,26 +185,3 @@ To make sure the app can share data, producers need to be set up. There is an in ) } ``` - -## Configuring the dashboard -### Accessing the dashboard from your local machine - -Since we use dispatcher v2, which dispatches on hostname, we'll have to update `/etc/hosts`. -Add an entry similar to the following. Ensure the first part of the domain starts with `dashboard`.: - -``` -127.0.0.1 dashboard.localhost -``` - -### Creating new users -For now, we use specific logins for the dashboard users. Each environment has its own passwords. - -To add a user, make sure to have [mu-cli](https://github.com/mu-semtech/mu-cli) installed first. -Then in `docker-compose.override.yml` -``` - dashboard-login: - environment: - MU_APPLICATION_SALT: 'a_random_string_with_sufficient_entropy_hence_not_this_one' -``` -You can now generate a user by running `mu script project-scripts generate-dashboard-login` and following the steps. -Restart `migrations` and it should insert the new user into the database. \ No newline at end of file diff --git a/scripts/project/config.json b/scripts/project/config.json index 66a03a0..6e4cda6 100644 --- a/scripts/project/config.json +++ b/scripts/project/config.json @@ -48,21 +48,6 @@ "mounts": { "app": "/data/app/" } - }, - { - "documentation": { - "command": "generate-dashboard-login", - "description": "generate a login account for the jobs dashboard", - "arguments": [] - }, - "environment": { - "image": "ruby", - "interactive": true, - "script": "generate-dashboard-login/run.sh" - }, - "mounts": { - "app": "/project/" - } } ] -} \ No newline at end of file +} diff --git a/scripts/project/generate-dashboard-login/run.sh b/scripts/project/generate-dashboard-login/run.sh deleted file mode 100755 index 03f4aba..0000000 --- a/scripts/project/generate-dashboard-login/run.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env ruby -require 'bundler/inline' -require 'yaml' -require 'securerandom' -require 'date' - -$stdout.sync = true -print "installing dependencies..." -gemfile do - source 'https://rubygems.org' - gem 'bcrypt' -end -puts "done" - -salt = "" -begin - File.open("/project/docker-compose.override.yml") do |file| - config = YAML.load(file) - salt = config.dig("services", "dashboard-login", "environment", "MU_APPLICATION_SALT") - throw "invalid salt" unless salt - end -rescue - puts "Tried to locate login salt in docker-compose.override.yml, but couldn't find it." - puts "Please make sure a salt is configured:" - puts < -PREFIX people: -PREFIX accounts: -PREFIX dcterms: -PREFIX mu: -PREFIX ext: -PREFIX account: -PREFIX xsd: -INSERT DATA { - GRAPH { - people:#{person_uuid} a foaf:Person ; - foaf:name "#{account_name}"; - foaf:account accounts:#{account_uuid}; - mu:uuid "#{person_uuid}"; - dcterms:created "#{now}"^^xsd:datetime; - dcterms:modified "#{now}"^^xsd:datetime. - accounts:#{account_uuid} a foaf:OnlineAccount; - foaf:accountName "#{account_name}"; - mu:uuid "#{account_uuid}"; - account:password """#{hashed_password}"""; - account:salt "#{account_salt}"; - account:status ; - dcterms:created "#{now}"^^xsd:datetime; - ext:sessionRole "dashboard-user"; - dcterms:modified "#{now}"^^xsd:datetime. -}} -) - -timestamp = DateTime.now.strftime("%Y%m%d%H%M%L") -filename = "#{timestamp}-create-user-#{account_name.gsub(" ", "-")}.sparql" -File.write("/project/config/migrations/local/#{filename}", query) -puts "generated migration ./config/migrations/local/#{filename} for #{account_name.inspect} : #{password.inspect}" \ No newline at end of file