From 0bd08b1169ebb17dcd4c3e3977f7e682f4f58c8e Mon Sep 17 00:00:00 2001 From: Kouhai Date: Sun, 6 Nov 2022 13:32:33 -0800 Subject: [PATCH 1/7] quick status hover hack --- .../glitch/styles/components/status.scss | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss index 4fb4fcc451..5a4d738c38 100644 --- a/app/javascript/flavours/glitch/styles/components/status.scss +++ b/app/javascript/flavours/glitch/styles/components/status.scss @@ -293,23 +293,28 @@ } } + +@mixin focusable { + outline: 0; + background: lighten($ui-base-color, 4%); + + &.status.status-direct { + background: lighten($ui-base-color, 12%); + + &.muted { + background: transparent; + } + } + + .detailed-status, + .detailed-status__action-bar { + background: lighten($ui-base-color, 8%); + } +} .focusable { - &:focus { - outline: 0; - background: lighten($ui-base-color, 4%); - - &.status.status-direct { - background: lighten($ui-base-color, 12%); - - &.muted { - background: transparent; - } - } - - .detailed-status, - .detailed-status__action-bar { - background: lighten($ui-base-color, 8%); - } + &:focus, + &:hover { + @include focusable; } } -- 2.41.0 From dec67bc50e957011416355f62576ddc90fd7bf7b Mon Sep 17 00:00:00 2001 From: Kouhai Date: Fri, 25 Nov 2022 22:17:17 -0600 Subject: [PATCH 2/7] temporarily remove "Get the app" link" --- app/javascript/mastodon/features/ui/components/link_footer.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/javascript/mastodon/features/ui/components/link_footer.js b/app/javascript/mastodon/features/ui/components/link_footer.js index 2b83d6378f..53d69656d2 100644 --- a/app/javascript/mastodon/features/ui/components/link_footer.js +++ b/app/javascript/mastodon/features/ui/components/link_footer.js @@ -79,8 +79,6 @@ class LinkFooter extends React.PureComponent { {' '} {' · '} - - {' · '} {' · '} -- 2.41.0 From c762da600aa3a1295ea7ae6207e088c2d0b0eeb3 Mon Sep 17 00:00:00 2001 From: Kouhai Date: Sun, 27 Nov 2022 22:29:30 -0600 Subject: [PATCH 3/7] update dockerignore --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index fedbea236d..42cd560cae 100644 --- a/.dockerignore +++ b/.dockerignore @@ -19,3 +19,4 @@ postgres14 redis elasticsearch chart +data -- 2.41.0 From 051f883fbf2e82ffca68b40766fe2f1cc5be0b5e Mon Sep 17 00:00:00 2001 From: Kouhai Date: Sun, 27 Nov 2022 22:58:04 -0600 Subject: [PATCH 4/7] update browserslist to remove unnecessary "not IE 11" --- .browserslistrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.browserslistrc b/.browserslistrc index 54dd3aaf34..543ef47010 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -1,6 +1,5 @@ [production] defaults -not IE 11 not dead [development] -- 2.41.0 From 8a10baa6760d44d06eddf02bd81bcb3d92c8b32b Mon Sep 17 00:00:00 2001 From: Kouhai Date: Sun, 27 Nov 2022 23:43:56 -0600 Subject: [PATCH 5/7] update default repository/source metadata --- lib/mastodon/version.rb | 13 +++++++++---- spec/presenters/instance_presenter_spec.rb | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index 5bdc88d50b..e63e37c38a 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -33,11 +33,11 @@ module Mastodon end def repository - ENV.fetch('GITHUB_REPOSITORY', 'glitch-soc/mastodon') + ENV.fetch('GIT_REPOSITORY', false) || ENV.fetch('GITHUB_REPOSITORY', false) || 'treehouse/mastodon' end def source_base_url - ENV.fetch('SOURCE_BASE_URL', "https://github.com/#{repository}") + ENV.fetch('SOURCE_BASE_URL', "https://gitea.treehouse.systems/#{repository}") end # specify git tag or commit hash here @@ -46,8 +46,13 @@ module Mastodon end def source_url - if source_tag - "#{source_base_url}/tree/#{source_tag}" + if source_tag && source_base_url =~ /gitea/ + suffix = if !str[/\H/] + "commit/#{source_tag}" + else + "branch/#{source_tag}" + end + "#{source_base_url}/#{suffix}" else source_base_url end diff --git a/spec/presenters/instance_presenter_spec.rb b/spec/presenters/instance_presenter_spec.rb index f4c415d2f1..82aff5fa2c 100644 --- a/spec/presenters/instance_presenter_spec.rb +++ b/spec/presenters/instance_presenter_spec.rb @@ -87,8 +87,8 @@ describe InstancePresenter do end describe '#source_url' do - it 'returns "https://github.com/glitch-soc/mastodon"' do - expect(instance_presenter.source_url).to eq('https://github.com/glitch-soc/mastodon') + it 'returns the default URL' do + expect(instance_presenter.source_url).to eq('https://gitea.treehouse.systems/treehouse/mastodon') end end -- 2.41.0 From f090d1d17e36b0cf86709bed254d1555f312a17e Mon Sep 17 00:00:00 2001 From: Kouhai Date: Sun, 4 Dec 2022 20:32:47 -0800 Subject: [PATCH 6/7] add deps rake tasks --- lib/tasks/deps.rake | 104 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 lib/tasks/deps.rake diff --git a/lib/tasks/deps.rake b/lib/tasks/deps.rake new file mode 100644 index 0000000000..55ec526627 --- /dev/null +++ b/lib/tasks/deps.rake @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +require 'pathname' + +DATA_DIR = Pathname.new('data') +POSTGRES_DIR = DATA_DIR / 'postgres' +POSTGRES_CONF_FILE = POSTGRES_DIR / 'postgresql.conf' +POSTGRES_SOCKET_FILE = POSTGRES_DIR / '.s.PGSQL.5432' +POSTGRES_PID_FILE = POSTGRES_DIR / 'postmaster.pid' +REDIS_DIR = DATA_DIR / 'redis' +REDIS_PID_FILE = REDIS_DIR / 'redis-dev.pid' + +def get_pid(pid_file) + return false unless File.file?(pid_file) + pid = File.read(pid_file).to_i + + Process.kill(0, pid) + pid +rescue Errno::ESRCH + nil +end + +def postgres_running? + get_pid POSTGRES_PID_FILE +end + +directory REDIS_DIR.to_s + +namespace :deps do + task start: ['postgres:start', 'redis:start'] + task stop: ['postgres:stop', 'redis:stop'] + + namespace :postgres do + namespace :setup do + task all: [POSTGRES_DIR.to_s] + + file POSTGRES_DIR.to_s do + if POSTGRES_CONF_FILE.exist? + puts 'Postgres conf exists, skipping initdb' + next + end + sh %(printf '%s\\n' pg_ctl -D data/postgres initdb -o '-U mastodon --auth-host=trust') + end + + task configure: [POSTGRES_DIR.to_s] do + next if File.foreach(POSTGRES_CONF_FILE).detect? { |line| line == /^unix_socket_directories = \.\s*$/ } + + POSTGRES_CONF_FILE.open('at') do |f| + f.write("\n", PG_SOCKET_DIRECTORIES_LINE, "\n") + end + end + end + + task start: ['setup:all'] do + if (pid = get_pid POSTGRES_PID_FILE) + puts "Postgres is running (pid #{pid})!" + next + end + + puts 'Starting postgres...' + puts '==========' + sh %(pg_ctl -D ./data/postgres start) + puts '==========' + end + + task :stop do + unless (pid = get_pid POSTGRES_PID_FILE) + puts "Postgres isn't running!" + next + end + + puts "Stopping Postgres (pid #{pid})...\n==========" + sh %(pg_ctl -D ./data/postgres stop) + puts '==========' + end + end + + namespace :redis do + task init: [REDIS_DIR.to_s] do + end + + task start: [:init] do + if (pid = get_pid REDIS_PID_FILE) + puts "Redis is running (pid #{pid})!" + next + end + + puts 'Starting redis...' + puts '==========' + sh %(redis-server redis-dev.conf) + puts '==========' + end + + task :stop do + unless (pid = get_pid REDIS_PID_FILE) + puts "Redis isn't running!" + next + end + + puts "Stopping Redis (pid #{pid})...\n==========" + Process.kill(:TERM, pid) + end + end +end -- 2.41.0 From ca239f9159c7b6e1aaa892c8f6b1d2e64154e31d Mon Sep 17 00:00:00 2001 From: Kouhai Date: Sat, 17 Dec 2022 19:05:32 -0800 Subject: [PATCH 7/7] consistent dividers --- lib/tasks/deps.rake | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/tasks/deps.rake b/lib/tasks/deps.rake index 55ec526627..2ebd8d5084 100644 --- a/lib/tasks/deps.rake +++ b/lib/tasks/deps.rake @@ -10,6 +10,10 @@ POSTGRES_PID_FILE = POSTGRES_DIR / 'postmaster.pid' REDIS_DIR = DATA_DIR / 'redis' REDIS_PID_FILE = REDIS_DIR / 'redis-dev.pid' +def divider + puts '==========' +end + def get_pid(pid_file) return false unless File.file?(pid_file) pid = File.read(pid_file).to_i @@ -58,9 +62,9 @@ namespace :deps do end puts 'Starting postgres...' - puts '==========' + divider sh %(pg_ctl -D ./data/postgres start) - puts '==========' + divider end task :stop do @@ -69,9 +73,9 @@ namespace :deps do next end - puts "Stopping Postgres (pid #{pid})...\n==========" + puts "Stopping Postgres (pid #{pid})..." sh %(pg_ctl -D ./data/postgres stop) - puts '==========' + divider end end @@ -86,9 +90,9 @@ namespace :deps do end puts 'Starting redis...' - puts '==========' + divider sh %(redis-server redis-dev.conf) - puts '==========' + divider end task :stop do @@ -97,7 +101,8 @@ namespace :deps do next end - puts "Stopping Redis (pid #{pid})...\n==========" + puts "Stopping Redis (pid #{pid})..." + divider Process.kill(:TERM, pid) end end -- 2.41.0