Skip to content

Commit 01b12fa

Browse files
committed
Add licensing information
1 parent e013a53 commit 01b12fa

11 files changed

+321
-8
lines changed

.reuse/dep5

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: DevPT codewars leaderboard
3+
Upstream-Contact: Hugo Peixoto <[email protected]>
4+
Source: https://devpt-codewars.fly.dev/
5+
6+
Files: *
7+
Copyright: 2022 Hugo Peixoto <[email protected]>
8+
License: AGPL-3.0-only

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ ADD *.rb ./
1010
ADD index.html.erb ./
1111
ADD config.ru ./
1212

13-
CMD ["puma"]
13+
CMD ["puma", "-p", "8080"]

LICENSES/AGPL-3.0-only.txt

+235
Large diffs are not rendered by default.

codewars.rb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
# SPDX-FileCopyrightText: 2022 Hugo Peixoto <[email protected]>
3+
4+
require 'json'
5+
require 'net/http'
6+
17
module Codewars
28
def self.profile(username)
39
JSON.parse(Net::HTTP::get(URI("https://www.codewars.com/api/v1/users/#{username}")))

config.ru

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
# SPDX-FileCopyrightText: 2022 Hugo Peixoto <[email protected]>
3+
14
require './main'
25
run Sinatra::Application

database.rb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
# SPDX-FileCopyrightText: 2022 Hugo Peixoto <[email protected]>
3+
4+
require 'active_record'
5+
require 'pg'
6+
17
ActiveRecord::Base.establish_connection
28
ActiveRecord::Base.logger = Logger.new(STDOUT)
39
ActiveRecord::Schema.define do

fly.toml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# fly.toml file generated for devpt-codewars on 2022-09-21T21:19:41+01:00
2+
3+
app = "devpt-codewars"
4+
kill_signal = "SIGINT"
5+
kill_timeout = 5
6+
processes = []
7+
8+
[env]
9+
10+
[experimental]
11+
allowed_public_ports = []
12+
auto_rollback = true
13+
14+
[[services]]
15+
http_checks = []
16+
internal_port = 8080
17+
processes = ["app"]
18+
protocol = "tcp"
19+
script_checks = []
20+
[services.concurrency]
21+
hard_limit = 25
22+
soft_limit = 20
23+
type = "connections"
24+
25+
[[services.ports]]
26+
force_https = true
27+
handlers = ["http"]
28+
port = 80
29+
30+
[[services.ports]]
31+
handlers = ["tls", "http"]
32+
port = 443
33+
34+
[[services.tcp_checks]]
35+
grace_period = "1s"
36+
interval = "15s"
37+
restart_limit = 0
38+
timeout = "2s"

gems.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
# SPDX-FileCopyrightText: 2022 Hugo Peixoto <[email protected]>
3+
14
source 'https://rubygems.org'
25

36
gem 'sinatra'

index.html.erb

+11-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88

99
body {
10-
background-color: #262729;
10+
background-color: #16171b;
1111
color: rgba(255, 255, 255);
1212
}
1313

@@ -16,13 +16,17 @@
1616

1717
td.solved, td.unsolved { text-align: center; }
1818

19-
section {
19+
section, footer {
20+
background-color: #27272a;
2021
max-width: 600px;
21-
background-color: #222327;
2222
margin: 0 auto;
2323
padding: 10px;
2424
}
2525

26+
footer {
27+
margin-top: 20px;
28+
}
29+
2630
</style>
2731
</head>
2832
<body>
@@ -61,5 +65,9 @@
6165
</tbody>
6266
</table>
6367
</section>
68+
69+
<footer>
70+
<p><a href="https://github.com/hugopeixoto/devpt-codewars">Software licensed under AGPL-3.0-only</a>
71+
</footer>
6472
</body>
6573
</html>

main.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
# SPDX-FileCopyrightText: 2022 Hugo Peixoto <[email protected]>
3+
14
require 'sinatra'
2-
require 'pg'
3-
require 'net/http'
4-
require 'active_record'
55

66
require './database.rb'
7-
require './codewars.rb'
87
require './models.rb'
98

109
User.all.each(&:refresh!)

models.rb

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
# SPDX-FileCopyrightText: 2022 Hugo Peixoto <[email protected]>
3+
4+
require 'active_record'
5+
require 'date'
6+
require './codewars'
7+
18
class User < ActiveRecord::Base
29
def self.register(username)
310
self.create(

0 commit comments

Comments
 (0)