summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Whited2018-11-12 15:27:36 -0600
committerSam Whited2018-11-12 16:32:15 -0600
commitf98adf026dabd9b2b05fdfa6e1d786a9e0b0ff6c (patch)
treed46fba6b496c0b9a4a2320b3b62eee953d8132e5
downloadaur-f98adf026dabd9b2b05fdfa6e1d786a9e0b0ff6c.tar.gz
Initial commit v0.2.0
-rw-r--r--.SRCINFO23
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD46
-rw-r--r--config.ini26
-rw-r--r--writefreely-sysusers.conf1
-rw-r--r--writefreely.install6
-rw-r--r--writefreely.service34
-rw-r--r--writefreely.tmpfiles2
8 files changed, 143 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..aaaa90caa66
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = writefreely
+ pkgdesc = Write.as GTK desktop app
+ pkgver = 0.2.0
+ pkgrel = 1
+ url = https://writefreely.org/
+ install = writefreely.install
+ arch = x86_64
+ license = AGPL3
+ depends = mariadb
+ backup = etc/writefreely/config.ini
+ source = writefreely.tmpfiles
+ source = writefreely-sysusers.conf
+ source = writefreely.service
+ source = config.ini
+ source = https://github.com/writeas/writefreely/releases/download/v0.2.0/writefreely_0.2_linux_amd64.tar.gz
+ sha256sums = fe04838284663b3725d5bb1cd82ca8fbe180512d59200c88b0a5829f8e390b2d
+ sha256sums = 6c74c81e27165851daf20d4bcf958227342f063aa3ec53b1cb86a56dac565f10
+ sha256sums = dbb332d30c49a8b9f8a1f926c0b3439c1487d395fbef979481f9e76e53a3bcaa
+ sha256sums = a3ef5fcb0ab3459b739245cd5667c478973efad7fc5a04a054edf7f6a6d2188b
+ sha256sums = 79c8a37f472e8563f2add3352b9302879f7ff81aa49268557dd1e0bd16ecfbf6
+
+pkgname = writefreely
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..b53c6dff121
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+pkg/
+src/
+*.zip
+*.tar.xz
+*.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..6393ea61937
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Sam Whited <sam@samwhited.com>
+
+pkgname=writefreely
+_shortpkgver=0.2
+pkgver=${_shortpkgver}.0
+pkgrel=1
+pkgdesc='Write.as GTK desktop app'
+arch=('x86_64')
+url='https://writefreely.org/'
+license=('AGPL3')
+depends=('mariadb')
+backup=('etc/writefreely/config.ini')
+install=writefreely.install
+source=('writefreely.tmpfiles'
+ 'writefreely-sysusers.conf'
+ 'writefreely.service'
+ 'config.ini'
+ "https://github.com/writeas/writefreely/releases/download/v${pkgver}/writefreely_${_shortpkgver}_linux_amd64.tar.gz")
+sha256sums=('fe04838284663b3725d5bb1cd82ca8fbe180512d59200c88b0a5829f8e390b2d'
+ '6c74c81e27165851daf20d4bcf958227342f063aa3ec53b1cb86a56dac565f10'
+ 'dbb332d30c49a8b9f8a1f926c0b3439c1487d395fbef979481f9e76e53a3bcaa'
+ 'a3ef5fcb0ab3459b739245cd5667c478973efad7fc5a04a054edf7f6a6d2188b'
+ '79c8a37f472e8563f2add3352b9302879f7ff81aa49268557dd1e0bd16ecfbf6')
+
+package() {
+ # -o writefreely -g writefreely
+ install -dm770 "${pkgdir}"/var/lib/writefreely/data
+ install -dm770 "${pkgdir}"/var/lib/writefreely/keys
+ install -dm770 "${pkgdir}"/var/lib/writefreely/pages
+ install -dm770 "${pkgdir}"/var/lib/writefreely/static
+ install -dm770 "${pkgdir}"/var/lib/writefreely/templates
+ install -Dm644 writefreely.service -t "${pkgdir}"/usr/lib/systemd/system/
+ install -Dm755 writefreely "${pkgdir}"/usr/bin/writefreely
+ install -Dm644 writefreely.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/writefreely.conf
+ install -Dm644 writefreely-sysusers.conf "${pkgdir}"/usr/lib/sysusers.d/writefreely.conf
+
+ # These files should probably be in /usr/share and /etc but writefreely
+ # expects everything in the same directory.
+ install -Dm644 config.ini "${pkgdir}"/var/lib/writefreely/config.ini
+ install -Dm644 schema.sql "${pkgdir}"/var/lib/writefreely/schema.sql
+ cp -r pages/* "${pkgdir}"/var/lib/writefreely/pages
+ cp -r static/* "${pkgdir}"/var/lib/writefreely/static
+ cp -r templates/* "${pkgdir}"/var/lib/writefreely/templates
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/config.ini b/config.ini
new file mode 100644
index 00000000000..0edefb15108
--- /dev/null
+++ b/config.ini
@@ -0,0 +1,26 @@
+[server]
+hidden_host =
+port = 8080
+
+[database]
+type = mysql
+username =
+password =
+database =
+host = localhost
+port = 3306
+
+[app]
+site_name =
+host = http://localhost:8080
+theme = write
+disable_js = false
+webfonts = true
+single_user = true
+open_registration = false
+min_username_len = 3
+max_blogs = 1
+federation = true
+public_stats = true
+private = false
+
diff --git a/writefreely-sysusers.conf b/writefreely-sysusers.conf
new file mode 100644
index 00000000000..a01f780dca9
--- /dev/null
+++ b/writefreely-sysusers.conf
@@ -0,0 +1 @@
+u writefreely - "writefreely blogging platform daemon" - -
diff --git a/writefreely.install b/writefreely.install
new file mode 100644
index 00000000000..30d076ee5b4
--- /dev/null
+++ b/writefreely.install
@@ -0,0 +1,6 @@
+post_install() {
+ chown -R writefreely:writefreely /var/lib/writefreely
+
+ cd /var/lib/writefreely
+ sudo -u writefreely writefreely -gen-keys
+}
diff --git a/writefreely.service b/writefreely.service
new file mode 100644
index 00000000000..4672206f42b
--- /dev/null
+++ b/writefreely.service
@@ -0,0 +1,34 @@
+[Unit]
+Description=Write Freely
+After=syslog.target
+After=network.target
+After=mysqld.service
+After=mariadb.service
+
+[Service]
+User=writefreely
+Group=writefreely
+Type=simple
+WorkingDirectory=/var/lib/writefreely
+ExecStart=/usr/bin/writefreely
+Restart=always
+RestartSec=2s
+CapabilityBoundingSet=
+NoNewPrivileges=true
+PrivateUsers=true
+PrivateDevices=true
+PrivateTmp=true
+ProtectHome=true
+ProtectSystem=strict
+ProtectControlGroups=yes
+ProtectKernelTunables=true
+ProtectKernelModules=yes
+ReadWritePaths=/var/lib/writefreely
+LockPersonality=true
+MemoryDenyWriteExecute=true
+RestrictRealtime=true
+SystemCallArchitectures=native
+SystemCallFilter=@system-service
+
+[Install]
+WantedBy=multi-user.target
diff --git a/writefreely.tmpfiles b/writefreely.tmpfiles
new file mode 100644
index 00000000000..a80eb333e59
--- /dev/null
+++ b/writefreely.tmpfiles
@@ -0,0 +1,2 @@
+d /var/lib/writefreely 0750 writefreely writefreely
+d /var/lib/writefreely/keys 0750 writefreely writefreely