.
diff --git a/_scripts/migrate.rb b/_scripts/migrate.rb
deleted file mode 100755
index 283dbdf..0000000
--- a/_scripts/migrate.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env ruby
-
-require "rubygems"
-require "sqlite3"
-require "pp"
-require "date"
-require "reverse_markdown"
-require "fileutils"
-
-mg_db = SQLite3::Database.new "baby-mediagoblin/mediagoblin.db"
-yenu_db = SQLite3::Database.new "yenu_dev.db"
-data_dir = 'baby-mediagoblin/user_dev/media/public/media_entries'
-target_data_dir = '/home/aaron/workbench/yenu/data/to-process'
-
-# Read all images, comments, tags
-# Associate the image, build the hash, move to target
-
-mg_db.execute("SELECT id, title, created, description FROM core__media_entries ORDER BY created ASC") do |entry|
- entry_id, title, created, description = entry
- created = DateTime.parse(created).strftime('%F %T')
- description = ReverseMarkdown.convert(description)
- comments = mg_db.execute("SELECT user.username, c.created, c.content FROM core__media_comments AS c INNER JOIN core__users AS user ON user.id = c.author WHERE c.media_entry = "+entry_id.to_s+" ORDER BY c.created ASC")
- tags = mg_db.execute("SELECT name FROM core__media_tags WHERE media_entry = "+entry_id.to_s).flatten
-
- filepath = nil
- Dir.glob(data_dir + '/' + entry_id.to_s + '/*').each do |file|
- next if file =~ /.*(thumbnail|medium)\..*/
- filepath = file
- end
-
- yenu_db.execute("INSERT INTO images (hash, title, description, created_at)
- VALUES ('<"+entry_id.to_s+">', '"+SQLite3::Database.quote(title)+"', '"+SQLite3::Database.quote(description)+"', '"+created+"')")
- new_id = yenu_db.last_insert_row_id
-
- comments.each do |comment|
- username, created, content = comment
- created = DateTime.parse(created).strftime('%F %T')
- yenu_db.execute("INSERT INTO comments (image_id, author, comment, created_at)
- VALUES ('"+new_id.to_s+"', '"+username+"', '"+SQLite3::Database.quote(content)+"', '"+created+"')")
- end
-
- tags.each do |tag|
- yenu_db.execute('INSERT OR IGNORE INTO tags (tagname)
- VALUES ("'+tag+'")')
- tag_id = yenu_db.execute('SELECT id FROM tags WHERE tagname = "'+tag+'"')[0][0]
- yenu_db.execute('INSERT INTO image_tags (image_id, tag_id)
- VALUES ("'+new_id.to_s+'", "'+tag_id.to_s+'")')
- end
-
- if filepath and ['.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG'].include?(File.extname(filepath))
- new_filename = new_id.to_s + File.extname(filepath)
- puts "#{filepath} => #{new_filename}"
- FileUtils.cp(filepath, File.join(target_data_dir, new_filename))
- else
- puts "ERROR: File not imported: #{filepath}"
- end
-end
diff --git a/_scripts/migration.clj b/_scripts/migration.clj
deleted file mode 100644
index 1d8f69b..0000000
--- a/_scripts/migration.clj
+++ /dev/null
@@ -1,13 +0,0 @@
-(ns yenu.db.migration
- (:require [yenu.helpers.images :as image]
- [me.raynes.fs :as fs]
- [yenu.db.core :as db]))
-
-(defn migrate-image [image-path]
- (let [new-id (fs/base-name image-path true)
- hash (image/scale-image-and-save image-path)]
- (db/set-image-hash {:hash hash :id new-id})))
-
-(defn start-migration []
- (let [images (fs/list-dir (image/data-path "to-process"))]
- (run! migrate-image images)))
diff --git a/env/dev/resources/config.edn b/env/dev/resources/config.edn
index 1175fab..7fde9fc 100644
--- a/env/dev/resources/config.edn
+++ b/env/dev/resources/config.edn
@@ -1,5 +1,5 @@
{:dev true
- :port 3000
+ :port 80
:host "0.0.0.0"
:creator-password "creator"
:user-password "user"
diff --git a/env/prod/resources/config.edn b/env/prod/resources/config.edn
index 1a5d661..8f35411 100644
--- a/env/prod/resources/config.edn
+++ b/env/prod/resources/config.edn
@@ -1,7 +1,7 @@
{:production true
:creator-password "xxx"
:user-password "yyy"
- :port 3000
+ :port 80
:host "0.0.0.0"
:database-url "jdbc:sqlite:yenu.db"
diff --git a/website/index.html b/website/index.html
index beef790..e86c6c5 100644
--- a/website/index.html
+++ b/website/index.html
@@ -39,7 +39,8 @@
If you like docker, you can use docker-compose to boot up the application
and send it to the background
- $ docker-compose up -d
+ $ docker-compose build
+$ docker-compose up -d
Where is my data?
All your images are placed in the data/gallery/ directory, next to the