Skip to content

Commit

Permalink
Move to code.golf
Browse files Browse the repository at this point in the history
  • Loading branch information
JRaspass committed Jun 5, 2020
1 parent 2778785 commit 5d60397
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ cert:

.PHONY: db
db:
@ssh -t rancher@code-golf.io \
@ssh -t rancher@code.golf \
docker run -it --entrypoint psql --env-file /etc/code-golf.env --rm postgres

db-admin:
@ssh -t rancher@code-golf.io \
@ssh -t rancher@code.golf \
docker run -it --entrypoint psql --env-file /etc/code-golf.env --rm postgres -WU doadmin

deps:
Expand All @@ -41,7 +41,7 @@ dev:

diff-db:
@diff --color --label live --label dev --strip-trailing-cr -su \
<(ssh rancher@code-golf.io "docker run --entrypoint pg_dump \
<(ssh rancher@code.golf "docker run --entrypoint pg_dump \
--env-file /etc/code-golf.env --rm postgres:11.8-alpine -Os") \
<(docker-compose exec db pg_dump -OsU postgres code-golf)

Expand Down Expand Up @@ -71,7 +71,7 @@ live:

@docker push codegolf/code-golf

@ssh rancher@code-golf.io " \
@ssh rancher@code.golf " \
docker pull codegolf/code-golf && \
docker stop code-golf; \
docker rm code-golf; \
Expand All @@ -94,7 +94,7 @@ live:
codegolf/code-golf"

logs:
@ssh rancher@code-golf.io docker logs -f code-golf
@ssh rancher@code.golf docker logs -f code-golf

test:
# FIXME Stub out assets if it doesn't yet exist.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Code Golf

This is the repository behind https://code-golf.io
This is the repository behind https://code.golf

## Quickstart

Expand Down Expand Up @@ -39,7 +39,7 @@ $ ./build-langs --pull
$ make dev
```

6. Optionally, load information from the code-golf.io database.
6. Optionally, load information from the code.golf database.
```
pip install -r utils/requirements.txt
utils/update_sql_from_api.py
Expand Down
10 changes: 5 additions & 5 deletions langs/j/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ RUN mv jsource-* jsource \
/jsource/jlibrary/system/defs \
/jsource/jlibrary/system/main/socket.ijs \
&& cd jsource/jsrc \
&& echo '#define jbuilder "code-golf.io"' >> jversion.h \
&& echo '#define jlicense "GPL3"' >> jversion.h \
&& echo '#define jplatform "linux"' >> jversion.h \
&& echo '#define jtype "release"' >> jversion.h \
&& echo '#define jversion "807"' >> jversion.h \
&& echo '#define jbuilder "code.golf"' >> jversion.h \
&& echo '#define jlicense "GPL3"' >> jversion.h \
&& echo '#define jplatform "linux"' >> jversion.h \
&& echo '#define jtype "release"' >> jversion.h \
&& echo '#define jversion "807"' >> jversion.h \
&& gcc -s -O2 -o jconsole jconsole.c jeload.c \
&& rm andjnative.c fnmatch.c jconsole.c jeload.c jep.c jfex.c \
&& gcc -s -O2 -fPIC -fwrapv -fno-strict-aliasing -shared -o libj.so *.c blis/*.c
Expand Down
2 changes: 1 addition & 1 deletion latest-langs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ constant @langs = (

constant $len = @langs[0, 3*.chars.max;

my %current = (get('https://code-golf.io/about') ~~ m:g/
my %current = (get('https://code.golf/about') ~~ m:g/
'<tr><th' .+? '>' (.+?) '<' .*? (<[\d+.]> ** 2..*)
/)».list.flat».Str.Hash;

Expand Down
2 changes: 1 addition & 1 deletion middleware/redirect_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"syscall"
)

var host = "code-golf.io"
var host = "code.golf"

func init() {
if _, dev := syscall.Getenv("DEV"); dev {
Expand Down
4 changes: 2 additions & 2 deletions routes/feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var atomFeed, jsonFeed, rssFeed []byte
// c1503f7 initial
func init() {
feed := feeds.Feed{
Link: &feeds.Link{Href: "https://code-golf.io/"},
Link: &feeds.Link{Href: "https://code.golf/"},
Title: "Code Golf",
}

Expand Down Expand Up @@ -92,7 +92,7 @@ func init() {
{"c5468f0", "2017-06-12 23:34:47", "Raku", false},
{"8029a96", "2017-05-08 23:06:22", "Ruby", false},
} {
link := "https://code-golf.io/"
link := "https://code.golf/"

if !i.hole {
link += "scores/all-holes/"
Expand Down
2 changes: 1 addition & 1 deletion routes/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func render(
// Shallow copy because we want to modify a string.
config := config

config.RedirectURL = "https://code-golf.io/callback?redirect_uri=" +
config.RedirectURL = "https://code.golf/callback?redirect_uri=" +
url.QueryEscape(r.RequestURI)

// TODO State is a token to protect the user from CSRF attacks.
Expand Down
2 changes: 1 addition & 1 deletion t/args.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ for ( map [ split /\n/, $_, 2 ], <DATA> ) {
@run{qw/Lang Code Hole/} = ( @$_, 'rock-paper-scissors-spock-lizard' );

my $res = ( state $ua = HTTP::Tiny->new )->post(
'https://code-golf.io/solution', { content => encode_json \%run } );
'https://code.golf/solution', { content => encode_json \%run } );

die $res->{content} unless $res->{success};

Expand Down
2 changes: 1 addition & 1 deletion t/inspect.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ like { run('say slurp "/proc/self/status"') =~ /(.+):\s*(.*)/g } => {

sub run {
my $res = ( state $ua = HTTP::Tiny->new )->post(
'https://code-golf.io/solution',
'https://code.golf/solution',
{ content => encode_json { Code => $_[0], Hole => 'π', Lang => 'raku' } },
);

Expand Down
2 changes: 1 addition & 1 deletion t/redirects.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use constant PATH => '/foo?bar=baz';

my $ua = HTTP::Tiny->new;

is $ua->get( $_ . PATH )->{url}, 'https://code-golf.io' . PATH, $_
is $ua->get( $_ . PATH )->{url}, 'https://code.golf' . PATH, $_
for <http{,s}://{,www.}code{-golf.io,.golf}>;

done_testing;
2 changes: 1 addition & 1 deletion t/timeout.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use JSON::PP;
use Test2::V0;

my $res = HTTP::Tiny->new->post(
'https://code-golf.io/solution',
'https://code.golf/solution',
{ content => encode_json {
Code => 'sleep 8',
Hole => 'fizz-buzz',
Expand Down
2 changes: 1 addition & 1 deletion t/truncate.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use JSON::PP;
use Test2::V0;

my $res = HTTP::Tiny->new->post(
'https://code-golf.io/solution',
'https://code.golf/solution',
{ content => encode_json {
Code => 'say "a" x 1024 and say STDERR "b" x 1024 for 0..128',
Hole => 'fizz-buzz',
Expand Down
4 changes: 2 additions & 2 deletions utils/update_sql_from_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
"""Update the local code-golf database with information from code-golf.io.
"""Update the local code-golf database with information from code.golf.
Instead of storing the actual solution code, store 'a' * strokes.
This is helpful for working on features that affect the apperance of the
leaderboards, users page, recent page, and more.
Expand All @@ -16,7 +16,7 @@


def _main():
text = requests.get('https://code-golf.io/scores/all-holes/all-langs/all').content.decode()
text = requests.get('https://code.golf/scores/all-holes/all-langs/all').content.decode()
data = json.loads(text)

users = []
Expand Down
2 changes: 1 addition & 1 deletion views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ <h2>{{ .Hole.Name }}</h2>
|
<a href=/feeds/rss>RSS</a>
<p class="right span">
<a href=//status.code-golf.io>Status Page</a>
<a href=//status.code.golf>Status Page</a>
</main>

0 comments on commit 5d60397

Please sign in to comment.