summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO10
-rw-r--r--0002-Fix-Paths.patch66
-rw-r--r--PKGBUILD18
-rw-r--r--earthwalker.env25
-rw-r--r--earthwalker.install3
-rw-r--r--earthwalker.service2
6 files changed, 13 insertions, 111 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 78052666081..179a5d2237b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = earthwalker-git
pkgdesc = A selfhosted browsergame in which you find out where you are by navigating StreetView.
- pkgver = r272.c4b7337
- pkgrel = 3
+ pkgver = r280.5723714
+ pkgrel = 1
url = https://gitlab.com/glatteis/earthwalker
install = earthwalker.install
arch = i686
@@ -21,14 +21,12 @@ pkgbase = earthwalker-git
source = earthwalker.sysusers.conf
source = earthwalker.tmpfiles.conf
source = 0001-Adapt-Config.patch
- source = 0002-Fix-Paths.patch
sha512sums = SKIP
- sha512sums = 484d5b10b83202dcf0bc0b0717c637f806f1a457d54dd78185ad56316cfbef49ab16338d15994cde1923b1f31cfcac6d7b7b66e15051c3f59fa85f3df9c6daab
- sha512sums = 754aaed7d7e039a45266a217376607fe54f7e2fefaaeef6c4d604572bd45147947ba607b0d71cb5f5c7ab02fea682c45838edeff2b6fff6565da94511cd063b7
+ sha512sums = d69fa71bf2dffb38e31ff32b6d0cb77ffc5f66540a5a54bac3ed1a58794b82148d37ab18e7dca9276324d39d638d7b78a50ee26302f5ce149c9eef21d9967204
+ sha512sums = 467349a18238f5bc8bb1a6b73b094ddcdb2c9aeab7a11eecde2335ada98abf0654862791d5f36b48a59354c62ebc739693952e3830cc7a1ccdb24b062a60e1ed
sha512sums = 03823fd28e00034932e6f30912f93f6c58cf5897a99bc4c9b96cda73bb17e0391c9a3937ef587ddd9bac54581f9337f86046b0ce29af3702444f162baca33439
sha512sums = c2ddeba33f565ffa2a78ffedfaacb5e0ed8030c67c2f45e3286261b7e005739d3c4cd16ce5e59c46c9eba14f514270ccae343c4879d11f57d418cb596a9a8e1e
sha512sums = bb357c1c64d6451fe9eb93c946ade46d174108fdbe04b79b89ac5116accef11ab332349b7f4329887efa2a73620dbf8c5b0cc4288ab08aa16b0740d82a6f76b4
- sha512sums = 91e66257356bf4e554a82abf16dd752f7e697c9082a0a625a81fa3c8fe5b9557b503b2931279a66faf4bfca055572a2142fea1dbe78156bfd92e0da917ca7919
pkgname = earthwalker-git
diff --git a/0002-Fix-Paths.patch b/0002-Fix-Paths.patch
deleted file mode 100644
index d31aad46b91..00000000000
--- a/0002-Fix-Paths.patch
+++ /dev/null
@@ -1,66 +0,0 @@
---- a/handlers/play.go
-+++ b/handlers/play.go
-@@ -20,6 +20,7 @@ const resultCookiePrefix = "earthwalker_lastResult_"
- type Play struct {
- ChallengeStore domain.ChallengeStore
- ChallengeResultStore domain.ChallengeResultStore
-+ Config domain.Config
- }
-
- func (handler Play) ServeHTTP(w http.ResponseWriter, r *http.Request) {
-@@ -67,7 +68,7 @@ func (handler Play) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- log.Println(challenge.Places[len(result.Guesses)].Location)
- // TODO: FIXME: this fails catastrophically if the player has already
- // completed the challenge and tries to navigate back to /play
-- ServeLocation(challenge.Places[len(result.Guesses)].Location, w, r)
-+ handler.ServeLocation(challenge.Places[len(result.Guesses)].Location, w, r)
- }
-
- func getChallengeID(r *http.Request) (string, error) {
-@@ -92,7 +93,7 @@ func getResultID(r *http.Request, challengeID string) (string, error) {
- return resultCookie.Value, nil
- }
-
--func modifyMainPage(target string, w http.ResponseWriter, r *http.Request) {
-+func (handler Play) modifyMainPage(target string, w http.ResponseWriter, r *http.Request) {
- res, err := http.Get(target)
- if err != nil {
- http.Error(w, err.Error(), http.StatusForbidden)
-@@ -107,7 +108,7 @@ func modifyMainPage(target string, w http.ResponseWriter, r *http.Request) {
- bodyAsString := string(body)
-
- // TODO: FIXME: use config static path
-- insertBody, err := ioutil.ReadFile("public/modify_frontend/modify.html")
-+ insertBody, err := ioutil.ReadFile(handler.Config.StaticPath + "/public/modify_frontend/modify.html")
- if err != nil {
- log.Fatal(err)
- }
-@@ -169,9 +170,9 @@ func buildURL(location domain.Coords) string {
- }
-
- // ServeLocation serves a specific location to the user.
--func ServeLocation(l domain.Coords, w http.ResponseWriter, r *http.Request) {
-+func (handler Play) ServeLocation(l domain.Coords, w http.ResponseWriter, r *http.Request) {
- mapsURL := buildURL(l)
-- modifyMainPage(mapsURL, w, r)
-+ handler.modifyMainPage(mapsURL, w, r)
- }
-
- // ServeMaps is a proxy to google maps
-diff --git a/main.go b/main.go
-index 1fb231a..8bbabbf 100644
---- a/main.go
-+++ b/main.go
-@@ -104,10 +104,11 @@ func main() {
- http.Handle("/play/", handlers.Play{
- ChallengeStore: challengeStore,
- ChallengeResultStore: challengeResultStore,
-+ Config: conf,
- })
- http.HandleFunc("/maps/", handlers.ServeMaps)
- // Otherwise, just serve index.html and let the frontend deal with the consequences
-- http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "public/index.html") })
-+ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, conf.StaticPath+"/public/index.html") })
-
- // == ENGAGE ========
- log.Println("earthwalker is running on ", port)
diff --git a/PKGBUILD b/PKGBUILD
index d5de20876a9..461f51538c1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,8 +3,8 @@
pkgname=earthwalker-git
_pkgbase=earthwalker
-pkgver=r272.c4b7337
-pkgrel=4
+pkgver=r280.5723714
+pkgrel=1
pkgdesc="A selfhosted browsergame in which you find out where you are by navigating StreetView."
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="https://gitlab.com/glatteis/earthwalker"
@@ -21,15 +21,13 @@ source=('git+https://gitlab.com/glatteis/earthwalker.git'
"${_pkgbase}.service"
"${_pkgbase}.sysusers.conf"
"${_pkgbase}.tmpfiles.conf"
- "0001-Adapt-Config.patch"
- "0002-Fix-Paths.patch")
+ "0001-Adapt-Config.patch")
sha512sums=('SKIP'
- '484d5b10b83202dcf0bc0b0717c637f806f1a457d54dd78185ad56316cfbef49ab16338d15994cde1923b1f31cfcac6d7b7b66e15051c3f59fa85f3df9c6daab'
- '754aaed7d7e039a45266a217376607fe54f7e2fefaaeef6c4d604572bd45147947ba607b0d71cb5f5c7ab02fea682c45838edeff2b6fff6565da94511cd063b7'
+ 'd69fa71bf2dffb38e31ff32b6d0cb77ffc5f66540a5a54bac3ed1a58794b82148d37ab18e7dca9276324d39d638d7b78a50ee26302f5ce149c9eef21d9967204'
+ '467349a18238f5bc8bb1a6b73b094ddcdb2c9aeab7a11eecde2335ada98abf0654862791d5f36b48a59354c62ebc739693952e3830cc7a1ccdb24b062a60e1ed'
'03823fd28e00034932e6f30912f93f6c58cf5897a99bc4c9b96cda73bb17e0391c9a3937ef587ddd9bac54581f9337f86046b0ce29af3702444f162baca33439'
'c2ddeba33f565ffa2a78ffedfaacb5e0ed8030c67c2f45e3286261b7e005739d3c4cd16ce5e59c46c9eba14f514270ccae343c4879d11f57d418cb596a9a8e1e'
- 'bb357c1c64d6451fe9eb93c946ade46d174108fdbe04b79b89ac5116accef11ab332349b7f4329887efa2a73620dbf8c5b0cc4288ab08aa16b0740d82a6f76b4'
- '91e66257356bf4e554a82abf16dd752f7e697c9082a0a625a81fa3c8fe5b9557b503b2931279a66faf4bfca055572a2142fea1dbe78156bfd92e0da917ca7919')
+ 'bb357c1c64d6451fe9eb93c946ade46d174108fdbe04b79b89ac5116accef11ab332349b7f4329887efa2a73620dbf8c5b0cc4288ab08aa16b0740d82a6f76b4')
pkgver() {
@@ -43,7 +41,6 @@ pkgver() {
build() {
cd "$srcdir/$_pkgbase"
patch -N -p1 -i "$srcdir/0001-Adapt-Config.patch"
- patch -N -p1 -i "$srcdir/0002-Fix-Paths.patch"
make
}
@@ -61,14 +58,11 @@ package() {
install -D -m 0644 "$srcdir/${_pkgbase}.tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/${_pkgbase}.conf"
# copy default config files
- #install -D -m 0644 "$srcdir/${_pkgbase}.env" "$pkgdir/etc/${_pkgbase}/${_pkgbase}.env"
install -D -m 0644 "$srcdir/$_pkgbase/config.toml.sample" "$pkgdir/etc/${_pkgbase}/config.toml"
# copy application data
install -d "$pkgdir/usr/share/${_pkgbase}"
cp -r "$srcdir/${_pkgbase}/public" "$pkgdir/usr/share/${_pkgbase}"
-# cp -r "$srcdir/${_pkgbase}/static" "$pkgdir/usr/share/${_pkgbase}"
-# cp -r "$srcdir/${_pkgbase}/templates" "$pkgdir/usr/share/${_pkgbase}"
# copy binary
install -D -m 0755 "$srcdir/$_pkgbase/${_pkgbase}" "$pkgdir/usr/bin/${_pkgbase}"
diff --git a/earthwalker.env b/earthwalker.env
deleted file mode 100644
index 9e7cc7c2d5c..00000000000
--- a/earthwalker.env
+++ /dev/null
@@ -1,25 +0,0 @@
-### IMPORTANT!!! THIS FILE IS NO LONGER USED! ANYTHING IN HERE CAN BE CONFIGURED IN CONFIG.TOML/EARTHWALKER.SERVICE!!! ###
-
-### Paths
-
-# The path where the static files, like javascript and templates are located.`static` and `templates` are expected to be subdirectories of the specified path. Defaults to the location of the binary.
-#EARTHWALKER_STATIC_PATH=<location of binary>
-EARTHWALKER_STATIC_PATH=/usr/share/earthwalker/public
-
-
-# The path where the config file is located. Defaults to $PWD/config.toml
-#EARTHWALKER_CONFIG_PATH=config.toml
-EARTHWALKER_CONFIG_PATH=/etc/earthwalker/config.toml
-
-# The path where the database is located. Defaults to <the dir where the binary is located>/badger
-#EARTHWALKER_DB_PATH=/badger
-EARTHWALKER_DB_PATH=/badger
-# Defines if the path is relative to the executable(`executable`), relative to the current working dir(`cwd`) or absolute(`absolute`). Defaults to `executable`.
-#EARTHWALKER_DB_PATH_REL=executable
-EARTHWALKER_DB_PATH_REL=cwd
-
-
-### Web settings
-
-# The tcp port on which earthwalker listens.
-#EARTHWALKER_PORT=8080
diff --git a/earthwalker.install b/earthwalker.install
index ec36f0e1adb..49242e86622 100644
--- a/earthwalker.install
+++ b/earthwalker.install
@@ -2,8 +2,9 @@ post_install() {
echo ""
echo "##########"
echo "#"
- #TODO echo "# Remember to configure the server via its environment-variables under /etc/earthwalker.env"
+ echo "# Remember to configure the server via its configuration file at /etc/earthwalker/config.toml"
echo "# After installing, start/enable the server via 'systemctl enable earthwalker.service --now'"
+ echo '# earthwalker should then be reachable under http://$yourIPAdress:$PortSetInConfig.'
echo "#"
echo "##########"
echo ""
diff --git a/earthwalker.service b/earthwalker.service
index 8980041e107..89169ffd28d 100644
--- a/earthwalker.service
+++ b/earthwalker.service
@@ -17,7 +17,7 @@ ExecStart=/usr/bin/earthwalker
LimitNOFILE=1048576
LimitNPROC=64
-# Only allow writes to the following directory and set it to the working directory (user and password data are stored here)
+# Only allow writes to the following directory and set it to the working directory (application data are stored here)
WorkingDirectory=/var/lib/earthwalker
ReadWritePaths=/var/lib/earthwalker