2015-11-23 00:26:51 +00:00
|
|
|
# transmet ![thrree eyed smiley face](https://raw.githubusercontent.com/dballard/transmet/master/favicon.ico)
|
2015-05-12 15:32:47 +00:00
|
|
|
Quick fast personal link store that exports to a HTML template for quick posting to a blog
|
|
|
|
|
|
|
|
Usecase: storing interesting news articles you come across during a week with at the moment notes/commentary and
|
|
|
|
then exporting in a currated organized format for immediate blog posting at your convience
|
|
|
|
|
|
|
|
## Note
|
|
|
|
|
2015-11-20 21:34:12 +00:00
|
|
|
As this is a personal project, some of the niceities like user managment
|
|
|
|
are left to be done in SQL. I needed a tool to store links and export
|
2015-05-12 15:32:47 +00:00
|
|
|
to html so that's what I've focused on.
|
2015-05-02 17:13:33 +00:00
|
|
|
|
2015-05-02 17:14:31 +00:00
|
|
|
# Install
|
2015-05-02 17:13:33 +00:00
|
|
|
|
2015-05-16 20:04:46 +00:00
|
|
|
go get github.com/dballard/transmet
|
|
|
|
|
2015-05-02 17:13:33 +00:00
|
|
|
## DB setup
|
2015-05-02 17:14:31 +00:00
|
|
|
|
2015-05-16 20:04:46 +00:00
|
|
|
sudo apt-get install postgres postgresql-contrib
|
2015-05-02 17:14:31 +00:00
|
|
|
|
2015-12-25 17:07:03 +00:00
|
|
|
Setup postgres to handle a local connection for transmet in pg_hba.conf
|
2015-08-16 19:09:48 +00:00
|
|
|
either:
|
|
|
|
'''host transmet transmet 127.0.0.1/32 md5'''
|
|
|
|
or a more liberal:
|
|
|
|
'''host all all 127.0.0.1/32 md5 '''
|
2015-12-25 17:07:03 +00:00
|
|
|
and do the same for
|
|
|
|
'''host all all ::1/128 md5'''
|
|
|
|
ipv6
|
2015-08-16 19:09:48 +00:00
|
|
|
|
|
|
|
create ssl certs and put them somewhere
|
|
|
|
|
|
|
|
enable SSL in postgresql.conf
|
|
|
|
'''
|
|
|
|
ssl = true
|
|
|
|
ssl_cert_file = 'WHER_YOU_PUT/server.crt'
|
|
|
|
ssl_key_file = 'WHERE_YOU_PUT/server.key'
|
|
|
|
'''
|
|
|
|
|
2015-05-16 20:04:46 +00:00
|
|
|
Create postgress DB and user
|
2015-05-12 05:06:28 +00:00
|
|
|
|
2015-08-16 19:09:48 +00:00
|
|
|
'''sh
|
2015-12-25 17:07:03 +00:00
|
|
|
sudo -u postgres --or-- sudo su - postgres
|
2015-08-16 19:09:48 +00:00
|
|
|
createuser -S -P -E transmet
|
|
|
|
createdb --owner transmet --encoding utf8 transmet
|
|
|
|
psql
|
|
|
|
\c transmet
|
2015-05-02 17:13:33 +00:00
|
|
|
CREATE EXTENSION pgcrypto;
|
2015-08-16 19:09:48 +00:00
|
|
|
'''
|
2015-05-02 17:13:33 +00:00
|
|
|
|
2015-05-16 20:04:46 +00:00
|
|
|
put DB details in
|
|
|
|
db/dbconf.yml (copied from db/dbconf.EXAMPLE)
|
|
|
|
config/prod.json (copied from config/local.json)
|
2015-05-02 17:14:31 +00:00
|
|
|
|
2015-05-16 20:04:46 +00:00
|
|
|
go get bitbucket.org/liamstask/goose/cmd/goose
|
2015-05-12 15:32:47 +00:00
|
|
|
|
2015-05-02 17:13:33 +00:00
|
|
|
goose up
|
|
|
|
|
2015-05-16 20:04:46 +00:00
|
|
|
## Run
|
|
|
|
|
|
|
|
Assumed GOPATH=/opt/go
|
2015-05-02 17:14:31 +00:00
|
|
|
|
2015-05-14 14:20:30 +00:00
|
|
|
edit transmet.conf to point to correct location
|
|
|
|
|
2015-05-02 17:13:33 +00:00
|
|
|
sudo cp transmet.conf /etc/init
|
2015-05-02 17:14:31 +00:00
|
|
|
|
2015-11-20 21:34:12 +00:00
|
|
|
./gen-csrf.sh
|
|
|
|
|
2015-05-02 17:13:33 +00:00
|
|
|
sudo service transmet start
|
2015-05-12 15:32:47 +00:00
|
|
|
|
|
|
|
## Setup environment
|
|
|
|
|
|
|
|
### Adding a user
|
|
|
|
|
|
|
|
INSERT INTO users (username, password) VALUES('USERNAME', crypt('PASSWORD', gen_salt('bf')));
|