├── .gitignore ├── .sandstorm ├── Vagrantfile ├── app-graphics │ ├── appGrid.png │ ├── grain.png │ └── market.png ├── build.sh ├── description.md ├── global-setup.sh ├── launcher.sh ├── pgp-keyring ├── pgp-signature ├── sandstorm-files.list ├── sandstorm-pkgdef.capnp ├── screenshot.png ├── setup.sh └── stack ├── Makefile ├── README.md ├── custom └── conf │ └── app.ini └── scripts └── build.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.spk 2 | /.sandstorm/.vagrant 3 | /build 4 | /gogs 5 | -------------------------------------------------------------------------------- /.sandstorm/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # Guess at a reasonable name for the VM based on the folder vagrant-spk is 5 | # run from. The timestamp is there to avoid conflicts if you have multiple 6 | # folders with the same name. 7 | VM_NAME = File.basename(File.dirname(File.dirname(__FILE__))) + "_sandstorm_#{Time.now.utc.to_i}" 8 | 9 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 10 | VAGRANTFILE_API_VERSION = "2" 11 | 12 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 13 | # Base on the Sandstorm snapshots of the official Debian 8 (jessie) box. 14 | config.vm.box = "sandstorm/debian-jessie64" 15 | 16 | if Vagrant.has_plugin?("vagrant-vbguest") then 17 | # vagrant-vbguest is a Vagrant plugin that upgrades 18 | # the version of VirtualBox Guest Additions within each 19 | # guest. If you have the vagrant-vbguest plugin, then it 20 | # needs to know how to compile kernel modules, etc., and so 21 | # we give it this hint about operating system type. 22 | config.vm.guest = "debian" 23 | end 24 | 25 | # We forward port 6080, the Sandstorm web port, so that developers can 26 | # visit their sandstorm app from their browser as local.sandstorm.io:6080 27 | # (aka 127.0.0.1:6080). 28 | config.vm.network :forwarded_port, guest: 6080, host: 6080 29 | 30 | # Use a shell script to "provision" the box. This installs Sandstorm using 31 | # the bundled installer. 32 | config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/global-setup.sh", keep_color: true 33 | # Then, do stack-specific and app-specific setup. 34 | config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/setup.sh", keep_color: true 35 | 36 | # Shared folders are configured per-provider since vboxsf can't handle >4096 open files, 37 | # NFS requires privilege escalation every time you bring a VM up, 38 | # and 9p is only available on libvirt. 39 | 40 | # Calculate the number of CPUs and the amount of RAM the system has, 41 | # in a platform-dependent way; further logic below. 42 | cpus = nil 43 | total_kB_ram = nil 44 | 45 | host = RbConfig::CONFIG['host_os'] 46 | if host =~ /darwin/ 47 | cpus = `sysctl -n hw.ncpu`.to_i 48 | total_kB_ram = `sysctl -n hw.memsize`.to_i / 1024 49 | elsif host =~ /linux/ 50 | cpus = `nproc`.to_i 51 | total_kB_ram = `grep MemTotal /proc/meminfo | awk '{print $2}'`.to_i 52 | elsif host =~ /mingw/ 53 | # powershell may not be available on Windows XP and Vista, so wrap this in a rescue block 54 | begin 55 | cpus = `powershell -Command "(Get-WmiObject Win32_Processor -Property NumberOfLogicalProcessors | Select-Object -Property NumberOfLogicalProcessors | Measure-Object NumberOfLogicalProcessors -Sum).Sum"`.to_i 56 | total_kB_ram = `powershell -Command "Get-CimInstance -class cim_physicalmemory | % $_.Capacity}"`.to_i / 1024 57 | rescue 58 | end 59 | end 60 | # Use the same number of CPUs within Vagrant as the system, with 1 61 | # as a default. 62 | # 63 | # Use at least 512MB of RAM, and if the system has more than 2GB of 64 | # RAM, use 1/4 of the system RAM. This seems a reasonable compromise 65 | # between having the Vagrant guest operating system not run out of 66 | # RAM entirely (which it basically would if we went much lower than 67 | # 512MB) and also allowing it to use up a healthily large amount of 68 | # RAM so it can run faster on systems that can afford it. 69 | if cpus.nil? or cpus.zero? 70 | cpus = 1 71 | end 72 | if total_kB_ram.nil? or total_kB_ram < 2048000 73 | assign_ram_mb = 512 74 | else 75 | assign_ram_mb = (total_kB_ram / 1024 / 4) 76 | end 77 | # Actually apply these CPU/memory values to the providers. 78 | config.vm.provider :virtualbox do |vb, override| 79 | vb.cpus = cpus 80 | vb.memory = assign_ram_mb 81 | vb.name = VM_NAME 82 | 83 | override.vm.synced_folder "..", "/opt/app" 84 | override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm" 85 | override.vm.synced_folder "..", "/vagrant" 86 | end 87 | config.vm.provider :libvirt do |libvirt, override| 88 | libvirt.cpus = cpus 89 | libvirt.memory = assign_ram_mb 90 | libvirt.default_prefix = VM_NAME 91 | 92 | override.vm.synced_folder "..", "/opt/app", type: "9p", accessmode: "passthrough" 93 | override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", type: "9p", accessmode: "passthrough" 94 | override.vm.synced_folder "..", "/vagrant", type: "9p", accessmode: "passthrough" 95 | end 96 | end 97 | -------------------------------------------------------------------------------- /.sandstorm/app-graphics/appGrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cem/gogs-sandstorm/1974e4570d90321f615c698878c3d2803a00f355/.sandstorm/app-graphics/appGrid.png -------------------------------------------------------------------------------- /.sandstorm/app-graphics/grain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cem/gogs-sandstorm/1974e4570d90321f615c698878c3d2803a00f355/.sandstorm/app-graphics/grain.png -------------------------------------------------------------------------------- /.sandstorm/app-graphics/market.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cem/gogs-sandstorm/1974e4570d90321f615c698878c3d2803a00f355/.sandstorm/app-graphics/market.png -------------------------------------------------------------------------------- /.sandstorm/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | # This script is run in the VM each time you run `vagrant-spk dev`. This is 4 | # the ideal place to invoke anything which is normally part of your app's build 5 | # process - transforming the code in your repository into the collection of files 6 | # which can actually run the service in production 7 | # 8 | # Some examples: 9 | # 10 | # * For a C/C++ application, calling 11 | # ./configure && make && make install 12 | # * For a Python application, creating a virtualenv and installing 13 | # app-specific package dependencies: 14 | # virtualenv /opt/app/env 15 | # /opt/app/env/bin/pip install -r /opt/app/requirements.txt 16 | # * Building static assets from .less or .sass, or bundle and minify JS 17 | # * Collecting various build artifacts or assets into a deployment-ready 18 | # directory structure 19 | 20 | # By default, this script does nothing. You'll have to modify it as 21 | # appropriate for your application. 22 | cd /opt/app 23 | exit 0 24 | -------------------------------------------------------------------------------- /.sandstorm/description.md: -------------------------------------------------------------------------------- 1 | Gogs is an advanced, yet lightweight git server written in Go. It comes with a familiar user interface that allows viewing files and commit info. It also includes an issue tracker. 2 | 3 | This is the Sandstorm port of [Gogs](http://gogs.io). 4 | -------------------------------------------------------------------------------- /.sandstorm/global-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | CURL_OPTS="--silent --show-error" 5 | echo localhost > /etc/hostname 6 | hostname localhost 7 | curl $CURL_OPTS https://install.sandstorm.io/ > /host-dot-sandstorm/caches/install.sh 8 | SANDSTORM_CURRENT_VERSION=$(curl $CURL_OPTS -f "https://install.sandstorm.io/dev?from=0&type=install") 9 | SANDSTORM_PACKAGE="sandstorm-$SANDSTORM_CURRENT_VERSION.tar.xz" 10 | if [[ ! -f /host-dot-sandstorm/caches/$SANDSTORM_PACKAGE ]] ; then 11 | echo -n "Downloading Sandstorm version ${SANDSTORM_CURRENT_VERSION}..." 12 | curl $CURL_OPTS --output "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "https://dl.sandstorm.io/$SANDSTORM_PACKAGE" 13 | mv "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" 14 | echo "...done." 15 | fi 16 | if [ ! -e /opt/sandstorm/latest/sandstorm ] ; then 17 | echo -n "Installing Sandstorm version ${SANDSTORM_CURRENT_VERSION}..." 18 | bash /host-dot-sandstorm/caches/install.sh -d -e "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" >/dev/null 19 | echo "...done." 20 | fi 21 | modprobe ip_tables 22 | # Make the vagrant user part of the sandstorm group so that commands like 23 | # `spk dev` work. 24 | usermod -a -G 'sandstorm' 'vagrant' 25 | # Bind to all addresses, so the vagrant port-forward works. 26 | sudo sed --in-place='' \ 27 | --expression='s/^BIND_IP=.*/BIND_IP=0.0.0.0/' \ 28 | /opt/sandstorm/sandstorm.conf 29 | sudo service sandstorm restart 30 | # Enable apt-cacher-ng proxy to make things faster if one appears to be running on the gateway IP 31 | GATEWAY_IP=$(ip route | grep ^default | cut -d ' ' -f 3) 32 | if nc -z "$GATEWAY_IP" 3142 ; then 33 | echo "Acquire::http::Proxy \"http://$GATEWAY_IP:3142\";" > /etc/apt/apt.conf.d/80httpproxy 34 | fi 35 | -------------------------------------------------------------------------------- /.sandstorm/launcher.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | # This script is run every time an instance of our app - aka grain - starts up. 4 | # This is the entry point for your application both when a grain is first launched 5 | # and when a grain resumes after being previously shut down. 6 | # 7 | # This script is responsible for launching everything your app needs to run. The 8 | # thing it should do *last* is: 9 | # 10 | # * Start a process in the foreground listening on port 8000 for HTTP requests. 11 | # 12 | # This is how you indicate to the platform that your application is up and 13 | # ready to receive requests. Often, this will be something like nginx serving 14 | # static files and reverse proxying for some other dynamic backend service. 15 | # 16 | # Other things you probably want to do in this script include: 17 | # 18 | # * Building folder structures in /var. /var is the only non-tmpfs folder 19 | # mounted read-write in the sandbox, and when a grain is first launched, it 20 | # will start out empty. It will persist between runs of the same grain, but 21 | # be unique per app instance. That is, two instances of the same app have 22 | # separate instances of /var. 23 | # * Preparing a database and running migrations. As your package changes 24 | # over time and you release updates, you will need to deal with migrating 25 | # data from previous schema versions to new ones, since users should not have 26 | # to think about such things. 27 | # * Launching other daemons your app needs (e.g. mysqld, redis-server, etc.) 28 | 29 | # By default, this script does nothing. You'll have to modify it as 30 | # appropriate for your application. 31 | 32 | export USER=gogsuser 33 | export HOME=/var/gogs/home 34 | export GIT_AUTHOR_NAME="gogs" 35 | export GIT_AUTHOR_EMAIL="gogs@localhost" 36 | export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" 37 | export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" 38 | 39 | 40 | if [ ! -d /var/gogs/home ]; then 41 | mkdir -p /var/gogs/home 42 | fi 43 | 44 | cd /var/gogs 45 | /opt/app/gogs/gogs web 46 | 47 | exit 0 48 | -------------------------------------------------------------------------------- /.sandstorm/pgp-keyring: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cem/gogs-sandstorm/1974e4570d90321f615c698878c3d2803a00f355/.sandstorm/pgp-keyring -------------------------------------------------------------------------------- /.sandstorm/pgp-signature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cem/gogs-sandstorm/1974e4570d90321f615c698878c3d2803a00f355/.sandstorm/pgp-signature -------------------------------------------------------------------------------- /.sandstorm/sandstorm-files.list: -------------------------------------------------------------------------------- 1 | # *** WARNING: GENERATED FILE *** 2 | # This file is automatically updated and rewritten in sorted order every time 3 | # the app runs in dev mode. You may manually add or remove files, but don't 4 | # expect comments or ordering to be retained. 5 | bin/bash 6 | bin/dash 7 | bin/mkdir 8 | bin/sed 9 | bin/sh 10 | bin/uname 11 | etc/ld.so.cache 12 | etc/localtime 13 | etc/mime.types 14 | lib/x86_64-linux-gnu/ld-2.19.so 15 | lib/x86_64-linux-gnu/libc-2.19.so 16 | lib/x86_64-linux-gnu/libc.so.6 17 | lib/x86_64-linux-gnu/libcom_err.so.2 18 | lib/x86_64-linux-gnu/libcom_err.so.2.1 19 | lib/x86_64-linux-gnu/libdl-2.19.so 20 | lib/x86_64-linux-gnu/libdl.so.2 21 | lib/x86_64-linux-gnu/libexpat.so.1 22 | lib/x86_64-linux-gnu/libexpat.so.1.6.0 23 | lib/x86_64-linux-gnu/libgcrypt.so.20 24 | lib/x86_64-linux-gnu/libgpg-error.so.0 25 | lib/x86_64-linux-gnu/libgpg-error.so.0.13.0 26 | lib/x86_64-linux-gnu/libkeyutils.so.1 27 | lib/x86_64-linux-gnu/libkeyutils.so.1.5 28 | lib/x86_64-linux-gnu/libncurses.so.5 29 | lib/x86_64-linux-gnu/libncurses.so.5.9 30 | lib/x86_64-linux-gnu/libnsl-2.19.so 31 | lib/x86_64-linux-gnu/libnsl.so.1 32 | lib/x86_64-linux-gnu/libnss_compat-2.19.so 33 | lib/x86_64-linux-gnu/libnss_compat.so.2 34 | lib/x86_64-linux-gnu/libnss_dns.so.2 35 | lib/x86_64-linux-gnu/libnss_files-2.19.so 36 | lib/x86_64-linux-gnu/libnss_files.so.2 37 | lib/x86_64-linux-gnu/libnss_nis-2.19.so 38 | lib/x86_64-linux-gnu/libnss_nis.so.2 39 | lib/x86_64-linux-gnu/libpcre.so.3 40 | lib/x86_64-linux-gnu/libpcre.so.3.13.1 41 | lib/x86_64-linux-gnu/libpthread-2.19.so 42 | lib/x86_64-linux-gnu/libpthread.so.0 43 | lib/x86_64-linux-gnu/libresolv-2.19.so 44 | lib/x86_64-linux-gnu/libresolv.so.2 45 | lib/x86_64-linux-gnu/librt-2.19.so 46 | lib/x86_64-linux-gnu/librt.so.1 47 | lib/x86_64-linux-gnu/libselinux.so.1 48 | lib/x86_64-linux-gnu/libtinfo.so.5 49 | lib/x86_64-linux-gnu/libtinfo.so.5.9 50 | lib/x86_64-linux-gnu/libz.so.1 51 | lib/x86_64-linux-gnu/libz.so.1.2.8 52 | lib64/ld-linux-x86-64.so.2 53 | opt/app/.sandstorm/launcher.sh 54 | opt/app/gogs/custom/conf/app.ini 55 | opt/app/gogs/gogs 56 | opt/app/gogs/public 57 | opt/app/gogs/public/assets/font-awesome-4.6.3/css/font-awesome.min.css 58 | opt/app/gogs/public/assets/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2 59 | opt/app/gogs/public/assets/octicons-4.3.0/octicons.min.css 60 | opt/app/gogs/public/assets/octicons-4.3.0/octicons.woff2 61 | opt/app/gogs/public/css/gogs.css 62 | opt/app/gogs/public/css/semantic-2.2.13.min.css 63 | opt/app/gogs/public/css/themes/default/assets/fonts/icons.woff2 64 | opt/app/gogs/public/img/404.png 65 | opt/app/gogs/public/img/dingtalk.png 66 | opt/app/gogs/public/img/discord.png 67 | opt/app/gogs/public/img/favicon.png 68 | opt/app/gogs/public/img/slack.png 69 | opt/app/gogs/public/js/gogs.js 70 | opt/app/gogs/public/js/jquery-1.11.3.min.js 71 | opt/app/gogs/public/js/libs/clipboard-1.5.9.min.js 72 | opt/app/gogs/public/js/libs/emojify-1.1.0.min.js 73 | opt/app/gogs/public/js/libs/identicon.js 74 | opt/app/gogs/public/js/libs/jquery.are-you-sure.js 75 | opt/app/gogs/public/js/semantic-2.2.13.min.js 76 | opt/app/gogs/public/plugins/codemirror-5.17.0/addon/mode/loadmode.js 77 | opt/app/gogs/public/plugins/codemirror-5.17.0/mode/meta.js 78 | opt/app/gogs/public/plugins/dropzone-4.2.0/dropzone.css 79 | opt/app/gogs/public/plugins/dropzone-4.2.0/dropzone.js 80 | opt/app/gogs/public/plugins/highlight-9.6.0/github.css 81 | opt/app/gogs/public/plugins/highlight-9.6.0/highlight.pack.js 82 | opt/app/gogs/public/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.css 83 | opt/app/gogs/public/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.js 84 | opt/app/gogs/public/plugins/jquery.minicolors-2.2.3/jquery.minicolors.css 85 | opt/app/gogs/public/plugins/jquery.minicolors-2.2.3/jquery.minicolors.min.js 86 | opt/app/gogs/public/plugins/simplemde-1.10.1/simplemde.min.css 87 | opt/app/gogs/public/plugins/simplemde-1.10.1/simplemde.min.js 88 | opt/app/gogs/templates 89 | opt/app/gogs/templates/.VERSION 90 | opt/app/gogs/templates/admin 91 | opt/app/gogs/templates/admin/auth 92 | opt/app/gogs/templates/admin/auth/edit.tmpl 93 | opt/app/gogs/templates/admin/auth/list.tmpl 94 | opt/app/gogs/templates/admin/auth/new.tmpl 95 | opt/app/gogs/templates/admin/base 96 | opt/app/gogs/templates/admin/base/page.tmpl 97 | opt/app/gogs/templates/admin/base/search.tmpl 98 | opt/app/gogs/templates/admin/config.tmpl 99 | opt/app/gogs/templates/admin/dashboard.tmpl 100 | opt/app/gogs/templates/admin/monitor.tmpl 101 | opt/app/gogs/templates/admin/nav.tmpl 102 | opt/app/gogs/templates/admin/navbar.tmpl 103 | opt/app/gogs/templates/admin/notice.tmpl 104 | opt/app/gogs/templates/admin/org 105 | opt/app/gogs/templates/admin/org/list.tmpl 106 | opt/app/gogs/templates/admin/repo 107 | opt/app/gogs/templates/admin/repo/list.tmpl 108 | opt/app/gogs/templates/admin/user 109 | opt/app/gogs/templates/admin/user/edit.tmpl 110 | opt/app/gogs/templates/admin/user/list.tmpl 111 | opt/app/gogs/templates/admin/user/new.tmpl 112 | opt/app/gogs/templates/base 113 | opt/app/gogs/templates/base/alert.tmpl 114 | opt/app/gogs/templates/base/delete_modal_actions.tmpl 115 | opt/app/gogs/templates/base/footer.tmpl 116 | opt/app/gogs/templates/base/head.tmpl 117 | opt/app/gogs/templates/explore 118 | opt/app/gogs/templates/explore/navbar.tmpl 119 | opt/app/gogs/templates/explore/organizations.tmpl 120 | opt/app/gogs/templates/explore/page.tmpl 121 | opt/app/gogs/templates/explore/repo_list.tmpl 122 | opt/app/gogs/templates/explore/repos.tmpl 123 | opt/app/gogs/templates/explore/search.tmpl 124 | opt/app/gogs/templates/explore/users.tmpl 125 | opt/app/gogs/templates/home.tmpl 126 | opt/app/gogs/templates/inject 127 | opt/app/gogs/templates/inject/footer.tmpl 128 | opt/app/gogs/templates/inject/head.tmpl 129 | opt/app/gogs/templates/install.tmpl 130 | opt/app/gogs/templates/mail 131 | opt/app/gogs/templates/mail/auth 132 | opt/app/gogs/templates/mail/auth/activate.tmpl 133 | opt/app/gogs/templates/mail/auth/activate_email.tmpl 134 | opt/app/gogs/templates/mail/auth/register_notify.tmpl 135 | opt/app/gogs/templates/mail/auth/reset_passwd.tmpl 136 | opt/app/gogs/templates/mail/issue 137 | opt/app/gogs/templates/mail/issue/comment.tmpl 138 | opt/app/gogs/templates/mail/issue/mention.tmpl 139 | opt/app/gogs/templates/mail/notify 140 | opt/app/gogs/templates/mail/notify/collaborator.tmpl 141 | opt/app/gogs/templates/org 142 | opt/app/gogs/templates/org/create.tmpl 143 | opt/app/gogs/templates/org/header.tmpl 144 | opt/app/gogs/templates/org/home.tmpl 145 | opt/app/gogs/templates/org/member 146 | opt/app/gogs/templates/org/member/invite.tmpl 147 | opt/app/gogs/templates/org/member/members.tmpl 148 | opt/app/gogs/templates/org/settings 149 | opt/app/gogs/templates/org/settings/delete.tmpl 150 | opt/app/gogs/templates/org/settings/navbar.tmpl 151 | opt/app/gogs/templates/org/settings/options.tmpl 152 | opt/app/gogs/templates/org/settings/webhook_new.tmpl 153 | opt/app/gogs/templates/org/settings/webhooks.tmpl 154 | opt/app/gogs/templates/org/team 155 | opt/app/gogs/templates/org/team/members.tmpl 156 | opt/app/gogs/templates/org/team/new.tmpl 157 | opt/app/gogs/templates/org/team/repositories.tmpl 158 | opt/app/gogs/templates/org/team/sidebar.tmpl 159 | opt/app/gogs/templates/org/team/teams.tmpl 160 | opt/app/gogs/templates/repo 161 | opt/app/gogs/templates/repo/bare.tmpl 162 | opt/app/gogs/templates/repo/branch_dropdown.tmpl 163 | opt/app/gogs/templates/repo/branches 164 | opt/app/gogs/templates/repo/branches/all.tmpl 165 | opt/app/gogs/templates/repo/branches/navbar.tmpl 166 | opt/app/gogs/templates/repo/branches/overview.tmpl 167 | opt/app/gogs/templates/repo/commits.tmpl 168 | opt/app/gogs/templates/repo/commits_table.tmpl 169 | opt/app/gogs/templates/repo/create.tmpl 170 | opt/app/gogs/templates/repo/diff 171 | opt/app/gogs/templates/repo/diff/box.tmpl 172 | opt/app/gogs/templates/repo/diff/page.tmpl 173 | opt/app/gogs/templates/repo/diff/section_unified.tmpl 174 | opt/app/gogs/templates/repo/editor 175 | opt/app/gogs/templates/repo/editor/commit_form.tmpl 176 | opt/app/gogs/templates/repo/editor/delete.tmpl 177 | opt/app/gogs/templates/repo/editor/diff_preview.tmpl 178 | opt/app/gogs/templates/repo/editor/edit.tmpl 179 | opt/app/gogs/templates/repo/editor/upload.tmpl 180 | opt/app/gogs/templates/repo/forks.tmpl 181 | opt/app/gogs/templates/repo/header.tmpl 182 | opt/app/gogs/templates/repo/home.tmpl 183 | opt/app/gogs/templates/repo/issue 184 | opt/app/gogs/templates/repo/issue/comment_tab.tmpl 185 | opt/app/gogs/templates/repo/issue/label_precolors.tmpl 186 | opt/app/gogs/templates/repo/issue/labels.tmpl 187 | opt/app/gogs/templates/repo/issue/list.tmpl 188 | opt/app/gogs/templates/repo/issue/milestone_new.tmpl 189 | opt/app/gogs/templates/repo/issue/milestones.tmpl 190 | opt/app/gogs/templates/repo/issue/navbar.tmpl 191 | opt/app/gogs/templates/repo/issue/new.tmpl 192 | opt/app/gogs/templates/repo/issue/new_form.tmpl 193 | opt/app/gogs/templates/repo/issue/view.tmpl 194 | opt/app/gogs/templates/repo/issue/view_content.tmpl 195 | opt/app/gogs/templates/repo/issue/view_title.tmpl 196 | opt/app/gogs/templates/repo/migrate.tmpl 197 | opt/app/gogs/templates/repo/offer_template.tmpl 198 | opt/app/gogs/templates/repo/pulls 199 | opt/app/gogs/templates/repo/pulls/commits.tmpl 200 | opt/app/gogs/templates/repo/pulls/compare.tmpl 201 | opt/app/gogs/templates/repo/pulls/files.tmpl 202 | opt/app/gogs/templates/repo/pulls/fork.tmpl 203 | opt/app/gogs/templates/repo/pulls/tab_menu.tmpl 204 | opt/app/gogs/templates/repo/release 205 | opt/app/gogs/templates/repo/release/list.tmpl 206 | opt/app/gogs/templates/repo/release/new.tmpl 207 | opt/app/gogs/templates/repo/settings 208 | opt/app/gogs/templates/repo/settings/branches.tmpl 209 | opt/app/gogs/templates/repo/settings/collaboration.tmpl 210 | opt/app/gogs/templates/repo/settings/deploy_keys.tmpl 211 | opt/app/gogs/templates/repo/settings/githook_edit.tmpl 212 | opt/app/gogs/templates/repo/settings/githooks.tmpl 213 | opt/app/gogs/templates/repo/settings/nav.tmpl 214 | opt/app/gogs/templates/repo/settings/navbar.tmpl 215 | opt/app/gogs/templates/repo/settings/options.tmpl 216 | opt/app/gogs/templates/repo/settings/protected_branch.tmpl 217 | opt/app/gogs/templates/repo/settings/webhook 218 | opt/app/gogs/templates/repo/settings/webhook/base.tmpl 219 | opt/app/gogs/templates/repo/settings/webhook/delete_modal.tmpl 220 | opt/app/gogs/templates/repo/settings/webhook/dingtalk.tmpl 221 | opt/app/gogs/templates/repo/settings/webhook/discord.tmpl 222 | opt/app/gogs/templates/repo/settings/webhook/gogs.tmpl 223 | opt/app/gogs/templates/repo/settings/webhook/history.tmpl 224 | opt/app/gogs/templates/repo/settings/webhook/list.tmpl 225 | opt/app/gogs/templates/repo/settings/webhook/new.tmpl 226 | opt/app/gogs/templates/repo/settings/webhook/settings.tmpl 227 | opt/app/gogs/templates/repo/settings/webhook/slack.tmpl 228 | opt/app/gogs/templates/repo/user_cards.tmpl 229 | opt/app/gogs/templates/repo/view_file.tmpl 230 | opt/app/gogs/templates/repo/view_list.tmpl 231 | opt/app/gogs/templates/repo/watchers.tmpl 232 | opt/app/gogs/templates/repo/wiki 233 | opt/app/gogs/templates/repo/wiki/new.tmpl 234 | opt/app/gogs/templates/repo/wiki/pages.tmpl 235 | opt/app/gogs/templates/repo/wiki/start.tmpl 236 | opt/app/gogs/templates/repo/wiki/view.tmpl 237 | opt/app/gogs/templates/status 238 | opt/app/gogs/templates/status/404.tmpl 239 | opt/app/gogs/templates/status/500.tmpl 240 | opt/app/gogs/templates/user 241 | opt/app/gogs/templates/user/auth 242 | opt/app/gogs/templates/user/auth/activate.tmpl 243 | opt/app/gogs/templates/user/auth/forgot_passwd.tmpl 244 | opt/app/gogs/templates/user/auth/login.tmpl 245 | opt/app/gogs/templates/user/auth/prohibit_login.tmpl 246 | opt/app/gogs/templates/user/auth/reset_passwd.tmpl 247 | opt/app/gogs/templates/user/auth/signup.tmpl 248 | opt/app/gogs/templates/user/auth/two_factor.tmpl 249 | opt/app/gogs/templates/user/auth/two_factor_recovery_code.tmpl 250 | opt/app/gogs/templates/user/dashboard 251 | opt/app/gogs/templates/user/dashboard/dashboard.tmpl 252 | opt/app/gogs/templates/user/dashboard/feeds.tmpl 253 | opt/app/gogs/templates/user/dashboard/issues.tmpl 254 | opt/app/gogs/templates/user/dashboard/navbar.tmpl 255 | opt/app/gogs/templates/user/meta 256 | opt/app/gogs/templates/user/meta/followers.tmpl 257 | opt/app/gogs/templates/user/meta/header.tmpl 258 | opt/app/gogs/templates/user/meta/stars.tmpl 259 | opt/app/gogs/templates/user/profile.tmpl 260 | opt/app/gogs/templates/user/settings 261 | opt/app/gogs/templates/user/settings/applications.tmpl 262 | opt/app/gogs/templates/user/settings/avatar.tmpl 263 | opt/app/gogs/templates/user/settings/delete.tmpl 264 | opt/app/gogs/templates/user/settings/email.tmpl 265 | opt/app/gogs/templates/user/settings/navbar.tmpl 266 | opt/app/gogs/templates/user/settings/organizations.tmpl 267 | opt/app/gogs/templates/user/settings/password.tmpl 268 | opt/app/gogs/templates/user/settings/profile.tmpl 269 | opt/app/gogs/templates/user/settings/repositories.tmpl 270 | opt/app/gogs/templates/user/settings/security.tmpl 271 | opt/app/gogs/templates/user/settings/sshkeys.tmpl 272 | opt/app/gogs/templates/user/settings/two_factor_enable.tmpl 273 | opt/app/gogs/templates/user/settings/two_factor_recovery_codes.tmpl 274 | proc/cpuinfo 275 | sandstorm-http-bridge 276 | sandstorm-http-bridge-config 277 | sandstorm-manifest 278 | usr/bin/basename 279 | usr/bin/env 280 | usr/bin/gettext.sh 281 | usr/bin/git 282 | usr/bin/tr 283 | usr/lib/git-core/git 284 | usr/lib/git-core/git-merge 285 | usr/lib/git-core/git-pull 286 | usr/lib/git-core/git-receive-pack 287 | usr/lib/git-core/git-remote-http 288 | usr/lib/git-core/git-remote-https 289 | usr/lib/git-core/git-sh-i18n 290 | usr/lib/git-core/git-sh-setup 291 | usr/lib/git-core/git-upload-pack 292 | usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 293 | usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.3.0 294 | usr/lib/x86_64-linux-gnu/libffi.so.6 295 | usr/lib/x86_64-linux-gnu/libgmp.so.10 296 | usr/lib/x86_64-linux-gnu/libgmp.so.10.2.0 297 | usr/lib/x86_64-linux-gnu/libgnutls-deb0.so.28 298 | usr/lib/x86_64-linux-gnu/libgnutls-deb0.so.28.41.0 299 | usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 300 | usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2 301 | usr/lib/x86_64-linux-gnu/libhogweed.so.2 302 | usr/lib/x86_64-linux-gnu/libhogweed.so.2.5 303 | usr/lib/x86_64-linux-gnu/libidn.so.11 304 | usr/lib/x86_64-linux-gnu/libk5crypto.so.3 305 | usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1 306 | usr/lib/x86_64-linux-gnu/libkrb5.so.3 307 | usr/lib/x86_64-linux-gnu/libkrb5.so.3.3 308 | usr/lib/x86_64-linux-gnu/libkrb5support.so.0 309 | usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1 310 | usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 311 | usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 312 | usr/lib/x86_64-linux-gnu/libnettle.so.4 313 | usr/lib/x86_64-linux-gnu/libnettle.so.4.7 314 | usr/lib/x86_64-linux-gnu/libp11-kit.so.0 315 | usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0 316 | usr/lib/x86_64-linux-gnu/librtmp.so.1 317 | usr/lib/x86_64-linux-gnu/libsasl2.so.2 318 | usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25 319 | usr/lib/x86_64-linux-gnu/libssh2.so.1 320 | usr/lib/x86_64-linux-gnu/libssh2.so.1.0.1 321 | usr/lib/x86_64-linux-gnu/libtasn1.so.6 322 | usr/lib/x86_64-linux-gnu/libtasn1.so.6.3.2 323 | usr/share/git-core/templates 324 | usr/share/git-core/templates/branches 325 | usr/share/git-core/templates/description 326 | usr/share/git-core/templates/hooks 327 | usr/share/git-core/templates/hooks/applypatch-msg.sample 328 | usr/share/git-core/templates/hooks/commit-msg.sample 329 | usr/share/git-core/templates/hooks/post-update.sample 330 | usr/share/git-core/templates/hooks/pre-applypatch.sample 331 | usr/share/git-core/templates/hooks/pre-commit.sample 332 | usr/share/git-core/templates/hooks/pre-push.sample 333 | usr/share/git-core/templates/hooks/pre-rebase.sample 334 | usr/share/git-core/templates/hooks/prepare-commit-msg.sample 335 | usr/share/git-core/templates/hooks/update.sample 336 | usr/share/git-core/templates/info 337 | usr/share/git-core/templates/info/exclude 338 | -------------------------------------------------------------------------------- /.sandstorm/sandstorm-pkgdef.capnp: -------------------------------------------------------------------------------- 1 | @0xcddef93213bbea1b; 2 | 3 | using Spk = import "/sandstorm/package.capnp"; 4 | # This imports: 5 | # $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp 6 | # Check out that file to see the full, documented package definition format. 7 | 8 | const pkgdef :Spk.PackageDefinition = ( 9 | # The package definition. Note that the spk tool looks specifically for the 10 | # "pkgdef" constant. 11 | 12 | id = "d9ygf47xrtnw12j92cyt6cu8ut75esx01u4q3kcrn8415w9qzzgh", 13 | # Your app ID is actually its public key. The private key was placed in 14 | # your keyring. All updates must be signed with the same key. 15 | 16 | manifest = ( 17 | # This manifest is included in your app package to tell Sandstorm 18 | # about your app. 19 | 20 | appTitle = (defaultText = "Gogs"), 21 | 22 | appVersion = 5, # Increment this for every release. 23 | 24 | appMarketingVersion = (defaultText = "0.11.34-fix1"), 25 | # Human-readable representation of appVersion. Should match the way you 26 | # identify versions of your app in documentation and marketing. 27 | 28 | actions = [ 29 | # Define your "new document" handlers here. 30 | ( title = (defaultText = "New Gogs instance"), 31 | command = .myCommand 32 | # The command to run when starting for the first time. (".myCommand" 33 | # is just a constant defined at the bottom of the file.) 34 | ) 35 | ], 36 | 37 | continueCommand = .myCommand, 38 | # This is the command called to start your app back up after it has been 39 | # shut down for inactivity. Here we're using the same command as for 40 | # starting a new instance, but you could use different commands for each 41 | # case. 42 | 43 | metadata = ( 44 | icons = ( 45 | appGrid = (png = (dpi1x = embed "app-graphics/appGrid.png")), 46 | grain = (png = (dpi1x = embed "app-graphics/grain.png")), 47 | market = (png = (dpi1x = embed "app-graphics/market.png")), 48 | ), 49 | 50 | website = "http://gogs.io", 51 | codeUrl = "https://github.com/cem/gogs-sandstorm", 52 | license = (openSource = mit), 53 | categories = [developerTools], 54 | 55 | author = ( 56 | contactEmail = "cem@soda9.co", 57 | pgpSignature = embed "pgp-signature", 58 | upstreamAuthor = "Gogs Authors", 59 | ), 60 | pgpKeyring = embed "pgp-keyring", 61 | 62 | description = (defaultText = embed "description.md"), 63 | shortDescription = (defaultText = "Git server and interface"), 64 | 65 | screenshots = [ 66 | (width = 1150, height = 800, png = embed "screenshot.png") 67 | ], 68 | 69 | #changeLog = (defaultText = embed "CHANGELOG.md"), 70 | ), 71 | ), 72 | 73 | sourceMap = ( 74 | # Here we defined where to look for files to copy into your package. The 75 | # `spk dev` command actually figures out what files your app needs 76 | # automatically by running it on a FUSE filesystem. So, the mappings 77 | # here are only to tell it where to find files that the app wants. 78 | searchPath = [ 79 | ( sourcePath = "." ), # Search this directory first. 80 | ( sourcePath = "/", # Then search the system root directory. 81 | hidePaths = [ "home", "proc", "sys", 82 | "etc/passwd", "etc/hosts", "etc/host.conf", 83 | "etc/nsswitch.conf", "etc/resolv.conf" ] 84 | # You probably don't want the app pulling files from these places, 85 | # so we hide them. Note that /dev, /var, and /tmp are implicitly 86 | # hidden because Sandstorm itself provides them. 87 | ) 88 | ] 89 | ), 90 | 91 | fileList = "sandstorm-files.list", 92 | # `spk dev` will write a list of all the files your app uses to this file. 93 | # You should review it later, before shipping your app. 94 | 95 | alwaysInclude = [] 96 | # Fill this list with more names of files or directories that should be 97 | # included in your package, even if not listed in sandstorm-files.list. 98 | # Use this to force-include stuff that you know you need but which may 99 | # not have been detected as a dependency during `spk dev`. If you list 100 | # a directory here, its entire contents will be included recursively. 101 | ); 102 | 103 | const myCommand :Spk.Manifest.Command = ( 104 | # Here we define the command used to start up your server. 105 | argv = ["/sandstorm-http-bridge", "8000", "--", "/opt/app/.sandstorm/launcher.sh"], 106 | environ = [ 107 | # Note that this defines the *entire* environment seen by your app. 108 | (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin") 109 | ] 110 | ); 111 | -------------------------------------------------------------------------------- /.sandstorm/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cem/gogs-sandstorm/1974e4570d90321f615c698878c3d2803a00f355/.sandstorm/screenshot.png -------------------------------------------------------------------------------- /.sandstorm/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | # This script is run in the VM once when you first run `vagrant-spk up`. It is 4 | # useful for installing system-global dependencies. It is run exactly once 5 | # over the lifetime of the VM. 6 | # 7 | # This is the ideal place to do things like: 8 | # 9 | # export DEBIAN_FRONTEND=noninteractive 10 | # apt-get install -y nginx nodejs nodejs-legacy python2.7 mysql-server 11 | # 12 | # If the packages you're installing here need some configuration adjustments, 13 | # this is also a good place to do that: 14 | # 15 | # sed --in-place='' \ 16 | # --expression 's/^user www-data/#user www-data/' \ 17 | # --expression 's#^pid /run/nginx.pid#pid /var/run/nginx.pid#' \ 18 | # --expression 's/^\s*error_log.*/error_log stderr;/' \ 19 | # --expression 's/^\s*access_log.*/access_log off;/' \ 20 | # /etc/nginx/nginx.conf 21 | 22 | # By default, this script does nothing. You'll have to modify it as 23 | # appropriate for your application. 24 | 25 | export DEBIAN_FRONTEND=noninteractive 26 | apt-get update 27 | apt-get install -y git 28 | exit 0 29 | -------------------------------------------------------------------------------- /.sandstorm/stack: -------------------------------------------------------------------------------- 1 | diy 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SRCDIR = build/src/github.com/gogits/gogs 2 | ROOTDIR = $(PWD) 3 | OURGOPATH = $(ROOTDIR)/build 4 | 5 | all : gogs/gogs 6 | 7 | $(SRCDIR) : 8 | rm -rf build ; \ 9 | mkdir -p $(SRCDIR) ; \ 10 | cd $(SRCDIR)/.. ; \ 11 | git clone https://github.com/cem/gogs gogs ; \ 12 | cd gogs ; \ 13 | git checkout sandstorm3 ; \ 14 | cd .. ; \ 15 | find . -type l -delete ; \ 16 | GOPATH="$(OURGOPATH)" go get -tags "sqlite" github.com/gogits/gogs 17 | 18 | update : $(SRCDIR) 19 | GOPATH="$(OURGOPATH)" go get -u -tags "sqlite" github.com/gogits/gogs 20 | 21 | gogs/gogs : $(SRCDIR) custom scripts/build.sh 22 | rm -rf gogs ; ./scripts/build.sh && cp -r custom/ gogs/custom 23 | 24 | clean : 25 | rm -rf gogs 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Gogs for Sandstorm 2 | 3 | Use this repository to develop or package Gogs for the Sandstorm platform. https://sandstorm.io/ 4 | 5 | Built using vagrant-spk. 6 | -------------------------------------------------------------------------------- /custom/conf/app.ini: -------------------------------------------------------------------------------- 1 | APP_NAME = Gogs 2 | RUN_USER = gogsuser 3 | RUN_MODE = prod 4 | 5 | [database] 6 | DB_TYPE = sqlite3 7 | HOST = 127.0.0.1:3306 8 | NAME = gogs 9 | USER = root 10 | PASSWD = 11 | SSL_MODE = disable 12 | PATH = /var/gogs/data/gogs.db 13 | 14 | [repository] 15 | ROOT = /var/gogs/repositories 16 | 17 | [server] 18 | DOMAIN = localhost 19 | HTTP_PORT = 8000 20 | ROOT_URL = http://localhost:8000/ 21 | DISABLE_SSH = true 22 | SSH_PORT = 22 23 | OFFLINE_MODE = true 24 | 25 | [mailer] 26 | ENABLED = false 27 | 28 | [service] 29 | REGISTER_EMAIL_CONFIRM = false 30 | ENABLE_NOTIFY_MAIL = false 31 | DISABLE_REGISTRATION = true 32 | REQUIRE_SIGNIN_VIEW = false 33 | ENABLE_REVERSE_PROXY_AUTHENTICATION = true 34 | ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = true 35 | 36 | [picture] 37 | DISABLE_GRAVATAR = true 38 | AVATAR_UPLOAD_PATH = /var/gogs/avatars 39 | 40 | [session] 41 | PROVIDER = file 42 | 43 | [log] 44 | ROOT_PATH = /var/gogs/log 45 | MODE = console 46 | LEVEL = Warn 47 | 48 | [security] 49 | INSTALL_LOCK = true 50 | SECRET_KEY = nK1ZxDu7k1UW6cX 51 | REVERSE_PROXY_AUTHENTICATION_USER = X-SANDSTORM-USER-ID 52 | 53 | -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | rootPath=$PWD 2 | outPath=gogs 3 | srcPath=build/src/github.com/gogits/gogs 4 | 5 | rm -rf $outPath 6 | mkdir $outPath 7 | 8 | GOPATH="$rootPath/build" go build -o "$outPath/gogs" -tags "sqlite" "$srcPath/gogs.go" 9 | 10 | cp -r $srcPath/conf/ $outPath/conf/ 11 | cp -r $srcPath/public/ $outPath/public/ 12 | cp -r $srcPath/templates/ $outPath/templates/ 13 | #cp cert.pem $outPath/ 14 | #cp gogs_supervisord.sh $outPath/ 15 | #cp ../key.pem $outPath/ 16 | cp -r $srcPath/LICENSE $outPath/ 17 | --------------------------------------------------------------------------------