diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..bef8cc7 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,17 @@ +pkgname=mycorrhiza +pkgver=1.1.0 +pkgrel=1 +pkgdesc="Filesystem and git-based wiki engine written in Go using mycomarkup as its primary markup language." +arch=('x86_64' 'i686') +url="https://github.com/bouncepaw/mycorrhiza" +license=('AGPL3') +depends=('git') +source_x86_64=("$pkgname-$pkgver.tar.gz::https://github.com/bouncepaw/mycorrhiza/releases/download/v$pkgver/mycorrhiza-v$pkgver-linux-amd64.tar.gz") +source_i686=("$pkgname-$pkgver.tar.gz::https://github.com/bouncepaw/mycorrhiza/releases/download/v$pkgver/mycorrhiza-v$pkgver-linux-868.tar.gz") +md5sums_x86_64=('aa62f1c71f082332df4f67d40c8dcdbd') +md5sums_i686=('aa62f1c71f082332df4f67d40c8dcdbd') + +package() { + install -Dm755 "mycorrhiza" "$pkgdir/usr/bin/mycorrhiza" +} + diff --git a/README.md b/README.md index 5a7b52a..dc15a79 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,19 @@ A wiki engine. ## Building See [the guide](https://mycorrhiza.lesarbr.es/hypha/guide/deployment) on the wiki. +## Installing + +If you use a linux distro with pacman package manager (Arch, Manjaro, Garuda, etc) you can install it using PKGBUILD: +```sh +$ wget https://raw.githubusercontent.com/bouncepaw/mycorrhiza/master/PKGBUILD +$ makepkg --install +``` + ## Usage ``` mycorrhiza [OPTIONS...] WIKI_PATH -WIKI_PATH must be a path to git repository which you want to be a wiki. +WIKI_PATH must be a path to a git repository which you want to be a wiki. Options: -config-path string @@ -21,7 +29,7 @@ Options: ## Features * Wiki pages (called hyphae) are written in mycomarkup -* Edit pages through html forms, graphical preview, toolbar that helps you use the markup +* Edit pages through html forms, a graphical preview and a toolbar that helps you use mycomarkup * Responsive design, dark theme (synced with system theme) * Works in text browsers * Everything is stored as simple files, no database required. You can run a wiki on almost any directory and get something to work with @@ -31,13 +39,13 @@ Options: * History page * Random page * Recent changes page; RSS, Atom and JSON feeds available -* Hyphae can be deleted (while still preserving history) +* Hyphae can be deleted while still preserving history * Hyphae can be renamed (recursive renaming of subhyphae is also supported) * Light on resources * Authorization with pre-set credentials, registration * Basic Gemini protocol support ## Contributing -Help is always needed. We have a [tg chat](https://t.me/mycorrhizadev) where some development is coordinated. You can also sponsor on [boosty](https://boosty.to/bouncepaw). Feel free to open an issue or contact directly. +Help is always needed. We have a [tg chat](https://t.me/mycorrhizadev) where some development is coordinated. You can also sponsor bouncepaw on [boosty](https://boosty.to/bouncepaw). Feel free to open an issue or contact us directly. You can view list of all planned features on [our kanban board](https://github.com/bouncepaw/mycorrhiza/projects/1). diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..c890ba6 --- /dev/null +++ b/default.nix @@ -0,0 +1,5 @@ +{ pkgs ? import {} }: + +# TODO: add shell support +pkgs.callPackage ./release.nix { } + diff --git a/release.nix b/release.nix new file mode 100644 index 0000000..a9b0410 --- /dev/null +++ b/release.nix @@ -0,0 +1,33 @@ +{ stdenv, lib, fetchFromGitHub, buildGoModule +, git +}: + +buildGoModule rec { + pname = "mycorrhiza"; + version = "1.1.0"; + + src = ./.; + + # That's for a nixpkgs release or something. Mind the hashes. + # src = fetchFromGitHub { + # owner = "bouncepaw"; + # repo = "mycorrhiza"; + # rev = "v${version}"; + # sha256 = "0di4msrl44jcnhck11k0r7974cjnwdyw45b3hf0s3dbwx6ijdkdd"; + # fetchSubmodules = true; + # }; + + vendorSha256 = "0hxcbfh55avly9gvdysqgjzh66g7rdy2l0wmy9jnlq0skpa6j0jq"; + + subPackages = [ "." ]; + + propagatedBuildInputs = [ git ]; + + meta = with lib; { + description = "Filesystem and git-based wiki engine written in Go using mycomarkup as its primary markup language"; + homepage = "https://github.com/bouncepaw/mycorrhiza"; + license = licenses.agpl3; + # maintainers = with maintainers; [ bouncepaw ]; + platforms = platforms.linux; + }; +} diff --git a/user/files.go b/user/files.go index bb8465e..eb11039 100644 --- a/user/files.go +++ b/user/files.go @@ -103,7 +103,7 @@ func dumpRegistrationCredentials() error { tmp = append(tmp, copiedUser) } - blob, err := json.Marshal(tmp) + blob, err := json.MarshalIndent(tmp, "", "\t") if err != nil { log.Println(err) return err @@ -126,7 +126,7 @@ func dumpTokens() { return true }) - blob, err := json.Marshal(tmp) + blob, err := json.MarshalIndent(tmp, "", "\t") if err != nil { log.Println(err) } else {