wardrobe-organizer

command module
v0.0.0-...-b49271d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2018 License: MIT Imports: 2 Imported by: 0

README

Wardrobe Organizer

Build Status Go Report Card

Web-based open source wardrobe organizer created while teaching Go programming.

Run locally

Set environment variables

    export WARDROBE_SESSIONSECRET=somerandomvalue
    export WARDROBE_PORT=8080
    export WARDROBE_TEMPLATEPATH=template/*.html

Install PostgresSQL, for example with brew:

brew install postgresql

Create database and user:

createdb wardrobe
createuser wardrobe

Install "migrate" package

go install github.com/wallester/migrate

Run migrations

make migrate

Run the app

make run

Deployment

Configure server

Install postgresql and nginx

Create deployment user

Create user "deploy" on server

Create deployment folder

Log into remote server as user "deploy" and create a folder called "deploy"

Configure nginx

For example, edit /etc/nginx/sites-enabled/default to look like this

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html;

        index index.html index.htm index.nginx-debian.html;

        server_name wardrobe-organizer.com;

        location / {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                proxy_set_header X-NginX-Proxy true;
                proxy_pass http://localhost:9000/;
        }
}

and restart nginx

Configure systemctl

For example, edit /etc/systemd/system/wardrobe.service to look like this

[Unit]
Description=wardrobe

[Service]
Environment=FOO=bar
WorkingDirectory=/home/deploy/wardrobe
ExecStart=/home/deploy/wardrobe/wardrobe-linux
Restart=always

[Install]
WantedBy=multi-user.target

Allow user "deploy" to restart the service

For example, run visudo and append following:

Cmnd_Alias MYAPP_CMNDS = /bin/systemctl start wardrobe, /bin/systemctl stop wardrobe
deploy ALL=(ALL) NOPASSWD: MYAPP_CMNDS

Deploy

Execute on your local machine (not on server!)

make deploy

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL