CypherSetup: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
[[Category:CypherTech]] | [[Category:CypherTech]] | ||
= Host Setup = | |||
<syntaxhighlight lang="bash"> | |||
mkdir -p /opt/cypherpunk/cypherpunk_reddit | |||
cd /opt/cypherpunk/cypherpunk_reddit | |||
ln -s /home/bob/projects/cypherpunk/cypherpunk_reddit/html ./ | |||
ln -s /home/bob/projects/cypherpunk/cypherpunk_reddit/archive ./ | |||
ln -s /home/bob/projects/cypherpunk/cypherpunk_reddit/config ./ | |||
</syntaxhighlight> | |||
= Python Venv = | |||
<syntaxhighlight lang="bash"> | |||
python -m venv .venv | |||
./.venv/bin/activate | |||
pip install mysql-connector-python | |||
pip install jinja2 flask | |||
pip install secp256k1 | |||
</syntaxhighlight> | |||
= MariaDB = | |||
<syntaxhighlight lang="bash"> | |||
apt install mariadb-server mariadb-client | |||
sudo mariadb | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="sql"> | |||
create user 'cypunk'@'localhost' identified by 'password'; | |||
grant all on cypunk.* to 'cypunk'@'localhost'; | |||
flush privileges; | |||
exit; | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="sql"> | |||
create database if not exists cypunk; | |||
-- drop table if exists cypunk.user; | |||
create table if not exists cypunk.user ( | |||
id int not null primary key auto_increment, | |||
username varchar(128) not null unique key, | |||
salty_hash varchar(256) not null | |||
); | |||
-- drop table if exists cypunk.nostr_user; | |||
create table if not exists cypunk.nostr_user ( | |||
id int not null primary key auto_increment, | |||
user_id int not null, | |||
privhex varchar(256) not null | |||
); | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="sql"> | |||
insert into cypunk.user ( username, salty_hash ) | |||
values ('test1', 'saltyhash'), | |||
('test2', 'anotherhash') | |||
; | |||
</syntaxhighlight> | |||
= Old Version = | |||
= Host Setup = | = Host Setup = | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> |
Revision as of 20:18, 17 December 2023
Host Setup
mkdir -p /opt/cypherpunk/cypherpunk_reddit
cd /opt/cypherpunk/cypherpunk_reddit
ln -s /home/bob/projects/cypherpunk/cypherpunk_reddit/html ./
ln -s /home/bob/projects/cypherpunk/cypherpunk_reddit/archive ./
ln -s /home/bob/projects/cypherpunk/cypherpunk_reddit/config ./
Python Venv
python -m venv .venv
./.venv/bin/activate
pip install mysql-connector-python
pip install jinja2 flask
pip install secp256k1
MariaDB
apt install mariadb-server mariadb-client
sudo mariadb
create user 'cypunk'@'localhost' identified by 'password';
grant all on cypunk.* to 'cypunk'@'localhost';
flush privileges;
exit;
create database if not exists cypunk;
-- drop table if exists cypunk.user;
create table if not exists cypunk.user (
id int not null primary key auto_increment,
username varchar(128) not null unique key,
salty_hash varchar(256) not null
);
-- drop table if exists cypunk.nostr_user;
create table if not exists cypunk.nostr_user (
id int not null primary key auto_increment,
user_id int not null,
privhex varchar(256) not null
);
insert into cypunk.user ( username, salty_hash )
values ('test1', 'saltyhash'),
('test2', 'anotherhash')
;
Old Version
Host Setup
mkdir -p /opt/cypherpunk/cypherpunk_reddit
cd /opt/cypherpunk/cypherpunk_reddit
ln -s /home/bob/projects/cypherpunk/cypherpunk_reddit/html ./
ln -s /home/bob/projects/cypherpunk/cypherpunk_reddit/archive ./
ln -s /home/bob/projects/cypherpunk/cypherpunk_reddit/config ./
Python Venv
python -m venv .venv
./.venv/bin/activate
pip install mysql-connector-python
pip install jinja2 flask
pip install secp256k1
MariaDB
apt install mariadb-server mariadb-client
sudo mariadb
create user 'cypunk'@'localhost' identified by 'password';
grant all on cypunk.* to 'cypunk'@'localhost';
flush privileges;
exit;
create database if not exists cypunk;
-- drop table if exists cypunk.user;
create table if not exists cypunk.user (
id int not null primary key auto_increment,
username varchar(128) not null unique key,
salty_hash varchar(256) not null
);
-- drop table if exists cypunk.nostr_user;
create table if not exists cypunk.nostr_user (
id int not null primary key auto_increment,
user_id int not null,
privhex varchar(256) not null
);
insert into cypunk.user ( username, salty_hash )
values ('test1', 'saltyhash'),
('test2', 'anotherhash')
;