Skip to content
Snippets Groups Projects
Commit 408856b7 authored by Ossi Laine's avatar Ossi Laine
Browse files

How to create users manually

parent fa6a54e0
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,10 @@ service gunicorn restart
Install docker and docker-compose
Generate users and groups in deploy/config/mysql/data.sql
Password can be generated with generate_password.py -script
Go to deploy folder. Build containers and run them with:
```
docker-compose -f docker-compose.yml up -d --build
......
/* password:password */
INSERT INTO user VALUES(1,'admin',NULL,'pbkdf2:sha256:50000$6Cc6Mjmo$3fe413a88db1bacfc4d617f7c1547bd1ea4cbd6c5d675a58e78332201f6befc6');
/* password:password */
INSERT INTO user VALUES(2,'editor',NULL,'pbkdf2:sha256:50000$Rq2WwVVi$12335e8d02fa3f25ffd11ba9f02fd1db7ca2964c5eaa13ca179a02ee3f19a656');
INSERT INTO research_group(id, name, tag, description) VALUES(1, 'Human Emotion Systems', 'emotion', 'Welcome to the Human Emotion Systems -laboratory`s Onni-net laboratory! The experiments that are currently underway are listed below - you can participate for as many experiments you want.');
INSERT INTO research_group(id, name, tag, description) VALUES(2, 'Turku Eye-tracking', 'eyelabs', 'Welcome to the Turku Eyelabs -laboratory`s Onni-net laboratory! The experiments that are currently underway are listed below - you can participate for as many experiments you want.');
INSERT INTO user_in_group VALUES (1,1, 'admin');
INSERT INTO user_in_group VALUES (2,1, 'editor');
......@@ -197,10 +197,7 @@ ALTER TABLE experiment ADD COLUMN (embody_enabled BOOLEAN DEFAULT 0);
/* Set current answer type (embody/slider/etc..) so returning users are routed to correct question */
ALTER TABLE answer_set ADD COLUMN (answer_type VARCHAR(120));
INSERT INTO user VALUES(1,'admin',NULL,'pbkdf2:sha256:50000$6Cc6Mjmo$3fe413a88db1bacfc4d617f7c1547bd1ea4cbd6c5d675a58e78332201f6befc6');
/* eyelabs */
INSERT INTO user VALUES(2,'eyelabs',NULL,'pbkdf2:sha256:50000$sdBu3Rjm$7ab97c6d2686460b85a2a20517b7012c15ffb341ba3fef5b0f17ed8354fc38d9');
ALTER TABLE experiment ADD COLUMN (group_id INTEGER), ADD FOREIGN KEY(group_id) REFERENCES research_group(id);
CREATE TABLE research_group (
......@@ -211,9 +208,6 @@ CREATE TABLE research_group (
PRIMARY KEY (id)
);
INSERT INTO research_group(id, name, tag, description) VALUES(1, 'Human Emotion Systems', 'emotion', 'Welcome to the Human Emotion Systems -laboratory`s Onni-net laboratory! The experiments that are currently underway are listed below - you can participate for as many experiments you want.');
INSERT INTO research_group(id, name, tag, description) VALUES(2, 'Turku Eye-tracking', 'eyelabs', 'Welcome to the Turku Eyelabs -laboratory`s Onni-net laboratory! The experiments that are currently underway are listed below - you can participate for as many experiments you want.');
CREATE TABLE user_in_group (
idgroup INTEGER,
iduser INTEGER,
......@@ -222,8 +216,3 @@ CREATE TABLE user_in_group (
FOREIGN KEY(iduser) REFERENCES user (id)
);
INSERT INTO user_in_group VALUES (1,1, 'admin');
INSERT INTO user_in_group VALUES (2,1, 'admin');
ALTER TABLE experiment ADD COLUMN (group_id INTEGER), ADD FOREIGN KEY(group_id) REFERENCES research_group(id);
from werkzeug.security import generate_password_hash, check_password_hash
hash1 = 'pbkdf2:sha256:50000$6Cc6Mjmo$3fe413a88db1bacfc4d617f7c1547bd1ea4cbd6c5d675a58e78332201f6befc6'
hash2 = 'pbkdf2:sha256:50000$vQutOphQ$9f80b3ef2b5bc2f971a40febf0d964326386e12d1b90e0f6f5d1a235f6e8093d'
print(check_password_hash(hash1, 'password'))
print(check_password_hash(hash2, 'password'))
print(generate_password_hash('password'))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment