Skip to content

Commit

Permalink
docs: update Shimmie docs to use Docker (fix #3054)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Oct 18, 2023
1 parent 1b28293 commit d76a76f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 50 deletions.
76 changes: 28 additions & 48 deletions docs/docs/commands/shimmie.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,77 +4,57 @@ title: Shimmie
---


_Thanks a lot to [Siegen](https://github.com/Siegen) for his integration of Shimmie and upload script._
!!! warning

Using commands can slow down huge batch downloads (a recent computer may need from 100ms to 1s more per image)

_Thanks a lot to [Siegen](https://github.com/Siegen) for his integration of Shimmie and upload script._

## Introduction

First of all, know that using commands can slow down huge batch downloads (a recent computer may need from 100ms to 1s more per image, which is very consequent).

## Shimmie

### Install
Follow the official [Docker installation](https://github.com/shish/shimmie2/wiki/Docker) documentation from the Shimmie repository.
Note that you'll need to have [Docker](https://docs.docker.com/get-docker/) installed.
If you prefer a more on-hands installation without Docker, they also have a [on-disk installation](https://github.com/shish/shimmie2/wiki/Install) documentation you can follow instead.

## Installation

### Local web server
### Configuration

First, we're going to install WAMP, which contains everything required to have a local web server.
* The first time you visit [the site](http://localhost:8000/), it will ask you for database credentials, you can just switch the "Type" to SQLite if you don't know
* Create an account on the [registration page](http://localhost:8000/index.php?q=user_admin/create), you should automatically be an administrator
* Go to the [setup page](http://localhost:8000/index.php?q=setup), and edit settings as needed (it's recommended to at least increase the "Max size per file" setting to a higher value)

1. Download the latest version of WampServer here (2.2e as I am writing this): http://sourceforge.net/projects/wampserver/
2. Install it somewhere that doesn’t requires admin rights to write into (for example, the default location c:\wamp)
3. At the end of the installation, the installer may ask for two things.
1. First, he will ask you what your favorite browser is. You can leave it to the default value which will be Internet Explorer, or change it to another browser (Firefox, Chrome, etc.).
2. Finally, he will ask some email settings. Leave the default values, you don’t care about that.
4. Now that WampServer is installed, you should see a little green W in your system tray, near the clock (you may need to expand the tray to see it).
5. Congratulations! You can visit your local server by going to [here](http://localhost/)!


### Shimmie

1. Download the latest version of Shimmie [here](https://github.com/shish/shimmie2).
2. Extract it to the www directory in your WampServer installation folder. You can either extract it to a subfolder or not. If you extract it to a subfolder, the site’s url will be <http://localhost/subfolder/>, and if you don’t it will only be <http://localhost/>. It’s your choice, but if you don’t create a subfolder, you must remember to remove all the files in your www folder first. For the end of this tutorial, I’ll consider that you are using the subfolder "shimmie".
3. Go to <http://localhost/phpmyadmin/>. If you have to login, use "root" as username and "" as password (no password).
4. Then, go to the databases tab and create a database named "shimmie" with an "utf8_unicode_ci" encoding.
5. Go to <http://localhost/shimmie/>
6. Enter your database information then click "install" (type: `MySQL`, host: `localhost`, username: `root`, no password, db name: `shimmie`).
7. Hopefully you'll end up at the welcome screen!
8. From there, register a new user with the `admin` username to have your admin account.
## Grabber

### Install PHP

## Configuration
You need PHP to be installed on your machine to use the upload script used by Grabber.
You can find installation instructions on [their website](https://www.php.net/manual/en/install.php).

### Max upload size
Once installed, make sure that the cURL extension is enabled as the script requires it. It can be done by editing the `php.ini` file in your PHP installation, replacing `;extension=curl` by `extension=curl` (without the leading semicolon). Otherwise, you might encounter this error:

The default max upload size is around 1MB. With these steps, it will increase to around 12MB.
> Call to undefined function curl_init()
1. Edit the `php.ini` file located in "C:\wamp\bin\php\php5.6.19" (the version number can change depending on which version of WAMP you installed). Note that if there is also a `phpForApache.ini` file, you must edit both.
2. Change `upload_max_filesize = 2M` into `upload_max_filesize = 100M`.
3. Restart WAMP services (left click > restart services).
4. Go to <http://localhost/phpmyadmin/>
5. Go to the "SQL" tab, and execute
```sql
INSERT INTO `shimmie`.`config` (`name`, `value`) VALUES ('upload_size', '104857600');
```

This will allow you to upload bigger files to Shimmie.
### Download the upload script

### Grabber
1. Download the [UploadToShimmie.php](UploadToShimmie.php) file somewhere you can edit it.
2. Edit the top part of the file, especially `$shimmieUser` and `$shimmiePassword`.
3. Move the file into Grabber's installation folder.

#### Basic settings

Enable the "Replace spaces by underscores" setting.
### Configuration

Set the `Commands > Image` setting to
```powershell
"C:\wamp\bin\php\php5.6.19\php.exe" "UploadToShimmie.php" -h="%md5%" -f="%path%" -t="%all:includenamespace,unsafe,separator=;%" -s="%website%" -r="%rating%"
Open Grabber, then go to "Options > Commands", and set the "Image" field to:
```bash
php "UploadToShimmie.php" -h="%md5%" -f="%path%" -t="%all:includenamespace,underscores,unsafe,separator=;%" -s="%website%" -r="%rating%"
```
*(change the path to PHP according to your installed version in WAMP: just go to "C:\wamp\bin\php" and there should be only one version)*

If you are using MAMP on a Mac, your PHP path will look something like this. Again, remember to change the version number.
`/Applications/MAMP/bin/php/php5.6.19/bin/php`

#### Upload script
!!! note

1. Download the [UploadToShimmie.php](UploadToShimmie.php) file.
2. Edit the contents accordingly if you did not follow the default settings of this tutorial (especially `shimmieUser` and `shimmiePassword`).
3. Move the `UploadToShimmie.php` file to Grabber's installation folder.
If you did not install PHP globally, you might need to change `php` into its exact path, like `C:\tools\php82\php.exe` (for a [Chocolatey](https://chocolatey.org/) install on Windows).
2 changes: 1 addition & 1 deletion docs/docs/sources/shimmie.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ In addition:
* `downvote:` is transformed to `downvoted_by:`
* `upvote:` is transformed to `upvoted_by:`
* `tagcount:` is transformed to `tags:`
* `fav:` is transformed to `c:` or `favorited_by_userno` depending on whether the second part is a number or not
* `fav:` is transformed to `favourited_by` or `favorited_by_userno` depending on whether the second part is a number or not
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ nav:
- Introduction: docs/commands/index.md
- docs/commands/szurubooru.md
- docs/commands/danbooru.md
- docs/commands/shimmie.md
- docs/commands/my-imouto.md
- docs/commands/gelbooru.md
- docs/commands/shimmie.md
- docs/compilation.md
- docs/cli.md
- docs/portable-version.md
Expand Down

0 comments on commit d76a76f

Please sign in to comment.