flobee / gitea-installer Goto Github PK
View Code? Open in Web Editor NEWHelper script/s to update or install go-gitea/gitea binary version from scratch
License: Other
Helper script/s to update or install go-gitea/gitea binary version from scratch
License: Other
Hello, it's me again. I have a more specific issue for you this time, encountered during an update run. When I ran sudo ./update.sh
I saw this:
Download url: 'https://dl.gitea.com/gitea/1.20.5/gitea-1.20.5-linux-arm64'
Download sources now? (defaut: 'Y')
Confirm (Y)es,(n)o (def:'Y'):
/tmp/latest 100%[=============================================>] 121.93M 5.55MB/s in 22s
/tmp/latest.sha256 100%[=============================================>] 91 --.-KB/s in 0s
Download checksum check...
sha256sum: gitea-1.20.5-linux-arm64: No such file or directory
OK
# install binary
---------------------------------------------------------------------
If you dont see any erros.. the service was removed, re-added and
gitea was started again. (If you run this script e.g for updates)
NOTE: gitea app.ini is temporary set with write rights for user git so that the
Web installer could write the configuration file.
After installation is done it is recommended to set rights to read-only to keep
the config secure. Please run:
chmod 750 /home/git/tea/custom/conf/
chmod 640 /home/git/tea/custom/conf/app.ini
chown -R root:git /home/git/tea/custom/conf/
To check if the service is runing:
systemctl status gitea.service
Checking migration status:
tail -f /home/git/tea/log/gitea.log
Happy git + tea :)
Notice these lines in particular:
Download checksum check...
sha256sum: gitea-1.20.5-linux-arm64: No such file or directory
OK
So the update script attempts to check the SHA256 hash, fails, and then continues anyway. This surely is not intended behaviour?
Inside the download.sh
script, it says this:
if [ `sha256sum --status -c "${GITEA_BIN_BASENAME}.sha256"` ]; then
echo 'Checksum error';
exit 1;
else
echo "OK";
fi
There are two problems. The first is that the logic in the above if
is inverted: sha256sum --status -c
will return success (0) if it finds the file and its hash matches, and in that case it will hit the 'Checksum error' condition. Only if the sha256sum
call fails to match the hash will it hit the "OK" condition. Easy solution is to switch the positions of the two outcomes.
The second problem is that the sha256sum
program assumes the file will have the same name as it does in the hash file, i.e. the same name as on the server. But download.sh
saves the file to latest
(and the hash to latest.sha256
). This seems to be a consequence of GITEA_BIN_BASENAME
being defined in config.sh-dist
, which is invoked prior to config.sh
, and thus any variables which depend on fields changed by config.sh
will not be updated. Solving this might need a little bit of refactoring so that dependent variables wait until config.sh
is loaded before being defined. Or (possibly) download.sh
does not override the output file name from what the server calls the file.
Hello,
I recently used these scripts to install a new instance of Gitea 1.19.3 on Debian Bookworm running on RaspberryPi 4 (64bit) hardware. I succeeded eventually, but not without some hiccups (sorry for posting multiple issues together - I have limited time):
I addressed each of those problems as I went, and now have a working Gitea server. Thanks for your helpful scripts!
Best,
Brendon
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.