From 138528092a571e967dda58426bfcc1ded5b3e3ce Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 9 May 2020 09:28:12 +0200 Subject: [PATCH 1/6] Move CoC and Contributing guidelines to .github --- CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md | 0 CONTRIBUTING.md => .github/CONTRIBUTING.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md (100%) rename CONTRIBUTING.md => .github/CONTRIBUTING.md (100%) diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md From 957ab06a4c910c4fec1cdbecab9ee84bf9b6bd3f Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 9 May 2020 09:28:21 +0200 Subject: [PATCH 2/6] Remove TODO file --- TODO | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 TODO diff --git a/TODO b/TODO deleted file mode 100644 index 14d0438a..00000000 --- a/TODO +++ /dev/null @@ -1,42 +0,0 @@ -Not done: -[001| 0%] user blocking (prohibits blocked user from asking question to that person and seeing their answers) -[007| 20%] (?) keyboard shortcuts - |----- Open "Ask your followers" with Ctrl/Meta+M -[015| 0%] make a public accessible API (maybe even as an oauth provider?) -[016| 5%] WRYYYYte more specs -[022| 0%] recommended follows - |----- Solved with Discover (?) -[023| 0%] disabling group-questions -[024| 0%] disabling questions from certain users - -In Progress: -[003| 75%] file uploads (for now only avatars, file uploads for embedding images in questions MAYBE LATER) -[011| 75%] auto-posting to other services (twatter, fakelook) - -Finished: -[002|100%] asking modal (ask all followers/one person a question with a modal you can open over the navbar) -[004|100%] admin status page (like the one from justask2 in Python) -[005|100%] make the hamburger menu button glow or something if there are new questions in the inbox -[006|100%] privacy options (e.g. profile visible for members only, disable anonymous questions, opt-out from public timeline) -[008|100%] make email work! -[009|100%] a notification view or something -[013|100%] restructure questions (has_many :answers) for less redundancy in the DB when implementing #002 -[014|100%] generate questions if there are none in the inbox (probably make it as a gem) -[018|100%] that annoying "we use cookies" thing every website in the EU must? add -[019|100%] omniAuth (twatter, fakelook, goggles plus) for social networking elitists -[021|100%] deleting comments - |----- restructure comment design -[012|100%] (?) open source the entire thing – in late 2015 or 2016 maybe, after we got bought by fakelook. -[017|100%] write "terms of service" and a privacy policy. -[025|100%] answering options (sharing/nsfw/private) in inbox panels -[026|100%] profile headers -[027| 66%] moderation - |----- moderator user group √ - |----- moderation panel √ - |----- ability to report questions √ - -Needs rewrite: -[010|100%] locales (these can wait for now) - -Stalled: -[020| 0%] helper function for profile headings to resize on certain string length \ No newline at end of file From 40a10355e48e9977d3f1309dabd3cba63c0660a8 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 9 May 2020 09:28:35 +0200 Subject: [PATCH 3/6] Add codeowners file --- .github/CODEOWNERS | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..21ae0322 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,27 @@ +# Retrospring CODEOWNERS + +# General code ownership +* @nilsding @pixeldesu + +# Ruby/Backend related code +*.rb @nilsding + +# Frontend assets +*.coffee @pixeldesu +*.scss @pixeldesu + +# Frontend views +*.haml @pixeldesu + +# Public documents +/service-docs/ @pixeldesu + +# Localization +/config/locales/ @pixeldesu + +# Tests +/spec/ @nilsding + +# Docker setup related files +Dockerfile @pixeldesu +docker-compose.yml @pixeldesu \ No newline at end of file From 425d66e67a8a0b8e6130d82ef2e8d0c01d50a8d5 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 9 May 2020 09:29:05 +0200 Subject: [PATCH 4/6] Update README - Remove paragraph about shutdown - Adjust link to contributing file --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index ff811b59..d2565bfd 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,6 @@ This is the source code that powers Retrospring. This is a detached fork of [nilsding/justask](https://github.com/nilsding/justask), where we continue development. -Retrospring shut down on June 12, 2016, but it's somehow still alive. You're -welcome. - ## Installation You can find all the installation instructions needed for a local/production @@ -18,7 +15,7 @@ setup of Retrospring in the Guidelines for Pull Requests and general information about how you can help us improving Retrospring can be found -[here](https://github.com/Retrospring/retrospring/blob/master/CONTRIBUTING.md). +[here](https://github.com/Retrospring/retrospring/blob/master/.github/CONTRIBUTING.md). ## License From ccb8b47e6e6d30826d454dd82fcc3f88f12ba343 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 9 May 2020 10:16:30 +0200 Subject: [PATCH 5/6] Improve Docker setup --- .docker/entrypoint.sh | 8 ++++++++ .docker/ruby/Dockerfile | 38 +++++++++++++++++--------------------- docker-compose.yml | 9 ++++----- 3 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 .docker/entrypoint.sh diff --git a/.docker/entrypoint.sh b/.docker/entrypoint.sh new file mode 100644 index 00000000..eb40a5ea --- /dev/null +++ b/.docker/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +# Remove a potentially pre-existing server.pid for Rails. +rm -f /app/tmp/pids/server.pid + +# Then exec the container's main process (what's set as CMD in the Dockerfile). +exec "$@" \ No newline at end of file diff --git a/.docker/ruby/Dockerfile b/.docker/ruby/Dockerfile index 0b7cdad3..a6775f9c 100644 --- a/.docker/ruby/Dockerfile +++ b/.docker/ruby/Dockerfile @@ -1,30 +1,26 @@ FROM ruby:2.7 -RUN apt-get update -qq && apt-get install -y build-essential +RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - -# for postgres -RUN apt-get install -y libpq-dev +RUN apt-get update -qq && \ + apt-get install -y --no-install-recommends build-essential \ + libpq-dev postgresql-client \ + libxml2-dev libxslt1-dev \ + libmagickwand-dev imagemagick \ + nodejs -# for nokogiri -RUN apt-get install -y libxml2-dev libxslt1-dev +RUN rm -rf /var/lib/apt/lists/* -# for images -RUN apt-get install -y libmagickwand-dev imagemagick +RUN mkdir /app +WORKDIR /app -# for a JS runtime -RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - -RUN apt-get install -y nodejs - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - postgresql-client \ - && rm -rf /var/lib/apt/lists/* - -ENV APP_HOME /app -RUN mkdir $APP_HOME -WORKDIR $APP_HOME - -ADD Gemfile* $APP_HOME/ +ADD Gemfile* /app/ RUN bundle install +COPY . /app +COPY .docker/entrypoint.sh /usr/bin/ +RUN chmod +x /usr/bin/entrypoint.sh +ENTRYPOINT ["entrypoint.sh"] EXPOSE 3000 + +CMD ["rails", "server", "-b", "0.0.0.0"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 659d7afe..85e5d8b1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,12 +2,11 @@ version: "3.7" services: web: - build: - context: . + build: + context: . dockerfile: .docker/ruby/Dockerfile - command: - ruby bin/rails server --port 3000 --binding 0.0.0.0 - links: + command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" + depends_on: - postgres - redis environment: From 4c9574795910eba14cbf022cb3112ff6ea1a9068 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 9 May 2020 10:36:00 +0200 Subject: [PATCH 6/6] Combine RUN commands in Dockerfile where possible --- .docker/ruby/Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.docker/ruby/Dockerfile b/.docker/ruby/Dockerfile index a6775f9c..88cf8de1 100644 --- a/.docker/ruby/Dockerfile +++ b/.docker/ruby/Dockerfile @@ -2,14 +2,13 @@ FROM ruby:2.7 RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - -RUN apt-get update -qq && \ - apt-get install -y --no-install-recommends build-essential \ +RUN apt-get update -qq \ + && apt-get install -y --no-install-recommends build-essential \ libpq-dev postgresql-client \ libxml2-dev libxslt1-dev \ libmagickwand-dev imagemagick \ - nodejs - -RUN rm -rf /var/lib/apt/lists/* + nodejs \ + && rm -rf /var/lib/apt/lists/* RUN mkdir /app WORKDIR /app