Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .crystal-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.34.0
1.11.2
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:0.34.0-alpine-build AS build-env
FROM crystallang/crystal:1.11.2-alpine-build AS build-env

RUN apk --no-cache add build-base libgit2 git nodejs yarn libgit2-dev

Expand All @@ -15,7 +15,7 @@ RUN yarn prod
RUN lucky build.release


FROM crystallang/crystal:0.34.0-alpine-build
FROM crystallang/crystal:1.11.2-alpine-build

RUN mkdir -p /app
WORKDIR /app
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Microgit is meant to be a self-hosting open source that will be an alternative to gitlab. See this as a crystal version of gitea but with own design.

This project now targets Crystal `1.11.2`.

## What it can do now:
* Git pull/push/fetch
* See tree of files
Expand Down
188 changes: 112 additions & 76 deletions shard.lock
Original file line number Diff line number Diff line change
@@ -1,146 +1,182 @@
version: 1.0
version: 2.0
shards:
apatite:
github: watzon/apatite
commit: 9ed28220eb7136eecc05c70cb16b7a41a6d0e958
git: https://github.com/watzon/apatite.git
version: 0.1.0+git.commit.36f3aef41e31b75e824b9b60ec30cdc399ced9c9

authentic:
github: luckyframework/authentic
version: 0.5.4
git: https://github.com/luckyframework/authentic.git
version: 1.0.2

avram:
github: luckyframework/avram
version: 0.14.0
git: https://github.com/luckyframework/avram.git
version: 1.3.0

avram_scoped_id:
github: microgit-com/avram_scoped_id
commit: d5853177e55fabc04c9456f5b45f073e3f5a54d9
backtracer:
git: https://github.com/sija/backtracer.cr.git
version: 1.2.4

blank:
github: kostya/blank
version: 0.1.0
bindata:
git: https://github.com/spider-gazelle/bindata.git
version: 2.1.0

cadmium_classifier:
github: cadmiumcr/classifier
commit: 22609f050564fb90595bdbdfdf4007e67861c5c4
git: https://github.com/cadmiumcr/classifier.git
version: 0.2.0+git.commit.9ac9abe0ba882ccc085bde732f16e79e186d83e3

cadmium_tokenizer:
github: cadmiumcr/tokenizer
commit: e7f8733e4d8ead9a811b6f41d0b5fa621ba03033
git: https://github.com/cadmiumcr/tokenizer.git
version: 0.1.0+git.commit.e7f8733e4d8ead9a811b6f41d0b5fa621ba03033

cadmium_transliterator:
git: https://github.com/cadmiumcr/transliterator.git
version: 0.1.0+git.commit.46c4c14594057dbcfaf27e7e7c8c164d3f0ce3f1

carbon:
github: luckyframework/carbon
version: 0.1.1
git: https://github.com/luckyframework/carbon.git
version: 0.6.0

cry:
github: paulcsmith/cry
version: 0.4.2
git: https://github.com/luckyframework/cry.git
version: 0.4.3

crystar:
git: https://github.com/naqvis/crystar.git
version: 0.3.1

db:
github: crystal-lang/crystal-db
version: 0.9.0
git: https://github.com/crystal-lang/crystal-db.git
version: 0.13.1

dexter:
github: luckyframework/dexter
version: 0.2.0
git: https://github.com/luckyframework/dexter.git
version: 0.3.4

dotenv:
github: gdotdesign/cr-dotenv
git: https://github.com/gdotdesign/cr-dotenv.git
version: 0.3.0

exception_page:
github: crystal-loot/exception_page
version: 0.1.4
git: https://github.com/crystal-loot/exception_page.git
version: 0.5.0

fnv:
git: https://github.com/naqvis/crystal-fnv.git
version: 0.1.3

git:
github: microgit-com/libgit2.cr
commit: 7069411d3357628a6294af97f88e9c718e87f8e9
git: https://github.com/microgit-com/libgit2.cr.git
version: 0.1.0+git.commit.7069411d3357628a6294af97f88e9c718e87f8e9

git_diff_parser:
github: microgit-com/git_diff_parser
commit: e9e7db8e14367680a8478cfcb569f6ff6c33e531
git: https://github.com/microgit-com/git_diff_parser.git
version: 0.1.0+git.commit.e9e7db8e14367680a8478cfcb569f6ff6c33e531

habitat:
github: luckyframework/habitat
version: 0.4.3
git: https://github.com/luckyframework/habitat.git
version: 0.4.9

html5:
git: https://github.com/naqvis/crystal-html5.git
version: 0.5.0

jwt:
github: crystal-community/jwt
version: 1.2.0
git: https://github.com/crystal-community/jwt.git
version: 1.6.1

kilt:
github: jeromegn/kilt
version: 0.6.0
git: https://github.com/jeromegn/kilt.git
version: 0.6.1

linguist:
github: microgit-com/linguist.cr
git: https://github.com/microgit-com/linguist.cr.git
version: 0.2.2

lucky:
github: luckyframework/lucky
version: 0.21.1
git: https://github.com/luckyframework/lucky.git
version: 1.3.0

lucky_can:
github: confact/lucky_can
commit: 2004fe0e4d02a43ca3f7b4728c28b1c501285a9c
lucky_cache:
git: https://github.com/luckyframework/lucky_cache.git
version: 0.1.1

lucky_cli:
github: luckyframework/lucky_cli
version: 0.21.0
lucky_can:
git: https://github.com/confact/lucky_can.git
version: 0.1.0+git.commit.2004fe0e4d02a43ca3f7b4728c28b1c501285a9c

lucky_encrypted:
github: microgit-com/lucky_encrypted
commit: 7f8f8ae16b4801d9237cc75044f915d1ea67f323
git: https://github.com/microgit-com/lucky_encrypted.git
version: 0.5.0+git.commit.87ff7a96b5d1eb36dd129ffde12b34c6c295980c

lucky_flow:
github: luckyframework/lucky_flow
version: 0.6.3
git: https://github.com/luckyframework/lucky_flow.git
version: 0.10.0

lucky_router:
github: luckyframework/lucky_router
version: 0.2.2
git: https://github.com/luckyframework/lucky_router.git
version: 0.6.0

markd:
github: icyleaf/markd
lucky_task:
git: https://github.com/luckyframework/lucky_task.git
version: 0.3.0

lucky_template:
git: https://github.com/luckyframework/lucky_template.git
version: 0.2.0

markd:
git: https://github.com/icyleaf/markd.git
version: 0.5.0

mosquito:
github: robacarp/mosquito
version: 0.7.0
git: https://github.com/robacarp/mosquito.git
version: 2.0.0

openssl_ext:
github: stakach/openssl_ext
version: 1.2.0
git: https://github.com/spider-gazelle/openssl_ext.git
version: 2.4.4

pg:
github: will/crystal-pg
version: 0.21.0
git: https://github.com/will/crystal-pg.git
version: 0.28.0

pool:
github: ysbaddaden/pool
pulsar:
git: https://github.com/luckyframework/pulsar.git
version: 0.2.3

redis:
github: stefanwille/crystal-redis
version: 2.6.0
git: https://github.com/jgaskins/redis.git
version: 0.12.0

selenium:
github: ysbaddaden/selenium-webdriver-crystal
commit: bda2fd406c1a118251c5a2883f1e1f3af242116e
git: https://github.com/crystal-loot/selenium.cr.git
version: 0.12.1

shell-table:
github: luckyframework/shell-table.cr
commit: 078a04ea58ead5203bb435a3b5fff448ddabaeea
git: https://github.com/luckyframework/shell-table.cr.git
version: 0.9.3

sluggr:
github: microgit-com/sluggr
commit: 789ba497be050135465e8ef12b9b969514c5d2fd
git: https://github.com/microgit-com/sluggr.git
version: 0.1.0+git.commit.789ba497be050135465e8ef12b9b969514c5d2fd

teeplate:
github: luckyframework/teeplate
version: 0.8.1
splay_tree_map:
git: https://github.com/wyhaines/splay_tree_map.cr.git
version: 0.3.0

webdrivers:
git: https://github.com/crystal-loot/webdrivers.cr.git
version: 0.4.4

webless:
git: https://github.com/crystal-loot/webless.git
version: 0.1.0

wordsmith:
github: luckyframework/wordsmith
version: 0.2.0
git: https://github.com/luckyframework/wordsmith.git
version: 0.4.0

xpath2:
git: https://github.com/naqvis/crystal-xpath2.git
version: 0.1.3

22 changes: 12 additions & 10 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,30 @@ targets:
microgit:
main: src/microgit.cr

crystal: 0.34.0
crystal: 1.11.2

dependencies:
lucky:
github: luckyframework/lucky
version: ~> 0.21
version: ~> 1.3
authentic:
github: luckyframework/authentic
version: ~> 0.5.4
version: ~> 1.0
carbon:
github: luckyframework/carbon
version: ~> 0.1.1
version: ~> 0.6
dotenv:
github: gdotdesign/cr-dotenv
version: 0.3.0
lucky_flow:
github: luckyframework/lucky_flow
version: ~> 0.6.3
version: ~> 0.10
jwt:
github: crystal-community/jwt
version: ~> 1.2.0
version: ~> 1.6
avram:
github: luckyframework/avram
version: ~> 1.3
git:
github: microgit-com/libgit2.cr
kilt:
Expand All @@ -39,16 +42,15 @@ dependencies:
github: microgit-com/sluggr
lucky_encrypted:
github: microgit-com/lucky_encrypted
branch: master
git_diff_parser:
github: microgit-com/git_diff_parser
linguist:
github: microgit-com/linguist.cr
redis:
github: stefanwille/crystal-redis
version: ~> 2.6
github: jgaskins/redis
version: ~> 0.12
lucky_can:
github: confact/lucky_can
avram_scoped_id:
github: microgit-com/avram_scoped_id
mosquito:
github: robacarp/mosquito
4 changes: 2 additions & 2 deletions src/handlers/git_handler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class HTTP::GitHandler
end

private def clear_cache(repo)
redis = Redis::PooledClient.new
keys = redis.keys("#{repo.cache_key}*").map(&.to_s)
redis = Redis::Client.new
keys = redis.keys("#{repo.cache_key}*")
return if keys.empty?
redis.del(keys)
end
Expand Down
4 changes: 2 additions & 2 deletions src/models/label.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Label < BaseModel
column color : String
belongs_to repository : Repository
has_many label_in_items : LabelInItem
has_many issues : Issue, through: :label_in_items
has_many merge_requests : MergeRequest, through: :label_in_items
has_many issues : Issue, through: [:label_in_items, :issue]
has_many merge_requests : MergeRequest, through: [:label_in_items, :merge_request]
end
end
2 changes: 1 addition & 1 deletion src/models/team.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Team < BaseModel
has_one namespace : Namespace
has_many repositories : Repository
has_many team_members : TeamMembers
has_many users : User, through: :team_members
has_many users : User, through: [:team_members, :user]
end

def slug
Expand Down
2 changes: 1 addition & 1 deletion src/models/user.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class User < BaseModel
has_one namespace : Namespace
has_many api_tokens : ApiToken
has_many team_members : TeamMembers
has_many teams : Team, through: :team_members
has_many teams : Team, through: [:team_members, :team]
end

def confirmed?
Expand Down
2 changes: 1 addition & 1 deletion src/operations/create_issue.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CreateIssue < Issue::SaveOperation
needs repo_id : Int64

before_save do
AvramScopedId.set column: scoped_id,
ScopedId.set column: scoped_id,
query: IssueQuery.new.repository_id(repo_id.not_nil!)
end
end
2 changes: 1 addition & 1 deletion src/operations/create_merge_request.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CreateMergeRequest < MergeRequest::SaveOperation
needs repo_id : Int64

before_save do
AvramScopedId.set column: scoped_id,
ScopedId.set column: scoped_id,
query: MergeRequestQuery.new.repository_id(repo_id.not_nil!)
end
end
Loading