Compare commits

...

9 Commits

Author SHA1 Message Date
kouhai dev a31e6c25ac consistent dividers 2022-12-26 16:18:16 -06:00
Rin 9bdf9195ff force psych <4 in Gemfile 2022-12-26 16:18:16 -06:00
kouhai dev 992e7eb55c add deps rake tasks 2022-12-26 16:18:16 -06:00
kouhai dev a7f3ed49f0 update default repository/source metadata 2022-12-26 16:18:16 -06:00
kouhai dev 80f701bc28 use yarn 3 2022-12-26 16:18:16 -06:00
kouhai dev 7334439573 update browserslist 2022-12-26 16:18:16 -06:00
kouhai dev d39230c0be update dockerignore 2022-12-26 16:18:16 -06:00
kouhai dev 75ac9fc617 temporarily remove "Get the app" link" 2022-12-26 16:18:16 -06:00
kouhai dev dd8292e53f quick status hover hack 2022-12-26 16:18:16 -06:00
11 changed files with 16319 additions and 12272 deletions

View File

@ -1,6 +1,5 @@
[production]
defaults
not IE 11
not dead
[development]

View File

@ -19,3 +19,4 @@ postgres14
redis
elasticsearch
chart
data

View File

@ -3,6 +3,9 @@
source 'https://rubygems.org'
ruby '>= 2.6.0', '< 3.1.0'
gem 'psych', '< 4'
gem 'pkg-config', '~> 1.4'
gem 'rexml', '~> 3.2'

View File

@ -478,6 +478,7 @@ GEM
pry (>= 0.13, < 0.15)
pry-rails (0.3.9)
pry (>= 0.10.4)
psych (3.3.4)
public_suffix (5.0.0)
puma (5.6.5)
nio4r (~> 2.0)
@ -813,6 +814,7 @@ DEPENDENCIES
private_address_check (~> 0.5)
pry-byebug (~> 3.10)
pry-rails (~> 0.3)
psych (< 4)
puma (~> 5.6)
pundit (~> 2.2)
rack (~> 2.2.4)
@ -858,3 +860,9 @@ DEPENDENCIES
webpacker (~> 5.4)
webpush!
xorcist (~> 1.1)
RUBY VERSION
ruby 3.0.4p208
BUNDLED WITH
2.3.26

View File

@ -295,23 +295,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;
}
}

View File

@ -79,8 +79,6 @@ class LinkFooter extends React.PureComponent {
{' '}
<a href='https://joinmastodon.org' target='_blank'><FormattedMessage id='footer.about' defaultMessage='About' /></a>
{' · '}
<a href='https://joinmastodon.org/apps' target='_blank'><FormattedMessage id='footer.get_app' defaultMessage='Get the app' /></a>
{' · '}
<Link to='/keyboard-shortcuts'><FormattedMessage id='footer.keyboard_shortcuts' defaultMessage='Keyboard shortcuts' /></Link>
{' · '}
<a href={source_url} rel='noopener noreferrer' target='_blank'><FormattedMessage id='footer.source_code' defaultMessage='View source code' /></a>

View File

@ -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

109
lib/tasks/deps.rake Normal file
View File

@ -0,0 +1,109 @@
# 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 divider
puts '=========='
end
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...'
divider
sh %(pg_ctl -D ./data/postgres start)
divider
end
task :stop do
unless (pid = get_pid POSTGRES_PID_FILE)
puts "Postgres isn't running!"
next
end
puts "Stopping Postgres (pid #{pid})..."
sh %(pg_ctl -D ./data/postgres stop)
divider
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...'
divider
sh %(redis-server redis-dev.conf)
divider
end
task :stop do
unless (pid = get_pid REDIS_PID_FILE)
puts "Redis isn't running!"
next
end
puts "Stopping Redis (pid #{pid})..."
divider
Process.kill(:TERM, pid)
end
end
end

View File

@ -36,12 +36,13 @@
"@rails/ujs": "^6.1.7",
"abortcontroller-polyfill": "^1.7.5",
"array-includes": "^3.1.5",
"atrament": "0.2.4",
"arrow-key-navigation": "^1.2.0",
"atrament": "0.2.4",
"autoprefixer": "^9.8.8",
"axios": "^1.1.3",
"babel-loader": "^8.2.5",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-macros": "^3.1.0",
"babel-plugin-preval": "^5.1.0",
"babel-plugin-react-intl": "^6.2.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
@ -173,5 +174,6 @@
"optionalDependencies": {
"bufferutil": "^4.0.7",
"utf-8-validate": "^5.0.10"
}
},
"packageManager": "yarn@3.3.0"
}

View File

@ -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

28407
yarn.lock

File diff suppressed because it is too large Load Diff