Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: bump to monorepo #345

Merged
merged 363 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
363 commits
Select commit Hold shift + click to select a range
1098058
feat: Update config example file.
qwqcode Feb 26, 2022
6bee451
fix: Wrong logic of captcha 'always' config.
qwqcode Feb 26, 2022
f420fb5
fix: Reduce the use of native raw SQL to process boolean judgments an…
qwqcode Feb 26, 2022
f518f43
chore: Update artalk-go.example.yml.
qwqcode Feb 26, 2022
3960a83
fix(UA): Cooperate with client-side to correct Win11 UA.
qwqcode Apr 11, 2022
bece167
feat: Add script to build artalk-sidebar
qwqcode Apr 11, 2022
afd8896
chore: Remove deprecated artransfer cdoe
qwqcode Apr 11, 2022
72383a0
docs: Update README.md
qwqcode Apr 11, 2022
17f6897
fix: Dockerfile install bash
qwqcode Apr 11, 2022
60e91a5
chore: Script check and install yarn
qwqcode Apr 11, 2022
aa90260
feat: Use bluemonday sanitizer
qwqcode Apr 11, 2022
0df40c4
chore: Update script use volta install node
qwqcode Apr 11, 2022
94859f8
feat: Global trusted_domain config
qwqcode Apr 12, 2022
597d4db
feat: trusted_domains disable referer check
qwqcode Apr 12, 2022
79abdae
feat: Remove example config allow_origins field
qwqcode Apr 12, 2022
e95a944
feat: Page PV counter
qwqcode Apr 12, 2022
f5e2432
feat(pv): Make route rule & create pvs table
qwqcode Apr 12, 2022
931902f
docs: Update README.md
qwqcode Apr 12, 2022
eda9ae4
fix(captcha): Always-mode fail on the first req & modify font size
qwqcode Apr 12, 2022
c1dfcab
fix(typo): CaptchaCheck typo
qwqcode Apr 12, 2022
fcfba0c
feat(api/get): SortBy & ViewOnlyAdmin param support.
qwqcode Apr 12, 2022
e5aac45
feat(model): Add IsPinned field into commnent model.
qwqcode Apr 12, 2022
a26e8f4
feat(pin): Update admin_comment_edit api to edit IsPinned
qwqcode Apr 12, 2022
3538d6a
feat(pin): Pin comments keep most top & Child-comments recursive quer…
qwqcode Apr 12, 2022
1016adf
docs: Update README.md
qwqcode Apr 12, 2022
5a6f926
feat(img-upload): Add img-upload option to config file.
qwqcode Apr 13, 2022
7b2db0f
feat(img-upload): Image Upload Api
qwqcode Apr 13, 2022
c943c8f
feat(img-upload): Upload rate limitation.
qwqcode Apr 13, 2022
ef3cbf5
feat(img-upload): Upload using upgit
qwqcode Apr 13, 2022
30e8ade
docs: Update README.md
qwqcode Apr 13, 2022
d17987d
feat(img-upload): Admin always enable img_upload function.
qwqcode Apr 13, 2022
523fab8
fix(img-upload): Set img_upload.path defualt value
qwqcode Apr 13, 2022
3b3947c
chore: Modify img_upload.max_size example value.
qwqcode Apr 13, 2022
f6674c1
Merge pull request #18 from ArtalkJS/img-upload
qwqcode Apr 13, 2022
ba7c366
feat(self-upgrade): Add cmd Self-upgrade function
qwqcode Apr 14, 2022
b862508
chore(pkm): Replace yarn to pnpm.
qwqcode Apr 14, 2022
2027f26
fix(admin_site_edit): Split urls and TrimSpace to allow Space around …
qwqcode Apr 14, 2022
f70a509
feat(notify): Various ways to send notify message for admin.
qwqcode Apr 14, 2022
5d5bc6d
chore: Modify FeMinVersion to 2.1.9
qwqcode Apr 14, 2022
996b762
feat(cmd): Add workdir parameter & gen cmd.
qwqcode Apr 15, 2022
73b97a8
fix(docker): Run artalk-go anywhere with a right config
qwqcode Apr 15, 2022
651ac9d
chore(license): Relicense project to LGPL-v3
qwqcode Apr 15, 2022
9c463c1
feat(tencent_tms): Support tencent tms for Spam detection.
qwqcode Apr 15, 2022
a7bb22f
feat(anti-spam): Support Aliyun for Spam detection.
qwqcode Apr 15, 2022
93a4f6f
feat(anti-spam): Support KeyWords for Spam detection.
qwqcode Apr 15, 2022
b85a5a4
fix: Truncate Chinese character issue.
qwqcode Apr 15, 2022
53c4a64
refactor(notify_launcher): notify_launcher refactor and fix some bugs.
qwqcode Apr 16, 2022
b9cbe4e
feat(geetest): Access geetest API
qwqcode Apr 16, 2022
14661ed
feat(geetest): Provide geetest check API for frontend.
qwqcode Apr 16, 2022
c1279b3
fix(captcha): Fix lots of bugs.
qwqcode Apr 16, 2022
a8faad7
fix(api_main_get): Msg center disable comment-pin.
qwqcode Apr 16, 2022
ab9b9ec
feat(api): Get login status API
qwqcode Apr 16, 2022
2a5e54f
fix(limit-middleware): Precise match & fix disable captcha config.
qwqcode Apr 16, 2022
19e188b
feat(cmd): Add config cmd
qwqcode Apr 16, 2022
b2a780e
fix(api_version): Trim version prefix v char
qwqcode Apr 16, 2022
67358ca
docs: Update README.md
qwqcode Apr 16, 2022
c216e5a
feat(api): Modify some APIs method to post
qwqcode Apr 16, 2022
eb529ac
feat(version): Update Frontend min version to 2.2.1
qwqcode Apr 16, 2022
19885c8
docs: Update README.md
qwqcode Apr 16, 2022
25f0e26
fix(import/export): Fix some bugs & simplify code
qwqcode Apr 17, 2022
eb2bf34
chore: Modify build-frontend.sh to use the latest commit
qwqcode Apr 17, 2022
0c69206
feat(api-import-upload): Frontend importer upload before.
qwqcode Apr 17, 2022
8e8e428
chore: Update FeMinVersion to v2.2.2
qwqcode Apr 17, 2022
c691c49
chore: Update docker-compose.yml
qwqcode Apr 17, 2022
da746c4
fix: Geetest js resource url
qwqcode Apr 17, 2022
c94eaba
feat(db): Remove formal foreign key constraints
qwqcode Apr 18, 2022
1e98599
fix(importer): UrlResolver avoid end of slash being removed
qwqcode Apr 18, 2022
34f5005
feat: Admin update all title of pages.
qwqcode Apr 18, 2022
f861fa2
refactor: Improve GetLinkToReply logic
qwqcode Apr 18, 2022
dd55b7f
feat(api): Add Accessible URL fields
qwqcode Apr 18, 2022
5973269
feat(api_login_status): Add is_admin field
qwqcode Apr 18, 2022
3348b62
feat: Page title fetch support meta tag redirect link
qwqcode Apr 18, 2022
b2710b1
feat(api): Site cannot find err mark
qwqcode Apr 18, 2022
873a2f9
chore: Remove pvs table & merge pv field to page table.
qwqcode Apr 18, 2022
fba2210
feat(api_admin_page_fetch): Add GetStatus parameter.
qwqcode Apr 18, 2022
3c58913
fix(upgrade): Upgrade cmd load config
qwqcode Apr 18, 2022
b30b98c
feat(api_add): Allow patch user-agent parameter
qwqcode Apr 19, 2022
024c5fc
fix(geetest): Static page prevent cache
qwqcode Apr 19, 2022
6e58a80
chore: Update frontend to 2.2.6
qwqcode Apr 20, 2022
796cf2c
refactor: Bind API actions under a struct.
qwqcode Apr 21, 2022
3f4f0cb
refactor: Replace global variable lib.DB with injected db.
qwqcode Apr 21, 2022
09d4dfb
chore: Add some comments.
qwqcode Apr 21, 2022
bc14540
chore: First testing.
qwqcode Apr 21, 2022
9fea95e
Merge pull request #21 from ArtalkJS/refactor
qwqcode Apr 21, 2022
af5e721
test(model): Find & Create actions.
qwqcode Apr 22, 2022
264b464
Merge pull request #23 from ArtalkJS/refactor
qwqcode Apr 22, 2022
95e387f
feat(upgit): Config del_local to remove local file after uploaded.
qwqcode Apr 22, 2022
1eff830
chore(conf): Update artalk-go.example.yml file.
qwqcode Apr 22, 2022
d1986c4
feat(cache): Almost full cache coverage.
qwqcode Apr 22, 2022
0ab5d1f
fix: Cache add mutex lock
qwqcode Apr 23, 2022
323455c
fix: Add lock prevent query db repeatedly while cache miss.
qwqcode Apr 23, 2022
9ab36c6
fix: Add lock in ChildCommentCacheSave
qwqcode Apr 23, 2022
dcde2b4
feat: FindCommentChildren query db while cache miss
qwqcode Apr 23, 2022
72d205f
feat(cache): Support redis & memcache
qwqcode Apr 23, 2022
12ee6ab
chore(docs): Update README.md
qwqcode Apr 23, 2022
3f1313a
fix(cache): ChildCommentCacheSave repeatedly cache while exist
qwqcode Apr 23, 2022
5cd0129
feat(cache): Replace built-in json lib with vmihailenco/msgpack to sp…
qwqcode Apr 23, 2022
177ca04
feat(importer): Speed up importer & fix some bugs.
qwqcode Apr 23, 2022
5a1b361
fix(db): Support postgres database.
qwqcode Apr 23, 2022
0529746
feat(conf): Config database options not just dsn.
qwqcode Apr 23, 2022
ff03509
fix(admin_edit): Remove cache before admin_edit.
qwqcode Apr 23, 2022
a27b015
fix(db): Fix query syntax error & importer vote recover.
qwqcode Apr 23, 2022
446213b
fix(conf_admins): Preserve admin user which not in config file.
qwqcode Apr 23, 2022
11d107e
feat(api_admin_cache): Add api handle cache
qwqcode Apr 23, 2022
9ca2a80
feat(db): Allow set table_prefix
qwqcode Apr 23, 2022
fd1be63
fix(db): Time type field use pointer to solve 0000-00-00 issue.
qwqcode Apr 23, 2022
05ad1c4
feat(conf): Support control Frontend Conf by Backend.
qwqcode Apr 25, 2022
231a6b3
feat(upgrade): Upgrade command allow ignore version check.
qwqcode Apr 25, 2022
3c76f52
chore(version): Update FeMinVersion to v2.2.8
qwqcode Apr 25, 2022
d03534f
fix(importer): Fix too many sql variables Err while too much items.
qwqcode Apr 26, 2022
2ad6864
fix(validator): ValidateURL modify to IsRequestURL
qwqcode Apr 26, 2022
3120b81
fix(cache): Type conversion issue in Captcha part when using redis.
qwqcode Apr 27, 2022
9a8b979
feat(user): Admin email sending isolation between sites.
qwqcode Apr 28, 2022
8f3a1ce
chore(admin_check): Remove useless jwt middleware
qwqcode Apr 28, 2022
0c64ca0
chore(admin_check): Query user from db before check.
qwqcode Apr 28, 2022
0307098
chore(admin_check): Remove useless AdminOnly method calls in each adm…
qwqcode Apr 28, 2022
8d7e5ca
fix(cors): Import cors domains from db site urls.
qwqcode Apr 28, 2022
886bbd8
chore(multi-site): Preliminary Site Manager Access control
qwqcode Apr 28, 2022
bb2e683
chore(rename): Rename code files in http folder
qwqcode Apr 29, 2022
fcd44bc
refactor(api): Remove unnecessary parameter of ParamsDecode method
qwqcode Apr 29, 2022
02b3173
feat(multi-site): Isolate admin users among sites
qwqcode Apr 29, 2022
a03e985
refactor(api_get): Comments get api.
qwqcode Apr 29, 2022
9ccf4d4
chore(cache): Replace all cache_marshaler global variable to cache.
qwqcode Apr 29, 2022
f224a55
Merge pull request #28 from ArtalkJS/multi-site
qwqcode Apr 29, 2022
8d60195
chore: Rename Makefile file.
qwqcode Apr 29, 2022
4de9b00
chore(makefile): Modify PHONY
qwqcode Apr 29, 2022
a36f4fb
test: Add fixtures & set up testing.
qwqcode Apr 29, 2022
2e6b99f
chore(model): Organize some methods
qwqcode Apr 30, 2022
19cba53
chore: Move some methods
qwqcode Apr 30, 2022
8db752f
fix(cache): Use SingleFlight to avoid Cache breakdown.
qwqcode Apr 30, 2022
c55e772
test(model): Add query_find test
qwqcode Apr 30, 2022
9e873fe
test(model): Add query_del test
qwqcode Apr 30, 2022
566595e
test(model): Add query_find_create test
qwqcode Apr 30, 2022
5d2c090
test(page): GetAccessibleURL method
qwqcode Apr 30, 2022
12bd0b5
fix: Prevent unsafe svg image uploads
qwqcode May 1, 2022
2cb8e40
fix(transfer): Importer boot param parse.
qwqcode May 3, 2022
a16977d
fix(frontend-conf): Use pointer with omitempty to ignore frontend con…
qwqcode May 4, 2022
e60c4a6
fix(importer): UrlResolver disabled by default when a TargetSiteUrl i…
qwqcode May 4, 2022
f15c84c
chore(version): Update FeMinVersion to 2.2.12
qwqcode May 4, 2022
f5a5117
chore(dockerfile): Update pnpm to 7.0.0
qwqcode May 4, 2022
2f012d9
feat(go): Update golang to v1.18.1
qwqcode May 4, 2022
1f81be4
chore(test): Add CircleCI config
qwqcode May 5, 2022
225f93f
chore(docs): Add CircleCI shield
qwqcode May 5, 2022
8a17ab5
chore(pkg-manager): Update pnpm to 7.1.2
qwqcode May 19, 2022
3bba263
feat(api): New statistic api
qwqcode May 20, 2022
89d39eb
chore(api/stat): Modify type names
qwqcode May 20, 2022
f39e857
chore(version): Update FeMinVersion to 2.3.0
qwqcode May 20, 2022
8924afd
fix(api/stat): Query when using default site
qwqcode May 21, 2022
c478608
fix(cache): Duplicate display reply comments when pid cache is deleted
qwqcode May 21, 2022
d32f42f
chore: Remove achieved TODO
qwqcode May 22, 2022
99b7dc8
fix(comment_add): PendingDefault ignore Admin user
qwqcode May 22, 2022
94c789b
fix(comment_edit): Resend email when comment is_pending status is mod…
qwqcode May 22, 2022
9659460
Merge pull request #31 from ArtalkJS/pending-email-send
qwqcode May 22, 2022
d9c4cf9
fix(api/stat): Add limit for comment_most_pages sql
qwqcode May 22, 2022
067730c
feat(api/stat): Support 'rand_comments' and 'rand_pages' types & fix …
qwqcode May 22, 2022
e04f2eb
fix(utils): func SplitAndTrimSpace remove blank items by default
qwqcode May 22, 2022
37112f9
chore(conf): Update FrontendConf
qwqcode May 22, 2022
924a080
refactor(conf): Rename notify to admin_notify & admin_notify.email op…
qwqcode May 22, 2022
5334763
feat(conf): Support for admin_notify.email.enabled option
qwqcode May 22, 2022
dbc8e26
chore(conf): Prevent deprecated options from unmarshall in JSON
qwqcode May 22, 2022
2af6e3e
feat(conf): Support for admin_notify.noise_mode option
qwqcode May 23, 2022
d5b67a2
feat(notify): Support template & fix some bugs
qwqcode May 23, 2022
27b6fcd
fix(notify): Remove atk-emoticon img tags
qwqcode May 23, 2022
ed54720
feat(notify): Support WebHook notify
qwqcode May 23, 2022
fc69bf7
fix(time): Embed IANA timezone database in Windows build
qwqcode Jun 6, 2022
0f87730
fix(api/stat): Different RAND expressions for SQLite
qwqcode Jun 6, 2022
1666681
feat(comment): Add field content_marked to render the markdown content
qwqcode Jun 6, 2022
bac1271
fix(trusted_domains): Extract from full URL with slash suffix & impro…
qwqcode Jun 6, 2022
546ebee
fix(docker): Docker-compose file add build option
qwqcode Jun 6, 2022
7dee18c
feat(gen): Gen cmd support overwrite file
qwqcode Jun 6, 2022
346595f
refactor(docker): Use a folder to place config instead of mounting a …
qwqcode Jun 6, 2022
7d9f15a
fix(dockerfile): Expose host for external device
qwqcode Jun 7, 2022
a244286
fix(trusted_domains): Disable CORS restrictions
qwqcode Jun 7, 2022
60ed699
fix(docker): Entrypoint script gen command
qwqcode Jun 7, 2022
4e2f78e
perf(trusted_domains): Improve origin checker
qwqcode Jun 8, 2022
af132d0
chore: Remove some unused GET method API
qwqcode Jun 8, 2022
0b9f364
chore(pkg-manager): Upgrade pnpm to 7.2.1
qwqcode Jun 15, 2022
8329bee
feat: Global site & origin checker & support cookie
qwqcode Jun 15, 2022
de7c2c2
chore(docs): Fix link (#39)
KevinZonda Jun 16, 2022
1f5494e
refactor(api): Modify admin_comment_edit user merge logic
qwqcode Jun 17, 2022
dfba394
chore: Upgrade FeMinVersion to v2.3.4
qwqcode Jun 17, 2022
ff96cd9
fix(api): Modify to only api subpath enable SiteOrigin checker
qwqcode Jun 18, 2022
a694ee8
feat(api): settings get & save
qwqcode Sep 26, 2022
171c17e
fix(importer): UrlResolver disabled by default
qwqcode Sep 26, 2022
326d9b3
chore(version): upgrade FeMinVersion to 2.4.1
qwqcode Sep 26, 2022
eb58cac
fix: replace gravatar default mirror
qwqcode Oct 9, 2022
9e01dc2
feat(api/login): support choose user when multi usernames use the sam…
qwqcode Oct 13, 2022
6fe8375
feat: root path redict to sidebar login page
qwqcode Oct 14, 2022
0fe3121
fix(config): replace viper with koanf to make map case sensitivity (#47)
qwqcode Oct 14, 2022
ddec9d2
chore(ci): set up CodeQL CI
qwqcode Oct 14, 2022
0539487
feat(email-tpl): add ip variable to email template
qwqcode Oct 18, 2022
7897407
chore(deps): bump github.com/labstack/echo/v4 from 4.5.0 to 4.9.0 (#48)
dependabot[bot] Oct 18, 2022
cd14cac
chore(deps): upgrade echo to v4.9.1
qwqcode Oct 18, 2022
97898c5
feat(api/admin): add user management api for admin
qwqcode Oct 18, 2022
f85c200
feat(api/comment): add search for comment list api
qwqcode Oct 18, 2022
8c95417
fix(artransfer): incorrect IsPinned reference to IsPending (#49)
qwqcode Oct 19, 2022
02bd2a3
chore(api/admin): enhance user management api
qwqcode Oct 22, 2022
13e2bab
feat(conf): auto-gen config file when initializing the app
qwqcode Oct 23, 2022
ac87f46
feat(cmd): add admin command to create new user
qwqcode Oct 23, 2022
1c095c3
perf(conf): only provide conf for frontend when fetching the first page
qwqcode Oct 26, 2022
4494e53
refactor: http origin checker
qwqcode Oct 29, 2022
59a47ba
fix: add whitelist for origin checker
qwqcode Oct 29, 2022
fcf4849
chore: upgrade FeMinVersion to v2.4.3
qwqcode Oct 29, 2022
0cab1cc
fix: crash when frontend config is not set
qwqcode Oct 29, 2022
3d1cbae
fix(api/comment_get): use frontend pageSize config
qwqcode Oct 31, 2022
6b40ee6
refactor: abstract email service
AH-dark Dec 20, 2022
0978293
chore(CI): fix circleci cache
qwqcode Dec 20, 2022
938bd18
refactor: project package structure
qwqcode Jan 1, 2023
2055727
refactor: replace pkger with go:embed
qwqcode Jan 2, 2023
d2d0015
chore: update .gitignore
qwqcode Jan 2, 2023
11cd327
Merge pull request #53 from ArtalkJS/refactor
qwqcode Jan 2, 2023
2f20159
feat(go): upgrade to Go 1.19 and update some deps
qwqcode Jan 2, 2023
0b37cfd
chore: create dependabot.yml
qwqcode Jan 2, 2023
389be3c
refactor: migrate from echo to go-fiber
qwqcode Jan 4, 2023
f0d7921
Merge pull request #54 from ArtalkJS/fiber
qwqcode Jan 4, 2023
91ae48c
fix(api/get): fix concurrent map writes error
qwqcode Jan 5, 2023
8f58754
feat(conf): add conf option for specific email tpl for admins
qwqcode Jan 5, 2023
d0bb5b7
Merge pull request #55 from ArtalkJS/feat/admin_email_tpl
qwqcode Jan 5, 2023
038a1c5
chore: move all to tmp dir
pluveto Jan 16, 2023
15b15a7
refactor: merge backend to monorepo branch
pluveto Jan 16, 2023
6a41950
refactor: merge ci workflows
pluveto Jan 16, 2023
8da91b3
fix: naming conflict of node circleci
pluveto Jan 16, 2023
4f046f8
refactor: move from tmp dir to root
pluveto Jan 16, 2023
802749f
chore: rename dir frontend to public
qwqcode Jan 16, 2023
d229a62
refactor: build scripts and CI tests
qwqcode Jan 16, 2023
8d4219a
refactor: renamed from artalk-go to artalk
pluveto Jan 17, 2023
d9cc493
docs: migrate ArtalkJS/Docs to monorepo docs
pluveto Jan 17, 2023
ac26e67
fix: frontend repository directory issue
pluveto Jan 17, 2023
697ed72
refactor: batch removing artalk `-go` postfix
pluveto Jan 17, 2023
9441131
chore: example file in English
pluveto Jan 17, 2023
c7e2c8d
docs: example in zh-CN
pluveto Jan 17, 2023
1b7766c
fix: config alias and Dockerfile
qwqcode Jan 17, 2023
15e472a
fix: missing trusted_domains field
pluveto Jan 17, 2023
f210f15
feat: one-key site creating with artalk integrated
pluveto Jan 17, 2023
61da5eb
docs: update setup-example-site.sh script usage
pluveto Jan 17, 2023
593639f
chore: move files from `docs/docs` to `docs`
qwqcode Jan 17, 2023
664a9e0
chore: rename `artalk.example_zh-CN.yml` to `artalk.example.zh-CN.yml`
qwqcode Jan 17, 2023
e4ffc0b
fix: add `.npmignore` to fix NPM publish inclusion issue
qwqcode Jan 17, 2023
f89f87d
fix: docker image build script
qwqcode Jan 17, 2023
342f3d3
chore: merge .gitignore and clean up
qwqcode Jan 17, 2023
5b73049
feat: docker ci add support for building arm64 wheels
qwqcode Jan 17, 2023
6c896b3
chore: rename `dockerhub.yml` to `docker.yml`
qwqcode Jan 17, 2023
90ebd71
docs: add `CODE_OF_CONDUCT.md`
qwqcode Jan 17, 2023
5c06c1c
docs: update CONTRIBUTING.md `make debug-build`
pluveto Jan 18, 2023
1419c32
chore(makefile): add debug-build target
pluveto Jan 18, 2023
e1c1b33
feat: launch with vscode debugger
pluveto Jan 18, 2023
0f8d3f9
refactor(scripts): double quote to prevent globbing and word splitting
pluveto Jan 18, 2023
bfceff6
feat(i18n): add i18n support for backend (#343)
qwqcode Jan 18, 2023
891246a
docs: add translation section to `CONTRIBUTING.md`
pluveto Jan 19, 2023
1ca892f
feat(i18n): translations for backend (#344)
qwqcode Jan 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
105 changes: 105 additions & 0 deletions .circleci/conditional_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
version: 2.1

orbs:
node: circleci/[email protected]

executors:
base:
docker:
- image: cimg/base:stable
node:
docker:
- image: 'cimg/node:16.15.1'
go:
docker:
- image: cimg/go:1.19

parameters:
trigger-app:
type: boolean
default: false
trigger-ui:
type: boolean
default: false
run-them-all:
type: boolean
default: false

jobs:
## Backend
test_app:
executor: go
working_directory: ~/go/src/github.com/ArtalkJS/Artalk
environment:
GO111MODULE: "on"
steps:
- checkout
- run:
name: "Print the Go version"
command: >
go version
- restore_cache:
keys:
- go-mod-1.19-{{ checksum "go.sum" }}
- run:
name: Install Dependencies
command: go mod download
- save_cache:
key: go-mod-1.19-{{ checksum "go.sum" }}
paths:
- "~/go/pkg/mod"
- run:
name: Run tests
command: |
mkdir -p /tmp/test-reports
gotestsum --junitfile /tmp/test-reports/unit-tests.xml
- store_test_results:
path: /tmp/test-reports

## Frontend
test_ui:
executor: node
steps:
- node/install
- checkout
- run:
name: Print the node version
command: node -v
- run:
name: Install pnpm
command: npm i -g [email protected]
- run:
name: Install Dependencies
command: pnpm --dir ./ui install --frozen-lockfile
- run:
name: Build Artalk
command: pnpm --dir ./ui build:all

all_projects:
executor: base
steps:
- run:
command: |
echo "all"

workflows:
build-app:
when:
or:
- << pipeline.parameters.trigger-app >>
- << pipeline.parameters.run-them-all >>
jobs:
- test_app

build-ui:
when:
or:
- << pipeline.parameters.trigger-ui >>
- << pipeline.parameters.run-them-all >>
jobs:
- test_ui

build-shared-other:
when: << pipeline.parameters.run-them-all >>
jobs:
- all_projects
39 changes: 17 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
# https://circleci.com/docs/2.0/configuration-reference
version: 2.1

# this allows you to use CircleCI's dynamic configuration
# https://circleci.com/docs/2.0/dynamic-config/
setup: true

# the path-filtering orb is required to continue a pipeline based on
# https://circleci.com/developer/orbs/orb/circleci/path-filtering
orbs:
node: circleci/[email protected]
jobs:
build:
docker:
- image: 'cimg/node:16.15.1'
steps:
- node/install
- checkout
- run:
name: Print the node version
command: node -v
- run:
name: Install pnpm
command: npm i -g [email protected]
- run:
name: Install Dependencies
command: pnpm install --frozen-lockfile
- run:
name: Build Artalk
command: pnpm build:all
path-filtering: circleci/[email protected]

workflows:
tests:
setup:
jobs:
- build:
- path-filtering/filter:
mapping: |
(cmd|internal|server|pkg|test)/.* trigger-app true
main.go|go.mod|go.sum|artalk.example.yml trigger-app true
(ui)/.* trigger-ui true
base-revision: master # git branch name
config-path: .circleci/conditional_config.yml
filters:
branches:
ignore:
Expand Down
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,19 @@ indent_style = space
indent_size = 2

[*.md]
indent_size = 2
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2

[{Makefile,go.mod,go.sum,*.go,.gitmodules}]
indent_style = tab
indent_size = 4

[*.sh]
indent_size = 4

[Dockerfile]
indent_size = 4
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: [ 'go', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

Expand All @@ -48,11 +48,11 @@ jobs:
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
Expand All @@ -61,7 +61,7 @@ jobs:
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI to Docker Hub

on:
push:
# branches:
# - "master"
tags:
- "v*"
# pull_request:
# branches:
# - "master"

jobs:
docker:
if: github.repository == 'ArtalkJS/Artalk'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@master
- run: |
git fetch --prune --unshallow --tags -f

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

# Docker tag 值生成
# https://github.com/docker/metadata-action
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/artalk
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha

# 编译多平台
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
with:
platforms: 'amd64,arm64' # 'all'

# 缓存 Docker
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

# build docker image
# https://github.com/docker/build-push-action
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./
file: ./Dockerfile
platforms: 'linux/amd64,linux/arm64' # ',linux/arm/v7'
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# 缓存
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
49 changes: 49 additions & 0 deletions .github/workflows/docs-cn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: China Mirror Deploy

on:
push:
branches:
- "master"

jobs:
deploy:
if: github.repository == 'ArtalkJS/Artalk'

runs-on: ubuntu-latest

defaults:
run:
working-directory: ./docs # set for building docs

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use pnpm
uses: pnpm/[email protected]
with:
version: 7.2.1

- name: Set node version to 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm docs:build

- name: Deploy
uses: TencentCloud/cos-action@v1
with:
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
cos_bucket: ${{ secrets.DOCS_CN_COS_BUCKET }}
cos_region: ${{ secrets.DOCS_CN_COS_REGION }}
local_path: .vitepress/dist/
remote_path: /
clean: true
10 changes: 8 additions & 2 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ jobs:
publish:
# prevents this action from running on forks
if: github.repository == 'ArtalkJS/Artalk'

runs-on: ubuntu-latest

defaults:
run:
working-directory: ./ui # set for building UI

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use pnpm
uses: pnpm/[email protected]
with:
version: 7.11.0
version: 7.25.0

- name: Set node version to 16.x
uses: actions/setup-node@v3
Expand All @@ -34,7 +40,7 @@ jobs:
run: pnpm build

- name: Publish
run: cd packages/artalk && pnpm publish --no-git-checks
run: pnpm publish -F artalk --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down
Loading