diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..83654a4 --- /dev/null +++ b/.env.staging @@ -0,0 +1,31 @@ +# This file is actually loaded by Dotenv when RAILS_ENV=development + +RACK_ENV=development +RAILS_ENV=development + +APP_SECRET=fe837ea72667ec3d8ecb94cfba1a1bba + +DEPLOY_PATH=/var/www +FILES_PATH=/var/www/public/files + +PUMA_WORKERS=0 +PUMA_MIN_THREADS=1 +PUMA_MAX_THREADS=16 +PUMA_PORT=4000 + +# Set this to higher to enable debugging +PUMA_TIMEOUT=30 + +MYSQL_HOST=db +MYSQL_DATABASE=ensl_staging +MYSQL_USERNAME=ensl +MYSQL_PASSWORD=ensl +MYSQL_ROOT_PASSWORD=ensl +MYSQL_CONNECTION_POOL=32 + +NEW_RELIC_APP_NAME=ENSL +NEW_RELIC_LICENSE_KEY= + +GOOGLE_API_KEY= +GOOGLE_CALENDAR_ID= +GOOGLE_CALENDAR=enabled \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2b9f7c7..3d0e719 100644 --- a/.gitignore +++ b/.gitignore @@ -21,9 +21,8 @@ db_data/* db/data/ !db/data/.placeholder db/initdb.d/* -!db/initdb.d/*setup.sql !db/initdb.d/.placeholder -*.sql* +!db/initdb.d/*setup*.sql # ignore dkim keys dkim diff --git a/db/initdb.d/ensl.db.setup.sql b/db/initdb.d/ensl.db.setup.sql new file mode 100644 index 0000000..edcbdb0 --- /dev/null +++ b/db/initdb.d/ensl.db.setup.sql @@ -0,0 +1,6 @@ +-- FIXME: this should be somewhere else probably +CREATE DATABASE ensl_test; +GRANT ALL PRIVILEGES ON ensl_test.* TO 'ensl'@'%' WITH GRANT OPTION; + +CREATE DATABASE ensl_staging; +GRANT ALL PRIVILEGES ON ensl_staging.* TO 'ensl'@'%' WITH GRANT OPTION; \ No newline at end of file diff --git a/db/scripts/fix_utf_conversion_errors.sql b/db/scripts/fix_utf_conversion_errors.sql new file mode 100644 index 0000000..3f8140e --- /dev/null +++ b/db/scripts/fix_utf_conversion_errors.sql @@ -0,0 +1,140 @@ +update `articles` set `text` = replace(`text` ,'É','É'); +update `articles` set `text` = replace(`text` ,'“','"'); +update `articles` set `text` = replace(`text` ,'â€','"'); +update `articles` set `text` = replace(`text` ,'Ç','Ç'); +update `articles` set `text` = replace(`text` ,'Ã','Ã'); +update `articles` set `text` = replace(`text` ,'Ã','À'); +update `articles` set `text` = replace(`text` ,'ú','ú'); +update `articles` set `text` = replace(`text` ,'•','-'); +update `articles` set `text` = replace(`text` ,'Ø','Ø'); +update `articles` set `text` = replace(`text` ,'õ','õ'); +update `articles` set `text` = replace(`text` ,'í','í'); +update `articles` set `text` = replace(`text` ,'â','â'); +update `articles` set `text` = replace(`text` ,'ã','ã'); +update `articles` set `text` = replace(`text` ,'ê','ê'); +update `articles` set `text` = replace(`text` ,'á','á'); +update `articles` set `text` = replace(`text` ,'é','é'); +update `articles` set `text` = replace(`text` ,'ó','ó'); +update `articles` set `text` = replace(`text` ,'–','–'); +update `articles` set `text` = replace(`text` ,'ç','ç'); +update `articles` set `text` = replace(`text` ,'ª','ª'); +update `articles` set `text` = replace(`text` ,'º','º'); +update `articles` set `text` = replace(`text` ,'à ','à'); +update `articles` set `text` = replace(`text` ,'ç','ç'); +update `articles` set `text` = replace(`text` ,'ã','ã'); +update `articles` set `text` = replace(`text` ,'á','á'); +update `articles` set `text` = replace(`text` ,'â','â'); +update `articles` set `text` = replace(`text` ,'é','é'); +update `articles` set `text` = replace(`text` ,'í','í'); +update `articles` set `text` = replace(`text` ,'õ','õ'); +update `articles` set `text` = replace(`text` ,'ú','ú'); +update `articles` set `text` = replace(`text` ,'ç','ç'); +update `articles` set `text` = replace(`text` ,'Á','Á'); +update `articles` set `text` = replace(`text` ,'Â','Â'); +update `articles` set `text` = replace(`text` ,'É','É'); +update `articles` set `text` = replace(`text` ,'Í','Í'); +update `articles` set `text` = replace(`text` ,'Õ','Õ'); +update `articles` set `text` = replace(`text` ,'Ú','Ú'); +update `articles` set `text` = replace(`text` ,'Ç','Ç'); +update `articles` set `text` = replace(`text` ,'Ã','Ã'); +update `articles` set `text` = replace(`text` ,'À','À'); +update `articles` set `text` = replace(`text` ,'Ê','Ê'); +update `articles` set `text` = replace(`text` ,'Ó','Ó'); +update `articles` set `text` = replace(`text` ,'Ô','Ô'); +update `articles` set `text` = replace(`text` ,'Ü','Ü'); +update `articles` set `text` = replace(`text` ,'ã','ã'); +update `articles` set `text` = replace(`text` ,'à','à'); +update `articles` set `text` = replace(`text` ,'ê','ê'); +update `articles` set `text` = replace(`text` ,'ó','ó'); +update `articles` set `text` = replace(`text` ,'ô','ô'); +update `articles` set `text` = replace(`text` ,'ü','ü'); +update `articles` set `text` = replace(`text` ,'&','&'); +update `articles` set `text` = replace(`text` ,'>','>'); +update `articles` set `text` = replace(`text` ,'<','<'); +update `articles` set `text` = replace(`text` ,'ˆ','ˆ'); +update `articles` set `text` = replace(`text` ,'˜','˜'); +update `articles` set `text` = replace(`text` ,'¨','¨'); +update `articles` set `text` = replace(`text` ,'&cute;','´'); +update `articles` set `text` = replace(`text` ,'¸','¸'); +update `articles` set `text` = replace(`text` ,'"','"'); +update `articles` set `text` = replace(`text` ,'“','“'); +update `articles` set `text` = replace(`text` ,'”','”'); +update `articles` set `text` = replace(`text` ,'‘','‘'); +update `articles` set `text` = replace(`text` ,'’','’'); +update `articles` set `text` = replace(`text` ,'‹','‹'); +update `articles` set `text` = replace(`text` ,'›','›'); +update `articles` set `text` = replace(`text` ,'«','«'); +update `articles` set `text` = replace(`text` ,'»','»'); +update `articles` set `text` = replace(`text` ,'º','º'); +update `articles` set `text` = replace(`text` ,'ª','ª'); +update `articles` set `text` = replace(`text` ,'–','–'); +update `articles` set `text` = replace(`text` ,'—','—'); +update `articles` set `text` = replace(`text` ,'¯','¯'); +update `articles` set `text` = replace(`text` ,'…','…'); +update `articles` set `text` = replace(`text` ,'¦','¦'); +update `articles` set `text` = replace(`text` ,'•','•'); +update `articles` set `text` = replace(`text` ,'¶','¶'); +update `articles` set `text` = replace(`text` ,'§','§'); +update `articles` set `text` = replace(`text` ,'¹','¹'); +update `articles` set `text` = replace(`text` ,'²','²'); +update `articles` set `text` = replace(`text` ,'³','³'); +update `articles` set `text` = replace(`text` ,'½','½'); +update `articles` set `text` = replace(`text` ,'¼','¼'); +update `articles` set `text` = replace(`text` ,'¾','¾'); +update `articles` set `text` = replace(`text` ,'⅛','⅛'); +update `articles` set `text` = replace(`text` ,'⅜','⅜'); +update `articles` set `text` = replace(`text` ,'⅝','⅝'); +update `articles` set `text` = replace(`text` ,'⅞','⅞'); +update `articles` set `text` = replace(`text` ,'>','>'); +update `articles` set `text` = replace(`text` ,'<','<'); +update `articles` set `text` = replace(`text` ,'±','±'); +update `articles` set `text` = replace(`text` ,'−','−'); +update `articles` set `text` = replace(`text` ,'×','×'); +update `articles` set `text` = replace(`text` ,'÷','÷'); +update `articles` set `text` = replace(`text` ,'∗','∗'); +update `articles` set `text` = replace(`text` ,'⁄','⁄'); +update `articles` set `text` = replace(`text` ,'‰','‰'); +update `articles` set `text` = replace(`text` ,'∫','∫'); +update `articles` set `text` = replace(`text` ,'∑','∑'); +update `articles` set `text` = replace(`text` ,'∏','∏'); +update `articles` set `text` = replace(`text` ,'√','√'); +update `articles` set `text` = replace(`text` ,'∞','∞'); +update `articles` set `text` = replace(`text` ,'≈','≈'); +update `articles` set `text` = replace(`text` ,'≅','≅'); +update `articles` set `text` = replace(`text` ,'∝','∝'); +update `articles` set `text` = replace(`text` ,'≡','≡'); +update `articles` set `text` = replace(`text` ,'≠','≠'); +update `articles` set `text` = replace(`text` ,'≤','≤'); +update `articles` set `text` = replace(`text` ,'≥','≥'); +update `articles` set `text` = replace(`text` ,'∴','∴'); +update `articles` set `text` = replace(`text` ,'⋅','⋅'); +update `articles` set `text` = replace(`text` ,'·','·'); +update `articles` set `text` = replace(`text` ,'∂','∂'); +update `articles` set `text` = replace(`text` ,'ℑ','ℑ'); +update `articles` set `text` = replace(`text` ,'ℜ','ℜ'); +update `articles` set `text` = replace(`text` ,'′','′'); +update `articles` set `text` = replace(`text` ,'″','″'); +update `articles` set `text` = replace(`text` ,'°','°'); +update `articles` set `text` = replace(`text` ,'∠','∠'); +update `articles` set `text` = replace(`text` ,'⊥','⊥'); +update `articles` set `text` = replace(`text` ,'∇','∇'); +update `articles` set `text` = replace(`text` ,'⊕','⊕'); +update `articles` set `text` = replace(`text` ,'⊗','⊗'); +update `articles` set `text` = replace(`text` ,'ℵ','ℵ'); +update `articles` set `text` = replace(`text` ,'ø','ø'); +update `articles` set `text` = replace(`text` ,'Ø','Ø'); +update `articles` set `text` = replace(`text` ,'∈','∈'); +update `articles` set `text` = replace(`text` ,'∉','∉'); +update `articles` set `text` = replace(`text` ,'∩','∩'); +update `articles` set `text` = replace(`text` ,'∪','∪'); +update `articles` set `text` = replace(`text` ,'⊂','⊂'); +update `articles` set `text` = replace(`text` ,'⊃','⊃'); +update `articles` set `text` = replace(`text` ,'⊆','⊆'); +update `articles` set `text` = replace(`text` ,'⊇','⊇'); +update `articles` set `text` = replace(`text` ,'∃','∃'); +update `articles` set `text` = replace(`text` ,'∀','∀'); +update `articles` set `text` = replace(`text` ,'∅','∅'); +update `articles` set `text` = replace(`text` ,'¬','¬'); +update `articles` set `text` = replace(`text` ,'∧','∧'); +update `articles` set `text` = replace(`text` ,'∨','∨'); +update `articles` set `text` = replace(`text` ,'↵','↵'); \ No newline at end of file