vintagesucks / caddy-script Goto Github PK
View Code? Open in Web Editor NEW:whale: Caddy installation script
License: MIT License
:whale: Caddy installation script
License: MIT License
Sometimes I just want to install caddy server. I don't need PHP or MariaDB. Could you make the other components to be optional? Thanks.
Script is failing for me on a fresh Ubuntu Server 17.10 install.
root@***:~#
bash <(curl -s https://raw.githubusercontent.com/vintagesucks/caddy-script/master/main.sh)
Current default time zone: 'America/New_York'
Local time is now: Tue Nov 21 21:00:15 EST 2017.
Universal Time is now: Wed Nov 22 02:00:15 UTC 2017.
Enter an email address (e.g. [email protected]) ***@***com
Enter a domain (e.g. example.org) ***.com
Enter the Caddy extensions you want (e.g. http.git,http.upload) http.upload,http.basicauth,http.realip,http.login,http
.cors
Install WordPress? (Y/N)n
Install Shopware? (Y/N)n
Install phpMyAdmin? (Y/N)n
Configure unattended-upgrades? (Y/N)n
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Caddy Features: http.upload,http.basicauth,http.realip,http.login,http.cors
Domain: ***.com
Email: ***@***.com
WordPress: 0
Shopware: 0
phpMyAdmin: 0
unattended-upgrades: 0
Continue with setup? (Y/N)y
Checking if logged in user is root.
User is root.
Checking if user caddy already exists.
Adding user caddy.
Adding user `caddy' ...
Adding new group `caddy' (1001) ...
Adding new user `caddy' (1001) with group `caddy' ...
Creating home directory `/home/caddy' ...
Copying files from `/etc/skel' ...
Adding user caddy to sudoers.
Successfully set up user caddy and needed permissions.
Installing Caddy.
Downloading Caddy for linux/amd64 (personal license)...
curl: (22) The requested URL returned error: 400 Bad Request
Aborted, error 22 in command: curl -fsSL "$caddy_url" -u "$CADDY_ACCOUNT_ID:$CADDY_API_KEY" -o "$dl"`
Hello @vintagesucks
I've tried to install Caddy on a Scaleway server and it failed. Below is the output. Maybe you got an idea where to look next?
root@scw-803c89:~# bash <(curl -s https://raw.githubusercontent.com/vintagesucks/caddy-script/master/main.sh)
Current default time zone: 'Europe/Berlin'
Local time is now: Mon May 28 15:41:03 CEST 2018.
Universal Time is now: Mon May 28 13:41:03 UTC 2018.
Enter an email address (e.g. [email protected]) [email protected]
Enter a domain (e.g. example.org) xxxxxxx.com
Enter the Caddy extensions you want (e.g. http.git,http.upload) http.root,http.fastcgi,http.rewrite
Install WordPress? (Y/N)n
Install Shopware? (Y/N)n
Install phpMyAdmin? (Y/N)n
Configure unattended-upgrades? (Y/N)y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Caddy Features: http.root,http.fastcgi,http.rewrite
Domain: xxxx.com
Email: [email protected]
WordPress: 0
Shopware: 0
phpMyAdmin: 0
unattended-upgrades: 1
Continue with setup? (Y/N)y
Checking if logged in user is root.
User is root.
Checking if user caddy already exists.
Adding user caddy.
Adding user `caddy' ...
Adding new group `caddy' (1000) ...
Adding new user `caddy' (1000) with group `caddy' ...
Creating home directory `/home/caddy' ...
Copying files from `/etc/skel' ...
Adding user caddy to sudoers.
Successfully set up user caddy and needed permissions.
Installing Caddy.
Downloading Caddy for linux/arm64 (personal license)...
curl: (22) The requested URL returned error: 400 Bad Request
Aborted, error 22 in command: curl -fsSL "$caddy_url" -u "$CADDY_ACCOUNT_ID:$CADDY_API_KEY" -o "$dl"
...instead of cloning directy. Should lead to shorter build time.
-q, --quiet
Install IonCube
Install gd
Install gd_jpg
Install freetype
Install zip
memory_limit -> 256M
upload_max_filesize -> 6M
Use most recent or user-defined version.
Currently hardcoded.
Missing in current Builds:
Using a clean DigitalOcean Ubuntu/Docker droplet, I am having difficulty getting this to start.
It installs fine, but won't start. It is a clean droplet with ufw disabled, and no DigitalOcean firewall setup yet.
It is basically restarting until it hits the hourly LetsEncrypt rate limit. I've tried disabling the "Restart-on-failure", but it still won't start. Am I missing something really simple? No firewall. But it won't get a cert. It gives error 400 until it reaches the hourly limit then throws error 429 (rate limiting).
Any thoughts?
Ubuntu 16.04. LTS
Remove DigitalOcean dependency
This caddy-script creates a user "caddy" to runt caddy. However, a popularer caddy.service uses the traditional httpd user "www-data" to run caddy.
I think www-data should be better.
When i run the intaller on my WSL (Ubuntu 16.04) it gives me this when running as root
bunny@DESKTOP-EHL74VA:~$ sudo bash <(curl -s https://raw.githubusercontent.com/vintagesucks/caddy-script/master/main.sh)
[sudo] password for bunny:
bash: /dev/fd/63: No such file or directory```
Using a subdomain with caddy-script (e.g. test.example.com
) results in the following Caddyfile
redirect, which is breaking certificate obtaining:
www.test.example.com {
redir https://test.example.com{uri}
}
Keep Travis, Code Climate GPA and Codacy.
Thank you very much for such one-key installation script.
However, it doesn't work in my freshly installation of Ubuntu 18.04.
Checking if logged in user is root.
User is root.
Checking if user caddy already exists.
Adding user caddy.
Adding user `caddy' ...
Adding new group `caddy' (1001) ...
Adding new user `caddy' (1001) with group `caddy' ...
Creating home directory `/home/caddy' ...
Copying files from `/etc/skel' ...
Adding user caddy to sudoers.
Successfully set up user caddy and needed permissions.
Installing Caddy.
sudo: curl: command not found
Setting permissions for Caddy.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcap2-bin is already the newest version (1:2.25-1.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Failed to set capabilities on file `/usr/local/bin/caddy' (No such file or directory)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
Support noninteractive mode (for Travis CI+Docker)
...in order to shorten the setup duration.
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
test on linux and wsl, modify service file if needed
On a new droplet I get the following:
Checking if logged in user is root.
User is root.
Checking if user caddy already exists.
Adding user caddy.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Adding user `caddy' ...
Adding new group `caddy' (1000) ...
Adding new user `caddy' (1000) with group `caddy' ...
Creating home directory `/home/caddy' ...
Copying files from `/etc/skel' ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Adding user `caddy' to group `www-data' ...
Adding user caddy to group www-data
Done.
Adding user caddy to sudoers.
Successfully set up user caddy and needed permissions.
Installing Caddy.
Downloading Caddy for linux/amd64...
https://caddyserver.com/download/build?os=linux&arch=amd64&arm=&features=
Extracting...
Putting caddy in /usr/local/bin (may require password)
Caddy 0.9.5
Successfully installed
Setting permissions for Caddy.
Creating Caddyfile.
Setting up directorys for new.soderlind.no
Adding PHP7 repository
gpg: keyring `/tmp/tmp77wq001z/secring.gpg' created
gpg: keyring `/tmp/tmp77wq001z/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp77wq001z/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ond\xc5\x99ej Sur�" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 688, in addkey_func
func(**kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 401, in add_key
return apsk.add_ppa_signing_key()
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 271, in add_ppa_signing_key
tmp_export_keyring, signing_key_fingerprint, tmp_keyring_dir):
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 220, in _verify_fingerprint
got_fingerprints = self._get_fingerprints(keyring, keyring_dir)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 212, in _get_fingerprints
output = subprocess.check_output(cmd, universal_newlines=True)
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 695, in run
stdout, stderr = process.communicate(input, timeout=timeout)
File "/usr/lib/python3.5/subprocess.py", line 1059, in communicate
stdout = self.stdout.read()
File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 92: ordinal not in range(128)
Check Packages for updates
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease [23.9 kB]
Ign:2 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages [42.6 kB]
Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main Translation-en [24.7 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main Sources [61.1 kB]
Get:6 http://security.ubuntu.com/ubuntu xenial-security/restricted Sources [2288 B]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [23.4 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/multiverse Sources [1148 B]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [219 kB]
Get:10 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [92.0 kB]
Get:11 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [89.5 kB]
Get:12 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [49.5 kB]
Hit:13 http://ams2.mirrors.digitalocean.com/ubuntu xenial InRelease
Get:14 http://ams2.mirrors.digitalocean.com/ubuntu xenial-updates InRelease [102 kB]
Get:15 http://ams2.mirrors.digitalocean.com/ubuntu xenial-backports InRelease [102 kB]
Get:16 http://ams2.mirrors.digitalocean.com/ubuntu xenial/main Sources [868 kB]
Get:17 http://ams2.mirrors.digitalocean.com/ubuntu xenial/restricted Sources [4808 B]
Get:18 http://ams2.mirrors.digitalocean.com/ubuntu xenial/universe Sources [7728 kB]
Get:19 http://ams2.mirrors.digitalocean.com/ubuntu xenial/multiverse Sources [179 kB]
Get:20 http://ams2.mirrors.digitalocean.com/ubuntu xenial-updates/main Sources [235 kB]
Get:21 http://ams2.mirrors.digitalocean.com/ubuntu xenial-updates/restricted Sources [2688 B]
Get:22 http://ams2.mirrors.digitalocean.com/ubuntu xenial-updates/universe Sources [139 kB]
Get:23 http://ams2.mirrors.digitalocean.com/ubuntu xenial-updates/multiverse Sources [4556 B]
Get:24 http://ams2.mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 Packages [485 kB]
Get:25 http://ams2.mirrors.digitalocean.com/ubuntu xenial-updates/main Translation-en [193 kB]
Get:26 http://ams2.mirrors.digitalocean.com/ubuntu xenial-updates/universe amd64 Packages [429 kB]
Get:27 http://ams2.mirrors.digitalocean.com/ubuntu xenial-updates/universe Translation-en [163 kB]
Get:28 http://ams2.mirrors.digitalocean.com/ubuntu xenial-backports/main Sources [3200 B]
Get:29 http://ams2.mirrors.digitalocean.com/ubuntu xenial-backports/universe Sources [1868 B]
Get:30 http://ams2.mirrors.digitalocean.com/ubuntu xenial-backports/main amd64 Packages [4672 B]
Get:31 http://ams2.mirrors.digitalocean.com/ubuntu xenial-backports/main Translation-en [3200 B]
Get:32 http://ams2.mirrors.digitalocean.com/ubuntu xenial-backports/universe amd64 Packages [2512 B]
Get:33 http://ams2.mirrors.digitalocean.com/ubuntu xenial-backports/universe Translation-en [1216 B]
Fetched 11.4 MB in 3s (3069 kB/s)
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
W: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Installing PHP7 and extensions
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libcurl3 libmcrypt4 libssl1.0.2 libxslt1.1 libzip4 php-common php7.0-cli
php7.0-common php7.0-json php7.0-opcache php7.0-readline
Suggested packages:
libmcrypt-dev mcrypt php-pear
The following NEW packages will be installed:
libcurl3 libmcrypt4 libssl1.0.2 libxslt1.1 libzip4 php-common php7.0-cli
php7.0-common php7.0-curl php7.0-fpm php7.0-intl php7.0-json php7.0-mbstring
php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-readline php7.0-soap
php7.0-xml php7.0-zip
0 upgraded, 20 newly installed, 0 to remove and 13 not upgraded.
Need to get 6291 kB of archives.
After this operation, 22.6 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
libssl1.0.2 libzip4 php-common php7.0-common php7.0-json php7.0-opcache
php7.0-readline php7.0-cli php7.0-curl php7.0-fpm php7.0-intl
php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-soap php7.0-xml php7.0-zip
E: There were unauthenticated packages and -y was used without --allow-unauthenticated
service caddy status
from non-travis buildTravis uses the master branch no matter what, which is bad for PR validation.
Domain: https://${domain}
Logs are rotated automatically.
Add support for Ghost.
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.