Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 128 lines (88 sloc) 3.675 kB
8c04942 Add README and LICENSE
Marc Lagrange authored
1 # Photon
2
3 Photon is a rails app to publish a blog and photo gallery
4
5 Blog part is simple, gallery part permit to have collection of albums.
6
7 TODO:
8
9 * EXIF parsing
10 * MAP for GPS position of pictures
11 * Tag support for blog and images
12 * Perhaps a Flickr import task
13
14 ## Deploying your own Photon instance
15
16 Assumming you:
17 * will use a dedicated user with RVM
18 * will use unicorn and nginx
19 * will use it under example.com
20
21 Prepare the user:
22
23 useradd -m -s /bin/bash example.com
24 su - example.com
25 # install RVM
26 curl -L get.rvm.io | bash -s stable
27 rvm install ruby-1.9.3
28 rvm use --default ruby-1.9.3
29 echo "export RAILS_ENV=production" >> ~/.bash_profile
30
31 Clone photon:
32
33 git clone git://github.com/rhaamo/photon.git
34
35 Setup photon:
36
37 cd photon
38 bundle install
39 cp config/database.yml.sample config/database.yml
40 # Edit config/database.yml as you wishes, it use by default an MySQL or sqlite3 database
41 rake db:create db:migrate
42 # Seeds the database
43 rake db:seed
44 # Precompile assets
45 rake assets:precompile
46 # Create temp dirs, or unicorn can't start (no pids, logs, sessions, sockets dirs by default)
47 rake tmp:create
48
49 Setup unicorn:
50
51 cd ~
52 cp photon/vendor/unicorn.rb unicorn.rb
53 vim unicorn.rb
54 # here you need to change config at the top to match your app user (here example.com)
55
56 Exit from the user 'example.com', and do the rest as 'root' or privileged user
57
58 Setup nginx:
59
60 cp /home/example.com/photon/vendor/example.com.conf /etc/nginx/conf.d/example.com.conf
61 vim /etc/nginx/conf.d/example.com.conf
62 # Edit to match your needs
63
64 Setup init script:
65
66 cp /home/example.com/photon/vendor/unicorn_example.com /etc/init.d/unicorn_example.com
67 vim /etc/init.d/unicorn_example.com
68 # Edit top script and variables to match your needs
69 chmod +x /etc/init.d/unicorn_example.com
70 chkconfig --add unicorn_example.com && chkconfig unicorn_example.com on # on redhat/centos to add at runlevel
71
72 User right fix:
73
74 # You will probably need this
75 chmod o+x /home/example.com
76 chown -R :nginx /home/example.com/photon/public # or www-data
77 # Basically all you need is that 'www-data' or 'nginx' user or group can traverse the home directory
78 # and pick stuff in the 'public' app folder.
79 # And also edit your /etc/nginx/nginx.conf config file to use
80 user nginx nginx;
81 # or www-data www-data;, else nginx will run uder user www-data or nginx and group nobody, and cannot pick static files or unicorn socket.
82
83 ## Updating
84
85 Updating is easy, assuming you have a setup like the deploying section you have to do:
86
87 Stop unicorn:
88
89 /etc/init.d/unicorn_example.com stop
90
91 Update app:
92
93 su - example.com
94 cd photon
95 git pull
96 bundle install
97 rake db:migrate
98 rake assets:clean assets:precompile
99 exit
100
101 Start unicorn:
102
103 /etc/init.d/unicorn_example.com start
104
6ee16bc Flickr import
Marc Lagrange authored
105 ## Flickr Import
106
107 There is a basic things to import all your Collections and Sets from Flickr to Photon, to use it start to get an API key from Flickr then edit 'flickr.rb' and add API key and API secret in it then run it.
108
109 Access the URL and paste the token to the terminal, you will get a personnal Token and Secret, you need to put the four things (API key, API secret, personnal key, personnal secret) in 'lib/tasks/flickr_import.rake' and then run:
110
111 rake flickr:clean # will entirely drop all collections, albums and existing images
112 rake flickr:import # will import stuff
113
114 Not managed:
115 * Tags
116 * Favorites
117 * Crashs
118
119
8c04942 Add README and LICENSE
Marc Lagrange authored
120 ## Contact
121
122 Contact me using Github or use the following addresse:
123
124 * rhaamo .at. leloop .dot. org
125
126 ## License
127
128 MIT License, see LICENSE file.
Something went wrong with that request. Please try again.