diff --git a/README.md b/README.md index e5fc7bbf..b38dd81b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ vagrant up --provision ``` vagrant ssh cd /vagrant -bundle exec rackup +bundle exec rackup -o 0.0.0.0 ``` Now you can access the running site from your browser: http://127.0.0.1:9292 diff --git a/Vagrantfile b/Vagrantfile index 59a70b4d..a6356b83 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,4 +9,4 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vb.customize ['modifyvm', :id, '--memory', '1536'] vb.name = 'neocities' end -end \ No newline at end of file +end diff --git a/app/create.rb b/app/create.rb index b3f0d3d8..c2c8d264 100644 --- a/app/create.rb +++ b/app/create.rb @@ -84,6 +84,7 @@ post '/create' do return {result: 'error'}.to_json end + @site.email_confirmed = true if self.class.development? @site.save session[:captcha_valid] = nil diff --git a/config.yml.template b/config.yml.template index 0238d383..0ece0ae9 100644 --- a/config.yml.template +++ b/config.yml.template @@ -1,9 +1,9 @@ development: - database: 'postgres://neocities@localhost/neocities' + database: 'postgres://localhost/neocities' database_pool: 1 session_secret: "SECRET GOES HERE" - recaptcha_public_key: "ENTER PUBLIC KEY HERE" - recaptcha_private_key: "ENTER PRIVATE KEY HERE" + recaptcha_public_key: "6LdSMScTAAAAAADhP4IDb5s_EN1qMmvNmrUXReE-" + recaptcha_private_key: "6LdSMScTAAAAAIZAvP_W9d8fMsVT3iBX5wCwGvqV" sidekiq_user: "ENTER USER HERE" sidekiq_pass: "ENTER PASS HERE" stripe_publishable_key: "ENTER KEY HERE" @@ -18,7 +18,7 @@ development: letsencrypt_key: ./tests/files/letsencrypt.key letsencrypt_endpoint: https://acme-staging.api.letsencrypt.org/ test: - database: 'postgres://neocities@localhost/neocities_test' + database: 'postgres://localhost/neocities_test' database_pool: 1 session_secret: "SECRET GOES HERE" recaptcha_public_key: "ENTER PUBLIC KEY HERE" @@ -34,4 +34,4 @@ test: paypal_api_password: ing paypal_api_signature: tonz letsencrypt_key: ./tests/files/letsencrypt.key - letsencrypt_endpoint: https://acme-staging.api.letsencrypt.org/ \ No newline at end of file + letsencrypt_endpoint: https://acme-staging.api.letsencrypt.org/ diff --git a/models/site.rb b/models/site.rb index b4852529..d0b39816 100644 --- a/models/site.rb +++ b/models/site.rb @@ -78,7 +78,6 @@ class Site < Sequel::Model EMPTY_FILE_HASH = Digest::SHA1.hexdigest '' PHISHING_FORM_REGEX = /www.formbuddy.com\/cgi-bin\/form.pl/i - SPAM_MATCH_REGEX = ENV['RACK_ENV'] == 'test' ? /pillz/ : /#{$config['spam_smart_filter'].join('|')}/i EMAIL_SANITY_REGEX = /.+@.+\..+/i EDITABLE_FILE_EXT = /#{VALID_EDITABLE_EXTENSIONS.join('|')}/i BANNED_TIME = 2592000 # 30 days in seconds diff --git a/vagrant/development.sh b/vagrant/development.sh index 30061fc4..48b79513 100644 --- a/vagrant/development.sh +++ b/vagrant/development.sh @@ -10,4 +10,10 @@ ufw allow 9292 sudo su postgres -c "createuser -d vagrant" sudo su vagrant -c "createdb neocities" -sudo su vagrant -c "createdb neocities_test" \ No newline at end of file +sudo su vagrant -c "createdb neocities_test" + +sudo sh -c 'echo "local all postgres trust" > /etc/postgresql/9.3/main/pg_hba.conf' +sudo sh -c 'echo "local all all trust" >> /etc/postgresql/9.3/main/pg_hba.conf' +sudo sh -c 'echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/9.3/main/pg_hba.conf' +sudo sh -c 'echo "host all all ::1/128 trust" >> /etc/postgresql/9.3/main/pg_hba.conf' +sudo service postgresql restart diff --git a/vagrant/ruby.sh b/vagrant/ruby.sh index 853c0120..d010b6ae 100644 --- a/vagrant/ruby.sh +++ b/vagrant/ruby.sh @@ -3,5 +3,5 @@ apt-get -y install python-software-properties apt-add-repository -y ppa:brightbox/ruby-ng apt-get -y update -apt-get -y install ruby2.2 ruby2.2-dev -gem install bundler --no-rdoc --no-ri \ No newline at end of file +apt-get -y install ruby2.3 ruby2.3-dev +gem install bundler --no-rdoc --no-ri